From 77caf97b306222a879529305bdf1c15f36e15ecc Mon Sep 17 00:00:00 2001 From: erg Date: Thu, 7 Dec 2006 22:49:36 +0000 Subject: [PATCH] Re-do some .h files to limit exposure of internal values, .h files, and dependencies on config.h; return to a simple, concrete boolean type --- lib/gvc/gvloadimage.c | 2 +- lib/gvc/gvplugin.c | 8 ++++---- lib/gvc/gvplugin_loadimage.h | 2 +- lib/gvc/gvrender.c | 12 ++++++------ lib/gvc/gvtextlayout.c | 2 +- lib/gvc/gvusershape.c | 20 ++++++++++---------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/gvc/gvloadimage.c b/lib/gvc/gvloadimage.c index 50dbd5953..abb112a8e 100644 --- a/lib/gvc/gvloadimage.c +++ b/lib/gvc/gvloadimage.c @@ -49,7 +49,7 @@ int gvloadimage_select(GVJ_t * job, char *str) return NO_SUPPORT; } -void gvloadimage(GVJ_t * job, usershape_t *us, boxf b, bool filled, char *target) +void gvloadimage(GVJ_t * job, usershape_t *us, boxf b, boolean filled, char *target) { gvloadimage_engine_t *gvli; char type[SMALLBUF]; diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index af3cb452f..6ccac9292 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -31,7 +31,7 @@ #include "gvcint.h" #include "gvcproc.h" -extern const bool Demand_Loading; +extern const int Demand_Loading; /* * Define an apis array of name strings using an enumerated api_t as index. @@ -65,7 +65,7 @@ char *gvplugin_api_name(api_t api) /* install a plugin description into the list of available plugins */ /* list is alpha sorted by type, then quality sorted within the type, then, if qualities are the same, last install wins */ -bool gvplugin_install(GVC_t * gvc, api_t api, +boolean gvplugin_install(GVC_t * gvc, api_t api, char *typestr, int quality, char *packagename, char *path, gvplugin_installed_t * typeptr) { @@ -262,7 +262,7 @@ gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, char *str) /* string buffer management - FIXME - must have 20 solutions for this same thing */ -static const char *append_buf(char sep, char *str, bool new) +static const char *append_buf(char sep, char *str, boolean new) { static char *buf; static int bufsz, pos; @@ -289,7 +289,7 @@ const char *gvplugin_list(GVC_t * gvc, api_t api, char *str) gvplugin_available_t **pnext, **plugin, **pprev; const char *buf = NULL; char *s, *p, *typestr_last; - bool new = TRUE; + boolean new = TRUE; /* check for valid apis[] index */ if (api < 0) diff --git a/lib/gvc/gvplugin_loadimage.h b/lib/gvc/gvplugin_loadimage.h index 5f1c9026b..8a2e6c636 100644 --- a/lib/gvc/gvplugin_loadimage.h +++ b/lib/gvc/gvplugin_loadimage.h @@ -26,7 +26,7 @@ extern "C" { #endif struct gvloadimage_engine_s { - void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, bool filled); + void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, boolean filled); }; #ifdef __cplusplus diff --git a/lib/gvc/gvrender.c b/lib/gvc/gvrender.c index 8585695ee..17a0a0755 100644 --- a/lib/gvc/gvrender.c +++ b/lib/gvc/gvrender.c @@ -28,10 +28,10 @@ #include "memory.h" #include "const.h" #include "macros.h" +#include "colorprocs.h" #include "gvplugin_render.h" #include "graph.h" #include "gvcint.h" -#include "colorprocs.h" #include "geom.h" #include "geomprocs.h" #include "gvcproc.h" @@ -737,7 +737,7 @@ void gvrender_set_style(GVJ_t * job, char **s) #endif } -void gvrender_ellipse(GVJ_t * job, pointf pf, double rx, double ry, bool filled) +void gvrender_ellipse(GVJ_t * job, pointf pf, double rx, double ry, boolean filled) { gvrender_engine_t *gvre = job->render.engine; @@ -770,7 +770,7 @@ void gvrender_ellipse(GVJ_t * job, pointf pf, double rx, double ry, bool filled) #endif } -void gvrender_polygon(GVJ_t * job, pointf * af, int n, bool filled) +void gvrender_polygon(GVJ_t * job, pointf * af, int n, boolean filled) { gvrender_engine_t *gvre = job->render.engine; @@ -805,7 +805,7 @@ void gvrender_polygon(GVJ_t * job, pointf * af, int n, bool filled) #endif } -void gvrender_box(GVJ_t * job, boxf B, bool filled) +void gvrender_box(GVJ_t * job, boxf B, boolean filled) { pointf A[4]; @@ -820,7 +820,7 @@ void gvrender_box(GVJ_t * job, boxf B, bool filled) } void gvrender_beziercurve(GVJ_t * job, pointf * af, int n, - int arrow_at_start, int arrow_at_end, bool filled) + int arrow_at_start, int arrow_at_end, boolean filled) { gvrender_engine_t *gvre = job->render.engine; @@ -911,7 +911,7 @@ void gvrender_comment(GVJ_t * job, char *str) #endif } -void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n, bool filled) +void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n, boolean filled) { gvrender_engine_t *gvre = job->render.engine; usershape_t *us; diff --git a/lib/gvc/gvtextlayout.c b/lib/gvc/gvtextlayout.c index a1a4292eb..eb6b5e6fc 100644 --- a/lib/gvc/gvtextlayout.c +++ b/lib/gvc/gvtextlayout.c @@ -41,7 +41,7 @@ int gvtextlayout_select(GVC_t * gvc) return NO_SUPPORT; } -bool gvtextlayout(GVC_t *gvc, textpara_t *para, char **fontpath) +boolean gvtextlayout(GVC_t *gvc, textpara_t *para, char **fontpath) { gvtextlayout_engine_t *gvte = gvc->textlayout.engine; diff --git a/lib/gvc/gvusershape.c b/lib/gvc/gvusershape.c index 016e2ae43..5290caf4c 100644 --- a/lib/gvc/gvusershape.c +++ b/lib/gvc/gvusershape.c @@ -76,7 +76,7 @@ static int imagetype (usershape_t *us) return FT_NULL; } -static bool get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val) +static boolean get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val) { int ch, i; @@ -84,13 +84,13 @@ static bool get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val) for (i = 0; i < sz; i++) { ch = fgetc(f); if (feof(f)) - return false; + return FALSE; *val |= (ch << 8*i); } - return true; + return TRUE; } -static bool get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val) +static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val) { int ch, i; @@ -98,11 +98,11 @@ static bool get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val) for (i = 0; i < sz; i++) { ch = fgetc(f); if (feof(f)) - return false; + return FALSE; *val <<= 8; *val |= ch; } - return true; + return TRUE; } static void png_size (usershape_t *us) @@ -160,7 +160,7 @@ static void jpeg_size (usershape_t *us) { }; us->dpi = DEFAULT_DPI; - while (true) { + while (TRUE) { /* Now we must be at a 0xff or at a series of 0xff's. * If that is not the case, or if we're at EOF, then there's * a parsing error. @@ -221,15 +221,15 @@ static void jpeg_size (usershape_t *us) { static void ps_size (usershape_t *us) { char line[BUFSIZ]; - bool saw_bb; + boolean saw_bb; int lx, ly, ux, uy; us->dpi = POINTS_PER_INCH; fseek(us->f, 0, SEEK_SET); - saw_bb = false; + saw_bb = FALSE; while (fgets(line, sizeof(line), us->f)) { if (sscanf (line, "%%%%BoundingBox: %d %d %d %d", &lx, &ly, &ux, &uy) == 4) { - saw_bb = true; + saw_bb = TRUE; break; } } -- 2.40.0