diff options
author | Greg Hudson <ghudson@mit.edu> | 1997-09-14 18:12:16 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 1997-09-14 18:12:16 +0000 |
commit | ce6018836c422c86a729ba39fe5433ec11b87b02 (patch) | |
tree | cc2e6601489384fcf41e0565e8906822897b46c8 /zwgc/X_driver.c | |
parent | ac16f380e349fa39ec7e26bccb5456cb300006a5 (diff) |
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
Diffstat (limited to 'zwgc/X_driver.c')
-rw-r--r-- | zwgc/X_driver.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/zwgc/X_driver.c b/zwgc/X_driver.c index 96aa2c1..ba118b7 100644 --- a/zwgc/X_driver.c +++ b/zwgc/X_driver.c @@ -12,8 +12,10 @@ * "mit-copyright.h". */ +#include <sysdep.h> + #if (!defined(lint) && !defined(SABER)) -static char rcsid_X_driver_c[] = "$Id$"; +static const char rcsid_X_driver_c[] = "$Id$"; #endif #include <zephyr/mit-copyright.h> @@ -24,7 +26,8 @@ static char rcsid_X_driver_c[] = "$Id$"; /* */ /****************************************************************************/ -#include <stdio.h> +#ifndef X_DISPLAY_MISSING + #include "X_driver.h" #include <X11/Xresource.h> #include "new_memory.h" @@ -34,7 +37,7 @@ static char rcsid_X_driver_c[] = "$Id$"; #include "error.h" #include "X_gram.h" #include "xselect.h" -#include "ulong_dictionary.h" +#include "unsigned_long_dictionary.h" char *app_instance; @@ -54,14 +57,6 @@ Display *dpy = NULL; * */ -#ifndef APPDEFDATABASE -#define APPDEFDATABASE "/usr/athena/lib/zephyr/zwgc_resources" -#endif - -/* - * - */ - #ifndef APPNAME #define APPNAME "zwgc" #endif @@ -158,7 +153,7 @@ int get_bool_resource(name, class, default_value) return(result); } -static ulong_dictionary color_dict = NULL; +static unsigned_long_dictionary color_dict = NULL; /* Requires: name points to color name or hex string. name must be free'd * eventually by the caller. @@ -175,14 +170,14 @@ unsigned long x_string_to_color(name,def) char *name; unsigned long def; { - ulong_dictionary_binding *binding; + unsigned_long_dictionary_binding *binding; int exists; XColor xc; if (name == NULL) return(def); - binding = ulong_dictionary_Define(color_dict,name,&exists); + binding = unsigned_long_dictionary_Define(color_dict,name,&exists); if (exists) { return((unsigned long) binding->value); @@ -192,7 +187,7 @@ unsigned long x_string_to_color(name,def) if (XAllocColor(dpy, DefaultColormapOfScreen(DefaultScreenOfDisplay(dpy)), &xc)) { - binding->value = (ulong) xc.pixel; + binding->value = (unsigned long) xc.pixel; return(xc.pixel); } else { ERROR2("Error in XAllocColor on \"%s\": using default color\n", @@ -202,7 +197,7 @@ unsigned long x_string_to_color(name,def) ERROR2("Error in XParseColor on \"%s\": using default color\n", name); } - ulong_dictionary_Delete(color_dict,binding); + unsigned_long_dictionary_Delete(color_dict,binding); return(def); } /*NOTREACHED*/ @@ -248,6 +243,7 @@ int open_display_and_load_resources(pargc, argv) { XrmDatabase temp_db1, temp_db2, temp_db3; char *filename, *res, *xdef; + char dbasename[128]; extern char *getenv(); /* Initialize X resource manager: */ @@ -269,7 +265,8 @@ int open_display_and_load_resources(pargc, argv) return(1); /* Read in our application-specific resources: */ - temp_db1 = XrmGetFileDatabase(APPDEFDATABASE); + sprintf(dbasename, "%s/zwgc_resources", DATADIR); + temp_db1 = XrmGetFileDatabase(dbasename); /* * Get resources from the just opened display: @@ -371,7 +368,7 @@ int X_driver_init(drivername, notfirst, pargc, argv) app_instance=string_Copy(temp?temp+1:argv[0]); - color_dict = ulong_dictionary_Create(37); + color_dict = unsigned_long_dictionary_Create(37); xshowinit(); x_gram_init(dpy); @@ -408,3 +405,6 @@ char *X_driver(text) free_desc(desc); return(NULL); } + +#endif /* X_DISPLAY_MISSING */ + |