version 1.15, 2005/07/26 12:52:05 |
version 1.17, 2016/08/23 06:13:10 |
|
|
/* -*- mode: C -*- */ |
/* -*- mode: C -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.14 2005/07/20 17:48:03 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> |
|
|
ox_printf("testclient:: cmo received.(%p)\n", c); |
ox_printf("testclient:: cmo received.(%p)\n", c); |
print_cmo(c); |
print_cmo(c); |
|
|
mathcap_init(ID_STRING, "testclient"); |
mathcap_init(VERSION, ID_STRING, "testclient", NULL, NULL); |
send_ox_cmo(sv, (cmo *)oxf_cmo_mathcap(sv)); |
send_ox_cmo(sv, (cmo *)oxf_cmo_mathcap(sv)); |
|
|
ox_reset(sv); |
ox_reset(sv); |
|
|
{ |
{ |
cmo *c, *m; |
cmo *c, *m; |
|
|
mathcap_init("test!", "testclient"); |
mathcap_init(1000, "test!", "testclient", NULL, NULL); |
m = (cmo *)oxf_cmo_mathcap(sv); |
m = (cmo *)oxf_cmo_mathcap(sv); |
ox_printf("testclient:: test cmo_mathcap.\n"); |
ox_printf("testclient:: test cmo_mathcap.\n"); |
send_ox_cmo(sv, m); |
send_ox_cmo(sv, m); |
Line 94 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 102 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); |