source: plugins/audacity/audacity-libnyquist.diff @ 96fb8ad

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 96fb8ad was 96fb8ad, checked in by Paul Brossier <piem@altern.org>, 19 years ago

import 0.1.7.1

  • Property mode set to 100644
File size: 2.7 KB
  • lib-src/libnyquist/nyx/nyx.c

    old new  
    620620{
    621621   if (moreargs()) {
    622622      unsigned char *cmd;
     623      int retval;
    623624      cmd = (unsigned char *)getstring(xlgastring());
    624       fprintf(stderr, "Will not execute system command: %s\n", cmd);
     625      //fprintf(stderr, "Will not execute system command: %s\n", cmd);
     626      system(cmd);
     627      if (retval != 0)
     628        fprintf(stderr,
     629                "the command \n %s \n exited with the error %d\n",
     630                cmd, retval);
    625631   }
    626632   return s_true;
    627633}
  • lib-src/libnyquist/xlisp/xlftab.c

    old new  
    8383    xgetlambda(void),xmacroexpand(void),x1macroexpand(void),
    8484    xinfo(void),                                        //Added by Ning Hu      Apr.2001
    8585    xsetdir(void),                                      //Added by Ning Hu      May.2001
     86    xatof(void), xftoa(void),                           //Added by PiemBrossier Jul.2004
    8687    xtrace(void),xuntrace(void),xprofile(void),xstrsearch(void), xsetupconsole(void);
    8788#endif
    8889
     
    452453{       "WRITE-INT",                    S, xwrint               }, /* 292 */
    453454{       "WRITE-FLOAT",                  S, xwrfloat             }, /* 293 */
    454455{       "INFO",                         S, xinfo                }, /* 294 */ /* Ning Hu, Apr 2001 */
    455 {       NULL,                           S, xnotimp              }, /* 295 */
    456 {       NULL,                           S, xnotimp              }, /* 296 */
     456
     457{       "ATOF",                         S, xatof                }, /* 295 */ /* Paul Brossier <piem@altern.org> */
     458{       "FTOA",                         S, xftoa                }, /* 296 */ /* Jul. 2004 */
    457459{       NULL,                           S, xnotimp              }, /* 297 */
    458460{       NULL,                           S, xnotimp              }, /* 298 */
    459461{       NULL,                           S, xnotimp              }, /* 299 */
  • lib-src/libnyquist/xlisp/xlstr.c

    old new  
    1616#define TLEFT   1
    1717#define TRIGHT  2
    1818
     19/* on the NeXT, atof is a macro in stdlib.h */
     20#ifndef atof
     21extern double atof();
     22#endif
     23
    1924/* external variables */
    2025extern LVAL k_start,k_end,k_1start,k_1end,k_2start,k_2end;
    2126extern LVAL s_true;
     
    555560    return (icmp ? s_true : NIL);
    556561}
    557562
     563/* functions added by Paul Brossier <piem@altern.org> */
     564LVAL xatof() /* converts a string to a float */
     565{
     566        if (moreargs()) {
     567                unsigned char *astring = NULL;
     568                float afloat;
     569                astring = (unsigned char *)getstring(xlgastring());
     570                xllastarg();
     571                afloat = atof(astring);
     572                return cvflonum(afloat);
     573        } else
     574                return NIL;
     575}
     576
     577LVAL xftoa() /* converts a float to a string */
     578{
     579        LVAL arg;
     580        FIXTYPE ival=0;
     581        FLOTYPE fval=0;
     582        if (moreargs()) {
     583                /* get the first argument */
     584                arg = xlgetarg();
     585                xllastarg();
     586
     587                /* set the type of the first argument */
     588                if (fixp(arg)) {
     589                        ival = getfixnum(arg);
     590                        snprintf(buf,STRMAX,"%d",ival);
     591                }
     592                else if (floatp(arg)) {
     593                        fval = getflonum(arg);
     594                        snprintf(buf,STRMAX,"%f",fval);
     595                }
     596
     597                return cvstring(buf);
     598        } else
     599                return NIL;
     600}
Note: See TracBrowser for help on using the repository browser.