|
Graphviz 14.1.3~dev.20260126.0926
|
#include "config.h"#include "builddate.h"#include <assert.h>#include <ast/error.h>#include <cgraph/cgraph.h>#include <cgraph/ingraphs.h>#include <common/globals.h>#include <getopt.h>#include <gvpr/actions.h>#include <gvpr/compile.h>#include <gvpr/gprstate.h>#include <gvpr/gvpr.h>#include <setjmp.h>#include <stdbool.h>#include <stddef.h>#include <stdio.h>#include <string.h>#include <time.h>#include <unistd.h>#include <util/agxbuf.h>#include <util/alloc.h>#include <util/exit.h>#include <util/gv_ctype.h>#include <util/gv_find_me.h>#include <util/gv_fopen.h>#include <util/list.h>#include <util/path.h>#include <util/strview.h>#include <util/unreachable.h>Go to the source code of this file.
Data Structures | |
| struct | options |
| struct | nodestream |
| struct | trav_fns |
| struct | gvpr_state_t |
collective managed state used in gvpr_core More... | |
Macros | |
| #define | LISTSEP ':' |
| #define | MARKED(x) (((x)->iu.integer) & 1) |
| #define | MARK(x) (((x)->iu.integer) = 1) |
| #define | ONSTACK(x) (((x)->iu.integer) & 2) |
| #define | PUSH(x, e) (((x)->iu.integer) |= 2, (x)->ine = (e)) |
| #define | POP(x) (((x)->iu.integer) &= (~2)) |
| #define | PRE_VISIT 1 |
| #define | POST_VISIT 2 |
Typedefs | |
| typedef Agedge_t *(* | fstedgefn_t) (Agraph_t *, Agnode_t *) |
| typedef Agedge_t *(* | nxttedgefn_t) (Agraph_t *, Agedge_t *, Agnode_t *) |
Functions | |
| static clock_t | start_timer (void) |
| static double | elapsed_sec (clock_t start) |
| static FILE * | openOut (char *name) |
| static char * | gettok (char **sp) |
| static void | parseArgs (char *s, strviews_t *arg) |
| static char * | concat (char *pfx, char *sfx) |
| static char * | dflt_gvprpath (void) |
| static char * | resolve (char *arg, int verbose) |
| static char * | getOptarg (int c, char **argp, int *argip, int argc, char **argv) |
| static int | doFlags (char *arg, int argi, int argc, char **argv, options *opts) |
| static void | freeOpts (options opts) |
| static options | scanArgs (int argc, char **argv) |
| parse command line options | |
| static Agobj_t * | evalEdge (Gpr_t *state, Expr_t *prog, comp_block *xprog, Agedge_t *e) |
| static Agobj_t * | evalNode (Gpr_t *state, Expr_t *prog, comp_block *xprog, Agnode_t *n) |
| static Agnode_t * | nextNode (Gpr_t *state, nodestream *nodes) |
| static Agedge_t * | agnxtout_ (Agraph_t *g, Agedge_t *e, Agnode_t *ignored) |
agnxtout wrapper to tweak calling convention | |
| static Agedge_t * | agnxtin_ (Agraph_t *g, Agedge_t *e, Agnode_t *ignored) |
agnxtin wrapper to tweak calling convention | |
| static void | travBFS (Gpr_t *state, Expr_t *prog, comp_block *xprog) |
| static void | travDFS (Gpr_t *state, Expr_t *prog, comp_block *xprog, trav_fns *fns) |
| static void | travNodes (Gpr_t *state, Expr_t *prog, comp_block *xprog) |
| static void | travEdges (Gpr_t *state, Expr_t *prog, comp_block *xprog) |
| static void | travFlat (Gpr_t *state, Expr_t *prog, comp_block *xprog) |
| static void | doCleanup (Agraph_t *g) |
| reset node traversal data | |
| static bool | traverse (Gpr_t *state, Expr_t *prog, comp_block *bp, bool cleanup) |
| return true if traversal requires cleanup | |
| static void | addOutputGraph (Gpr_t *state, gvpropts *uopts) |
| static void | chkClose (Agraph_t *g) |
| static Agraph_t * | ing_read (const char *filename, void *fp) |
| static void | gvexitf (void *env, int v) |
| static void | gverrorf (Expr_t *handle, Exdisc_t *discipline, int level, const char *fmt,...) |
| static int | gvpr_core (int argc, char *argv[], gvpropts *uopts, gvpr_state_t *gs) |
| int | gvpr (int argc, char *argv[], gvpropts *uopts) |
Variables | |
| static char * | Info [] |
| static const char * | usage |
| static trav_fns | DFSfns = {agfstedge, agnxtedge, 1, 0} |
| static trav_fns | FWDfns = {agfstout, agnxtout_, 0, 0} |
| static trav_fns | REVfns = {agfstin, agnxtin_, 0, 0} |
| #define PUSH | ( | x, | |
| e | |||
| ) | (((x)->iu.integer) |= 2, (x)->ine = (e)) |
Definition at line 838 of file gvpr.c.
References agroot(), Agraph_s::base, cloneO(), Gpr_t::curgraph, gv_recalloc(), gvpropts::ingraphs, gvpropts::n_outgraphs, Gpr_t::outgraph, and gvpropts::outgraphs.
Referenced by gvpr_core().
Definition at line 530 of file gvpr.c.
References agnxtout().
|
static |
Definition at line 850 of file gvpr.c.
References agclose(), gData, gval_t::lock, gvlock_t::locked, and gvlock_t::zombie.
Referenced by gvpr_core().
|
static |
Definition at line 166 of file gvpr.c.
References agxbdisown(), and agxbprint().
Referenced by resolve().
|
static |
get gvpr’s default paths to search for scripts
The content returned is a list of paths separated by the platform’s native $PATH separator, either ':' or ';'. The caller is responsible for freeing the returned string.
NULL on failure Definition at line 179 of file gvpr.c.
References free(), gv_find_me(), LISTSEP, malloc(), NULL, and PATH_SEPARATOR.
Referenced by resolve().
|
static |
Definition at line 713 of file gvpr.c.
References agfstnode(), agnxtnode(), nData, and NULL.
Referenced by traverse().
|
static |
Definition at line 320 of file gvpr.c.
References error, ERROR_ERROR, ERROR_USAGE, ERROR_WARNING, getOptarg(), Info, openOut(), opts, parseArgs(), resolve(), setTraceLevel(), and usage.
Referenced by scanArgs().
|
static |
Definition at line 445 of file gvpr.c.
References case_stmt::action, agsubedge(), Gpr_t::curobj, comp_block::edge_stmts, exeval(), case_stmt::guard, EX_STYPE::integer, comp_block::n_estmts, and Gpr_t::target.
Referenced by travBFS(), travDFS(), travEdges(), and travFlat().
|
static |
Definition at line 467 of file gvpr.c.
References case_stmt::action, agsubnode(), Gpr_t::curobj, exeval(), case_stmt::guard, EX_STYPE::integer, comp_block::n_nstmts, comp_block::node_stmts, and Gpr_t::target.
Referenced by travBFS(), travDFS(), travFlat(), and travNodes().
|
static |
|
static |
|
static |
Definition at line 106 of file gvpr.c.
References error, ERROR_WARNING, gv_isspace(), and NULL.
Referenced by parseArgs().
|
static |
Definition at line 888 of file gvpr.c.
References ERROR_ERROR, errorv(), Gpr_t::flags, graphviz_exit(), GV_USE_EXIT, GV_USE_JUMP, Gpr_t::jbuf, and Exdisc_s::user.
Referenced by gvpr_core().
|
static |
Definition at line 882 of file gvpr.c.
References Gpr_t::jbuf, and gvpr_state_t::state.
Referenced by gvpr_core().
| int gvpr | ( | int | argc, |
| char * | argv[], | ||
| gvpropts * | uopts | ||
| ) |
main loop for gvpr
Definition at line 1060 of file gvpr.c.
References closeGPRState(), closeIngraph(), freeCompileProg(), freeOpts(), freeParseProg(), gvpr_core(), gvpr_state_t::ing, NULL, gvpr_state_t::opts, options::outFile, gvpr_state_t::prog, gvpr_state_t::state, and gvpr_state_t::xprog.
Referenced by main(), and run_gvpr().
|
static |
Definition at line 915 of file gvpr.c.
References addBindings(), addOutputGraph(), agdelete(), agnnodes(), options::args, Agraph_s::base, comp_block::begg_stmt, comp_prog::begin_stmt, gvpropts::bindings, comp_prog::blocks, chkClose(), cleanup(), compflags_t::clone, cloneO(), options::compflags, compileProg(), Gpr_t::curgraph, Gpr_t::curobj, comp_block::does_walk_graph, elapsed_sec(), comp_prog::end_stmt, comp_prog::endg_stmt, exeval(), fileName(), Gpr_t::flags, gvpropts::flags, GV_USE_EXIT, GV_USE_JUMP, GV_USE_OUTGRAPH, gverrorf(), gvexitf(), options::inFiles, Gpr_t::infname, gvpr_state_t::ing, ing_read(), gvpropts::ingraphs, initGPRState(), Gpr_t::jbuf, comp_prog::n_blocks, gvpropts::n_outgraphs, newIng(), newIngGraphs(), nextGraph(), Gpr_t::nextgraph, NULL, openGPRState(), gvpr_state_t::opts, options::outFile, Gpr_t::outgraph, gvpropts::outgraphs, parseProg(), comp_prog::prog, gvpr_state_t::prog, options::program, options::readAhead, scanArgs(), setErrorErrors(), sfioWrite(), compflags_t::srcout, start_timer(), options::state, gvpr_state_t::state, Gpr_t::target, traverse(), Gpr_t::tvroot, options::useFile, comp_prog::uses_graph, options::verbose, and gvpr_state_t::xprog.
Referenced by gvpr().
|
static |
Definition at line 860 of file gvpr.c.
References agconcat(), AGEDGE, aginit(), AGNODE, AGRAPH, NULL, and UDATA.
Referenced by gvpr_core().
|
static |
Definition at line 494 of file gvpr.c.
References agfstnode(), agnxtnode(), Gpr_t::curgraph, Gpr_t::flags, GV_NEXT_SET, nodestream::oldroot, nodestream::prev, Gpr_t::tvnext, and Gpr_t::tvroot.
Referenced by travBFS(), and travDFS().
|
static |
Definition at line 88 of file gvpr.c.
References error, ERROR_ERROR, and gv_fopen().
Referenced by doFlags().
|
static |
|
static |
Definition at line 223 of file gvpr.c.
References agxbfree(), agxbprint(), agxbput(), agxbput_n(), agxbuse(), concat(), dflt_gvprpath(), error, ERROR_ERROR, fname, free(), gv_strdup(), LISTSEP, NULL, PATH_SEPARATOR, and verbose.
Referenced by doFlags().
|
static |
Definition at line 390 of file gvpr.c.
References doFlags(), error, ERROR_ERROR, ERROR_USAGE, LIST, LIST_APPEND, LIST_DETACH, LIST_FREE, LIST_IS_EMPTY, LIST_POP_FRONT, NULL, opts, setErrorId(), and usage.
Referenced by gvpr_core().
|
static |
Definition at line 81 of file gvpr.c.
Referenced by gvpr_core().
|
static |
Definition at line 545 of file gvpr.c.
References agfstedge(), agnxtedge(), Gpr_t::curgraph, evalEdge(), evalNode(), LIST, LIST_FREE, LIST_IS_EMPTY, LIST_POP_FRONT, LIST_PUSH_BACK, MARK, MARKED, nData, nextNode(), Agedge_s::node, nodestream::oldroot, ONSTACK, POP, nodestream::prev, PUSH, and Gpr_t::tvedge.
Referenced by traverse().
|
static |
Definition at line 588 of file gvpr.c.
References agopp, Gpr_t::curgraph, evalEdge(), evalNode(), trav_fns::fstedge, LIST, LIST_FREE, LIST_IS_EMPTY, LIST_POP_BACK, LIST_PUSH_BACK, MARK, MARKED, nData, nextNode(), Agedge_s::node, NULL, trav_fns::nxtedge, nodestream::oldroot, ONSTACK, POP, POST_VISIT, PRE_VISIT, nodestream::prev, PUSH, seed, Gpr_t::tvedge, trav_fns::undirected, and trav_fns::visit.
Referenced by traverse().
|
static |
Definition at line 678 of file gvpr.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), Gpr_t::curgraph, and evalEdge().
Referenced by traverse().
|
static |
Definition at line 725 of file gvpr.c.
References agsubg(), agxbfree(), agxbprint(), agxbuse(), cleanup(), Gpr_t::curgraph, DFSfns, doCleanup(), FWDfns, Gpr_t::name_used, openSubg(), Gpr_t::outgraph, POST_VISIT, PRE_VISIT, REVfns, Gpr_t::target, Gpr_t::tgtname, travBFS(), travDFS(), travEdges(), travFlat(), travNodes(), TV_bfs, TV_dfs, TV_en, TV_flat, TV_fwd, TV_ne, TV_postdfs, TV_postfwd, TV_postrev, TV_prepostdfs, TV_prepostfwd, TV_prepostrev, TV_rev, Gpr_t::tvt, UNREACHABLE, and trav_fns::visit.
Referenced by gvpr_core().
|
static |
Definition at line 693 of file gvpr.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), Gpr_t::curgraph, evalEdge(), evalNode(), and comp_block::n_estmts.
Referenced by traverse().
|
static |
Definition at line 668 of file gvpr.c.
References agfstnode(), agnxtnode(), Gpr_t::curgraph, and evalNode().
Referenced by traverse().
Definition at line 541 of file gvpr.c.
Referenced by traverse().
Definition at line 542 of file gvpr.c.
Referenced by traverse().
|
static |
Definition at line 543 of file gvpr.c.
Referenced by traverse().
|
static |
Definition at line 54 of file gvpr.c.
Referenced by doFlags(), errexit(), gdCmd(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), init(), initargs(), initargs(), initargs(), main(), parseArgs(), scanArgs(), scanArgs(), scanargs(), setAction(), and tclGdColorCmd().