/* Portions Copyright (C) 2001 artofcode LLC. Portions Copyright (C) 1996, 2001 Artifex Software Inc. Portions Copyright (C) 1988, 2000 Aladdin Enterprises. This software is based in part on the work of the Independent JPEG Group. All Rights Reserved. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at http://www.artifex.com/ or contact Artifex Software, Inc., 101 Lucas Valley Road #110, San Rafael, CA 94903, (415)492-9861, for further information. */ /*$Id$ */ /* plmain.c */ /* Main program command-line interpreter for PCL interpreters */ #include "string_.h" #include "gdebug.h" #include "gscdefs.h" #include "gsio.h" #include "gstypes.h" #include "gserrors.h" #include "gsmemory.h" #include "plalloc.h" #include "gsmalloc.h" #include "gsmchunk.h" #include "gsstruct.h" #include "gxalloc.h" #include "gsalloc.h" #include "gsargs.h" #include "gp.h" #include "gsdevice.h" #include "gxdevice.h" #include "gsparam.h" #include "gslib.h" #include "pjtop.h" #include "plparse.h" #include "plplatf.h" #include "plmain.h" #include "pltop.h" #include "pltoputl.h" #include "plapi.h" #include "gslibctx.h" /* includes for the display device */ #include "gdevdevn.h" #include "gsequivc.h" #include "gdevdsp.h" #include "gdevdsp2.h" #if defined(DEBUG) && defined(ALLOW_VD_TRACE) #include "dwtrace.h" #include "vdtrace.h" #endif /* * Define bookeeping for interpreters and devices */ typedef struct pl_main_universe_s { gs_memory_t *mem; /* mem alloc to dealloc devices */ pl_interp_implementation_t const * const * pdl_implementation; /* implementations to choose from */ pl_interp_instance_t * pdl_instance_array[100]; /* parallel to pdl_implementation */ pl_interp_t * pdl_interp_array[100]; /* parallel to pdl_implementation */ pl_interp_implementation_t const *curr_implementation; pl_interp_instance_t * curr_instance; gx_device *curr_device; } pl_main_universe_t; /* Include the extern for the device list. */ extern_gs_lib_device_list(); /* Extern for PJL */ extern pl_interp_implementation_t pjl_implementation; /* Extern for PDL(s): currently in one of: plimpl.c (XL & PCL), */ /* pcimpl.c (PCL only), or pximpl (XL only) depending on make configuration.*/ extern pl_interp_implementation_t const * const pdl_implementation[]; /* zero-terminated list */ /* Define the usage message. */ static const char *pl_usage = "\ Usage: %s [option* file]+...\n\ Options: -dNOPAUSE -E[#] -h -L -K -l -Z...\n\ -sDEVICE= -gx -r[x] -d{First|Last}Page=<#>\n\ -sOutputFile= (-s