]> granicus.if.org Git - graphviz/commitdiff
fix unresolved symbols in MacOS builds
authorellson <devnull@localhost>
Wed, 24 May 2006 03:12:52 +0000 (03:12 +0000)
committerellson <devnull@localhost>
Wed, 24 May 2006 03:12:52 +0000 (03:12 +0000)
lib/common/fontmetrics.c
lib/common/gdgen.c
lib/common/input.c
lib/gvc/gvcint.h
lib/gvc/gvcjob.h
lib/gvc/gvrender.c
plugin/gd/gvrender_gd.c

index 57df6a49ed572be836d49cd346fada5f8c9264a4..9d370c50df0b6fa80d169d568c22c1065c713a67 100644 (file)
@@ -175,7 +175,7 @@ pointf textsize(graph_t *g, textline_t * textline, char *fontname, double fontsi
 
     if (Verbose) {
        if (emit_once(fontname)) {
-           fprintf(stderr, "%s: fontname=%s fontpath=%s\n", CmdName,
+           fprintf(stderr, "%s: fontname=%s fontpath=%s\n", GD_gvc(g)->cmdname,
                    fontname, fontpath);
        }
     }
index 7dac5d8985c66365b0db11a8013fbb5a4fbfa28e..a640a55b1abc87f6e2ab6b401755e0cbec6467b1 100644 (file)
@@ -248,12 +248,12 @@ static void gd_begin_graph(GVC_t * gvc, graph_t * g, box bb, point pb)
         if (truecolor_p) {
            if (Verbose)
                fprintf(stderr, "%s: allocating a %dK TrueColor GD image\n",
-                       CmdName, ROUND(Viewport.x * Viewport.y * 4 / 1024.));
+                       gvc->cmdname, ROUND(Viewport.x * Viewport.y * 4 / 1024.));
            im = gdImageCreateTrueColor(Viewport.x, Viewport.y);
         } else {
            if (Verbose)
                fprintf(stderr, "%s: allocating a %dK PaletteColor GD image\n",
-                       CmdName, ROUND(Viewport.x * Viewport.y / 1024.));
+                       gvc->cmdname, ROUND(Viewport.x * Viewport.y / 1024.));
            im = gdImageCreate(Viewport.x, Viewport.y);
         }
         if (!im) {
index b5864168bef3b8549fa931123fe54e32a775fb59..be6276657596e91b0880e67e55a94fb9dcca6a07 100644 (file)
@@ -161,8 +161,8 @@ void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
     if (Config)
        exit (0);
 
-    CmdName = dotneato_basename(argv[0]);
-    i = gvlayout_select(gvc, CmdName);
+    CmdName = gvc->cmdname = dotneato_basename(argv[0]);
+    i = gvlayout_select(gvc, gvc->cmdname);
     if (i == NO_SUPPORT)
        gvlayout_select(gvc, "dot");
 
@@ -273,9 +273,10 @@ void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                    PSinputscale = POINTS_PER_INCH;
                break;
            case 'v':
-               Verbose = 1;
+               gvc->verbose = 1;
                if (isdigit(*(unsigned char *) rest))
-                   Verbose = atoi(rest);
+                   gvc->verbose = atoi(rest);
+               Verbose = gvc->verbose;
                break;
            case 'x':
                Reduce = TRUE;
@@ -287,7 +288,7 @@ void dotneato_args_initialize(GVC_t * gvc, int argc, char **argv)
                dotneato_usage(0);
                break;
            default:
-               fprintf(stderr, "%s: option -%c unrecognized\n\n", CmdName,
+               fprintf(stderr, "%s: option -%c unrecognized\n\n", gvc->cmdname,
                        c);
                dotneato_usage(1);
            }
@@ -374,7 +375,7 @@ graph_t *gvNextInputGraph(GVC_t *gvc)
            }
            else {
                while ((fn = gvc->input_filenames[fidx++]) && !(fp = fopen(fn, "r")))  {
-                   agerr(AGERR, "%s: can't open %s\n", CmdName, fn);
+                   agerr(AGERR, "%s: can't open %s\n", gvc->cmdname, fn);
                    graphviz_errors++;
                }
            }
index 702b71d135a1c78e21fd795ba6e486c4bf1e24e7..96db0a1f8e665234cc1260919c3d3c3fbf02ecf2 100644 (file)
@@ -75,6 +75,8 @@ extern "C" {
        /* gvNEWcontext() */
        char *user;
        char **info;
+       char *cmdname;
+       int verbose;
 
        char *config_path;
        bool config_found;
index 6c0fad547c5c2293a139502e40d200295f72a7e9..152d14a6e421984619473dcc2ce3391b6a31cf5c 100644 (file)
@@ -136,6 +136,8 @@ extern "C" {
        GVJ_t *next;            /* linked list of jobs */
        GVJ_t *next_active;     /* linked list of active jobs (e.g. multiple windows) */
 
+       char *cmdname;
+       int verbose;
        char *input_filename;
        int graph_index;
 
index 4eaa8e82f1a76964a6eceedbb085b12fa4497c20..74c9e99f2228d1303549ff999c8fce9171c6c230 100644 (file)
@@ -134,6 +134,8 @@ void gvrender_begin_job(GVJ_t * job)
         job->input_filename = NULL;
        job->graph_index = 0;
     }
+    job->cmdname = gvc->cmdname;
+    job->verbose = gvc->verbose;
     job->layout_type = gvc->layout.type;
     job->bb = gvc->bb;
     if (gvre) {
index 6ba30174e7ddd78ee1d091562c59f3de49a63516..7cff7e0ea3410ad73c76c2a01ca712ef1bf63b6d 100644 (file)
@@ -36,7 +36,6 @@ typedef enum { FORMAT_GD, FORMAT_GD2, FORMAT_GIF, FORMAT_JPEG, FORMAT_PNG,
        FORMAT_WBMP, FORMAT_XBM, } format_type;
 
 extern int mapbool(char *);
-extern pointf Bezier(pointf *, int, double, pointf *, pointf *);
 extern char *safefile(char *shapefilename);
 
 #define BEZIERSUBDIVISION 10
@@ -48,6 +47,47 @@ extern char *safefile(char *shapefilename);
 
 static Dict_t *ImageDict;
 
+/* from Glassner's Graphics Gems */
+#define W_DEGREE 5
+
+/*
+ *  Bezier :
+ *      Evaluate a Bezier curve at a particular parameter value
+ *      Fill in control points for resulting sub-curves if "Left" and
+ *      "Right" are non-null.
+ *
+ */
+static pointf Bezier(pointf * V, int degree, double t, pointf * Left,
+              pointf * Right)
+{
+    int i, j;                   /* Index variables      */
+    pointf Vtemp[W_DEGREE + 1][W_DEGREE + 1];
+
+    /* Copy control points  */
+    for (j = 0; j <= degree; j++) {
+        Vtemp[0][j] = V[j];
+    }
+
+    /* Triangle computation */
+    for (i = 1; i <= degree; i++) {
+        for (j = 0; j <= degree - i; j++) {
+            Vtemp[i][j].x =
+                (1.0 - t) * Vtemp[i - 1][j].x + t * Vtemp[i - 1][j + 1].x;
+            Vtemp[i][j].y =
+                (1.0 - t) * Vtemp[i - 1][j].y + t * Vtemp[i - 1][j + 1].y;
+        }
+    }
+
+    if (Left != NULL)
+        for (j = 0; j <= degree; j++)
+            Left[j] = Vtemp[j][0];
+    if (Right != NULL)
+        for (j = 0; j <= degree; j++)
+            Right[j] = Vtemp[degree - j][j];
+
+    return (Vtemp[degree][0]);
+}
+
 static void gdgen_resolve_color(GVJ_t * job, gvcolor_t * color)
 {
     gdImagePtr im = (gdImagePtr) job->surface;
@@ -93,32 +133,35 @@ static void gdgen_begin_graph(GVJ_t * job, char *graphname)
 //     truecolor_p = TRUE;     /* force truecolor */
 
     if (job->external_surface) {
-       if (Verbose)
-           fprintf(stderr, "%s: using existing GD image\n", CmdName);
+       if (job->verbose)
+           fprintf(stderr, "%s: using existing GD image\n", job->cmdname);
        im = (gdImagePtr) (job->output_file);
     } else {
        /* device size with margins all around */
        width = ROUND(job->boundingBox.UR.x + job->boundingBox.LL.x);
        height = ROUND(job->boundingBox.UR.y + job->boundingBox.LL.y);
        if (truecolor_p) {
-           if (Verbose)
+           if (job->verbose)
                fprintf(stderr,
                        "%s: allocating a %dK TrueColor GD image\n",
-                       CmdName,
+                       job->cmdname,
                        ROUND(width * height * 4 / 1024.));
            im = gdImageCreateTrueColor(width, height);
        } else {
-           if (Verbose)
+           if (job->verbose)
                fprintf(stderr,
                        "%s: allocating a %dK PaletteColor GD image\n",
-                       CmdName, ROUND(width * height / 1024.));
+                       job->cmdname, ROUND(width * height / 1024.));
            im = gdImageCreate(width, height);
        }
     }
     job->surface = (void *) im;
 
     if (!im) {
+#if 0
+/* FIXME - error function */
        agerr(AGERR, "gdImageCreate returned NULL. Malloc problem?\n");
+#endif
        return;
     }