[BACK]Return to sm.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_math

Diff for /OpenXM/src/ox_math/sm.c between version 1.3 and 1.5

version 1.3, 2003/01/13 12:04:53 version 1.5, 2003/02/12 08:28:41
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_math/sm.c,v 1.2 2003/01/11 12:38:57 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_math/sm.c,v 1.4 2003/02/04 14:27:43 ohara Exp $ */
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 33  void stack_extend()
Line 33  void stack_extend()
   
 void push(cmo *ob)  void push(cmo *ob)
 {  {
 #if DEBUG      ox_printf("push<%s>.\n", get_symbol_by_tag(ob->tag));
     symbol_t symp;  
   
     if (ob->tag == CMO_STRING) {  
         ox_printf("ox_math:: a CMO_STRING(%s) was pushed.\n", ((cmo_string *)ob)->s);  
     }else {  
         symp = lookup_by_tag(ob->tag);  
         ox_printf("ox_math:: a %s was pushed.\n", symbol_get_key(symp));  
     }  
 #endif  
     if (stack_ptr >= stack_size) {      if (stack_ptr >= stack_size) {
         stack_extend();          stack_extend();
     }      }
Line 79  an sm_* function, called by sm_run, pushes an error ob
Line 70  an sm_* function, called by sm_run, pushes an error ob
 void sm_popCMO()  void sm_popCMO()
 {  {
     cmo* m = pop();      cmo* m = pop();
 #ifdef DEBUG      ox_printf(" <%s>", get_symbol_by_tag(m->tag));
     symbol_t symp = lookup_by_tag(m->tag);  
     ox_printf("ox_math:: opecode = SM_popCMO. (%s)\n", symbol_get_key(symp));  
 #endif  
     send_ox_cmo(stack_oxfp, m);      send_ox_cmo(stack_oxfp, m);
 }  }
   
Line 99  void sm_pops()
Line 87  void sm_pops()
 void sm_run(int code)  void sm_run(int code)
 {  {
     int (*func)(OXFILE *) = sm_search_f(code);      int (*func)(OXFILE *) = sm_search_f(code);
 #ifdef DEBUG      ox_printf("opecode=<%s>[%d] ", get_symbol_by_tag(code), code);
     symbol_t sp = lookup_by_tag(code);  
     ox_printf("ox_math:: %s received.\n", symbol_get_key(sp));  
 #endif  
     if (func != NULL) {      if (func != NULL) {
         func(stack_oxfp);          func(stack_oxfp);
     }else {      }else {
         ox_printf("unknown command: %d.\n", code);  
         push_error(ERROR_ID_UNKNOWN_SM, new_cmo_null());          push_error(ERROR_ID_UNKNOWN_SM, new_cmo_null());
     }      }
       ox_printf("\n");
 }  }
   
 int oxf_error(OXFILE *oxfp)  int oxf_error(OXFILE *oxfp)
Line 119  int oxf_error(OXFILE *oxfp)
Line 104  int oxf_error(OXFILE *oxfp)
     }      }
     return e;      return e;
 }  }
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>