From 459655b06ba8e3a15e52c9e9c0e8fd936a5e2673 Mon Sep 17 00:00:00 2001 From: sabetts Date: Fri, 15 Sep 2000 04:27:08 +0000 Subject: Added a standard error reporting function PRINT_ERROR and a standard debug output function PRINT_DEBUG. --- src/main.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 13 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 313d7fc..39856f7 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "ratpoison.h" @@ -49,6 +50,12 @@ static XFontStruct *font; char **myargv; +/* Command line options */ +static struct option ratpoison_longopts[] = { {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'v'}, + {0, 0, 0, 0} }; +static char ratpoison_opts[] = "hv"; + void sighandler () { @@ -72,9 +79,7 @@ alrm_handler () { int i; -#ifdef DEBUG - printf ("alarm recieved.\n"); -#endif + PRINT_DEBUG ("alarm recieved.\n"); /* FIXME: should only hide 1 bar, but we hide them all. */ for (i=0; idef_cmap, BAR_FG_COLOR, &fg_color, &junk)) { - fprintf (stderr, "Unknown color '%s'\n", BAR_FG_COLOR); + fprintf (stderr, "ratpoison: Unknown color '%s'\n", BAR_FG_COLOR); } if (!XAllocNamedColor (dpy, s->def_cmap, BAR_BG_COLOR, &bg_color, &junk)) { - fprintf (stderr, "Unknown color '%s'\n", BAR_BG_COLOR); + fprintf (stderr, "ratpoison: Unknown color '%s'\n", BAR_BG_COLOR); } if (!XAllocNamedColor (dpy, s->def_cmap, BAR_BOLD_COLOR, &bold_color, &junk)) { - fprintf (stderr, "Unknown color '%s'\n", BAR_BOLD_COLOR); + fprintf (stderr, "ratpoison: Unknown color '%s'\n", BAR_BOLD_COLOR); } /* Setup the GC for drawing the font. */ -- cgit v1.2.3