version 1.3, 1999/11/06 21:39:37 |
version 1.4, 1999/11/07 12:12:56 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_math/testclient.c,v 1.2 1999/11/02 06:11:58 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_math/testclient.c,v 1.3 1999/11/06 21:39:37 ohara Exp $ */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 28 int dumpx(int fd, int n) |
|
Line 28 int dumpx(int fd, int n) |
|
return len; |
return len; |
} |
} |
|
|
/* 平成11年7月10日 */ |
/* 平成11年11月7日 */ |
#define VERSION 0x11071000 |
#define VERSION 0x11110700 |
#define ID_STRING "testclient version 0.11071000" |
#define ID_STRING "testclient version 0.11110700" |
|
|
int prompt() |
int prompt() |
{ |
{ |
printf("> "); |
printf("> "); |
} |
} |
|
|
int main(int argc, char* argv[]) |
int test_0() |
{ |
{ |
ox* m = NULL; |
|
cmo* c = NULL; |
cmo* c = NULL; |
int code; |
|
char *server = "ox_sm1"; |
|
|
|
setbuf(stderr, NULL); |
ox_mathcap(sv); |
|
send_ox_cmo(sv->stream, make_mathcap_object(VERSION, ID_STRING)); |
|
|
if (argc>1) { |
|
server = argv[1]; |
|
} |
|
fprintf(stderr, "testclient:: I use %s as an OX server.\n", server); |
|
sv = ox_start("localhost", "ox", server); |
|
if (sv == NULL) { |
|
fprintf(stderr, "testclient:: I cannot connect to servers.\n"); |
|
exit(1); |
|
} |
|
|
|
if (argc>1) { |
|
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); |
Line 69 int main(int argc, char* argv[]) |
|
Line 52 int main(int argc, char* argv[]) |
|
c = receive_cmo(sv->stream); |
c = receive_cmo(sv->stream); |
fprintf(stderr, "testclient:: cmo received.\n"); |
fprintf(stderr, "testclient:: cmo received.\n"); |
print_cmo(c); |
print_cmo(c); |
|
} |
|
|
|
int main(int argc, char* argv[]) |
|
{ |
|
ox* m = NULL; |
|
cmo* c = NULL; |
|
int code; |
|
char *server = "ox_sm1"; |
|
|
|
setbuf(stderr, NULL); |
|
|
|
if (argc>1) { |
|
server = argv[1]; |
|
} |
|
fprintf(stderr, "testclient:: I use %s as an OX server.\n", server); |
|
sv = ox_start("localhost", "ox", server); |
|
if (sv == NULL) { |
|
fprintf(stderr, "testclient:: I cannot connect to servers.\n"); |
|
exit(1); |
|
} |
|
|
|
if (strcmp(argc, "ox_math")==0) { |
|
test_0(); |
|
} |
|
|
while(prompt(), (m = parse()) != NULL) { |
while(prompt(), (m = parse()) != NULL) { |
send_ox(sv, m); |
send_ox(sv, m); |