[gs-commits] rev 11772 - trunk/ghostpdl/pl
henrys at ghostscript.com
henrys at ghostscript.com
Thu Oct 7 14:54:23 UTC 2010
Author: henrys
Date: 2010-10-07 14:54:23 +0000 (Thu, 07 Oct 2010)
New Revision: 11772
Modified:
trunk/ghostpdl/pl/plmain.c
trunk/ghostpdl/pl/plmain.h
Log:
Remove and rename options that conflict with ghostscript's option
processing, add -o shortcut and a warning cleanup for the effected
files.
Removes the pcl page count (-C) whose functionality overlaps with
simply using bbox device or other methods. Remove the leak check
option (-l) which is not relevant to the chunk allocator, we use -l
now to specify the PCL personality getting rid of -P which conflicts
with ghostscript. Uppercase 'L' is reserved to select the Language
(PCL, PCLXL, XPS etc). Now using the option -o [file] is equivalent
to -sOutputFile=[file] -dNOPAUSE consistent with ghostscript argument
processing.
Modified: trunk/ghostpdl/pl/plmain.c
===================================================================
--- trunk/ghostpdl/pl/plmain.c 2010-10-07 13:59:49 UTC (rev 11771)
+++ trunk/ghostpdl/pl/plmain.c 2010-10-07 14:54:23 UTC (rev 11772)
@@ -74,7 +74,7 @@
/* Define the usage message. */
static const char *pl_usage = "\
Usage: %s [option* file]+...\n\
-Options: -dNOPAUSE -E[#] -h -C -L<PCL|PCLXL> -K<maxK> -P<PCL5C|PCL5E|RTL> -Z...\n\
+Options: -dNOPAUSE -E[#] -h -L<PCL|PCLXL> -K<maxK> -l<PCL5C|PCL5E|RTL> -Z...\n\
-sDEVICE=<dev> -g<W>x<H> -r<X>[x<Y>] -d{First|Last}Page=<#>\n\
-sOutputFile=<file> (-s<option>=<string> | -d<option>[=<value>])*\n\
-J<PJL commands>\n";
@@ -201,8 +201,6 @@
static int
close_job(pl_main_universe_t *universe, pl_main_instance_t *pti)
{
- if ( pti->print_page_count )
- dlprintf1("%%%%PageCount: %d\n", pti->page_count);
return pl_dnit_job(universe->curr_instance);
}
@@ -491,12 +489,6 @@
if ( gs_debug_c('A') )
dprintf("Final time" );
pl_platform_dnit(0);
-#ifdef DEBUG
-#ifndef HEAP_ALLOCATOR_ONLY
- if (inst.leak_check)
- gs_memory_chunk_dump_memory(mem);
-#endif
-#endif
return 0;
}
@@ -769,7 +761,6 @@
pti->error_report = -1;
pti->pause = true;
- pti->print_page_count = false;
pti->device = 0;
pti->implementation = 0;
gp_get_usertime(pti->base_time);
@@ -778,7 +769,6 @@
pti->page_count = 0;
pti->saved_hwres = false;
pti->interpolate = false;
- pti->leak_check = false;
strncpy(&pti->pcl_personality[0], "PCL", sizeof(pti->pcl_personality)-1);
}
@@ -808,7 +798,7 @@
pti->device_memory);
if (pti->device != NULL)
gs_register_struct_root(pti->device_memory, &device_root,
- &pti->device, "pl_top_create_device");
+ (void **)&pti->device, "pl_top_create_device");
}
return code;
@@ -856,10 +846,6 @@
case '\0':
/* read from stdin - must be last arg */
continue;
- case 'c':
- case 'C':
- pmi->print_page_count = true;
- break;
case 'd':
case 'D':
if ( !strcmp(arg, "BATCH") )
@@ -993,12 +979,43 @@
rawheap->limit = (long)maxk << 10;
}
break;
- case 'l':
- pmi->leak_check=true;
+ case 'o':
+ {
+ const char *adef;
+ gs_param_string str;
+
+ if (arg[0] == 0) {
+ adef = arg_next(pal, &code);
+ if (code < 0)
break;
- case 'p':
- case 'P':
+ } else
+ adef = arg;
+ param_string_from_transient_string(str, adef);
+ code = param_write_string((gs_param_list *)params, "OutputFile", &str);
+ pmi->pause=false;
+ break;
+ }
+ case 'L': /* language */
{
+ int index;
+ for (index = 0; impl_array[index] != 0; ++index)
+ if (!strcmp(arg,
+ pl_characteristics(impl_array[index])->language))
+ break;
+ if (impl_array[index] != 0)
+ pmi->implementation = impl_array[index];
+ else {
+ dprintf("Choose language in -L<language> from: ");
+ for (index = 0; impl_array[index] != 0; ++index)
+ dprintf1("%s ",
+ pl_characteristics(impl_array[index])->language);
+ dprintf("\n");
+ return -1;
+ }
+ break;
+ }
+ case 'l': /* personality */
+ {
if ( !strcmp(arg, "RTL") || !strcmp(arg, "PCL5E") ||
!strcmp(arg, "PCL5C") )
strcpy(pmi->pcl_personality, arg);
@@ -1063,27 +1080,8 @@
case 'Z':
set_debug_flags(arg, gs_debug);
break;
- case 'L': /* language */
- {
- int index;
- for (index = 0; impl_array[index] != 0; ++index)
- if (!strcmp(arg,
- pl_characteristics(impl_array[index])->language))
- break;
- if (impl_array[index] != 0)
- pmi->implementation = impl_array[index];
- else {
- dprintf("Choose language in -L<language> from: ");
- for (index = 0; impl_array[index] != 0; ++index)
- dprintf1("%s ",
- pl_characteristics(impl_array[index])->language);
- dprintf("\n");
- return -1;
}
- break;
}
- }
- }
out: if ( help ) {
arg_finit(pal);
gs_c_param_list_release(params);
@@ -1167,7 +1165,7 @@
}
/* Log a string to console, optionally wait for input */
-void
+static void
pl_log_string(const gs_memory_t *mem, const char *str, int wait_for_key)
{
errwrite(mem, str, strlen(str));
Modified: trunk/ghostpdl/pl/plmain.h
===================================================================
--- trunk/ghostpdl/pl/plmain.h 2010-10-07 13:59:49 UTC (rev 11771)
+++ trunk/ghostpdl/pl/plmain.h 2010-10-07 14:54:23 UTC (rev 11772)
@@ -37,8 +37,6 @@
long base_time[2]; /* starting usertime */
int error_report; /* -E# */
bool pause; /* -dNOPAUSE => false */
- bool print_page_count; /* print the page number to stdout at
- the end of the job. */
int first_page; /* -dFirstPage= */
int last_page; /* -dLastPage= */
gx_device *device;
@@ -55,7 +53,6 @@
personality - rtl, pcl5c, pcl5e, and
pcl == default. NB doesn't belong here. */
bool interpolate;
- bool leak_check;
} pl_main_instance_t;
/* initialize gs_stdin, gs_stdout, and gs_stderr. Eventually the gs
More information about the gs-commits
mailing list