import 0.1.7.1
[aubio.git] / plugins / audacity / audacity-libnyquist.diff
1 --- audacity-1.2.1.orig/lib-src/libnyquist/nyx/nyx.c
2 +++ audacity-1.2.1/lib-src/libnyquist/nyx/nyx.c
3 @@ -620,8 +620,14 @@
4  {
5     if (moreargs()) {
6        unsigned char *cmd;
7 +      int retval;
8        cmd = (unsigned char *)getstring(xlgastring());
9 -      fprintf(stderr, "Will not execute system command: %s\n", cmd);
10 +      //fprintf(stderr, "Will not execute system command: %s\n", cmd);
11 +      system(cmd);
12 +      if (retval != 0) 
13 +       fprintf(stderr, 
14 +               "the command \n %s \n exited with the error %d\n", 
15 +               cmd, retval);
16     }
17     return s_true;
18  }
19 --- audacity-1.2.1.orig/lib-src/libnyquist/xlisp/xlftab.c
20 +++ audacity-1.2.1/lib-src/libnyquist/xlisp/xlftab.c
21 @@ -83,6 +83,7 @@
22      xgetlambda(void),xmacroexpand(void),x1macroexpand(void),
23      xinfo(void),                                       //Added by Ning Hu      Apr.2001
24      xsetdir(void),                                     //Added by Ning Hu      May.2001
25 +    xatof(void), xftoa(void),                          //Added by PiemBrossier Jul.2004
26      xtrace(void),xuntrace(void),xprofile(void),xstrsearch(void), xsetupconsole(void);
27  #endif
28  
29 @@ -452,8 +453,9 @@
30  {      "WRITE-INT",                    S, xwrint               }, /* 292 */
31  {      "WRITE-FLOAT",                  S, xwrfloat             }, /* 293 */
32  {      "INFO",                         S, xinfo                }, /* 294 */ /* Ning Hu, Apr 2001 */
33 -{      NULL,                           S, xnotimp              }, /* 295 */
34 -{      NULL,                           S, xnotimp              }, /* 296 */
35 +
36 +{      "ATOF",                         S, xatof                }, /* 295 */ /* Paul Brossier <piem@altern.org> */
37 +{      "FTOA",                         S, xftoa                }, /* 296 */ /* Jul. 2004 */ 
38  {      NULL,                           S, xnotimp              }, /* 297 */
39  {      NULL,                           S, xnotimp              }, /* 298 */
40  {      NULL,                           S, xnotimp              }, /* 299 */
41 --- audacity-1.2.1.orig/lib-src/libnyquist/xlisp/xlstr.c
42 +++ audacity-1.2.1/lib-src/libnyquist/xlisp/xlstr.c
43 @@ -16,6 +16,11 @@
44  #define TLEFT  1
45  #define TRIGHT 2
46  
47 +/* on the NeXT, atof is a macro in stdlib.h */
48 +#ifndef atof
49 +extern double atof();
50 +#endif
51 +
52  /* external variables */
53  extern LVAL k_start,k_end,k_1start,k_1end,k_2start,k_2end;
54  extern LVAL s_true;
55 @@ -555,3 +560,41 @@
56      return (icmp ? s_true : NIL);
57  }
58  
59 +/* functions added by Paul Brossier <piem@altern.org> */
60 +LVAL xatof() /* converts a string to a float */
61 +{
62 +       if (moreargs()) {
63 +               unsigned char *astring = NULL;
64 +               float afloat;
65 +               astring = (unsigned char *)getstring(xlgastring());
66 +               xllastarg();
67 +               afloat = atof(astring);
68 +               return cvflonum(afloat);
69 +       } else 
70 +               return NIL;
71 +}
72 +
73 +LVAL xftoa() /* converts a float to a string */
74 +{
75 +       LVAL arg;
76 +       FIXTYPE ival=0;
77 +       FLOTYPE fval=0;
78 +       if (moreargs()) {
79 +               /* get the first argument */
80 +               arg = xlgetarg();
81 +               xllastarg();
82 +
83 +               /* set the type of the first argument */
84 +               if (fixp(arg)) {
85 +                       ival = getfixnum(arg);
86 +                       snprintf(buf,STRMAX,"%d",ival);
87 +               }
88 +               else if (floatp(arg)) {
89 +                       fval = getflonum(arg);
90 +                       snprintf(buf,STRMAX,"%f",fval);
91 +               }
92 +
93 +               return cvstring(buf);
94 +       } else 
95 +               return NIL;
96 +}