version 1.5, 2000/01/22 06:29:18 |
version 1.8, 2000/11/28 20:16:03 |
|
|
/* -*- mode: C -*- */ |
/* -*- mode: C -*- */ |
/* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.4 2000/01/05 06:09:11 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/mlo.c,v 1.7 2000/10/10 19:58:29 ohara Exp $ */ |
|
|
/* |
/* |
Copyright (C) Katsuyoshi OHARA, 2000. |
Copyright (C) Katsuyoshi OHARA, 2000. |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <gmp.h> |
|
#include <mathlink.h> |
#include <mathlink.h> |
#include "oxtag.h" |
#include <ox_toolkit.h> |
#include "ox.h" |
|
#include "mlo.h" |
#include "mlo.h" |
#include "serv2.h" |
#include "serv2.h" |
|
|
Line 59 cmo *receive_mlo_function() |
|
Line 57 cmo *receive_mlo_function() |
|
MLGetFunction(stdlink, &s, &n); |
MLGetFunction(stdlink, &s, &n); |
fprintf(stderr, "--debug: MLO == MLTKFUNC (%s[#%d]).\n", s, n); |
fprintf(stderr, "--debug: MLO == MLTKFUNC (%s[#%d]).\n", s, n); |
m = new_cmo_list(); |
m = new_cmo_list(); |
append_cmo_list((cmo_list *)m, new_cmo_string(s)); |
list_append((cmo_list *)m, new_cmo_string(s)); |
|
|
for (i=0; i<n; i++) { |
for (i=0; i<n; i++) { |
fprintf(stderr, " --debug: arg[%d]\n", i); |
fprintf(stderr, " --debug: arg[%d]\n", i); |
fflush(stderr); |
fflush(stderr); |
ob = receive_mlo(); |
ob = receive_mlo(); |
append_cmo_list((cmo_list *)m, ob); |
list_append((cmo_list *)m, ob); |
} |
} |
|
|
MLDisownString(stdlink, s); |
MLDisownString(stdlink, s); |
Line 84 cmo *convert_mlo_to_cmo(mlo *m) |
|
Line 82 cmo *convert_mlo_to_cmo(mlo *m) |
|
} |
} |
#endif |
#endif |
|
|
|
#define MLO_FUNCTION (CMO_PRIVATE+1) |
|
|
mlo_function *new_mlo_function(char *function) |
mlo_function *new_mlo_function(char *function) |
{ |
{ |
mlo_function *c = malloc(sizeof(mlo_function)); |
mlo_function *c = malloc(sizeof(mlo_function)); |
Line 110 cmo *receive_mlo_function_newer() |
|
Line 110 cmo *receive_mlo_function_newer() |
|
fprintf(stderr, "--debug: arg[%d]\n", i); |
fprintf(stderr, "--debug: arg[%d]\n", i); |
fflush(stderr); |
fflush(stderr); |
ob = receive_mlo(); |
ob = receive_mlo(); |
append_cmo_list((cmo_list *)m, ob); |
list_append((cmo_list *)m, ob); |
} |
} |
|
|
MLDisownString(stdlink, s); |
MLDisownString(stdlink, s); |
Line 225 int send_mlo_zz(cmo *m) |
|
Line 225 int send_mlo_zz(cmo *m) |
|
int send_mlo_list(cmo *c) |
int send_mlo_list(cmo *c) |
{ |
{ |
char *s; |
char *s; |
cell *cp = ((cmo_list *)c)->head; |
cell *cp = list_first((cmo_list *)c); |
int len = length_cmo_list((cmo_list *)c); |
int len = list_length((cmo_list *)c); |
|
|
MLPutFunction(stdlink, "List", len); |
MLPutFunction(stdlink, "List", len); |
while(cp->next != NULL) { |
while(!list_endof(c, cp)) { |
send_mlo(cp->cmo); |
send_mlo(cp->cmo); |
cp = cp->next; |
cp = list_next(cp); |
} |
} |
} |
} |
|
|