gp = exnoncast(gp);
if (gp && exisAssign(gp)) {
if (src) {
+#ifdef GVDLL
+ setErrorFileLine (src, line);
+#else
error_info.file = src;
error_info.line = line;
+#endif
}
error(ERROR_WARNING, "assignment used as bool in guard");
}
p->end_stmt = compile(p->prog, inp->source, inp->end_stmt,
inp->l_end, "_end_", 0, VOID);
sfclose(tmps);
+#ifdef GVDLL
+ setErrorLine (0);
+#else
error_info.line = 0; /* execution errors have no line numbers */
+#endif
return p;
}
static Agiodisc_t gprIoDisc = { iofread, ioputstr, ioflush };
+#ifdef GVDLL
+static Agdisc_t gprDisc = { 0, 0, &gprIoDisc };
+#else
static Agdisc_t gprDisc = { &AgMemDisc, &AgIdDisc, &gprIoDisc };
+#endif
/* readG:
* Read graph from file and initialize
{
Agraph_t *g;
+#ifdef GVDLL
+ gprDisc.mem = &AgMemDisc;
+ gprDisc.id = &AgIdDisc;
+#endif
g = agread(fp, &gprDisc);
if (g) {
aginit(g, AGRAPH, UDATA, sizeof(gdata), 0);
options.useFile = 0;
options.argv = 0;
options.argc = 0;
+#ifdef GVDLL
+ setErrorId (options.cmdName);
+#else
error_info.id = options.cmdName;
+#endif
while ((c = getopt(argc, argv, ":?Vcia:f:o:")) != -1) {
switch (c) {
if (options.useFile == 0) {
if (argc == 0) {
error(2, "No program supplied via argument or -f option");
+#ifdef GVDLL
+ setErrorErrors (1);
+#else
error_info.errors = 1;
+#endif
} else {
options.program = *argv++;
argc--;
else
options.outFile = sfstdout;
+#ifdef GVDLL
+ if (getErrorErrors ())
+#else
if (error_info.errors)
+#endif
error(ERROR_USAGE | 4, "%s", usage);
}
return sfclose((Sfio_t *) fp);
}
+#ifdef GVDLL
+static ingdisc ingDisc = { ing_open, ing_read, ing_close, 0 };
+#else
static ingdisc ingDisc = { ing_open, ing_read, ing_close, &_Sfstdin };
+#endif
int main(int argc, char *argv[])
{
Gpr_t *state;
gpr_info info;
+#ifdef GVDLL
+ ingDisc.dflt = &_Sfstdin;
+#endif
scanArgs(argc, argv);
prog = parseProg(options.program, options.useFile);