20static int iofread(
void *chan,
char *buf,
int bufsize)
22 if (fgets(buf, bufsize, chan))
23 return (
int)strlen(buf);
31 return fputs(
str, chan);
50 if (bufsize == 0)
return 0;
55 ptr =
s->data +
s->cur;
66 }
while (c !=
'\n' && l < bufsize && (c = *ptr++));
Agraph_t * agmemconcat(Agraph_t *g, const char *cp)
Agraph_t * agconcat(Agraph_t *g, void *chan, Agdisc_t *disc)
merges the file contents with a pre-existing graph
Agraph_t * agmemread(const char *cp)
reads a graph from the input string
void agsetfile(const char *)
sets the current file name for subsequent error reporting
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
textitem scanner parser str
static int iofread(void *chan, char *buf, int bufsize)
static int memiofread(void *chan, char *buf, int bufsize)
static Agraph_t * agmemread0(Agraph_t *arg_g, const char *cp)
static int ioflush(void *chan)
static Agiodisc_t memIoDisc
static int ioputstr(void *chan, const char *str)
int(* putstr)(void *chan, const char *str)