[BACK]Return to testclient.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Diff for /OpenXM/src/ox_toolkit/testclient.c between version 1.13 and 1.17

version 1.13, 2003/09/15 09:31:42 version 1.17, 2016/08/23 06:13:10
Line 1 
Line 1 
 /* -*- mode: C -*- */  /* -*- mode: C -*- */
 /* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.12 2003/03/23 20:17:35 ohara Exp $ */  /* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.16 2005/10/12 04:03:37 takayama Exp $ */
   
 /* A sample implementation of an OpenXM client with OpenXM C library */  /* A sample implementation of an OpenXM client with OpenXM C library */
   /* Sample input
     (OX_DATA, (CMO_STRING,"printf(\"%a\");"))
     (OX_COMMAND,(SM_executeStringByLocalParser))
    */
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <unistd.h>  #include <unistd.h>
Line 41  static void prompt()
Line 44  static void prompt()
 {  {
     fprintf(stdout, "> ");      fprintf(stdout, "> ");
     fgets(cmdline, size, stdin);      fgets(cmdline, size, stdin);
     init_parser(cmdline);  
 }  }
   
 #define VERSION 0x11121500  #define VERSION 0x11121500
Line 95  int main(int argc, char* argv[])
Line 97  int main(int argc, char* argv[])
     ox* m = NULL;      ox* m = NULL;
     cmo* c = NULL;      cmo* c = NULL;
     int code;      int code;
     char *server = "ox_sm1";      char *server = "ox_asir";
   
     ox_stderr_init(stderr);      ox_stderr_init(stderr);
   
Line 103  int main(int argc, char* argv[])
Line 105  int main(int argc, char* argv[])
         server = argv[1];          server = argv[1];
     }      }
     ox_printf("testclient:: I use %s as an OX server.\n", server);      ox_printf("testclient:: I use %s as an OX server.\n", server);
 /*    sv = ox_start("localhost", "ox", server);  */      sv = ox_start("localhost", "ox", server);
     if (sv == NULL) {      if (sv == NULL) {
         ox_printf("testclient:: I cannot connect to servers.\n");          ox_printf("testclient:: I cannot connect to servers.\n");
         exit(1);          exit(1);
Line 113  int main(int argc, char* argv[])
Line 115  int main(int argc, char* argv[])
         test_1();          test_1();
     }      }
   
     setflag_parse(PFLAG_ADDREV);      while(prompt(), (m = ox_parse_lisp(cmdline)) != NULL) {
   
     while(prompt(), (m = parse()) != NULL) {  
         send_ox(sv, m);          send_ox(sv, m);
         if (m->tag == OX_COMMAND) {          if (m->tag == OX_COMMAND) {
             code = ((ox_command *)m)->command;              code = ((ox_command *)m)->command;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.17

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