diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-06-26 21:08:37 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-06-26 21:11:42 -0700 |
commit | 74003cdc55c5ca091c0804328c3d140b2b38baa4 (patch) | |
tree | 098b18eb22ca3b33119f70376ad8dfa0bc48ead7 /dsimple.c | |
parent | 36c17f9c944955968450da73decbbb4def72a115 (diff) |
Remove unused Xprint support
BUILD_PRINTSUPPORT has never been defined in autoconf/automake builds,
so it hasn't been built since 6.9
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'dsimple.c')
-rw-r--r-- | dsimple.c | 95 |
1 files changed, 6 insertions, 89 deletions
@@ -41,9 +41,6 @@ from The Open Group. * Written by Mark Lillibridge. Last updated 7/1/87 */ -#ifdef BUILD_PRINTSUPPORT -#include <X11/XprintUtil/xprintutil.h> -#endif /* BUILD_PRINTSUPPORT */ #include "dsimple.h" /* @@ -61,10 +58,6 @@ 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 *); @@ -136,42 +129,6 @@ Get_Display_Name(int *pargc/* MODIFIED */, char **argv/* MODIFIED */) } -#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(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<argc) - *pargv++ = argv[i++]; - break; - } - *pargv++ = arg; - } - - *pargv = NULL; - return (printername); -} -#endif /* BUILD_PRINTSUPPORT */ - /* * Open_Display: Routine to open a display with correct error handling. * Does not require dpy or screen defined on entry. @@ -202,39 +159,10 @@ Open_Display(char *display_name) void Setup_Display_And_Screen(int *argc/* MODIFIED */, char **argv/* MODIFIED */) { - char *displayname = NULL; -#ifdef BUILD_PRINTSUPPORT - char *printername = NULL; -#endif - - displayname = Get_Display_Name(argc, argv); -#ifdef BUILD_PRINTSUPPORT - printername = Get_Printer_Name(argc, argv); - - if (displayname && printername) { - fprintf (stderr, "%s: you cannot specify -printer (-p) and -display (-d) at the same time.\n", - program_name); - usage (); - } - - if (printername) { - printer_output = True; - - if (XpuGetPrinter(printername, &dpy, &pcontext) != 1) { - fprintf(stderr, "%s: Cannot open printer '%s'.\n", program_name, printername); - exit(EXIT_FAILURE); - } - - screen = XScreenNumberOfScreen(XpGetScreenOfContext(dpy, pcontext)); - } - else -#endif /* BUILD_PRINTSUPPORT */ - { - printer_output = False; - - dpy = Open_Display (displayname); - screen = XDefaultScreen(dpy); - } + char *displayname = Get_Display_Name(argc, argv); + + dpy = Open_Display (displayname); + screen = XDefaultScreen(dpy); } /* @@ -245,19 +173,8 @@ void Close_Display(void) if (dpy == NULL) return; -#ifdef BUILD_PRINTSUPPORT - if (printer_output) { - XpuClosePrinterDisplay(dpy, pcontext); - dpy = NULL; - pcontext = None; - printer_output = False; - } - else -#endif /* BUILD_PRINTSUPPORT */ - { - XCloseDisplay(dpy); - dpy = NULL; - } + XCloseDisplay(dpy); + dpy = NULL; } |