version 1.2, 1999/12/15 07:51:20 |
version 1.3, 1999/12/22 11:26:37 |
|
|
/* -*- mode: C -*- */ |
/* -*- mode: C -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.1 1999/12/15 05:21:25 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/testclient.c,v 1.2 1999/12/15 07:51:20 takayama Exp $ */ |
|
|
/* A sample implementation of an OpenXM client with OpenXM C library */ |
/* A sample implementation of an OpenXM client with OpenXM C library */ |
|
|
|
|
#include <errno.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include "ox.h" |
#include "ox.h" |
|
#include "parse.h" |
|
|
ox_file_t sv; |
ox_file_t sv; |
|
|
Line 30 int dumpx(int fd, int n) |
|
Line 31 int dumpx(int fd, int n) |
|
return len; |
return len; |
} |
} |
|
|
#define VERSION 0x11121500 |
#define SIZE_CMDLINE 8192 |
#define ID_STRING "testclient version 0.11121500" |
|
|
|
int prompt() |
static int size = SIZE_CMDLINE; |
|
static char cmdline[SIZE_CMDLINE]; |
|
|
|
static int prompt() |
{ |
{ |
printf("> "); |
fprintf(stdout, "> "); |
|
fgets(cmdline, size, stdin); |
|
init_parser(cmdline); |
} |
} |
|
|
|
#define VERSION 0x11121500 |
|
#define ID_STRING "testclient version 0.11121500" |
|
|
int test_0() |
int test_0() |
{ |
{ |
cmo* c = NULL; |
cmo* c = NULL; |
|
|
testclient |
testclient |
>(OX_DATA,(CMO_INT32,123)) |
>(OX_DATA,(CMO_INT32,123)) |
>(OX_COMMAND,(SM_popCMO)) |
>(OX_COMMAND,(SM_popCMO)) |
*/ |
*/ |
|
|
int main(int argc, char* argv[]) |
int main(int argc, char* argv[]) |
{ |
{ |
Line 104 int main(int argc, char* argv[]) |
|
Line 112 int main(int argc, char* argv[]) |
|
if (strcmp(server, "ox_math")==0) { |
if (strcmp(server, "ox_math")==0) { |
test_1(); |
test_1(); |
} |
} |
|
|
|
setflag_parse(PFLAG_ADDREV); |
|
|
while(prompt(), (m = parse()) != NULL) { |
while(prompt(), (m = parse()) != NULL) { |
send_ox(sv->stream, m); |
send_ox(sv->stream, m); |