version 1.5, 2004/07/05 10:08:35 |
version 1.6, 2008/09/19 10:55:40 |
|
|
/* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.4 2003/11/17 12:04:20 iwane Exp $ */ |
/* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.5 2004/07/05 10:08:35 ohara Exp $ */ |
|
|
|
/* |
|
[1208] ox_launch(0, "/home/openxm/OpenXM/src/ox_ntl/ox_ntl"); |
|
0 |
|
[1210] load("ntl.rr"); |
|
[1229] ntl.factor(0, x^2-1); |
|
[[1,1],[x+1,1],[x-1,1]] |
|
[1231] ox_shutdown(0); |
|
0 |
|
*/ |
#include "ox_toolkit.h" |
#include "ox_toolkit.h" |
#include "oxserv.h" |
#include "oxserv.h" |
#include "oxstack.h" |
#include "oxstack.h" |
|
|
#define VERSION 0x00000001 |
#define VERSION 0x00000001 |
#define ID_STRING "$Revision$" |
#define ID_STRING "$Revision$" |
|
|
|
|
static void |
static void |
ntl_executeFunction(const char *func, cmo **arg, int argc) |
ntl_executeFunction(const char *func, oxstack_node **arg, int argc) |
{ |
{ |
cmo *ans; |
oxstack_node *ans; |
int i; |
int i; |
|
|
|
enum { |
|
RET_CMO, |
|
RET_USR, |
|
}; |
|
|
struct { |
struct { |
const char *name; |
const char *name; |
cmo *(*func)(cmo **, int); |
oxstack_node *(*func)(oxstack_node **, int); |
|
int return_type; |
} funcs[] = { |
} funcs[] = { |
{"fctr", ntl_fctr}, |
{"fctr", ntl_fctr, RET_USR}, |
{"lll", ntl_lll}, |
{"lll", ntl_lll, RET_USR}, |
{NULL, NULL}, |
{NULL, NULL, 0} |
}; |
}; |
|
|
for (i = 0; funcs[i].name != NULL; i++) { |
for (i = 0; funcs[i].name != NULL; i++) { |
Line 31 ntl_executeFunction(const char *func, cmo **arg, int a |
|
Line 47 ntl_executeFunction(const char *func, cmo **arg, int a |
|
} |
} |
} |
} |
|
|
oxstack_push((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function"))); |
oxstack_push_cmo((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function"))); |
} |
} |
|
|
|
|
Line 39 ntl_executeFunction(const char *func, cmo **arg, int a |
|
Line 55 ntl_executeFunction(const char *func, cmo **arg, int a |
|
int |
int |
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
{ |
{ |
int fd = 3; |
const int fd = 3; |
int ret; |
int ret; |
|
|
OXFILE *oxfp; |
OXFILE *oxfp; |
Line 48 main(int argc, char *argv[]) |
|
Line 64 main(int argc, char *argv[]) |
|
|
|
ox_stderr_init(stderr); |
ox_stderr_init(stderr); |
|
|
oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, (void (*)())ntl_executeFunction, NULL); |
oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, (void *)(void (*)())ntl_executeFunction, NULL); |
oxserv_set(OXSERV_SET_DELETE_CMO, (void (*)())delete_cmon, NULL); |
oxserv_set(OXSERV_SET_DELETE_CMO, (void *)(void (*)())delete_cmon, NULL); |
oxserv_set(OXSERV_SET_GET_CMOTAG, (void (*)())get_cmon_tag, NULL); |
oxserv_set(OXSERV_SET_GET_CMOTAG, (void *)(void (*)())get_cmon_tag, NULL); |
oxserv_set(OXSERV_SET_CONVERT_CMO, (void (*)())convert_cmon, NULL); |
oxserv_set(OXSERV_SET_CONVERT_CMO, (void *)(void (*)())convert_cmon, NULL); |
oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL); |
oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL); |
|
|
|
printf("\n\n"); |
|
printf("MAPLE=%s\n", getenv("MAPLE")); |
|
printf("PATH=%s\n", getenv("PATH")); |
|
printf("LD_LIBRARY_PATH=%s\n", getenv("LD_LIBRARY_PATH")); |
|
sleep(10000); |
ret = oxserv_receive(oxfp); |
ret = oxserv_receive(oxfp); |
|
|
oxserv_dest(); |
oxserv_dest(); |