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

Diff for /OpenXM/src/ox_ntl/main.cpp between version 1.1 and 1.5

version 1.1, 2003/11/03 03:11:21 version 1.5, 2004/07/05 10:08:35
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM/src/ox_ntl/main.cpp,v 1.4 2003/11/17 12:04:20 iwane Exp $ */
   
 #include "ox_toolkit.h"  #include "ox_toolkit.h"
 #include "oxserv.h"  #include "oxserv.h"
   #include "oxstack.h"
 #include "ntl.h"  #include "ntl.h"
   
 #define VERSION 0x00000001  #define VERSION 0x00000001
 #define ID_STRING "$Revision$"  #define ID_STRING "$Revision$"
   
 #if 1  static void
 extern "C" {  
 void dprintf(const char *, ...);  
 }  
 #endif  
   
 static cmo *  
 ntl_executeFunction(const char *func, cmo **arg, int argc)  ntl_executeFunction(const char *func, cmo **arg, int argc)
 {  {
         if (strcmp(func, "fctr") == 0) {          cmo *ans;
                 return (ntl_fctr(arg, argc));          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 ;
                   }
         }          }
   
         return (NULL);          oxstack_push((cmo *)new_cmo_error2((cmo *)new_cmo_string("Unknown Function")));
 }  }
   
   
Line 29  int
Line 40  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         int fd = 3;          int fd = 3;
         int i;  
         int ret;          int ret;
   
         OXFILE *oxfp;          OXFILE *oxfp;
Line 38  main(int argc, char *argv[])
Line 48  main(int argc, char *argv[])
   
         ox_stderr_init(stderr);          ox_stderr_init(stderr);
   
         oxserv_set(OXSERV_SET_EXECUTE_FUNCTION, ntl_executeFunction, NULL);          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);          oxserv_init(oxfp, VERSION, ID_STRING, "ox_ntl", NULL, NULL);
   
         for (i = 0;; i++) {          ret = oxserv_receive(oxfp);
                 ret = oxserv_receive(oxfp);  
                 if (ret != OXSERV_SUCCESS)  
                         break;  
         }  
   
         oxserv_dest();          oxserv_dest();
         oxf_close(oxfp);          oxf_close(oxfp);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.5

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