=================================================================== RCS file: /home/cvs/OpenXM/src/ox_toolkit/testclient.c,v retrieving revision 1.5 retrieving revision 1.7 diff -u -p -r1.5 -r1.7 --- OpenXM/src/ox_toolkit/testclient.c 2000/10/10 05:23:21 1.5 +++ OpenXM/src/ox_toolkit/testclient.c 2000/11/27 09:57:10 1.7 @@ -1,5 +1,5 @@ /* -*- mode: C -*- */ -/* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.4 2000/03/10 12:24:40 ohara Exp $ */ +/* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.6 2000/11/21 07:59:08 ohara Exp $ */ /* A sample implementation of an OpenXM client with OpenXM C library */ @@ -47,6 +47,19 @@ static int prompt() #define VERSION 0x11121500 #define ID_STRING "v0.11121500" +mathcap *oxf_mathcap(OXFILE *oxfp) +{ + if (oxfp->mathcap == NULL) { + oxfp->mathcap = new_mathcap(); + } + return oxfp->mathcap; +} + +cmo_mathcap *oxf_cmo_mathcap(OXFILE *oxfp) +{ + return mathcap_get(oxf_mathcap(oxfp)); +} + int test_0() { cmo* c = NULL; @@ -60,8 +73,8 @@ int test_0() print_cmo(c); fflush(stderr); - mathcap_sysinfo_set(VERSION, ID_STRING, "testclient"); - send_ox_cmo(sv, mathcap_get()); + mathcap_init(VERSION, ID_STRING, "testclient", NULL, NULL); + send_ox_cmo(sv, oxf_cmo_mathcap(sv)); ox_reset(sv); send_ox_cmo(sv, (cmo *)new_cmo_string("N[ArcTan[1]]")); @@ -77,8 +90,8 @@ int test_1() { cmo *c, *m; - mathcap_sysinfo_set(1000, "test!", "testclient"); - m = mathcap_get(); + mathcap_init(1000, "test!", "testclient", NULL, NULL); + m = oxf_cmo_mathcap(sv); fprintf(stderr, "testclient:: test cmo_mathcap.\n"); send_ox_cmo(sv, m); send_ox_command(sv, SM_popCMO);