The special type "
ncgbuffer" is used to specify an arbitrary chunk
of data to be transferred between client and server. It becomes
TSPBUFFER *" in the generated code. A
two members; buf is a pointer to the data and n is the count of bytes
pointed to. The buf member is allocated for each transfer and must be
freed when no longer needed.
void firstword(ncgbuffer b) /* return the first word in the buffer */
for(i=0;i<b.n && b.buf[i]!=' ';i++); /* search for space */
b.n=i; /* reset length of buffer to what was found */
b.buf="Expansion Programs"; /* setup buffer to send to the server */
n_firstword(se,&b); /* call server to get first word in buffer */
for(i=0;i<b.n;i++) putchar(b.buf[i]); /* print the result buffer */
free(b.buf); /* free the returned buffer */