Graphviz 13.0.0~dev.20241220.2304
|
#include <xdot/xdot.h>
#include <stdlib.h>
#include <string.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/prisize_t.h>
#include <util/unreachable.h>
Go to the source code of this file.
Macros | |
#define | CHK(s) if(!s){*error=1;return 0;} |
#define | XDBSIZE 100 |
#define | CHK1(s) if(!s){free(stops);return NULL;} |
Typedefs | |
typedef int(* | pf) (void *, char *,...) |
typedef void(* | print_op) (xdot_op *op, pf print, void *info, int more) |
Functions | |
static char * | parseReal (char *s, double *fp) |
static char * | parseInt (char *s, int *ip) |
static char * | parseUInt (char *s, unsigned int *ip) |
static char * | parseRect (char *s, xdot_rect *rp) |
static char * | parsePolyline (char *s, xdot_polyline *pp) |
static char * | parseString (char *s, char **sp) |
static char * | parseAlign (char *s, xdot_align *ap) |
static char * | parseOp (xdot_op *op, char *s, drawfunc_t ops[], int *error) |
xdot * | parseXDotFOn (char *s, drawfunc_t fns[], size_t sz, xdot *x) |
xdot * | parseXDotF (char *s, drawfunc_t fns[], size_t sz) |
xdot * | parseXDot (char *s) |
static void | printRect (xdot_rect *r, pf print, void *info) |
static void | printPolyline (xdot_polyline *p, pf print, void *info) |
static void | printString (char *p, pf print, void *info) |
static void | printFloat (double f, pf print, void *info, int space) |
static void | printAlign (xdot_align a, pf print, void *info) |
static void | toGradString (agxbuf *xb, xdot_color *cp) |
static void | printXDot_Op (xdot_op *op, pf print, void *info, int more) |
static void | jsonRect (xdot_rect *r, pf print, void *info) |
static void | jsonPolyline (xdot_polyline *p, pf print, void *info) |
static void | jsonString (char *p, pf print, void *info) |
static void | jsonXDot_Op (xdot_op *op, pf print, void *info, int more) |
static void | _printXDot (xdot *x, pf print, void *info, print_op ofn) |
char * | sprintXDot (xdot *x) |
void | fprintXDot (FILE *fp, xdot *x) |
void | jsonXDot (FILE *fp, xdot *x) |
static void | freeXOpData (xdot_op *x) |
void | freeXDot (xdot *x) |
int | statXDot (xdot *x, xdot_stats *sp) |
static char * | radGradient (char *cp, xdot_color *clr) |
static char * | linGradient (char *cp, xdot_color *clr) |
char * | parseXDotColor (char *cp, xdot_color *clr) |
void | freeXDotColor (xdot_color *cp) |
Definition at line 714 of file xdot.c.
References cnt(), xdot::cnt, xdot::ops, print(), and xdot::sz.
Referenced by fprintXDot(), jsonXDot(), and sprintXDot().
void fprintXDot | ( | FILE * | fp, |
xdot * | x | ||
) |
Definition at line 731 of file xdot.c.
References _printXDot(), and printXDot_Op().
void freeXDot | ( | xdot * | x | ) |
Definition at line 782 of file xdot.c.
References xdot::cnt, free(), xdot::freefunc, freeXOpData(), xdot::ops, and xdot::sz.
Referenced by edge_spline(), edge_xdot(), graph_cleanup(), renderNodes(), renderSelectedEdges(), renderSelectedNodes(), and write_xdots().
void freeXDotColor | ( | xdot_color * | cp | ) |
Definition at line 974 of file xdot.c.
References xdot_color_stop::color, free(), xdot_color::ling, xdot_linear_grad::n_stops, xdot_radial_grad::n_stops, xdot_color::ring, xdot_linear_grad::stops, xdot_radial_grad::stops, xdot_color::type, xdot_color::u, xd_linear, and xd_radial.
Referenced by freeXOpData().
|
static |
Definition at line 743 of file xdot.c.
References _xdot_op::color, _xdot_op::font, free(), freeXDotColor(), _xdot_op::grad_color, _xdot_op::image, _xdot_op::kind, xdot_image::name, xdot_font::name, _xdot_op::polyline, xdot_polyline::pts, _xdot_op::style, xdot_text::text, _xdot_op::text, _xdot_op::u, xd_fill_color, xd_filled_bezier, xd_filled_polygon, xd_font, xd_grad_fill_color, xd_grad_pen_color, xd_image, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, and xd_unfilled_polygon.
Referenced by freeXDot().
|
static |
Definition at line 602 of file xdot.c.
References cnt(), xdot_polyline::cnt, print(), xdot_polyline::pts, xdot_point::x, and xdot_point::y.
Referenced by jsonXDot_Op().
Definition at line 597 of file xdot.c.
References xdot_rect::h, print(), xdot_rect::w, xdot_rect::x, and xdot_rect::y.
Referenced by jsonXDot_Op().
|
static |
Definition at line 612 of file xdot.c.
References print().
Referenced by jsonXDot_Op().
void jsonXDot | ( | FILE * | fp, |
xdot * | x | ||
) |
Definition at line 736 of file xdot.c.
References _printXDot(), and jsonXDot_Op().
Definition at line 625 of file xdot.c.
References agxbfree(), agxbuse(), xdot_text::align, _xdot_op::bezier, _xdot_op::color, _xdot_op::ellipse, _xdot_op::font, _xdot_op::fontchar, _xdot_op::grad_color, _xdot_op::image, jsonPolyline(), jsonRect(), jsonString(), _xdot_op::kind, xdot_image::name, xdot_font::name, _xdot_op::polygon, _xdot_op::polyline, xdot_image::pos, print(), printAlign(), printFloat(), xdot_font::size, _xdot_op::style, xdot_text::text, _xdot_op::text, toGradString(), _xdot_op::u, xdot_text::width, xdot_text::x, xd_fill_color, xd_filled_bezier, xd_filled_ellipse, xd_filled_polygon, xd_font, xd_fontchar, xd_grad_fill_color, xd_grad_pen_color, xd_image, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, xd_unfilled_ellipse, xd_unfilled_polygon, and xdot_text::y.
Referenced by jsonXDot().
|
static |
Definition at line 908 of file xdot.c.
References CHK1, color(), xdot_color_stop::frac, gv_calloc(), xdot_color::ling, xdot_linear_grad::n_stops, NULL, parseInt(), parseReal(), parseString(), xdot_linear_grad::stops, xdot_color::type, xdot_color::u, xdot_linear_grad::x0, xdot_linear_grad::x1, xd_linear, xdot_linear_grad::y0, and xdot_linear_grad::y1.
Referenced by parseXDotColor().
|
static |
|
static |
Definition at line 34 of file xdot.c.
Referenced by linGradient(), parseAlign(), parseString(), and radGradient().
|
static |
Definition at line 169 of file xdot.c.
References xdot_text::align, _xdot_op::bezier, CHK, xdot_color::clr, _xdot_op::color, _xdot_op::drawfunc, _xdot_op::ellipse, error, _xdot_op::font, _xdot_op::fontchar, _xdot_op::grad_color, gv_isspace(), _xdot_op::image, _xdot_op::kind, xdot_image::name, xdot_font::name, ops, parseAlign(), parsePolyline(), parseReal(), parseRect(), parseString(), parseUInt(), parseXDotColor(), _xdot_op::polygon, _xdot_op::polyline, xdot_image::pos, xdot_font::size, _xdot_op::style, xdot_text::text, _xdot_op::text, xdot_color::type, xdot_color::u, _xdot_op::u, xdot_text::width, xdot_text::x, xd_fill_color, xd_filled_bezier, xd_filled_ellipse, xd_filled_polygon, xd_font, xd_fontchar, xd_grad_fill_color, xd_grad_pen_color, xd_image, xd_none, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, xd_unfilled_ellipse, xd_unfilled_polygon, xop_bezier, xop_ellipse, xop_fill_color, xop_font, xop_fontchar, xop_grad_color, xop_image, xop_pen_color, xop_polygon, xop_polyline, xop_style, xop_text, and xdot_text::y.
Referenced by parseXDotFOn().
|
static |
Definition at line 87 of file xdot.c.
References xdot_polyline::cnt, free(), gv_calloc(), NULL, parseUInt(), ps, and xdot_polyline::pts.
Referenced by parseOp().
|
static |
Definition at line 21 of file xdot.c.
Referenced by linGradient(), parseOp(), and radGradient().
|
static |
Definition at line 56 of file xdot.c.
References xdot_rect::h, xdot_rect::w, xdot_rect::x, and xdot_rect::y.
Referenced by parseOp().
|
static |
Definition at line 120 of file xdot.c.
References agxbdisown(), agxbfree(), agxbputc(), and parseInt().
Referenced by linGradient(), parseOp(), and radGradient().
|
static |
Definition at line 45 of file xdot.c.
Referenced by parseOp(), and parsePolyline().
xdot * parseXDot | ( | char * | s | ) |
Definition at line 400 of file xdot.c.
References parseXDotF().
Referenced by write_xdots().
char * parseXDotColor | ( | char * | cp, |
xdot_color * | clr | ||
) |
Definition at line 946 of file xdot.c.
References xdot_color::clr, gv_isalnum(), linGradient(), NULL, radGradient(), xdot_color::type, xdot_color::u, and xd_none.
Referenced by parseOp().
xdot * parseXDotF | ( | char * | s, |
drawfunc_t | fns[], | ||
size_t | sz | ||
) |
Definition at line 396 of file xdot.c.
References NULL, and parseXDotFOn().
Referenced by init_xdot(), and parseXDot().
xdot * parseXDotFOn | ( | char * | s, |
drawfunc_t | fns[], | ||
size_t | sz, | ||
xdot * | x | ||
) |
Definition at line 343 of file xdot.c.
References xdot::cnt, error, xdot::flags, free(), gv_alloc(), gv_calloc(), gv_recalloc(), NULL, ops, xdot::ops, parseOp(), xdot::sz, XDBSIZE, and XDOT_PARSE_ERROR.
Referenced by parseXDotF(), and parseXdotwithattrs().
|
static |
Definition at line 459 of file xdot.c.
References print(), UNREACHABLE, xd_center, xd_left, and xd_right.
Referenced by jsonXDot_Op(), and printXDot_Op().
|
static |
Definition at line 447 of file xdot.c.
References agxbfree(), agxbprint(), agxbuf_trim_zeros(), agxbuse(), and print().
Referenced by jsonXDot_Op(), printXDot_Op(), and toGradString().
|
static |
Definition at line 426 of file xdot.c.
References agxbfree(), agxbprint(), agxbuf_trim_zeros(), agxbuse(), xdot_polyline::cnt, print(), PRISIZE_T, xdot_polyline::pts, xdot_point::x, and xdot_point::y.
Referenced by printXDot_Op().
Definition at line 407 of file xdot.c.
References agxbfree(), agxbprint(), agxbuf_trim_zeros(), agxbuse(), xdot_rect::h, print(), xdot_rect::w, xdot_rect::x, and xdot_rect::y.
Referenced by printXDot_Op().
|
static |
Definition at line 442 of file xdot.c.
References print(), and PRISIZE_T.
Referenced by printXDot_Op(), and toGradString().
Definition at line 516 of file xdot.c.
References agxbfree(), agxbuse(), xdot_text::align, _xdot_op::bezier, _xdot_op::color, _xdot_op::ellipse, _xdot_op::font, _xdot_op::fontchar, _xdot_op::grad_color, _xdot_op::image, _xdot_op::kind, xdot_image::name, xdot_font::name, _xdot_op::polygon, _xdot_op::polyline, xdot_image::pos, print(), printAlign(), printFloat(), printPolyline(), printRect(), printString(), xdot_font::size, _xdot_op::style, xdot_text::text, _xdot_op::text, toGradString(), _xdot_op::u, xdot_text::width, xdot_text::x, xd_fill_color, xd_filled_bezier, xd_filled_ellipse, xd_filled_polygon, xd_font, xd_fontchar, xd_grad_fill_color, xd_grad_pen_color, xd_image, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, xd_unfilled_ellipse, xd_unfilled_polygon, and xdot_text::y.
Referenced by fprintXDot(), and sprintXDot().
|
static |
Definition at line 867 of file xdot.c.
References CHK1, color(), xdot_color_stop::frac, gv_calloc(), xdot_radial_grad::n_stops, NULL, parseInt(), parseReal(), parseString(), xdot_radial_grad::r0, xdot_radial_grad::r1, xdot_color::ring, xdot_radial_grad::stops, xdot_color::type, xdot_color::u, xdot_radial_grad::x0, xdot_radial_grad::x1, xd_radial, xdot_radial_grad::y0, and xdot_radial_grad::y1.
Referenced by parseXDotColor().
char * sprintXDot | ( | xdot * | x | ) |
Definition at line 724 of file xdot.c.
References _printXDot(), agxbdisown(), agxbprint(), and printXDot_Op().
int statXDot | ( | xdot * | x, |
xdot_stats * | sp | ||
) |
Definition at line 799 of file xdot.c.
References _xdot_op::bezier, xdot_polyline::cnt, xdot::cnt, xdot_stats::cnt, _xdot_op::kind, xdot_stats::n_bezier, xdot_stats::n_bezier_pts, xdot_stats::n_color, xdot_stats::n_ellipse, xdot_stats::n_font, xdot_stats::n_fontchar, xdot_stats::n_gradcolor, xdot_stats::n_image, xdot_stats::n_polygon, xdot_stats::n_polygon_pts, xdot_stats::n_polyline, xdot_stats::n_polyline_pts, xdot_stats::n_style, xdot_stats::n_text, xdot::ops, _xdot_op::polygon, _xdot_op::polyline, xdot::sz, _xdot_op::u, xd_fill_color, xd_filled_bezier, xd_filled_ellipse, xd_filled_polygon, xd_font, xd_fontchar, xd_grad_fill_color, xd_grad_pen_color, xd_image, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, xd_unfilled_ellipse, and xd_unfilled_polygon.
Referenced by init_xdot().
|
static |
Definition at line 477 of file xdot.c.
References agxbprint(), agxbputc(), color(), xdot_color::ling, xdot_linear_grad::n_stops, xdot_radial_grad::n_stops, printFloat(), printString(), xdot_radial_grad::r0, xdot_radial_grad::r1, xdot_color::ring, xdot_linear_grad::stops, xdot_radial_grad::stops, xdot_color::type, xdot_color::u, xdot_linear_grad::x0, xdot_radial_grad::x0, xdot_linear_grad::x1, xdot_radial_grad::x1, xd_linear, xdot_linear_grad::y0, xdot_radial_grad::y0, xdot_linear_grad::y1, and xdot_radial_grad::y1.
Referenced by jsonXDot_Op(), and printXDot_Op().