=================================================================== RCS file: /home/cvs/OpenXM/doc/oxlib/test.c,v retrieving revision 1.1 retrieving revision 1.5 diff -u -p -r1.1 -r1.5 --- OpenXM/doc/oxlib/test.c 2002/02/25 07:09:01 1.1 +++ OpenXM/doc/oxlib/test.c 2018/03/28 05:09:38 1.5 @@ -1,16 +1,18 @@ -/* $OpenXM$ */ -#include +/* $OpenXM: OpenXM/doc/oxlib/test.c,v 1.4 2003/03/08 07:49:59 takayama Exp $ */ +#include +#include "hhh.h" main() { char ibuf[BUFSIZ]; - char *s,*buf; + char *obuf; int len,len0; asir_ox_init(1); /* Use the network byte order */ len0 = BUFSIZ; - buf = (char *)malloc(len0); + obuf = (char *)malloc(len0); while ( 1 ) { + printf("Input> "); fgets(ibuf,BUFSIZ,stdin); if ( !strncmp(ibuf,"bye",3) ) exit(0); @@ -18,10 +20,10 @@ main() { len = asir_ox_peek_cmo_string_length(); if ( len > len0 ) { len0 = len; - buf = (char *)realloc(buf,len0); + obuf = (char *)realloc(obuf,len0); } - asir_ox_pop_string(buf,len0); - printf("%s\n",buf); + asir_ox_pop_string(obuf,len0); + printf("Output> %s\n",obuf); } }