Graphviz 13.0.0~dev.20241220.2304
|
#include "config.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <common/macros.h>
#include <common/const.h>
#include <xdot/xdot.h>
#include <gvc/gvplugin_render.h>
#include <gvc/gvplugin_device.h>
#include <common/utils.h>
#include <gvc/gvc.h>
#include <gvc/gvio.h>
#include <gvc/gvcint.h>
#include <util/alloc.h>
#include <util/startswith.h>
#include <util/streq.h>
#include <util/unreachable.h>
Go to the source code of this file.
Data Structures | |
struct | state_t |
information the ID allocator needs to do its job More... | |
struct | gvid_t |
struct | intm |
Macros | |
#define | ID "id" |
#define | ND_gid(n) (((gvid_t*)aggetrec(n, ID, 0))->id) |
#define | ED_gid(n) (((gvid_t*)aggetrec(n, ID, 0))->id) |
#define | GD_gid(n) (((gvid_t*)aggetrec(n, ID, 0))->id) |
Typedefs | |
typedef int(* | putstrfn) (void *chan, const char *str) |
typedef int(* | flushfn) (void *chan) |
Enumerations | |
enum | format_type { FORMAT_JSON , FORMAT_JSON0 , FORMAT_DOT_JSON , FORMAT_XDOT_JSON } |
Functions | |
static bool | IS_CLUSTER (Agraph_t *s) |
static void | json_begin_graph (GVJ_t *job) |
static void | stoj (char *ins, state_t *sp, GVJ_t *job) |
static void | indent (GVJ_t *job, int level) |
static void | set_attrwf (Agraph_t *g, bool toplevel, bool value) |
static void | write_polyline (GVJ_t *job, xdot_polyline *polyline) |
static void | write_stops (GVJ_t *job, int n_stops, xdot_color_stop *stp, state_t *sp) |
static void | write_radial_grad (GVJ_t *job, xdot_radial_grad *rg, state_t *sp) |
static void | write_linear_grad (GVJ_t *job, xdot_linear_grad *lg, state_t *sp) |
static void | write_xdot (xdot_op *op, GVJ_t *job, state_t *sp) |
static void | write_xdots (char *val, GVJ_t *job, state_t *sp) |
static bool | isXDot (const char *name) |
static void | write_attrs (Agobj_t *obj, GVJ_t *job, state_t *sp) |
static void | write_hdr (Agraph_t *g, GVJ_t *job, bool top, state_t *sp) |
static void | write_graph (Agraph_t *g, GVJ_t *job, bool top, state_t *sp) |
static void | write_subg (Agraph_t *g, GVJ_t *job, state_t *sp) |
static bool | write_subgs (Agraph_t *g, GVJ_t *job, bool top, state_t *sp) |
static int | agseqasc (const void *x, const void *y) |
static void | write_edge (Agedge_t *e, GVJ_t *job, bool top, state_t *sp) |
static int | write_edges (Agraph_t *g, GVJ_t *job, bool top, state_t *sp) |
static void | write_node (Agnode_t *n, GVJ_t *job, bool top, state_t *sp) |
static int | write_nodes (Agraph_t *g, GVJ_t *job, bool top, bool has_subgs, state_t *sp) |
static void | freef (void *ident) |
static int | lookup (Dt_t *map, char *name) |
static void | insert (Dt_t *map, char *name, int v) |
static int | label_subgs (Agraph_t *g, int lbl, Dt_t *map) |
static void | json_end_graph (GVJ_t *job) |
Definition at line 54 of file gvrender_core_json.c.
Definition at line 55 of file gvrender_core_json.c.
#define ID "id" |
Definition at line 52 of file gvrender_core_json.c.
Definition at line 53 of file gvrender_core_json.c.
typedef int(* flushfn) (void *chan) |
Definition at line 710 of file gvrender_core_json.c.
typedef int(* putstrfn) (void *chan, const char *str) |
Definition at line 709 of file gvrender_core_json.c.
enum format_type |
Enumerator | |
---|---|
FORMAT_JSON | |
FORMAT_JSON0 | |
FORMAT_DOT_JSON | |
FORMAT_XDOT_JSON |
Definition at line 34 of file gvrender_core_json.c.
|
static |
Definition at line 434 of file gvrender_core_json.c.
References AGSEQ.
Referenced by write_edges().
|
static |
Definition at line 603 of file gvrender_core_json.c.
References free(), and intm::id.
|
static |
Definition at line 129 of file gvrender_core_json.c.
References gvputs().
Referenced by write_attrs(), write_edge(), write_edges(), write_graph(), write_hdr(), write_linear_grad(), write_node(), write_nodes(), write_radial_grad(), write_subgs(), write_xdot(), and write_xdots().
|
static |
Definition at line 625 of file gvrender_core_json.c.
References agwarningf(), dtinsert, dtmatch, gv_alloc(), gv_strdup(), intm::id, and intm::v.
Referenced by label_subgs().
|
static |
Definition at line 57 of file gvrender_core_json.c.
References agnameof(), and startswith().
Referenced by label_subgs().
|
static |
Definition at line 340 of file gvrender_core_json.c.
References streq().
Referenced by write_attrs().
|
static |
Definition at line 61 of file gvrender_core_json.c.
References attach_attrs(), FORMAT_JSON, FORMAT_JSON0, GVC_s::g, obj_state_s::g, GVJ_s::gvc, gvc, gvCloneGVC(), gvFreeCloneGVC(), gvRender(), gvplugin_active_render_s::id, NULL, GVJ_s::obj, GVJ_s::render, and obj_state_s::u.
|
static |
Definition at line 712 of file gvrender_core_json.c.
References Agiodisc_s::afread, AgIoDisc, CHAR_LATIN1, Agraph_s::clos, Agclos_s::disc, state_t::doXDot, Agiodisc_s::flush, FORMAT_JSON, FORMAT_XDOT_JSON, obj_state_s::g, GD_charset, gvflush(), gvputs(), gvplugin_active_render_s::id, Agdisc_s::io, state_t::isLatin, state_t::Level, NULL, GVJ_s::obj, Agiodisc_s::putstr, GVJ_s::render, set_attrwf(), obj_state_s::u, and write_graph().
Definition at line 640 of file gvrender_core_json.c.
References agfstsubg(), agnameof(), agnxtsubg(), agroot(), GD_gid, insert(), IS_CLUSTER(), and label_subgs().
Referenced by label_subgs(), and write_graph().
|
static |
Definition at line 618 of file gvrender_core_json.c.
References dtmatch, and intm::v.
Referenced by write_graph().
|
static |
Definition at line 136 of file gvrender_core_json.c.
References AGATTRWF, agfstnode(), agfstout(), agfstsubg(), agnxtnode(), agnxtout(), agnxtsubg(), and set_attrwf().
Referenced by json_end_graph(), and set_attrwf().
Convert dot string to a valid json string embedded in double quotes and output
ins | Input string |
sp | State, used to determine encoding of the input string |
job | Output job |
Definition at line 81 of file gvrender_core_json.c.
References free(), gvputc(), gvputs(), ins(), state_t::isLatin, and latin1ToUTF8().
Referenced by write_attrs(), write_hdr(), write_node(), write_stops(), and write_xdot().
Definition at line 346 of file gvrender_core_json.c.
References agnxtattr(), agroot(), AGTYPE, agxget(), state_t::doXDot, gvputs(), indent(), isXDot(), state_t::Level, Agsym_s::name, NULL, stoj(), streq(), type, and write_xdots().
Referenced by write_edge(), write_graph(), and write_node().
Definition at line 461 of file gvrender_core_json.c.
References aghead, agtail, ED_gid, gvprintf(), gvputs(), indent(), state_t::Level, ND_gid, top(), and write_attrs().
Referenced by write_edges().
Definition at line 482 of file gvrender_core_json.c.
References agfstnode(), agfstout(), agnxtnode(), agnxtout(), agseqasc(), free(), gv_calloc(), gvputs(), indent(), state_t::Level, top(), and write_edge().
Referenced by write_graph().
Definition at line 656 of file gvrender_core_json.c.
References AGEDGE, agfstnode(), agfstout(), aginit(), agnameof(), AGNODE, agnxtnode(), agnxtout(), AGRAPH, dtclose(), dtopen(), Dtoset, ED_gid, GD_gid, gvprintf(), gvputs(), ID, indent(), intDisc, IS_CLUST_NODE, label_subgs(), state_t::Level, lookup(), ND_gid, top(), write_attrs(), write_edges(), write_hdr(), write_nodes(), and write_subgs().
Referenced by json_end_graph(), and write_subg().
Definition at line 368 of file gvrender_core_json.c.
References agisdirected(), agisstrict(), agnameof(), gvprintf(), gvputs(), indent(), state_t::Level, stoj(), and top().
Referenced by write_graph().
|
static |
Definition at line 192 of file gvrender_core_json.c.
References gvprintf(), indent(), state_t::Level, xdot_linear_grad::n_stops, xdot_linear_grad::stops, write_stops(), xdot_linear_grad::x0, xdot_linear_grad::x1, xdot_linear_grad::y0, and xdot_linear_grad::y1.
Referenced by write_xdot().
Definition at line 531 of file gvrender_core_json.c.
References agnameof(), gvprintf(), gvputs(), indent(), state_t::Level, ND_gid, stoj(), top(), and write_attrs().
Referenced by write_nodes().
Definition at line 551 of file gvrender_core_json.c.
References agfstnode(), agnxtnode(), gvputs(), indent(), IS_CLUST_NODE, state_t::Level, top(), and write_node().
Referenced by write_graph().
|
static |
Definition at line 155 of file gvrender_core_json.c.
References cnt(), xdot_polyline::cnt, gvprintf(), and xdot_polyline::pts.
Referenced by write_xdot().
|
static |
Definition at line 182 of file gvrender_core_json.c.
References gvprintf(), indent(), state_t::Level, xdot_radial_grad::n_stops, xdot_radial_grad::r0, xdot_radial_grad::r1, xdot_radial_grad::stops, write_stops(), xdot_radial_grad::x0, xdot_radial_grad::x1, xdot_radial_grad::y0, and xdot_radial_grad::y1.
Referenced by write_xdot().
|
static |
Definition at line 168 of file gvrender_core_json.c.
References color(), gvprintf(), gvputc(), and stoj().
Referenced by write_linear_grad(), and write_radial_grad().
Definition at line 387 of file gvrender_core_json.c.
References agfstsubg(), agnxtsubg(), gvputs(), write_graph(), and write_subg().
Referenced by write_subg(), and write_subgs().
write out subgraphs
Definition at line 401 of file gvrender_core_json.c.
References agfstsubg(), agnxtsubg(), GD_gid, gvprintf(), gvputs(), indent(), state_t::Level, top(), and write_subg().
Referenced by write_graph().
Definition at line 202 of file gvrender_core_json.c.
References xdot_text::align, _xdot_op::bezier, xdot_color::clr, _xdot_op::color, _xdot_op::ellipse, _xdot_op::font, _xdot_op::fontchar, _xdot_op::grad_color, gvprintf(), gvputc(), gvputs(), xdot_rect::h, indent(), _xdot_op::kind, state_t::Level, xdot_color::ling, xdot_font::name, _xdot_op::polygon, _xdot_op::polyline, xdot_color::ring, xdot_font::size, stoj(), _xdot_op::style, xdot_text::text, _xdot_op::text, xdot_color::type, xdot_color::u, _xdot_op::u, UNREACHABLE, xdot_rect::w, xdot_text::width, write_linear_grad(), write_polyline(), write_radial_grad(), xdot_rect::x, xdot_text::x, xd_center, 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_left, xd_linear, xd_none, xd_pen_color, xd_polyline, xd_style, xd_text, xd_unfilled_bezier, xd_unfilled_ellipse, xd_unfilled_polygon, xdot_rect::y, and xdot_text::y.
Referenced by write_xdots().
Definition at line 313 of file gvrender_core_json.c.
References agwarningf(), xdot::cnt, freeXDot(), gvputs(), indent(), state_t::Level, xdot::ops, parseXDot(), and write_xdot().
Referenced by write_attrs().
gvdevice_features_t device_features_json |
Definition at line 792 of file gvrender_core_json.c.
gvdevice_features_t device_features_json_nop |
Definition at line 785 of file gvrender_core_json.c.
gvplugin_installed_t gvdevice_json_types[] |
Definition at line 807 of file gvrender_core_json.c.
gvplugin_installed_t gvrender_json_types[] |
Definition at line 799 of file gvrender_core_json.c.
|
static |
Definition at line 609 of file gvrender_core_json.c.
Referenced by write_graph().
gvrender_engine_t json_engine |
Definition at line 733 of file gvrender_core_json.c.
gvrender_features_t render_features_json |
Definition at line 774 of file gvrender_core_json.c.
gvrender_features_t render_features_json1 |
Definition at line 766 of file gvrender_core_json.c.