/[cvs]/stack/stack.c
ViewVC logotype

Diff of /stack/stack.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.105 by masse, Tue Mar 12 14:53:19 2002 UTC revision 1.107 by masse, Tue Mar 12 21:05:11 2002 UTC
# Line 37  Line 37 
37  #include <unistd.h>  #include <unistd.h>
38  /* EX_NOINPUT, EX_USAGE */  /* EX_NOINPUT, EX_USAGE */
39  #include <sysexits.h>  #include <sysexits.h>
40    
41    #ifdef __linux__
42  /* mtrace, muntrace */  /* mtrace, muntrace */
43  #include <mcheck.h>  #include <mcheck.h>
44  /* ioctl */  /* ioctl */
45  #include <sys/ioctl.h>  #include <sys/ioctl.h>
46  /* KDMKTONE */  /* KDMKTONE */
47  #include <linux/kd.h>  #include <linux/kd.h>
48    #endif /* __linux__ */
49    
50  #include "stack.h"  #include "stack.h"
51    
# Line 883  extern void quit(environment *env) Line 886  extern void quit(environment *env)
886    if(env->free_string!=NULL)    if(env->free_string!=NULL)
887      free(env->free_string);      free(env->free_string);
888        
889    #ifdef __linux__
890    muntrace();    muntrace();
891    #endif
892    
893    exit(EXIT_SUCCESS);    exit(EXIT_SUCCESS);
894  }  }
# Line 958  int main(int argc, char **argv) Line 963  int main(int argc, char **argv)
963    
964    int c;                        /* getopt option character */    int c;                        /* getopt option character */
965    
966    #ifdef __linux__
967    mtrace();    mtrace();
968    #endif
969    
970    init_env(&myenv);    init_env(&myenv);
971    
# Line 1362  extern void ifelse(environment *env) Line 1369  extern void ifelse(environment *env)
1369    eval(env);    eval(env);
1370  }  }
1371    
1372    extern void sx_656c7365(environment *env)
1373    {
1374      if(env->head==NULL || CDR(env->head)==NULL
1375         || CDR(CDR(env->head))==NULL || CDR(CDR(CDR(env->head)))==NULL) {
1376        printerr("Too Few Arguments");
1377        env->err= 1;
1378        return;
1379      }
1380    
1381      if(CAR(CDR(env->head))->type!=symb
1382         || strcmp(CAR(CDR(env->head))->content.sym->id, "if")!=0) {
1383        printerr("Bad Argument Type");
1384        env->err= 2;
1385        return;
1386      }
1387    
1388      swap(env); toss(env);
1389      ifelse(env);
1390    }
1391    
1392  /* "while" */  /* "while" */
1393  extern void sx_7768696c65(environment *env)  extern void sx_7768696c65(environment *env)
1394  {  {
# Line 1652  extern void sx_72656164(environment *env Line 1679  extern void sx_72656164(environment *env
1679      return sx_72656164(env);      return sx_72656164(env);
1680  }  }
1681    
1682    #ifdef __linux__
1683  extern void beep(environment *env)  extern void beep(environment *env)
1684  {  {
1685    int freq, dur, period, ticks;    int freq, dur, period, ticks;
# Line 1694  extern void beep(environment *env) Line 1722  extern void beep(environment *env)
1722      abort();      abort();
1723    }    }
1724  }  }
1725    #endif /* __linux__ */
1726    
1727  /* "wait" */  /* "wait" */
1728  extern void sx_77616974(environment *env)  extern void sx_77616974(environment *env)

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.107

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26