Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
input.c File Reference
#include <common/render.h>
#include <common/htmltable.h>
#include <errno.h>
#include <gvc/gvc.h>
#include <xdot/xdot.h>
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/gv_ctype.h>
#include <cgraph/gv_math.h>
#include <cgraph/exit.h>
#include <cgraph/startswith.h>
#include <cgraph/strcasecmp.h>
#include <cgraph/streq.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for input.c:

Go to the source code of this file.

Functions

int dotneato_usage (int exval)
 
static char * getFlagOpt (int argc, char **argv, int *idx)
 
static char * dotneato_basename (char *pathname)
 
static void use_library (GVC_t *gvc, const char *name)
 
static void global_def (char *dcl, int kind)
 
static int gvg_init (GVC_t *gvc, graph_t *g, char *fn, int gidx)
 
graph_tgvPluginsGraph (GVC_t *gvc)
 
int dotneato_args_initialize (GVC_t *gvc, int argc, char **argv)
 
static bool getdoubles2ptf (graph_t *g, char *name, pointf *result)
 
void getdouble (graph_t *g, char *name, double *result)
 
graph_tgvNextInputGraph (GVC_t *gvc)
 
static unsigned char findCharset (graph_t *g)
 
static void setRatio (graph_t *g)
 Checks "ratio" attribute, if any, and sets enum type.
 
void graph_init (graph_t *g, bool use_rankdir)
 
void graph_cleanup (graph_t *g)
 
char * charsetToStr (int c)
 Given an internal charset value, return a canonical string representation.
 
void do_graph_label (graph_t *sg)
 Set characteristics of graph label if it exists.
 

Variables

static char * usageFmt
 
static char * genericItems
 
static char * neatoFlags
 
static char * neatoItems
 
static char * fdpFlags
 
static char * fdpItems
 
static char * configFlags = "(additional options for config) [-cv]\n"
 
static char * configItems
 
static graph_tP_graph
 

Function Documentation

◆ charsetToStr()

char * charsetToStr ( int  c)

Definition at line 813 of file input.c.

References agerrorf(), CHAR_BIG5, CHAR_LATIN1, and CHAR_UTF8.

Referenced by initHTMLlexer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_graph_label()

void do_graph_label ( graph_t sg)

Definition at line 836 of file input.c.

References agfindgraphattr, agget(), aghtmlstr(), agroot(), BOTTOM_IX, DEFAULT_COLOR, DEFAULT_FONTNAME, DEFAULT_FONTSIZE, GD_border, GD_flip, GD_has_labels, GD_label, GD_label_pos, GRAPH_LABEL, LABEL_AT_BOTTOM, LABEL_AT_LEFT, LABEL_AT_RIGHT, LABEL_AT_TOP, late_double(), late_nnstring(), LEFT_IX, LT_HTML, LT_NONE, make_label(), MIN_FONTSIZE, PAD, RIGHT_IX, Agraph_s::root, str, TOP_IX, pointf_s::x, and pointf_s::y.

Referenced by add_cluster(), deriveGraph(), graph_init(), make_new_cluster(), and mkClusters().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dotneato_args_initialize()

int dotneato_args_initialize ( GVC_t gvc,
int  argc,
char **  argv 
)

Definition at line 216 of file input.c.

References agattr(), AGEDGE, AGERR, agerrorf(), AGMAX, AGNODE, AGRAPH, agseterr(), GVCOMMON_s::auto_outfile_names, CmdName, GVCOMMON_s::cmdname, GVC_s::common, GVCOMMON_s::config, dotneato_basename(), dotneato_usage(), free(), getFlagOpt(), global_def(), graphviz_exit(), gv_calloc(), gv_strdup(), gvc, gvconfig(), GvExitOnUsage, Gvfilepath, gvjobs_output_filename(), gvjobs_output_langname(), gvlayout_select(), gvplugin_graph(), gvplugin_list(), HTTPServerEnVar, GVCOMMON_s::info, GVC_s::input_filenames, is_exactly_zero(), GVC_s::jobs, layout(), NO_SUPPORT, NODENAME_ESC, NULL, GVJ_s::output_langname, P_graph, POINTS_PER_INCH, PSinputscale, Reduce, startswith(), streq(), use_library(), Verbose, GVCOMMON_s::verbose, and Y_invert.

Referenced by gvParseArgs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dotneato_basename()

static char * dotneato_basename ( char *  pathname)
static

Definition at line 127 of file input.c.

References gv_tolower_str().

Referenced by dotneato_args_initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dotneato_usage()

int dotneato_usage ( int  exval)

Definition at line 75 of file input.c.

References CmdName, configFlags, configItems, fdpFlags, fdpItems, genericItems, graphviz_exit(), GvExitOnUsage, neatoFlags, neatoItems, and usageFmt.

Referenced by dotneato_args_initialize(), fdp_extra_args(), and neato_extra_args().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCharset()

static unsigned char findCharset ( graph_t g)
static

Definition at line 549 of file input.c.

References agfindgraphattr, agwarningf(), CHAR_BIG5, CHAR_LATIN1, CHAR_UTF8, and late_nnstring().

Referenced by graph_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getdouble()

void getdouble ( graph_t g,
char *  name,
double *  result 
)

Definition at line 494 of file input.c.

References agget().

Referenced by scan_graph_mode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getdoubles2ptf()

static bool getdoubles2ptf ( graph_t g,
char *  name,
pointf result 
)
static

Definition at line 467 of file input.c.

References agget(), POINTS, pointf_s::x, and pointf_s::y.

Referenced by graph_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlagOpt()

static char * getFlagOpt ( int  argc,
char **  argv,
int *  idx 
)
static

Definition at line 104 of file input.c.

Referenced by dotneato_args_initialize().

Here is the caller graph for this function:

◆ global_def()

static void global_def ( char *  dcl,
int  kind 
)
static

Definition at line 172 of file input.c.

References agattr(), agxbfree(), agxbput(), agxbput_n(), agxbuse(), Agsym_s::fixed, kind, and NULL.

Referenced by dotneato_args_initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graph_cleanup()

void graph_cleanup ( graph_t g)

Definition at line 797 of file input.c.

References agclean(), AGRAPH, free(), free_label(), freeXDot(), GD_drawing, GD_label, and NULL.

Referenced by gvevent_read(), and gvFreeLayout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graph_init()

void graph_init ( graph_t g,
bool  use_rankdir 
)

Definition at line 596 of file input.c.

References agattr(), agfindedgeattr, agfindgraphattr, agfindnodeattr, agget(), agisdirected(), agmemconcat(), AGNODE, agxbfree(), agxbprint(), agxbuse(), CL_type, Concentrate, DEFAULT_NODESEP, DEFAULT_RANKSEP, do_graph_label(), E_arrowhead, E_arrowsz, E_arrowtail, E_color, E_comment, E_constr, E_decorate, E_dir, E_fillcolor, E_fontcolor, E_fontname, E_fontsize, E_headclip, E_headlabel, E_label, E_label_float, E_labelangle, E_labeldistance, E_labelfontcolor, E_labelfontname, E_labelfontsize, E_layer, E_minlen, E_penwidth, E_showboxes, E_style, E_tailclip, E_taillabel, E_weight, E_xlabel, EdgeLabelsDone, findCharset(), G_gradientangle, G_margin, G_ordering, GD_charset, GD_drawing, GD_exact_ranksep, GD_fontnames, GD_nodesep, GD_ranksep, GD_showboxes, getdoubles2ptf(), GLOBAL, gv_alloc(), GVBEGIN, Gvfilepath, Gvimagepath, HTTPServerEnVar, init_xdot(), Initial_dist, late_double(), late_int(), late_string(), LOCAL, mapbool(), maptoken(), MIN_NODESEP, MIN_RANKSEP, MYHUGE, N_color, N_comment, N_distortion, N_fillcolor, N_fixed, N_fontcolor, N_fontname, N_fontsize, N_gradientangle, N_group, N_height, N_imagepos, N_imagescale, N_label, N_layer, N_margin, N_nojustify, N_ordering, N_orientation, N_penwidth, N_peripheries, N_shape, N_showboxes, N_sides, N_skew, N_style, N_vertices, N_width, N_xlabel, N_z, NATIVEFONTS, NOCLUST, NODENAME_ESC, NULL, POINTS, PSFONTS, RANKDIR_BT, RANKDIR_LR, RANKDIR_RL, RANKDIR_TB, SET_RANKDIR, setRatio(), State, strdup_and_subst_obj(), streq(), and SVGFONTS.

Referenced by gvLayoutJobs(), and init_graph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gvg_init()

static int gvg_init ( GVC_t gvc,
graph_t g,
char *  fn,
int  gidx 
)
static

Definition at line 189 of file input.c.

References GVG_s::g, GVG_s::graph_index, gv_alloc(), gvc, GVG_s::gvc, GVC_s::gvg, GVC_s::gvgs, GVG_s::input_filename, and GVG_s::next.

Referenced by gvNextInputGraph(), and gvPluginsGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRatio()

static void setRatio ( graph_t g)
static

Definition at line 572 of file input.c.

References agget(), GD_drawing, R_AUTO, R_COMPRESS, R_EXPAND, R_FILL, R_VALUE, and streq().

Referenced by graph_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ use_library()

static void use_library ( GVC_t gvc,
const char *  name 
)
static

Definition at line 160 of file input.c.

References cnt(), GVC_s::common, gv_recalloc(), gvc, Lib, GVCOMMON_s::lib, and NULL.

Referenced by dotneato_args_initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ configFlags

char* configFlags = "(additional options for config) [-cv]\n"
static

Definition at line 66 of file input.c.

Referenced by dotneato_usage().

◆ configItems

char* configItems
static
Initial value:
= "\n\
-c - Configure plugins (Writes $prefix/lib/graphviz/config \n\
with available plugin information. Needs write privilege.)\n\
-? - Print usage and exit\n"

Definition at line 67 of file input.c.

Referenced by dotneato_usage().

◆ fdpFlags

char* fdpFlags
static
Initial value:
=
"(additional options for fdp) [-L(gO)] [-L(nUCT)<val>]\n"

Definition at line 56 of file input.c.

Referenced by dotneato_usage().

◆ fdpItems

char* fdpItems
static
Initial value:
= "\n\
-Lg - Don't use grid\n\
-LO - Use old attractive force\n\
-Ln<i> - Set number of iterations to i\n\
-LU<i> - Set unscaled factor to i\n\
-LC<v> - Set overlap expansion factor to v\n\
-LT[*]<v> - Set temperature (temperature factor) to v\n"

Definition at line 58 of file input.c.

Referenced by dotneato_usage().

◆ genericItems

char* genericItems
static
Initial value:
= "\n\
-V - Print version and exit\n\
-v - Enable verbose mode \n\
-Gname=val - Set graph attribute 'name' to 'val'\n\
-Nname=val - Set node attribute 'name' to 'val'\n\
-Ename=val - Set edge attribute 'name' to 'val'\n\
-Tv - Set output format to 'v'\n\
-Kv - Set layout engine to 'v' (overrides default based on command name)\n\
-lv - Use external library 'v'\n\
-ofile - Write output to 'file'\n\
-O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.) \n\
-P - Internally generate a graph of the current plugins. \n\
-q[l] - Set level of message suppression (=1)\n\
-s[v] - Scale input by 'v' (=72)\n\
-y - Invert y coordinate in output\n"

Definition at line 34 of file input.c.

Referenced by dotneato_usage().

◆ neatoFlags

char* neatoFlags
static
Initial value:
=
"(additional options for neato) [-x] [-n<v>]\n"

Definition at line 50 of file input.c.

Referenced by dotneato_usage().

◆ neatoItems

char* neatoItems
static
Initial value:
= "\n\
-n[v] - No layout mode 'v' (=1)\n\
-x - Reduce graph\n"

Definition at line 52 of file input.c.

Referenced by dotneato_usage().

◆ P_graph

graph_t* P_graph
static

Definition at line 204 of file input.c.

Referenced by dotneato_args_initialize(), and gvPluginsGraph().

◆ usageFmt

char* usageFmt
static
Initial value:
=
"Usage: %s [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>\n"

Definition at line 31 of file input.c.

Referenced by dotneato_usage().