33 static Tcl_DString dstr;
47 nput = Tcl_DStringLength(&dstr) - strpos;
50 memcpy(ubuf, (strpos + Tcl_DStringValue(&dstr)), n);
56 memcpy(ubuf, (strpos + Tcl_DStringValue(&dstr)), nput);
60 Tcl_DStringFree(&dstr);
61 Tcl_DStringInit(&dstr);
62 if (Tcl_Gets((Tcl_Channel) channel, &dstr) < 0) {
69 Tcl_DStringAppend(&dstr,
"\n", 1);
70 if (Tcl_DStringLength(&dstr) > n) {
73 memcpy(ubuf, Tcl_DStringValue(&dstr), n);
77 nput = Tcl_DStringLength(&dstr);
78 memcpy(ubuf, Tcl_DStringValue(&dstr),nput);
94 if (bufsize == 0)
return 0;
102 *optr++ = c = *ptr++;
104 }
while (c && (c !=
'\n') && (l < bufsize));
CGRAPH_API Agiodisc_t AgIoDisc
int myiodisc_memiofread(void *chan, char *buf, int bufsize)
CGRAPH_API Agraph_t * agread(void *chan, Agdisc_t *disc)
int(* afread)(void *chan, char *buf, int bufsize)
Agraph_t * agread_usergets(ictx_t *ictx, FILE *fp, int(*usergets)(void *chan, char *buf, int bufsize))
int myiodisc_afread(void *channel, char *ubuf, int n)
int(* putstr)(void *chan, const char *str)