39 *ip = (int)strtol(
s, &endp, 10);
49 *ip = (
unsigned int)strtoul(
s, &endp, 10);
59 rp->
x = strtod(
s, &endp);
65 rp->
y = strtod(
s, &endp);
71 rp->
w = strtod(
s, &endp);
77 rp->
h = strtod(
s, &endp);
97 for (i = 0; i < pp->
cnt; i++) {
98 ps->
x = strtod(
s, &endp);
105 ps->
y = strtod(
s, &endp);
124 while (*
s && *
s !=
'-')
138 for (
int accounted = 0; accounted < i; ++j) {
145 if (
s[j] !=
'\\' || (j > 0 &&
s[j - 1] ==
'\\')) {
360 size_t initcnt = x->
cnt;
372 if (x->
cnt == bufsz) {
399typedef int (*
pf)(
void *,
char *, ...);
423 for (
size_t i = 0; i < p->
cnt; i++) {
499 for (i = 0; i < n_stops; i++) {
593 print(
info,
"[%.06f,%.06f,%.06f,%.06f]", r->
x, r->
y, r->
w, r->
h);
598 for (
size_t i = 0; i < p->
cnt; i++) {
711 char *base = (
char *)x->
ops;
712 for (
size_t i = 0; i < x->
cnt; i++) {
728 const int r = vfprintf(stream,
format, ap);
785 char *
const base = (
char *)x->
ops;
786 for (
size_t i = 0; i < x->
cnt; i++) {
787 void *
const op = base + i * x->
sz;
804 base = (
char *)x->
ops;
805 for (
size_t i = 0; i < x->
cnt; i++) {
Dynamically expanding string buffers.
static void agxbfree(agxbuf *xb)
free any malloced resources
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static int vagxbprint(agxbuf *xb, const char *fmt, va_list ap)
vprintf-style output to an agxbuf
static WUR char * agxbuse(agxbuf *xb)
static int agxbputc(agxbuf *xb, char c)
add character to buffer
static char * agxbdisown(agxbuf *xb)
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
static void print(Excc_t *cc, Exnode_t *exnode)
static int cnt(Dict_t *d, Dtlink_t **set)
replacements for ctype.h functions
static bool gv_isalnum(int c)
static bool gv_isspace(int c)
static void color(Agraph_t *g)
GVIO_API const char * format
static void printAlign(xdot_align a, pf print, void *info)
void(* print_op)(xdot_op *op, pf print, void *info, int more)
static void printFloat(double f, pf print, void *info, int space)
static void jsonXDot_Op(xdot_op *op, pf print, void *info, int more)
xdot * parseXDotFOn(char *s, drawfunc_t fns[], size_t sz, xdot *x)
static char * linGradient(char *cp, xdot_color *clr)
static void printRect(xdot_rect *r, pf print, void *info)
static char * parseReal(char *s, double *fp)
int(* pf)(void *, char *,...)
char * parseXDotColor(char *cp, xdot_color *clr)
static char * parseString(char *s, char **sp)
static void printXDot_Op(xdot_op *op, pf print, void *info, int more)
static void jsonPolyline(xdot_polyline *p, pf print, void *info)
static int pf_agxbprint(void *xb, char *fmt,...)
wrapper to translate pf calling convention to agxbprint
int statXDot(xdot *x, xdot_stats *sp)
static void printString(char *p, pf print, void *info)
static char * parseRect(char *s, xdot_rect *rp)
static char * parseAlign(char *s, xdot_align *ap)
static void freeXOpData(xdot_op *x)
static void printPolyline(xdot_polyline *p, pf print, void *info)
char * sprintXDot(xdot *x)
static void jsonString(char *p, pf print, void *info)
static char * parseInt(char *s, int *ip)
void freeXDotColor(xdot_color *cp)
static int pf_fprintf(void *stream, char *format,...)
wrapper to translate pf calling convention to fprintf
void fprintXDot(FILE *fp, xdot *x)
static char * parseOp(xdot_op *op, char *s, drawfunc_t ops[], int *error)
xdot * parseXDotF(char *s, drawfunc_t fns[], size_t sz)
static char * parseUInt(char *s, unsigned int *ip)
xdot * parseXDot(char *s)
static void _printXDot(xdot *x, pf print, void *info, print_op ofn)
static void jsonRect(xdot_rect *r, pf print, void *info)
static void toGradString(agxbuf *xb, xdot_color *cp)
static char * parsePolyline(char *s, xdot_polyline *pp)
static char * radGradient(char *cp, xdot_color *clr)
void jsonXDot(FILE *fp, xdot *x)
parsing and deparsing of xdot operations
void(* freefunc_t)(xdot_op *)
void(* drawfunc_t)(xdot_op *, int)