/* Copyright (C) 2001-2021 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution. Refer to licensing information at http://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information. */ /* plmain.c */ /* Main program command-line interpreter for PCL interpreters */ #include "std.h" #include "gserrors.h" #include "ctype_.h" #include "string_.h" #include /* atof */ #include "assert_.h" #include "gdebug.h" #include "gscdefs.h" #include "gsio.h" #include "gstypes.h" #include "gserrors.h" #include "gsmemory.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 "gxdevsop.h" /* for gxdso_* */ #include "gxclpage.h" #include "gdevprn.h" #include "gsparam.h" #include "gslib.h" #include "pjtop.h" #include "plparse.h" #include "plmain.h" #include "pltop.h" #include "plapi.h" #include "gslibctx.h" #include "gsicc_manage.h" #include "gxiodev.h" #include "stream.h" #include "strmio.h" #include "gp.h" /* includes for the display device */ #include "gdevdevn.h" #include "gsequivc.h" #include "gdevdsp.h" #include "gdevdsp2.h" #define OMIT_SAVED_PAGES #define OMIT_SAVED_PAGES_TEST /* if we are not doing saved_pages, omit saved-pages-test mode as well */ #ifdef OMIT_SAVED_PAGES # ifndef OMIT_SAVED_PAGES_TEST # define OMIT_SAVED_PAGES_TEST # endif #endif /* Include the extern for the device list. */ extern_gs_lib_device_list(); /* 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 *pdl_implementations[]; /* zero-terminated list */ #define _STRING_IT(s) #s #define STRING_IT(s) _STRING_IT(s) #define PJL_VERSION_STRING STRING_IT(PJLVERSION) /* 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\ -Hxxx -dNOCACHE\n\ -sOutputFile= (-s