#ifndef lint static char sccs_id[] = "%W% (TriChlor) %G% %U%"; #endif /* lint */ #ifdef _MSDOS #include #include #include #endif #include #include "portable.h" #include "vnkeys.h" /* handles a maximum of 1024 input bytes at a time */ int #ifdef ANSI_C vk_qrto8(u_char FAR *inbuf, u_char FAR *outbuf, u_char esc, Vk_State state) #else vk_qrto8(inbuf, outbuf, esc, state) u_char FAR *inbuf; u_char FAR *outbuf; u_char esc; Vk_State state; #endif { Vk_Fsm id; int i, n; u_char FAR *ic; u_char FAR *oc; u_char ibuf[1024], obuf[4096]; /* in/out buffers */ int count; id = vk_init(state, esc, VK_DEFAULT_BS); vk_set(id, 1, VK_SET_BATCH); /* turn on batch mode */ ic = inbuf; oc = outbuf; for (ic = inbuf, oc = outbuf; *ic; ic++) { vk_step(id, *ic, (u_char FAR *) oc, (int FAR *) &count); oc += count; } /* shut the machine down and flush any pending characters */ vk_flush(id, oc, (int FAR *) &count); oc += count; *oc = '\0'; return(oc - outbuf); }