32#define graphName(g) (agnameof(g))
42static char *
useString =
"Usage: %s [-nv?] [-o outfile] <file>\n\
43 -o <file> - put output in <file>\n\
44 -n - do not output graph\n\
59 while ((c = getopt(argc, argv,
":vno:")) != -1)
63 fclose(
opts->outFile);
67 opts->doWrite =
false;
76 fprintf(stderr,
"%s: option -%c unrecognized\n",
cmd,
82 fprintf(stderr,
"%s: missing argument for option -%c\n",
94 opts->outFile = stdout;
97int main(
int argc,
char *argv[])
111 fprintf(stderr,
"Graph \"%s\" has cycles; %" PRISIZE_T " reversed edges\n",
114 fprintf(stderr,
"Graph \"%s\" is acyclic\n",
graphName(g));
119 fprintf(stderr,
"Graph \"%s\" is undirected\n",
graphName(g));
abstract graph C library, Cgraph API
static NORETURN void graphviz_exit(int status)
bool graphviz_acyclic(Agraph_t *g, const graphviz_acyclic_options_t *opts, size_t *num_rev)
int agisdirected(Agraph_t *g)
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
static const char * usage
static FILE * openFile(const char *argv0, const char *name, const char *mode)
#define PRISIZE_T
PRIu64 alike for printing size_t
options for passing to graphviz_acyclic