#include "config.h"
#include <cgraph/agxbuf.h>
+#include <cgraph/alloc.h>
#include <common/render.h>
#include <math.h>
#include <pathplan/pathplan.h>
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
li = Show_cnt+1;
- Show_boxes[li++] = strdup ("%%!");
- Show_boxes[li++] = strdup ("%% spline");
- Show_boxes[li++] = strdup ("gsave 1 0 0 setrgbcolor newpath");
+ Show_boxes[li++] = gv_strdup("%%!");
+ Show_boxes[li++] = gv_strdup("%% spline");
+ Show_boxes[li++] = gv_strdup("gsave 1 0 0 setrgbcolor newpath");
for (i = 0; i < spl.pn; i++) {
agxbuf buf = {0};
agxbprint(&buf, "%f %f %s", spl.ps[i].x, spl.ps[i].y,
i == 0 ? "moveto" : (i % 3 == 0 ? "curveto" : ""));
Show_boxes[li++] = agxbdisown(&buf);
}
- Show_boxes[li++] = strdup ("stroke grestore");
+ Show_boxes[li++] = gv_strdup("stroke grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;
}
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
li = Show_cnt+1;
- Show_boxes[li++] = strdup ("%%!");
- Show_boxes[li++] = strdup ("%% line");
- Show_boxes[li++] = strdup ("gsave 0 0 1 setrgbcolor newpath");
+ Show_boxes[li++] = gv_strdup("%%!");
+ Show_boxes[li++] = gv_strdup("%% line");
+ Show_boxes[li++] = gv_strdup("gsave 0 0 1 setrgbcolor newpath");
for (i = 0; i < pl.pn; i++) {
agxbuf buf = {0};
agxbprint(&buf, "%f %f %s", pl.ps[i].x, pl.ps[i].y,
i == 0 ? "moveto" : "lineto");
Show_boxes[li++] = agxbdisown(&buf);
}
- Show_boxes[li++] = strdup ("stroke grestore");
+ Show_boxes[li++] = gv_strdup("stroke grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;
}
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
li = Show_cnt+1;
- Show_boxes[li++] = strdup ("%% poly list");
- Show_boxes[li++] = strdup ("gsave 0 1 0 setrgbcolor");
+ Show_boxes[li++] = gv_strdup("%% poly list");
+ Show_boxes[li++] = gv_strdup("gsave 0 1 0 setrgbcolor");
for (bi = 0; bi < p.pn; bi++) {
tl.x = (int)p.ps[bi].x;
tl.y = (int)p.ps[bi].y;
agxbprint(&buf, "%s%d %d %d %d makevec", pfx, tl.x, tl.y, hd.x, hd.y);
Show_boxes[li++] = agxbdisown(&buf);
}
- Show_boxes[li++] = strdup ("grestore");
+ Show_boxes[li++] = gv_strdup("grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
li = Show_cnt+1;
- Show_boxes[li++] = strdup ("%% box list");
- Show_boxes[li++] = strdup ("gsave 0 1 0 setrgbcolor");
+ Show_boxes[li++] = gv_strdup("%% box list");
+ Show_boxes[li++] = gv_strdup("gsave 0 1 0 setrgbcolor");
for (bi = 0; bi < boxn; bi++) {
ll = boxes[bi].LL, ur = boxes[bi].UR;
agxbuf buf = {0};
Show_boxes[li++] = agxbdisown(&buf);
agxbprint(&buf, "%.0f %.0f lineto", ur.x, ll.y);
Show_boxes[li++] = agxbdisown(&buf);
- Show_boxes[li++] = strdup ("closepath stroke");
+ Show_boxes[li++] = gv_strdup("closepath stroke");
}
- Show_boxes[li++] = strdup ("grestore");
+ Show_boxes[li++] = gv_strdup("grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
if (begin)
- Show_boxes[1+Show_cnt] = strdup ("dbgstart");
+ Show_boxes[1+Show_cnt] = gv_strdup("dbgstart");
else
- Show_boxes[1+Show_cnt] = strdup ("grestore");
+ Show_boxes[1+Show_cnt] = gv_strdup("grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;
}
#include <math.h>
#include <cgraph/agxbuf.h>
+#include <cgraph/alloc.h>
#include <common/render.h>
#include <cgraph/unreachable.h>
#include <stdbool.h>
Show_boxes = ALLOC(newcnt+2,Show_boxes,char*);
li = Show_cnt+1;
- Show_boxes[li++] = strdup ("%% self list");
- Show_boxes[li++] = strdup ("dbgstart");
+ Show_boxes[li++] = gv_strdup("%% self list");
+ Show_boxes[li++] = gv_strdup("dbgstart");
for (bi = 0; bi < pn; bi++) {
agxbuf buf = {0};
agxbprint(&buf, "%.5g %.5g point", ps[bi].x, ps[bi].y);
Show_boxes[li++] = agxbdisown(&buf);
}
- Show_boxes[li++] = strdup ("grestore");
+ Show_boxes[li++] = gv_strdup("grestore");
Show_cnt = newcnt;
Show_boxes[Show_cnt+1] = NULL;