version 1.2, 2000/12/03 22:09:34 |
version 1.6, 2003/01/15 10:16:10 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_math/sm_ext.c,v 1.1 2000/12/03 21:45:48 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/sm_ext.c,v 1.5 2003/01/15 05:08:10 ohara Exp $ */ |
|
|
/* |
/* |
Copyright (C) Katsuyoshi OHARA, 2000. |
Copyright (C) Katsuyoshi OHARA, 2000. |
|
|
#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 51 void sm_popString() |
|
Line 50 void sm_popString() |
|
cmo *err; |
cmo *err; |
cmo *m; |
cmo *m; |
|
|
#ifdef DEBUG |
ox_printf("ox_math:: opecode = SM_popString.\n"); |
fprintf(stderr, "ox_math:: opecode = SM_popString.\n"); |
|
#endif |
|
|
|
m = pop(); |
m = pop(); |
if (m->tag == CMO_STRING) { |
if (m->tag == CMO_STRING) { |
send_ox_cmo(stack_oxfp, m); |
send_ox_cmo(stack_oxfp, m); |
Line 90 void sm_executeStringByLocalParser() |
|
Line 86 void sm_executeStringByLocalParser() |
|
symbol_t symp; |
symbol_t symp; |
cmo* m = pop(); |
cmo* m = pop(); |
char *s = NULL; |
char *s = NULL; |
#ifdef DEBUG |
|
fprintf(stderr, "ox_math:: opecode = SM_executeStringByLocalParser.\n"); |
|
#endif |
|
|
|
|
ox_printf("ox_math:: opecode = SM_executeStringByLocalParser.\n"); |
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 96 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(); |
push(ml_return()); |
push(receive_mlo()); |
|
} |
} |
}else { |
}else { |
#ifdef DEBUG |
#ifdef DEBUG |
symp = lookup_by_tag(m->tag); |
symp = lookup_by_tag(m->tag); |
fprintf(stderr, "ox_math:: error. the top of stack is %s.\n", symbol_get_key(symp)); |
ox_printf("ox_math:: error. the top of stack is %s.\n", symbol_get_key(symp)); |
#endif |
#endif |
push_error(SM_executeStringByLocalParser, m); |
push_error(SM_executeStringByLocalParser, m); |
} |
} |
Line 136 void sm_executeFunction() |
|
Line 129 void sm_executeFunction() |
|
argv[i] = pop(); |
argv[i] = pop(); |
} |
} |
ml_executeFunction(func, argc, argv); |
ml_executeFunction(func, argc, argv); |
ml_select(); |
push(ml_return()); |
push(receive_mlo()); |
|
} |
} |
|
|
void sm_mathcap() |
void sm_mathcap() |