Graphviz 12.0.1~dev.20240716.0800
|
#include <assert.h>
#include <unistd.h>
#include "builddate.h"
#include <gvpr/gprstate.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/cgraph.h>
#include <cgraph/gv_ctype.h>
#include <cgraph/ingraphs.h>
#include <cgraph/exit.h>
#include <cgraph/queue.h>
#include <cgraph/stack.h>
#include <cgraph/unreachable.h>
#include <common/globals.h>
#include <gvpr/compile.h>
#include <gvpr/gvpr.h>
#include <gvpr/actions.h>
#include <ast/error.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include <getopt.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 | DFLT_GVPRPATH "." |
#define | NUM_ARGS 100 |
#define | PATHSEP '/' |
#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 FILE * | openOut (char *name) |
static char * | gettok (char **sp) |
static int | parseArgs (char *s, int argc, char ***argv) |
static char * | concat (char *pfx, char *sfx) |
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) |
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) |
static bool | traverse (Gpr_t *state, Expr_t *prog, comp_block *bp, bool cleanup) |
static void | addOutputGraph (Gpr_t *state, gvpropts *uopts) |
static void | chkClose (Agraph_t *g) |
static Agraph_t * | ing_read (void *fp) |
static void | gvexitf (Expr_t *handle, Exdisc_t *discipline, 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 } |
static jmp_buf | jbuf |
Definition at line 826 of file gvpr.c.
References agroot(), cloneO(), gv_recalloc(), gvpropts::ingraphs, gvpropts::n_outgraphs, gvpropts::outgraphs, and state.
Referenced by gvpr_core().
Definition at line 521 of file gvpr.c.
References agnxtout().
|
static |
Definition at line 840 of file gvpr.c.
References agclose(), and gData.
Referenced by gvpr_core().
|
static |
Definition at line 189 of file gvpr.c.
References agxbdisown(), and agxbprint().
Referenced by resolve().
|
static |
Definition at line 706 of file gvpr.c.
References agfstnode(), agnxtnode(), nData, and NULL.
Referenced by traverse().
|
static |
Definition at line 296 of file gvpr.c.
References CLONE, error(), ERROR_ERROR, ERROR_USAGE, ERROR_WARNING, getOptarg(), INDUCE, Info, openOut(), opts, parseArgs(), resolve(), setTraceLevel(), SRCOUT, and usage.
Referenced by scanArgs().
|
static |
Definition at line 435 of file gvpr.c.
References case_stmt::action, agsubedge(), comp_block::edge_stmts, exeval(), case_stmt::guard, EX_STYPE::integer, comp_block::n_estmts, and state.
Referenced by travBFS(), travDFS(), travEdges(), and travFlat().
|
static |
Definition at line 457 of file gvpr.c.
References case_stmt::action, agsubnode(), exeval(), case_stmt::guard, EX_STYPE::integer, comp_block::n_nstmts, comp_block::node_stmts, and state.
Referenced by travBFS(), travDFS(), travFlat(), and travNodes().
|
static |
|
static |
|
static |
Definition at line 99 of file gvpr.c.
References error(), ERROR_WARNING, gv_isspace(), and NULL.
Referenced by parseArgs().
|
static |
Definition at line 871 of file gvpr.c.
References ERROR_ERROR, errorv(), graphviz_exit(), GV_USE_EXIT, GV_USE_JUMP, jbuf, state, and Exdisc_s::user.
Referenced by gvpr_core().
Definition at line 863 of file gvpr.c.
References jbuf.
Referenced by gvpr_core().
int gvpr | ( | int | argc, |
char * | argv[], | ||
gvpropts * | uopts | ||
) |
main loop for gvpr
Definition at line 1055 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 908 of file gvpr.c.
References addBindings(), addOutputGraph(), agdelete(), agnnodes(), options::argc, options::argv, comp_block::begg_stmt, comp_prog::begin_stmt, gvpropts::bindings, comp_prog::blocks, chkClose(), cleanup(), CLONE, cloneO(), options::compflags, compileProg(), Gpr_t::curgraph, Gpr_t::curobj, comp_prog::end_stmt, comp_prog::endg_stmt, exeval(), fileName(), Gpr_t::flags, gvpropts::flags, GV_USE_EXIT, GV_USE_JUMP, GV_USE_OUTGRAPH, gvelapsed_sec(), gverrorf(), gvexitf(), gvstart_timer(), options::inFiles, Gpr_t::infname, gvpr_state_t::ing, ing_read(), gvpropts::ingraphs, initGPRState(), 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(), SRCOUT, options::state, gvpr_state_t::state, Gpr_t::target, traverse(), Gpr_t::tvroot, options::useFile, usesGraph(), options::verbose, walksGraph(), and gvpr_state_t::xprog.
Referenced by gvpr().
|
static |
Definition at line 851 of file gvpr.c.
References readG().
Referenced by gvpr_core().
|
static |
Definition at line 484 of file gvpr.c.
References agfstnode(), agnxtnode(), GV_NEXT_SET, nodestream::oldroot, nodestream::prev, and state.
Referenced by travBFS(), and travDFS().
|
static |
Definition at line 80 of file gvpr.c.
References error(), and ERROR_ERROR.
Referenced by doFlags().
|
static |
Definition at line 149 of file gvpr.c.
References cnt(), error(), ERROR_WARNING, gettok(), gv_recalloc(), gv_strdup(), and NUM_ARGS.
Referenced by doFlags().
|
static |
Definition at line 202 of file gvpr.c.
References agxbfree(), agxbprint(), agxbput(), agxbput_n(), agxbuse(), concat(), DFLT_GVPRPATH, error(), ERROR_ERROR, fname, free(), gv_strdup(), LISTSEP, NULL, PATHSEP, and verbose.
Referenced by doFlags().
|
static |
Definition at line 370 of file gvpr.c.
References doFlags(), error(), ERROR_ERROR, ERROR_USAGE, free(), gv_calloc(), opts, setErrorId(), and usage.
Referenced by gvpr_core().
|
static |
Definition at line 536 of file gvpr.c.
References agfstedge(), agnxtedge(), evalEdge(), evalNode(), MARK, MARKED, nData, nextNode(), Agedge_s::node, nodestream::oldroot, ONSTACK, POP, nodestream::prev, PUSH, queue_free(), queue_pop(), queue_push(), and state.
Referenced by traverse().
|
static |
Definition at line 577 of file gvpr.c.
References agopp, evalEdge(), evalNode(), trav_fns::fstedge, MARK, MARKED, nData, nextNode(), Agedge_s::node, NULL, trav_fns::nxtedge, nodestream::oldroot, ONSTACK, POP, POST_VISIT, PRE_VISIT, nodestream::prev, PUSH, seed, stack_is_empty(), stack_pop(), stack_push(), stack_reset(), state, trav_fns::undirected, and trav_fns::visit.
Referenced by traverse().
|
static |
Definition at line 668 of file gvpr.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), evalEdge(), and state.
Referenced by traverse().
|
static |
Definition at line 721 of file gvpr.c.
References agsubg(), agxbfree(), agxbprint(), agxbuse(), cleanup(), DFSfns, doCleanup(), FWDfns, openSubg(), POST_VISIT, PRE_VISIT, REVfns, state, 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, UNREACHABLE, and trav_fns::visit.
Referenced by gvpr_core().
|
static |
Definition at line 684 of file gvpr.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), evalEdge(), evalNode(), comp_block::n_estmts, and state.
Referenced by traverse().
|
static |
Definition at line 657 of file gvpr.c.
References agfstnode(), agnxtnode(), evalNode(), and state.
Referenced by traverse().
Definition at line 532 of file gvpr.c.
Referenced by traverse().
Definition at line 533 of file gvpr.c.
Referenced by traverse().
|
static |
|
static |
Definition at line 856 of file gvpr.c.
Referenced by gverrorf(), gvexitf(), and gvpr_core().
Definition at line 534 of file gvpr.c.
Referenced by traverse().
|
static |
Definition at line 53 of file gvpr.c.
Referenced by doFlags(), errexit(), gdCmd(), 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().