version 1.4, 1999/11/07 12:12:56 |
version 1.6, 1999/12/15 02:49:55 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_math/testclient.c,v 1.3 1999/11/06 21:39:37 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/testclient.c,v 1.5 1999/12/14 09:31:56 ohara Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
|
int test_0() |
int test_0() |
{ |
{ |
cmo* c = NULL; |
cmo* c = NULL; |
|
#ifdef DEBUG |
|
fprintf(stderr, "testclient:: calling ox_mathcap().\n"); |
|
c = ox_mathcap(sv); |
|
fprintf(stderr, "testclient:: cmo received.(%p)\n", c); |
|
#else |
|
c = ox_mathcap(sv); |
|
#endif |
|
print_cmo(c); |
|
fflush(stderr); |
|
send_ox_cmo(sv->stream, make_mathcap_object(VERSION, ID_STRING)); |
|
|
ox_mathcap(sv); |
|
send_ox_cmo(sv->stream, make_mathcap_object(VERSION, ID_STRING)); |
|
|
|
ox_reset(sv); |
ox_reset(sv); |
send_ox_cmo(sv->stream, new_cmo_string("N[ArcTan[1]]")); |
send_ox_cmo(sv->stream, new_cmo_string("N[ArcTan[1]]")); |
send_ox_command(sv->stream, SM_executeStringByLocalParser); |
send_ox_command(sv->stream, SM_executeStringByLocalParser); |
|
|
print_cmo(c); |
print_cmo(c); |
} |
} |
|
|
|
int test_1() |
|
{ |
|
cmo *c = NULL; |
|
cmo *m = make_mathcap_object(1000, "test!"); |
|
fprintf(stderr, "testclient:: test cmo_mathcap.\n"); |
|
send_ox_cmo(sv->stream, m); |
|
send_ox_command(sv->stream, SM_popCMO); |
|
receive_ox_tag(sv->stream); |
|
c = receive_cmo(sv->stream); |
|
fprintf(stderr, "testclient:: cmo received.(%p)\n", c); |
|
print_cmo(c); |
|
fputc('\n', stderr); |
|
} |
|
|
int main(int argc, char* argv[]) |
int main(int argc, char* argv[]) |
{ |
{ |
ox* m = NULL; |
ox* m = NULL; |
Line 73 int main(int argc, char* argv[]) |
|
Line 94 int main(int argc, char* argv[]) |
|
exit(1); |
exit(1); |
} |
} |
|
|
if (strcmp(argc, "ox_math")==0) { |
if (strcmp(server, "ox_math")==0) { |
test_0(); |
test_1(); |
} |
} |
|
|
while(prompt(), (m = parse()) != NULL) { |
while(prompt(), (m = parse()) != NULL) { |
send_ox(sv, m); |
send_ox(sv->stream, m); |
if (m->tag == OX_COMMAND) { |
if (m->tag == OX_COMMAND) { |
code = ((ox_command *)m)->command; |
code = ((ox_command *)m)->command; |
if (code >= 1024) { |
if (code >= 1024) { |