File: [local] / OpenXM / src / ox_ntl / main.cpp (download)
Revision 1.5, Mon Jul 5 10:08:35 2004 UTC (20 years, 2 months ago) by ohara
Branch: MAIN
CVS Tags: RELEASE_1_2_3, KNOPPIX_2006, DEB_REL_1_2_3-9 Changes since 1.4: +5 -5
lines
1. removed declaration of dprintf. (for Debian GNU/Linux)
2. changed the function prototype of oxserv_set
and add some casts to the code. (for gcc 3.x)
|
/* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.5 2004/07/05 10:08:35 ohara Exp $ */
#include "ox_toolkit.h"
#include "oxserv.h"
#include "oxstack.h"
#include "ntl.h"
#define VERSION 0x00000001
#define ID_STRING "$Revision: 1.5 $"
static void
ntl_executeFunction(const char *func, cmo **arg, int argc)
{
cmo *ans;
int i;
struct {
const char *name;
cmo *(*func)(cmo **, int);
} funcs[] = {
{"fctr", ntl_fctr},
{"lll", ntl_lll},
{NULL, NULL},
};
for (i = 0; funcs[i].name != NULL; i++) {
if (strcmp(func, funcs[i].name) == 0) {
ans = funcs[i].func(arg, argc);
oxstack_push(ans);
return ;
}
}
oxstack_push((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function")));
}
int
main(int argc, char *argv[])
{
int fd = 3;
int ret;
OXFILE *oxfp;
oxfp = oxf_open(fd);
ox_stderr_init(stderr);
oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, (void (*)())ntl_executeFunction, NULL);
oxserv_set(OXSERV_SET_DELETE_CMO, (void (*)())delete_cmon, NULL);
oxserv_set(OXSERV_SET_GET_CMOTAG, (void (*)())get_cmon_tag, NULL);
oxserv_set(OXSERV_SET_CONVERT_CMO, (void (*)())convert_cmon, NULL);
oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL);
ret = oxserv_receive(oxfp);
oxserv_dest();
oxf_close(oxfp);
return (0);
}