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

Diff for /OpenXM/src/ox_math/sm_ext.c between version 1.3 and 1.7

version 1.3, 2003/01/11 12:38:57 version 1.7, 2003/02/04 14:27:43
Line 1 
Line 1 
 /* -*- mode: C; coding: euc-japan -*- */  /* -*- mode: C; coding: euc-japan -*- */
 /* $OpenXM: OpenXM/src/ox_math/sm_ext.c,v 1.2 2000/12/03 22:09:34 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_math/sm_ext.c,v 1.6 2003/01/15 10:16:10 ohara Exp $ */
   
 /*  /*
    Copyright (C) Katsuyoshi OHARA, 2000.     Copyright (C) Katsuyoshi OHARA, 2000.
Line 14 
Line 14 
 #include <stdlib.h>  #include <stdlib.h>
 #include <unistd.h>  #include <unistd.h>
 #include <gmp.h>  #include <gmp.h>
 #include <mathlink.h>  
 #include <ox_toolkit.h>  #include <ox_toolkit.h>
 #include "sm.h"  #include "sm.h"
   
Line 49  void sm_popString()
Line 48  void sm_popString()
 {  {
     char *s;      char *s;
     cmo *err;      cmo *err;
     cmo *m;      cmo *m = pop();
   
 #ifdef DEBUG  
     fprintf(ox_stderr, "ox_math:: opecode = SM_popString.\n");  
 #endif  
   
     m = pop();  
     if (m->tag == CMO_STRING) {      if (m->tag == CMO_STRING) {
         send_ox_cmo(stack_oxfp, m);          send_ox_cmo(stack_oxfp, m);
     }else if ((s = new_string_set_cmo(m)) != NULL) {      }else if ((s = new_string_set_cmo(m)) != NULL) {
Line 87  int local_execute(char *s)
Line 80  int local_execute(char *s)
 /* The following function is depend on an implementation of a server. */  /* The following function is depend on an implementation of a server. */
 void sm_executeStringByLocalParser()  void sm_executeStringByLocalParser()
 {  {
     symbol_t symp;  
     cmo* m = pop();      cmo* m = pop();
     char *s = NULL;      char *s = NULL;
 #ifdef DEBUG  
     fprintf(ox_stderr, "ox_math:: opecode = SM_executeStringByLocalParser.\n");  
 #endif  
   
     if (m->tag == CMO_STRING      if (m->tag == CMO_STRING
         && strlen(s = ((cmo_string *)m)->s) != 0) {          && strlen(s = ((cmo_string *)m)->s) != 0) {
         if (s[0] == ':') {          if (s[0] == ':') {
Line 102  void sm_executeStringByLocalParser()
Line 90  void sm_executeStringByLocalParser()
             /* for mathematica */              /* for mathematica */
             /* Sending the string `s' to mathematica for its evaluation. */              /* Sending the string `s' to mathematica for its evaluation. */
             ml_evaluateStringByLocalParser(s);              ml_evaluateStringByLocalParser(s);
             ml_select();              m = ml_return();
             push(receive_mlo());              push(m);
         }          }
     }else {      }else {
 #ifdef DEBUG                  ox_printf(" <%s>", get_symbol_by_tag(m->tag));
                 symp = lookup_by_tag(m->tag);  
                 fprintf(ox_stderr, "ox_math:: error. the top of stack is %s.\n", symbol_get_key(symp));  
 #endif  
                 push_error(SM_executeStringByLocalParser, m);                  push_error(SM_executeStringByLocalParser, m);
         }          }
 }  }
Line 136  void sm_executeFunction()
Line 121  void sm_executeFunction()
         argv[i] = pop();          argv[i] = pop();
     }      }
     ml_executeFunction(func, argc, argv);      ml_executeFunction(func, argc, argv);
     ml_select();      m = ml_return();
     push(receive_mlo());      push(m);
 }  }
   
 void sm_mathcap()  void sm_mathcap()
Line 155  void sm_set_mathcap()
Line 140  void sm_set_mathcap()
         /* an error object must be pushed */          /* an error object must be pushed */
     }      }
 }  }
   

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

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