27 const double d = strtod(
s, &p);
38 *ip = (int)strtol(
s, &endp, 10);
47 *ip = (
unsigned int)strtoul(
s, &endp, 10);
56 rp->
x = strtod(
s, &endp);
61 rp->
y = strtod(
s, &endp);
66 rp->
w = strtod(
s, &endp);
71 rp->
h = strtod(
s, &endp);
90 for (i = 0; i < pp->
cnt; i++) {
91 ps->
x = strtod(
s, &endp);
98 ps->
y = strtod(
s, &endp);
117 while (*
s && *
s !=
'-')
131 for (
int accounted = 0; accounted < i; ++j) {
138 if (
s[j] !=
'\\' || (j > 0 &&
s[j - 1] ==
'\\')) {
353 size_t initcnt = x->
cnt;
365 if (x->
cnt == bufsz) {
392typedef int (*
pf)(
void *,
char *, ...);
416 for (
size_t i = 0; i < p->
cnt; i++) {
492 for (
unsigned i = 0; i < n_stops; i++) {
586 print(
info,
"[%.06f,%.06f,%.06f,%.06f]", r->
x, r->
y, r->
w, r->
h);
591 for (
size_t i = 0; i < p->
cnt; i++) {
703 char *base = (
char *)x->
ops;
704 for (
size_t i = 0; i < x->
cnt; i++) {
720 const int r = vfprintf(stream,
format, ap);
777 char *
const base = (
char *)x->
ops;
778 for (
size_t i = 0; i < x->
cnt; i++) {
779 void *
const op = base + i * x->
sz;
793 char *
const base = (
char *)x->
ops;
794 for (
size_t i = 0; i < x->
cnt; i++) {
877 for (
unsigned int i = 0; i < clr->
u.
ring.
n_stops; 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)
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 void printXDot(xdot *x, pf print, void *info, print_op ofn)
static char * parseRect(char *s, xdot_rect *rp)
static char * parseReal(const char *s, double *fp)
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 * parseUInt(const char *s, unsigned 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)
xdot * parseXDot(char *s)
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)
static char * parseInt(const char *s, int *ip)
void jsonXDot(FILE *fp, xdot *x)
parsing and deparsing of xdot operations
void(* freefunc_t)(xdot_op *)
void(* drawfunc_t)(xdot_op *, int)