[BACK]Return to main.cpp CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_ntl

Annotation of OpenXM/src/ox_ntl/main.cpp, Revision 1.2

1.2     ! iwane       1: /* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.1 2003/11/03 03:11:21 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 $"
                     10:
1.2     ! iwane      11: #if 0
1.1       iwane      12: extern "C" {
                     13: void dprintf(const char *, ...);
                     14: }
                     15: #endif
                     16:
1.2     ! iwane      17: static void
1.1       iwane      18: ntl_executeFunction(const char *func, cmo **arg, int argc)
                     19: {
1.2     ! iwane      20:        cmo *ans;
1.1       iwane      21:        if (strcmp(func, "fctr") == 0) {
1.2     ! iwane      22:                ans = ntl_fctr(arg, argc);
        !            23:                oxstack_push(ans);
        !            24:                return ;
1.1       iwane      25:        }
                     26:
1.2     ! iwane      27:        oxstack_push((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function")));
1.1       iwane      28: }
                     29:
                     30:
                     31:
                     32: int
                     33: main(int argc, char *argv[])
                     34: {
                     35:        int fd = 3;
                     36:        int i;
                     37:        int ret;
                     38:
                     39:        OXFILE *oxfp;
                     40:
                     41:        oxfp = oxf_open(fd);
                     42:
                     43:        ox_stderr_init(stderr);
                     44:
                     45:        oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, ntl_executeFunction, NULL);
                     46:        oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL);
                     47:
                     48:        for (i = 0;; i++) {
                     49:                ret = oxserv_receive(oxfp);
                     50:                if (ret != OXSERV_SUCCESS)
                     51:                        break;
                     52:        }
                     53:
                     54:        oxserv_dest();
                     55:        oxf_close(oxfp);
                     56:
                     57:        return (0);
                     58: }
                     59:
                     60:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>