| version 1.8, 1999/11/18 21:56:44 |
version 1.9, 1999/11/19 20:51:36 |
|
|
| /* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
| /* $OpenXM: OpenXM/src/ox_math/serv2.c,v 1.7 1999/11/07 12:12:56 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/serv2.c,v 1.8 1999/11/18 21:56:44 ohara Exp $ */ |
| |
|
| /* Open Mathematica サーバ */ |
/* Open Mathematica サーバ */ |
| /* ファイルディスクリプタ 3, 4 は open されていると仮定して動作する. */ |
/* ファイルディスクリプタ 3, 4 は open されていると仮定して動作する. */ |
| Line 176 int send_mlo_string(cmo *m) |
|
| Line 176 int send_mlo_string(cmo *m) |
|
| { |
{ |
| char *s = ((cmo_string *)m)->s; |
char *s = ((cmo_string *)m)->s; |
| MLPutString(lp, s); |
MLPutString(lp, s); |
| fprintf(stderr, "ox_math:: put %s.", s); |
|
| } |
} |
| |
|
| int send_mlo_zz(cmo *m) |
int send_mlo_zz(cmo *m) |
| Line 185 int send_mlo_zz(cmo *m) |
|
| Line 184 int send_mlo_zz(cmo *m) |
|
| MLPutFunction(lp, "ToExpression", 1); |
MLPutFunction(lp, "ToExpression", 1); |
| s = convert_cmo_to_string(m); |
s = convert_cmo_to_string(m); |
| MLPutString(lp, s); |
MLPutString(lp, s); |
| fprintf(stderr, "put %s.", s); |
|
| } |
} |
| |
|
| int send_mlo_list(cmo *c) |
int send_mlo_list(cmo *c) |
| Line 194 int send_mlo_list(cmo *c) |
|
| Line 192 int send_mlo_list(cmo *c) |
|
| cell *cp = ((cmo_list *)c)->head; |
cell *cp = ((cmo_list *)c)->head; |
| int len = length_cmo_list((cmo_list *)c); |
int len = length_cmo_list((cmo_list *)c); |
| |
|
| fprintf(stderr, "ox_math:: put List with %d args.\n", len); |
|
| MLPutFunction(lp, "List", len); |
MLPutFunction(lp, "List", len); |
| while(cp->next != NULL) { |
while(cp->next != NULL) { |
| send_mlo(cp->cmo); |
send_mlo(cp->cmo); |
| Line 215 int send_mlo(cmo *m) |
|
| Line 212 int send_mlo(cmo *m) |
|
| case CMO_INT32: |
case CMO_INT32: |
| send_mlo_int32(m); |
send_mlo_int32(m); |
| break; |
break; |
| |
case CMO_ZERO: |
| |
case CMO_NULL: |
| |
send_mlo_int32(new_cmo_int32(0)); |
| |
break; |
| case CMO_STRING: |
case CMO_STRING: |
| send_mlo_string(m); |
send_mlo_string(m); |
| break; |
break; |
| case CMO_LIST: |
case CMO_LIST: |
| send_mlo_list(m); |
send_mlo_list(m); |
| break; |
break; |
| |
case CMO_MATHCAP: |
| |
send_mlo(((cmo_mathcap *)m)->ob); |
| |
break; |
| |
case CMO_ZZ: |
| |
send_mlo_zz(m); |
| |
break; |
| default: |
default: |
| MLPutFunction(lp, "ToExpression", 1); |
MLPutFunction(lp, "ToExpression", 1); |
| s = convert_cmo_to_string(m); |
s = convert_cmo_to_string(m); |
| MLPutString(lp, s); |
MLPutString(lp, s); |
| fprintf(stderr, "put %s.", s); |
|
| break; |
break; |
| } |
} |
| } |
} |