error_info.file = src;
error_info.line = line;
}
- error(ERROR_WARNING, "assignment used as boolean in guard");
+ error(ERROR_WARNING, "assignment used as bool in guard");
}
}
} pair_t;
static int margin = 8; /* Default margin in packing */
-static boolean doSplines = TRUE; /* Use edges in packing */
+static bool doSplines = TRUE; /* Use edges in packing */
static pack_mode packMode = l_clust; /* Default packing mode - use clusters */
static int verbose = 0;
static char **myFiles = 0;
* libcommon. If fill is true, we use init_nop (neato -n) to
* read in attributes relevant to the layout.
*/
-static void init_graph(Agraph_t * g, boolean fill)
+static void init_graph(Agraph_t * g, bool fill)
{
int d;
Dt_t *nnames; /* dict of used node names */
Agsym_t *G_bb;
Agsym_t *rv;
- boolean doWarn = TRUE;
+ bool doWarn = TRUE;
if (verbose)
fprintf(stderr, "Creating clone graph\n");
sys/select.h fpu_control.h sys/fpu.h strings.h sys/socket.h sys/stat.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
+AC_HEADER_STDBOOL
# Check for socklen_t
AC_MSG_CHECKING([for socklen_t])
}
/* inside function for calls to bezier_clip */
-static boolean inside(inside_t * inside_context, pointf p)
+static bool inside(inside_t * inside_context, pointf p)
{
return DIST2(p, inside_context->a.p[0]) <= inside_context->a.r[0];
}
job->layerNum = 1;
}
-static boolean validlayer(GVJ_t *job)
+static bool validlayer(GVJ_t *job)
{
return (job->layerNum <= job->numLayers);
}
job->pagesArrayElem = job->pagesArrayFirst;
}
-static boolean validpage(GVJ_t *job)
+static bool validpage(GVJ_t *job)
{
return ((job->pagesArrayElem.x >= 0)
&& (job->pagesArrayElem.x < job->pagesArraySize.x)
}
}
-static boolean write_edge_test(Agraph_t * g, Agedge_t * e)
+static bool write_edge_test(Agraph_t * g, Agedge_t * e)
{
Agraph_t *sg;
int c;
return TRUE;
}
-static boolean write_node_test(Agraph_t * g, Agnode_t * n)
+static bool write_node_test(Agraph_t * g, Agnode_t * n)
{
Agraph_t *sg;
int c;
}
#if 0
-static boolean node_in_view(GVJ_t *job, node_t * n)
+static bool node_in_view(GVJ_t *job, node_t * n)
{
boxf b;
}
#endif
-static boolean is_natural_number(char *sstr)
+static bool is_natural_number(char *sstr)
{
unsigned char *str = (unsigned char *) sstr;
return -1;
}
-static boolean selectedlayer(GVJ_t *job, char *spec)
+static bool selectedlayer(GVJ_t *job, char *spec)
{
GVC_t *gvc = job->gvc;
int n0, n1;
unsigned char buf[SMALLBUF];
char *w0, *w1;
agxbuf xb;
- boolean rval = FALSE;
+ bool rval = FALSE;
agxbinit(&xb, SMALLBUF, buf);
agxbput(&xb, spec);
return rval;
}
-static boolean node_in_layer(GVJ_t *job, graph_t * g, node_t * n)
+static bool node_in_layer(GVJ_t *job, graph_t * g, node_t * n)
{
char *pn, *pe;
edge_t *e;
return FALSE;
}
-static boolean edge_in_layer(GVJ_t *job, graph_t * g, edge_t * e)
+static bool edge_in_layer(GVJ_t *job, graph_t * g, edge_t * e)
{
char *pe, *pn;
int cnt;
return FALSE;
}
-static boolean clust_in_layer(GVJ_t *job, graph_t * sg)
+static bool clust_in_layer(GVJ_t *job, graph_t * sg)
{
char *pg;
node_t *n;
}
#if 1
-static boolean node_in_box(node_t *n, boxf b)
+static bool node_in_box(node_t *n, boxf b)
{
return boxf_overlap(ND_bb(n), b);
}
}
#if 0
-static boolean edge_in_view(GVJ_t *job, edge_t * e)
+static bool edge_in_view(GVJ_t *job, edge_t * e)
{
int i, j, np;
bezier bz;
bezierf bzf;
splinesf offspl, tmpspl;
pointf pf0, pf1, pf2 = { 0, 0 }, pf3, *offlist, *tmplist;
- boolean saved = FALSE;
+ bool saved = FALSE;
double scale, numc2;
char *p;
extern int xdemitState;
gvrender_end_context(job);
}
-static boolean edge_in_box(edge_t *e, boxf b)
+static bool edge_in_box(edge_t *e, boxf b)
{
splines *spl;
textlabel_t *lp;
}
}
-static boolean is_style_delim(int c)
+static bool is_style_delim(int c)
{
switch (c) {
case '(':
char **parse_style(char *s)
{
static char *parse[FUNLIMIT];
- static boolean is_first = TRUE;
+ static bool is_first = TRUE;
int fun = 0;
- boolean in_parens = FALSE;
+ bool in_parens = FALSE;
unsigned char buf[SMALLBUF];
char *p;
int c;
static void fig_user_shape(char *name, point * A, int n, int filled)
{
- static boolean onetime = TRUE;
+ static bool onetime = TRUE;
if (onetime) {
agerr(AGERR, "custom shapes not available with this driver\n");
onetime = FALSE;
cstk[0].penwidth = WIDTH_NORMAL;
}
-static boolean is_format_truecolor_capable(int Output_lang)
+static bool is_format_truecolor_capable(int Output_lang)
{
- boolean rv = FALSE;
+ bool rv = FALSE;
if (Output_lang == GD) {
rv = TRUE;
static void gd_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb)
{
char *bgcolor_str, *truecolor_str;
- boolean truecolor_p = FALSE; /* try to use cheaper paletted mode */
- boolean bg_transparent_p = FALSE;
+ bool truecolor_p = FALSE; /* try to use cheaper paletted mode */
+ bool bg_transparent_p = FALSE;
int bgcolor;
external_surface = gvc->job->external_surface;
return b;
}
-boolean box_overlap(box b0, box b1)
+bool box_overlap(box b0, box b1)
{
return OVERLAP(b0, b1);
}
-boolean boxf_overlap(boxf b0, boxf b1)
+bool boxf_overlap(boxf b0, boxf b1)
{
return OVERLAP(b0, b1);
}
-boolean box_contains(box b0, box b1)
+bool box_contains(box b0, box b1)
{
return CONTAINS(b0, b1);
}
-boolean boxf_contains(boxf b0, boxf b1)
+bool boxf_contains(boxf b0, boxf b1)
{
return CONTAINS(b0, b1);
}
extern boxf boxf_bb(boxf, boxf);
extern box box_intersect(box, box);
extern boxf boxf_intersect(boxf, boxf);
-extern boolean box_overlap(box, box);
-extern boolean boxf_overlap(boxf, boxf);
-extern boolean box_contains(box, box);
-extern boolean boxf_contains(boxf, boxf);
+extern bool box_overlap(box, box);
+extern bool boxf_overlap(boxf, boxf);
+extern bool box_contains(box, box);
+extern bool boxf_contains(boxf, boxf);
extern box flip_rec_box(box b, point p);
extern int lineToBox(pointf p1, pointf p2, boxf b);
EXTERN int Obj;
#endif
- EXTERN boolean Verbose, Reduce, MemTest, Config;
+ EXTERN bool Verbose, Reduce, MemTest, Config;
EXTERN char *HTTPServerEnVar;
EXTERN char *Output_file_name;
EXTERN int graphviz_errors;
EXTERN int Show_cnt;
EXTERN char** Show_boxes; /* emit code for correct box coordinates */
EXTERN int CL_type; /* NONE, LOCAL, GLOBAL */
- EXTERN boolean Concentrate; /* if parallel edges should be merged */
+ EXTERN bool Concentrate; /* if parallel edges should be merged */
EXTERN double Epsilon; /* defined in input_graph */
EXTERN double Nodesep;
EXTERN double Nodefactor;
static int PageWidth; /* Width of page, in points. */
static char *prefix; /* Machine-dependent prefix and suffix */
static char *suffix;
-/* static boolean onetime = TRUE; */
+/* static bool onetime = TRUE; */
#define MAXLINELEN 80
static int bufcnt; /* Number of characters output on current line */
static void hpgl_user_shape(char *name, point * A, int n, int filled)
{
- static boolean onetime = TRUE;
+ static bool onetime = TRUE;
if (onetime) {
agerr(AGERR, "custom shapes not available with this driver\n");
onetime = FALSE;
* converts a graph attribute to a point.
* Returns true if the attribute ends in '!'.
*/
-static boolean getdoubles2pt(graph_t * g, char *name, point * result)
+static bool getdoubles2pt(graph_t * g, char *name, point * result)
{
char *p;
int i;
double xf, yf;
char c = '\0';
- boolean rv = FALSE;
+ bool rv = FALSE;
if ((p = agget(g, name))) {
i = sscanf(p, "%lf,%lf%c", &xf, &yf, &c);
}
}
-void graph_init(graph_t * g, boolean use_rankdir)
+void graph_init(graph_t * g, bool use_rankdir)
{
char *p;
double xf;
extern "C" {
#endif
-typedef unsigned char boolean;
-
#define NOT(v) (!(v))
+
+#if ! defined HAVE_BOOL && ! defined __cplusplus
+typedef unsigned char bool;
+#define false 0
+#define true NOT(false)
+#endif
+
#ifndef FALSE
-#define FALSE 0
+#define FALSE false
#endif
#ifndef TRUE
-#define TRUE NOT(FALSE)
+#define TRUE true
#endif
#ifndef NOTUSED
static void mif_user_shape(char *name, point * A, int n, int filled)
{
- static boolean onetime = TRUE;
+ static bool onetime = TRUE;
if (onetime) {
agerr(AGERR, "custom shapes not available with this driver\n");
onetime = FALSE;
/* _write_plain:
*/
-static void _write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
+static void _write_plain(GVJ_t * job, graph_t * g, FILE * f, bool extend)
{
int i, j, splinePoints;
char *tport, *hport;
static int Rankdir;
-static boolean Flip;
+static bool Flip;
static point Offset;
static void place_flip_graph_label(graph_t * g);
translate_bb(GD_clust(g)[c], rankdir);
}
-void dot_nodesize(node_t * n, boolean flip)
+void dot_nodesize(node_t * n, bool flip)
{
double x, y;
int ps;
int must_inline;
} ps_image_t;
- typedef void (*nodesizefn_t) (Agnode_t *, boolean);
+ typedef void (*nodesizefn_t) (Agnode_t *, bool);
extern void add_box(path *, box);
extern void arrow_flags(Agedge_t * e, int *sflag, int *eflag);
extern int arrowEndClip(edge_t*, point*, int, int , bezier*, int eflag);
extern int arrowStartClip(edge_t*, point* ps, int, int, bezier*, int sflag);
extern void attach_attrs(Agraph_t *);
- extern void beginpath(path *, Agedge_t *, int, pathend_t *, boolean);
+ extern void beginpath(path *, Agedge_t *, int, pathend_t *, bool);
extern void bezier_clip(inside_t * inside_context,
- boolean(*insidefn) (inside_t * inside_context,
+ bool(*insidefn) (inside_t * inside_context,
pointf p), pointf * sp,
- boolean left_inside);
+ bool left_inside);
extern shape_desc *bind_shape(char *name, node_t *);
extern void clip_and_install(edge_t *, edge_t *, point *, int,
splineInfo *);
extern char* charsetToStr (int c);
extern point coord(node_t * n);
extern void do_graph_label(graph_t * sg);
- extern void graph_init(graph_t * g, boolean use_rankdir);
+ extern void graph_init(graph_t * g, bool use_rankdir);
extern void graph_cleanup(graph_t * g);
extern void dotneato_args_initialize(GVC_t * gvc, int, char **);
extern void dotneato_usage(int);
extern void emit_textlines(GVJ_t*, int, textline_t*, pointf,
double, char*, double, char*);
extern void enqueue_neighbors(nodequeue *, Agnode_t *, int);
- extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean);
+ extern void endpath(path *, Agedge_t *, int, pathend_t *, bool);
extern void epsf_init(node_t * n);
extern void epsf_free(node_t * n);
extern void extend_attrs(GVJ_t * job, graph_t *g, int s_arrows, int e_arrows);
Agsym_t * (*fun) (Agraph_t *, char *, char *));
extern int gvRenderJobs (GVC_t * gvc, graph_t * g);
extern point image_size(graph_t * g, char *shapefile);
- extern boolean isPolygon(node_t *);
+ extern bool isPolygon(node_t *);
extern char *strdup_and_subst_graph(char *str, Agraph_t * g);
extern char *strdup_and_subst_node(char *str, Agnode_t * n);
extern char *strdup_and_subst_edge(char *str, Agedge_t * e);
extern void osize_label(textlabel_t *, int *, int *, int *, int *);
extern char **parse_style(char *s);
extern void place_graph_label(Agraph_t *);
- extern void place_portlabel(edge_t * e, boolean head_p);
+ extern void place_portlabel(edge_t * e, bool head_p);
extern char *ps_string(char *s, int);
extern int rank(graph_t * g, int balance, int maxiter);
extern void routesplinesinit(void);
static void poly_init(node_t * n);
static void poly_free(node_t * n);
static port poly_port(node_t * n, char *portname, char *);
-static boolean poly_inside(inside_t * inside_context, pointf p);
+static bool poly_inside(inside_t * inside_context, pointf p);
static int poly_path(node_t* n, port* p, int side, box rv[], int *kptr);
static void poly_gencode(GVJ_t * job, node_t * n);
static void record_init(node_t * n);
static void record_free(node_t * n);
static port record_port(node_t * n, char *portname, char *);
-static boolean record_inside(inside_t * inside_context, pointf p);
+static bool record_inside(inside_t * inside_context, pointf p);
static int record_path(node_t* n, port* p, int side, box rv[], int *kptr);
static void record_gencode(GVJ_t * job, node_t * n);
static void point_init(node_t * n);
-static boolean epsf_inside(inside_t * inside_context, pointf p);
+static bool epsf_inside(inside_t * inside_context, pointf p);
static void epsf_gencode(GVJ_t * job, node_t * n);
/* polygon descriptions. "polygon" with 0 sides takes all user control */
return SH_USER;
}
-boolean isPolygon(node_t * n)
+bool isPolygon(node_t * n)
{
return (ND_shape(n) && (ND_shape(n)->fns->initfn == poly_init));
}
#define GET_PORT_BOX(n,e) ((n) == (e)->head ? ED_head_port(e).bp : ED_tail_port(e).bp)
-static boolean poly_inside(inside_t * inside_context, pointf p)
+static bool poly_inside(inside_t * inside_context, pointf p)
{
static node_t *lastn; /* last node argument */
static polygon_t *poly;
pointf P, *vertices;
static point *A;
static int A_size;
- boolean filled;
+ bool filled;
extern int xdemitState;
char *color;
* Note that this does not handle Mrecords correctly. It assumes
* everything is a rectangle.
*/
-static boolean
+static bool
record_inside(inside_t * inside_context, pointf p)
{
return rv;
}
-static boolean epsf_inside(inside_t * inside_context, pointf p)
+static bool epsf_inside(inside_t * inside_context, pointf p)
{
pointf P;
double x2;
* The points p are in node coordinates.
*/
void bezier_clip(inside_t * inside_context,
- boolean(*inside) (inside_t * inside_context, pointf p),
- pointf * sp, boolean left_inside)
+ bool(*inside) (inside_t * inside_context, pointf p),
+ pointf * sp, bool left_inside)
{
pointf seg[4], best[4], pt, opt, *left, *right;
double low, high, t, *idir, *odir;
- boolean found;
+ bool found;
int i;
if (left_inside) {
*/
static void
shape_clip0(inside_t * inside_context, node_t * n, point curve[4],
- boolean left_inside)
+ bool left_inside)
{
int i, save_real_size;
pointf c[4];
void shape_clip(node_t * n, point curve[4])
{
int save_real_size;
- boolean left_inside;
+ bool left_inside;
pointf c;
inside_t inside_context;
* to provide a polygon.
*/
void
-beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
+beginpath(path * P, edge_t * e, int et, pathend_t * endp, bool merge)
{
int side, mask;
node_t *n;
}
}
-void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
+void endpath(path * P, edge_t * e, int et, pathend_t * endp, bool merge)
{
int side, mask;
node_t *n;
}
/* vladimir */
-void place_portlabel(edge_t * e, boolean head_p)
+void place_portlabel(edge_t * e, bool head_p)
/* place the {head,tail}label (depending on HEAD_P) of edge E */
/* N.B. Assume edges are normalized, so tail is at spl->list[0].list[0]
* and head is at spl->list[spl->size-l].list[bez->size-1]
box *bp; /* if not null, points to bbox of
* rectangular area that is port target
*/
- boolean defined; /* if true, edge has port info at this end */
- boolean constrained; /* if true, constraints such as theta are set */
- boolean clip; /* if true, clip end to node/port shape */
+ bool defined; /* if true, edge has port info at this end */
+ bool constrained; /* if true, constraints such as theta are set */
+ bool clip; /* if true, clip end to node/port shape */
unsigned char order; /* for mincross */
unsigned char side; /* if port is on perimeter of node, this
* contains the bitwise OR of the sides (TOP,
} port;
typedef struct {
- boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
- boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
+ bool(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
+ bool(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
} splineInfo;
typedef struct pathend_t {
} txt;
htmllabel_t *html;
} u;
- boolean set; /* true if position is set */
- boolean html; /* true if html label */
+ bool set; /* true if position is set */
+ bool html; /* true if html label */
} textlabel_t;
typedef struct polygon_t { /* mutable shape information for a node */
void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */
void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */
port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */
- boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
+ bool(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
int (*pboxfn)(node_t* n, port* p, int side, box rv[], int *kptr); /* finds box path to reach port */
void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */
} shape_functions;
char *name; /* as read from graph file */
shape_functions *fns;
polygon_t *polygon; /* base polygon info */
- boolean usershape;
+ bool usershape;
} shape_desc;
#ifndef DISABLE_CODEGENS
void (*beziercurve) (point * A, int n, int arrow_at_start,
int arrow_at_end, int filled);
void (*polyline) (point * A, int n);
- boolean bezier_has_arrows;
+ bool bezier_has_arrows;
void (*comment) (char *str);
void (*textsize) (void); /* not used */
void (*user_shape) (char *name, point * A, int sides, int filled);
node_t **av; /* allocated list of nodes in rank */
int ht1, ht2; /* height below/above centerline */
int pht1, pht2; /* as above, but only primitive nodes */
- boolean candidate; /* for transpose () */
- boolean valid;
+ bool candidate; /* for transpose () */
+ bool valid;
int cache_nc; /* caches number of crossings */
adjmatrix_t *flat;
} rank_t;
point margin;
point page;
point size;
- boolean filled;
- boolean landscape;
- boolean centered;
+ bool filled;
+ bool landscape;
+ bool centered;
ratio_t ratio_kind;
} layout_t;
textlabel_t *label; /* if the cluster has a title */
box bb; /* bounding box */
point border[4]; /* sizes of margins for graph labels */
- boolean has_labels;
- boolean has_images;
- boolean active;
- boolean selected;
+ bool has_labels;
+ bool has_images;
+ bool active;
+ bool selected;
unsigned char charset; /* input character set */
int rankdir;
int ht1, ht2; /* below and above extremal ranks */
short minrank, maxrank;
/* various flags */
- boolean has_flat_edges;
- boolean showboxes;
- boolean cluster_was_collapsed;
+ bool has_flat_edges;
+ bool showboxes;
+ bool cluster_was_collapsed;
int nodesep, ranksep;
node_t *ln, *rn; /* left, right nodes of bounding box */
/* for clusters */
node_t *leader, **rankleader;
- boolean expanded;
+ bool expanded;
char installed;
char set_type;
char label_pos;
- boolean exact_ranksep;
+ bool exact_ranksep;
#endif
} Agraphinfo_t;
textlabel_t *label;
void *alg;
char state;
- boolean clustnode;
- boolean active;
- boolean selected;
+ bool clustnode;
+ bool active;
+ bool selected;
#ifndef DOT_ONLY
- boolean pinned;
+ bool pinned;
short xsize, ysize;
int id, heapindex, hops;
double *pos, dist;
#endif
#ifndef NEATO_ONLY
- boolean showboxes;
- boolean has_port;
+ bool showboxes;
+ bool has_port;
/* fast graph */
char node_type, mark, onstack;
char label_ontop;
edge_t *to_orig; /* for dot's shapes.c */
void *alg;
- boolean active;
- boolean selected;
+ bool active;
+ bool selected;
#ifndef DOT_ONLY
double factor;
Ppolyline_t path;
#endif
#ifndef NEATO_ONLY
- boolean showboxes;
- boolean conc_opp_flag;
+ bool showboxes;
+ bool conc_opp_flag;
short xpenalty;
int weight;
int cutvalue, tree_index;
* Return true if head/tail end of edge should not be clipped
* to node.
*/
-static boolean
+static bool
noClip(edge_t *e, attrsym_t* sym)
{
char *str;
- boolean rv = FALSE;
+ bool rv = FALSE;
if (sym) { /* mapbool isn't a good fit, because we want "" to mean TRUE */
str = agxget(e,sym->index);
/* addLabelBB:
*/
-static box addLabelBB(box bb, textlabel_t * lp, boolean flipxy)
+static box addLabelBB(box bb, textlabel_t * lp, bool flipxy)
{
int width, height;
point p = lp->p;
return ns;
}
-boolean overlap_node(node_t *n, boxf b)
+bool overlap_node(node_t *n, boxf b)
{
boxf bb;
inside_t ictxt;
return ND_shape(n)->fns->insidefn(&ictxt, p);
}
-boolean overlap_label(textlabel_t *lp, boxf b)
+bool overlap_label(textlabel_t *lp, boxf b)
{
double sx, sy;
boxf bb;
return OVERLAP(b, bb);
}
-static boolean overlap_arrow(pointf p, pointf u, double scale, int flag, boxf b)
+static bool overlap_arrow(pointf p, pointf u, double scale, int flag, boxf b)
{
boxf bb;
return FALSE;
}
-static boolean overlap_bezier(bezier bz, boxf b)
+static bool overlap_bezier(bezier bz, boxf b)
{
int i;
point pp;
return FALSE;
}
-boolean overlap_edge(edge_t *e, boxf b)
+bool overlap_edge(edge_t *e, boxf b)
{
int i;
splines *spl;
extern void updateBB(graph_t * g, textlabel_t * lp);
extern void compute_bb(Agraph_t *);
- extern boolean overlap_node(node_t *n, boxf b);
- extern boolean overlap_label(textlabel_t *lp, boxf b);
- extern boolean overlap_edge(edge_t *e, boxf b);
+ extern bool overlap_node(node_t *n, boxf b);
+ extern bool overlap_label(textlabel_t *lp, boxf b);
+ extern bool overlap_edge(edge_t *e, boxf b);
extern int processClusterEdges(graph_t * g);
extern void undoClusterEdges(graph_t * g);
#define UP 0
#define DOWN 1
-static boolean samedir(edge_t * e, edge_t * f)
+static bool samedir(edge_t * e, edge_t * f)
{
edge_t *e0, *f0;
* (ND_rank(e0->tail) - ND_rank(e0->head)) > 0);
}
-static boolean downcandidate(node_t * v)
+static bool downcandidate(node_t * v)
{
return ((ND_node_type(v) == VIRTUAL) && (ND_in(v).size == 1)
&& (ND_out(v).size == 1) && (ND_label(v) == NULL));
}
-static boolean bothdowncandidates(node_t * u, node_t * v)
+static bool bothdowncandidates(node_t * u, node_t * v)
{
edge_t *e, *f;
e = ND_in(u).list[0];
return FALSE;
}
-static boolean upcandidate(node_t * v)
+static bool upcandidate(node_t * v)
{
return ((ND_node_type(v) == VIRTUAL) && (ND_out(v).size == 1)
&& (ND_in(v).size == 1) && (ND_label(v) == NULL));
}
-static boolean bothupcandidates(node_t * u, node_t * v)
+static bool bothupcandidates(node_t * u, node_t * v)
{
edge_t *e, *f;
e = ND_out(u).list[0];
#if defined(_BLD_dot) && defined(_DLL)
# define extern __EXPORT__
#endif
- extern void dot_nodesize(Agnode_t *, boolean);
+ extern void dot_nodesize(Agnode_t *, bool);
extern void dot_concentrate(Agraph_t *);
extern void dot_mincross(Agraph_t *);
extern void dot_position(Agraph_t *);
#define GROWEDGES (edges = ALLOC (n_edges + CHUNK, edges, edge_t*))
-static boolean spline_merge(node_t * n)
+static bool spline_merge(node_t * n)
{
return ((ND_node_type(n) == VIRTUAL)
&& ((ND_in(n).size > 1) || (ND_out(n).size > 1)));
}
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
{
while (ED_to_orig(e))
e = ED_to_orig(e);
*/
static void
makeFlatEnd (spline_info_t* sp, path* P, node_t* n, edge_t* e, pathend_t* endp,
- boolean isBegin)
+ bool isBegin)
{
box b;
graph_t* g = n->graph;
*/
static void
makeBottomFlatEnd (spline_info_t* sp, path* P, node_t* n, edge_t* e,
- pathend_t* endp, boolean isBegin)
+ pathend_t* endp, bool isBegin)
{
box b;
graph_t* g = n->graph;
return rv;
}
-static boolean pathscross(n0, n1, ie1, oe1)
+static bool pathscross(n0, n1, ie1, oe1)
node_t *n0, *n1;
edge_t *ie1, *oe1;
{
bounds[SRB] = ord;
}
} else { /* forward */
- boolean onleft, onright;
+ bool onleft, onright;
onleft = onright = FALSE;
for (i = 0; (f = ND_out(v).list[i]); i++) {
if (ND_order(f->head) <= lpos) {
#define flatindex(v) ((v)->u.low)
/* forward declarations */
-static boolean medians(graph_t * g, int r0, int r1);
+static bool medians(graph_t * g, int r0, int r1);
static int nodeposcmpf(node_t ** n0, node_t ** n1);
static int edgeidcmpf(edge_t ** e0, edge_t ** e1);
static void flat_breakcycles(graph_t * g);
static int GlobalMinRank, GlobalMaxRank;
static edge_t **TE_list;
static int *TI_list;
-static boolean ReMincross;
+static bool ReMincross;
/* dot_mincross:
* Minimize edge crossings
static void flat_search(graph_t * g, node_t * v)
{
int i, j;
- boolean hascl;
+ bool hascl;
edge_t *e, *rev;
adjmatrix_t *M = GD_rank(g)[ND_rank(v)].flat;
reorder(graph_t * g, int r, int reverse, int hasfixed)
{
int changed = 0, nelt;
- boolean muststay, sawclust;
+ bool muststay, sawclust;
node_t **vlist = GD_rank(g)[r].v;
node_t **lp, **rp, **ep = vlist + GD_rank(g)[r].n;
#define VAL(node,port) (MC_SCALE * (node)->u.order + (port).order)
-static boolean medians(graph_t * g, int r0, int r1)
+static bool medians(graph_t * g, int r0, int r1)
{
int i, j, j0, lm, rm, lspan, rspan, *list;
node_t *n, **v;
edge_t *e;
- boolean hasfixed = FALSE;
+ bool hasfixed = FALSE;
list = TI_list;
v = GD_rank(g)[r0].v;
{
double xf = 0.0, yf = 0.0, actual, desired;
node_t *n;
- boolean scale_it, filled;
+ bool scale_it, filled;
point sz;
rec_bb(g, g);
/* idealsize:
* set g->drawing->size to a reasonable default.
- * returns a boolean to indicate if drawing is to
+ * returns a bool to indicate if drawing is to
* be scaled and filled */
static int idealsize(graph_t * g, double minallowed)
{
#endif
extern void fdp_layout(Agraph_t * g);
- extern void fdp_nodesize(node_t *, boolean);
+ extern void fdp_nodesize(node_t *, bool);
extern void fdp_init_graph(Agraph_t * g);
extern void fdp_init_node_edge(Agraph_t * g);
extern void fdp_cleanup(Agraph_t * g);
* How to combine parts, especially with disparate components?
*/
if (c_cnt > 1) {
- boolean *bp;
+ bool *bp;
if (pinned) {
- bp = N_NEW(c_cnt, boolean);
+ bp = N_NEW(c_cnt, bool);
bp[0] = TRUE;
} else
bp = 0;
#endif
void *surface; /* gd or cairo surface */
- boolean external_surface; /* surface belongs to caller */
+ bool external_surface; /* surface belongs to caller */
gvstyle_t *style; /* active style from gvc->styles[] */
pointf compscale; /* composite device scale incl: scale, zoom, dpi, y_goes_down */
pointf offset; /* composite translation */
- boolean fit_mode,
+ bool fit_mode,
needs_refresh,
click,
active,
char **info;
char *config_path;
- boolean config_found;
+ bool config_found;
/* gvrender_config() */
GVJ_t *jobs; /* linked list of jobs */
point pb; /* page size - including margins (inches) */
boxf bb; /* graph bb in graph units, not including margins */
int rotation; /* rotation - 0 = portrait, 90 = landscape */
- boolean graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
+ bool graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
/* layers */
char *layerDelims; /* delimiters in layer names */
++p;
#ifdef QUARTZ_RENDER
- static boolean unscanned = TRUE;
+ static bool unscanned = TRUE;
if (!p->name && unscanned) {
/* reached end of codegens but haven't yet scanned for Quicktime codegens... */
/*
gvconfig - parse a config file and install the identified plugins
*/
-void gvconfig(GVC_t * gvc, boolean rescan)
+void gvconfig(GVC_t * gvc, bool rescan)
{
#if 0
gvplugin_library_t **libraryp;
/* configuration */
extern char *gvconfig_libdir(void);
- extern void gvconfig(GVC_t * gvc, boolean rescan);
+ extern void gvconfig(GVC_t * gvc, bool rescan);
extern char *gvhostname(void);
/* plugins */
- extern boolean gvplugin_install(GVC_t * gvc, api_t api,
+ extern bool gvplugin_install(GVC_t * gvc, api_t api,
char *typestr, int quality, char *packagename, char *path,
gvplugin_installed_t * typeptr);
extern gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *type);
/* job */
extern void gvrender_output_filename_job(GVC_t * gvc, char *name);
- extern boolean gvrender_output_langname_job(GVC_t * gvc, char *name);
+ extern bool gvrender_output_langname_job(GVC_t * gvc, char *name);
extern GVJ_t *gvrender_first_job(GVC_t * gvc);
extern GVJ_t *gvrender_next_job(GVC_t * gvc);
extern void gvrender_delete_jobs(GVC_t * gvc);
}
/* -T switches */
-boolean gvrender_output_langname_job(GVC_t * gvc, char *name)
+bool gvrender_output_langname_job(GVC_t * gvc, char *name)
{
if (!gvc->jobs) {
output_langname_job = gvc->job = gvc->jobs =
#include "gvcint.h"
#include "gvcproc.h"
-extern void graph_init(graph_t *g, boolean use_rankdir);
+extern void graph_init(graph_t *g, bool use_rankdir);
extern void graph_cleanup(graph_t *g);
int gvlayout_select(GVC_t * gvc, char *layout)
/* install a plugin description into the list of available plugins */
/* list is alpha sorted by type, the quality sorted within the type,
then, if qualities are the same, last install wins */
-boolean gvplugin_install(GVC_t * gvc, api_t api,
+bool gvplugin_install(GVC_t * gvc, api_t api,
char *typestr, int quality, char *packagename, char *path,
gvplugin_installed_t * typeptr)
{
/* string buffer management
- FIXME - must have 20 solutions for this same thing */
-static const char *append_buf(char sep, char *str, boolean new)
+static const char *append_buf(char sep, char *str, bool new)
{
static char *buf;
static int bufsz, pos;
gvplugin_available_t **pnext, **plugin;
const char *buf = NULL;
char *s, *p, *typestr_last;
- boolean new = TRUE;
+ bool new = TRUE;
/* check for valid apis[] index */
if (api < 0)
void (*end_edges) (GVJ_t * job);
void (*begin_node) (GVJ_t * job, char *nodename, long id);
void (*end_node) (GVJ_t * job);
- void (*begin_edge) (GVJ_t * job, char *tailname, boolean directed,
+ void (*begin_edge) (GVJ_t * job, char *tailname, bool directed,
char *headname, long id);
void (*end_edge) (GVJ_t * job);
void (*begin_anchor) (GVJ_t * job, char *href, char *tooltip,
#include <macros.h>
extern void *gmalloc(size_t);
- typedef unsigned char bool;
-#define true TRUE
-#define false FALSE
#define DIGCOLA 1
#ifdef USE_STYLES
*/
static char *cc_pfx = "_neato_cc";
-void neato_nodesize(node_t * n, boolean flip)
+void neato_nodesize(node_t * n, bool flip)
{
int w;
int n_cc;
int i;
pack_info pinfo;
- boolean pin;
+ bool pin;
cc = pccomps(g, &n_cc, cc_pfx, &pin);
adjustNodes(gc);
}
if (n_cc > 1) {
- boolean *bp;
+ bool *bp;
if (pin) {
- bp = N_NEW(n_cc, boolean);
+ bp = N_NEW(n_cc, bool);
bp[0] = TRUE;
} else
bp = 0;
extern void heapdown(Agnode_t *);
extern void heapup(Agnode_t *);
extern void initial_positions(graph_t *, int);
- extern int init_port(Agnode_t *, Agedge_t *, char *, boolean);
+ extern int init_port(Agnode_t *, Agedge_t *, char *, bool);
extern void jitter3d(Agnode_t *, int);
extern void jitter_d(Agnode_t *, int, int);
extern Ppoly_t *makeObstacle(node_t * n, double SEP);
extern void makeSelfArcs(path * P, edge_t * e, int stepx);
- extern void makeSpline(edge_t *, Ppoly_t **, int, boolean);
+ extern void makeSpline(edge_t *, Ppoly_t **, int, bool);
extern void make_spring(graph_t *, Agnode_t *, Agnode_t *, double);
extern void move_node(graph_t *, int, Agnode_t *);
extern int init_nop(graph_t * g);
- extern void neato_nodesize(node_t * n, boolean flip);
+ extern void neato_nodesize(node_t * n, bool flip);
extern void neato_cleanup(graph_t * g);
extern void neato_cleanup_edge(edge_t * e);
extern void neato_cleanup_graph(graph_t * g);
extern void printvis(vconfig_t * cp);
extern int in_poly(Ppoly_t argpoly, Ppoint_t q);
-static boolean spline_merge(node_t * n)
+static bool spline_merge(node_t * n)
{
return FALSE;
}
-static boolean swap_ends_p(edge_t * e)
+static bool swap_ends_p(edge_t * e)
{
return FALSE;
}
* is on or inside one of the obstacles and, if so, tells the shortest path
* computation to ignore them.
*/
-void makeSpline(edge_t * e, Ppoly_t ** obs, int npoly, boolean chkPts)
+void makeSpline(edge_t * e, Ppoly_t ** obs, int npoly, bool chkPts)
{
Ppolyline_t line, spline;
Pvector_t slopes[2];
* Returns 0 on success.
*
* The edge function is given the graph, the separation to be added
- * around obstacles, and the type of edge. (At present, this is a boolean,
+ * around obstacles, and the type of edge. (At present, this is a bool,
* with 1 meaning splines and 0 meaning line segments.) It must guarantee
* that all bounding boxes are current; in particular, the bounding box of
* g must reflect the addition of the edges.
* Note that the component subgraphs do not contain any edges. These must
* be obtained from the root graph.
*/
-Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, boolean * pinned)
+Agraph_t **pccomps(Agraph_t * g, int *ncc, char *pfx, bool * pinned)
{
int c_cnt = 0;
char buffer[SMALLBUF];
Agraph_t **ccs;
int len;
int bnd = 10;
- boolean pin = FALSE;
+ bool pin = FALSE;
if (agnnodes(g) == 0) {
*ncc = 0;
point *places;
Dict_t *ps;
int i;
- boolean *fixed = pinfo->fixed;
+ bool *fixed = pinfo->fixed;
int fixed_cnt = 0;
box fixed_bb = { {0, 0}, {0, 0} };
point center;
unsigned int margin; /* margin left around objects, in points */
int doSplines; /* use splines in constructing graph shape */
pack_mode mode; /* granularity and method */
- boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
+ bool *fixed; /* fixed[i] == true implies g[i] should not be moved */
} pack_info;
extern point *putGraphs(int, Agraph_t **, Agraph_t *, pack_info *);
extern int isConnected(Agraph_t *);
extern Agraph_t **ccomps(Agraph_t *, int *, char *);
- extern Agraph_t **pccomps(Agraph_t *, int *, char *, boolean *);
+ extern Agraph_t **pccomps(Agraph_t *, int *, char *, bool *);
extern int nodeInduce(Agraph_t *);
#ifdef __cplusplus