Annotation of OpenXM/src/ox_ntl/main.cpp, Revision 1.5
1.5 ! ohara 1: /* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.4 2003/11/17 12:04:20 iwane Exp $ */
1.1 iwane 2:
3: #include "ox_toolkit.h"
4: #include "oxserv.h"
1.2 iwane 5: #include "oxstack.h"
1.1 iwane 6: #include "ntl.h"
7:
8: #define VERSION 0x00000001
9: #define ID_STRING "$Revision: 1.1 $"
1.3 iwane 10:
1.2 iwane 11: static void
1.1 iwane 12: ntl_executeFunction(const char *func, cmo **arg, int argc)
13: {
1.2 iwane 14: cmo *ans;
1.3 iwane 15: int i;
16:
17: struct {
18: const char *name;
19: cmo *(*func)(cmo **, int);
20: } funcs[] = {
21: {"fctr", ntl_fctr},
22: {"lll", ntl_lll},
23: {NULL, NULL},
24: };
25:
26: for (i = 0; funcs[i].name != NULL; i++) {
27: if (strcmp(func, funcs[i].name) == 0) {
28: ans = funcs[i].func(arg, argc);
29: oxstack_push(ans);
30: return ;
31: }
1.1 iwane 32: }
33:
1.2 iwane 34: oxstack_push((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function")));
1.1 iwane 35: }
36:
37:
38:
39: int
40: main(int argc, char *argv[])
41: {
42: int fd = 3;
43: int ret;
44:
45: OXFILE *oxfp;
46:
47: oxfp = oxf_open(fd);
48:
49: ox_stderr_init(stderr);
50:
1.5 ! ohara 51: oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, (void (*)())ntl_executeFunction, NULL);
! 52: oxserv_set(OXSERV_SET_DELETE_CMO, (void (*)())delete_cmon, NULL);
! 53: oxserv_set(OXSERV_SET_GET_CMOTAG, (void (*)())get_cmon_tag, NULL);
! 54: oxserv_set(OXSERV_SET_CONVERT_CMO, (void (*)())convert_cmon, NULL);
1.1 iwane 55: oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL);
56:
1.3 iwane 57: ret = oxserv_receive(oxfp);
1.1 iwane 58:
59: oxserv_dest();
60: oxf_close(oxfp);
61:
62: return (0);
63: }
64:
65:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>