From 11768cef4d667c23e1ede7f62449204e96a8bcec Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Wed, 27 Aug 2008 19:30:05 +0000 Subject: xwininfo 1.0.4 --- app/xwininfo/dsimple.c | 339 ++++--------------------------------------------- 1 file changed, 28 insertions(+), 311 deletions(-) (limited to 'app/xwininfo/dsimple.c') diff --git a/app/xwininfo/dsimple.c b/app/xwininfo/dsimple.c index c84ac3b51..171795b79 100644 --- a/app/xwininfo/dsimple.c +++ b/app/xwininfo/dsimple.c @@ -41,13 +41,11 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ -#ifdef BUILD_PRINTSUPPORT -#include -#endif /* BUILD_PRINTSUPPORT */ +#include "clientwin.h" #include "dsimple.h" /* - * Just_display: A group of routines designed to make the writting of simple + * Just_display: A group of routines designed to make the writing of simple * X11 applications which open a display but do not open * any windows much faster and easier. Unless a routine says * otherwise, it may be assumed to require program_name, dpy, @@ -61,54 +59,15 @@ from The Open Group. char *program_name = "unknown_program"; Display *dpy = NULL; int screen = 0; -Bool printer_output = False; /* Video or printer output ? */ -#ifdef BUILD_PRINTSUPPORT -XPContext pcontext = None; -#endif /* BUILD_PRINTSUPPORT */ - -static void _bitmap_error(int, char *); - -/* - * Malloc: like malloc but handles out of memory using Fatal_Error. - */ -char *Malloc(size) - unsigned size; -{ - char *data; - - if (!(data = malloc(size))) - Fatal_Error("Out of memory!"); - - return(data); -} - - -/* - * Realloc: like Malloc except for realloc, handles NULL using Malloc. - */ -char *Realloc(ptr, size) - char *ptr; - int size; -{ - char *new_ptr; - - if (!ptr) - return(Malloc(size)); - - if (!(new_ptr = realloc(ptr, size))) - Fatal_Error("Out of memory!"); - - return(new_ptr); -} /* * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char *Get_Display_Name( + int *pargc, /* MODIFIED */ + char **argv) /* MODIFIED */ { int argc = *pargc; char **pargv = argv+1; @@ -138,49 +97,12 @@ char *Get_Display_Name(pargc, argv) } -#ifdef BUILD_PRINTSUPPORT -/* - * Get_Printer_Name (argc, argv) Look for -printer, -p, - * If found, remove it from command line. Don't go past a lone -. - */ -char *Get_Printer_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ -{ - int argc = *pargc; - char **pargv = argv+1; - char *printername = NULL; - int i; - - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - - if (!strcmp (arg, "-printer") || !strcmp (arg, "-p")) { - if (++i >= argc) usage (); - - printername = argv[i]; - *pargc -= 2; - continue; - } - if (!strcmp(arg,"-")) { - while (i