/*
- * '_ppdNormalizeMakeAndModel()' - Normalize a product/make-and-model string.
+ * 'ppdNormalizeMakeAndModel()' - Normalize a product/make-and-model string.
*
* This function tries to undo the mistakes made by many printer manufacturers
* to produce a clean make-and-model string we can use.
*/
char * /* O - Normalized make-and-model string or NULL on error */
-_ppdNormalizeMakeAndModel(
+ppdNormalizeMakeAndModel(
const char *make_and_model, /* I - Original make-and-model string */
char *buffer, /* I - String buffer */
size_t bufsize) /* I - Size of string buffer */
}
/*
- * '_ppdConvertOptions()' - Convert printer options to standard IPP attributes.
+ * 'ppdConvertOptions()' - Convert printer options to standard IPP attributes.
*
* This functions converts PPD and CUPS-specific options to their standard IPP
* attributes and values and adds them to the specified IPP request.
*/
int /* O - New number of copies */
-_ppdConvertOptions(
+ppdConvertOptions(
ipp_t *request, /* I - IPP request */
ppd_file_t *ppd, /* I - PPD file */
_ppd_cache_t *pc, /* I - PPD cache info */
if ((keyword = cupsGetOption("PageSize", num_options, options)) == NULL)
keyword = cupsGetOption("media", num_options, options);
- media_source = _ppdCacheGetSource(pc, cupsGetOption("InputSlot", num_options, options));
- media_type = _ppdCacheGetType(pc, cupsGetOption("MediaType", num_options, options));
- size = _ppdCacheGetSize(pc, keyword);
+ media_source = ppdCacheGetSource(pc, cupsGetOption("InputSlot", num_options, options));
+ media_type = ppdCacheGetType(pc, cupsGetOption("MediaType", num_options, options));
+ size = ppdCacheGetSize(pc, keyword);
if (size || media_source || media_type)
{
if ((keyword = cupsGetOption("output-bin", num_options, options)) == NULL)
{
if ((choice = ppdFindMarkedChoice(ppd, "OutputBin")) != NULL)
- keyword = _ppdCacheGetBin(pc, choice->choice);
+ keyword = ppdCacheGetBin(pc, choice->choice);
}
if (keyword)
}
else
{
- num_finishings = _ppdCacheGetFinishingValues(ppd, pc, (int)(sizeof(finishings) / sizeof(finishings[0])), finishings);
+ num_finishings = ppdCacheGetFinishingValues(ppd, pc, (int)(sizeof(finishings) / sizeof(finishings[0])), finishings);
if (num_finishings > 0)
{
ippAddIntegers(request, IPP_TAG_JOB, IPP_TAG_ENUM, "finishings", num_finishings, finishings);
/*
- * '_ppdCacheCreateWithFile()' - Create PPD cache and mapping data from a
+ * 'ppdCacheCreateWithFile()' - Create PPD cache and mapping data from a
* written file.
*
- * Use the @link _ppdCacheWriteFile@ function to write PWG mapping data to a
+ * Use the @link ppdCacheWriteFile@ function to write PWG mapping data to a
* file.
*/
_ppd_cache_t * /* O - PPD cache and mapping data */
-_ppdCacheCreateWithFile(
+ppdCacheCreateWithFile(
const char *filename, /* I - File to read */
ipp_t **attrs) /* IO - IPP attributes, if any */
{
_ppd_pwg_print_quality_t print_quality; /* Print quality for preset */
- DEBUG_printf(("_ppdCacheCreateWithFile(filename=\"%s\")", filename));
+ DEBUG_printf(("ppdCacheCreateWithFile(filename=\"%s\")", filename));
/*
* Range check input...
if (!cupsFileGets(fp, line, sizeof(line)))
{
set_error(strerror(errno), 0);
- DEBUG_puts("_ppdCacheCreateWithFile: Unable to read first line.");
+ DEBUG_puts("ppdCacheCreateWithFile: Unable to read first line.");
cupsFileClose(fp);
return (NULL);
}
if (strncmp(line, "#CUPS-PPD-CACHE-", 16))
{
set_error(_("Bad PPD cache file."), 1);
- DEBUG_printf(("_ppdCacheCreateWithFile: Wrong first line \"%s\".", line));
+ DEBUG_printf(("ppdCacheCreateWithFile: Wrong first line \"%s\".", line));
cupsFileClose(fp);
return (NULL);
}
if (atoi(line + 16) != _PPD_CACHE_VERSION)
{
set_error(_("Out of date PPD cache file."), 1);
- DEBUG_printf(("_ppdCacheCreateWithFile: Cache file has version %s, "
+ DEBUG_printf(("ppdCacheCreateWithFile: Cache file has version %s, "
"expected %d.", line + 16, _PPD_CACHE_VERSION));
cupsFileClose(fp);
return (NULL);
if ((pc = calloc(1, sizeof(_ppd_cache_t))) == NULL)
{
set_error(strerror(errno), 0);
- DEBUG_puts("_ppdCacheCreateWithFile: Unable to allocate _ppd_cache_t.");
+ DEBUG_puts("ppdCacheCreateWithFile: Unable to allocate _ppd_cache_t.");
goto create_error;
}
while (cupsFileGetConf(fp, line, sizeof(line), &value, &linenum))
{
- DEBUG_printf(("_ppdCacheCreateWithFile: line=\"%s\", value=\"%s\", "
+ DEBUG_printf(("ppdCacheCreateWithFile: line=\"%s\", value=\"%s\", "
"linenum=%d", line, value, linenum));
if (!value)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Missing value on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Missing value on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if (attrs && *attrs)
{
- DEBUG_puts("_ppdCacheCreateWithFile: IPP listed multiple times.");
+ DEBUG_puts("ppdCacheCreateWithFile: IPP listed multiple times.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
else if (length <= 0)
{
- DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP length.");
+ DEBUG_puts("ppdCacheCreateWithFile: Bad IPP length.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if (ippReadIO(fp, (ipp_iocb_t)cupsFileRead, 1, NULL,
*attrs) != IPP_STATE_DATA)
{
- DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP data.");
+ DEBUG_puts("ppdCacheCreateWithFile: Bad IPP data.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if (cupsFileTell(fp) != (pos + length))
{
- DEBUG_puts("_ppdCacheCreateWithFile: Bad IPP data.");
+ DEBUG_puts("ppdCacheCreateWithFile: Bad IPP data.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
{
if (num_bins > 0)
{
- DEBUG_puts("_ppdCacheCreateWithFile: NumBins listed multiple times.");
+ DEBUG_puts("ppdCacheCreateWithFile: NumBins listed multiple times.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if ((num_bins = atoi(value)) <= 0 || num_bins > 65536)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumBins value %d on line "
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad NumBins value %d on line "
"%d.", num_sizes, linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if ((pc->bins = calloc((size_t)num_bins, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d bins.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Unable to allocate %d bins.",
num_sizes));
set_error(strerror(errno), 0);
goto create_error;
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad Bin on line %d.", linenum));
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad Bin on line %d.", linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if (pc->num_bins >= num_bins)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Too many Bin's on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Too many Bin's on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
{
if (num_sizes > 0)
{
- DEBUG_puts("_ppdCacheCreateWithFile: NumSizes listed multiple times.");
+ DEBUG_puts("ppdCacheCreateWithFile: NumSizes listed multiple times.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if ((num_sizes = atoi(value)) < 0 || num_sizes > 65536)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumSizes value %d on line "
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad NumSizes value %d on line "
"%d.", num_sizes, linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
{
if ((pc->sizes = calloc((size_t)num_sizes, sizeof(pwg_size_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sizes.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Unable to allocate %d sizes.",
num_sizes));
set_error(strerror(errno), 0);
goto create_error;
{
if (pc->num_sizes >= num_sizes)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Too many Size's on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Too many Size's on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
&(size->width), &(size->length), &(size->left),
&(size->bottom), &(size->right), &(size->top)) != 8)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad Size on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad Size on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
{
if (pc->custom_max_width > 0)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Too many CustomSize's on line "
+ DEBUG_printf(("ppdCacheCreateWithFile: Too many CustomSize's on line "
"%d.", linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
&(pc->custom_size.bottom), &(pc->custom_size.right),
&(pc->custom_size.top)) != 8)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad CustomSize on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad CustomSize on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
{
if (num_sources > 0)
{
- DEBUG_puts("_ppdCacheCreateWithFile: NumSources listed multiple "
+ DEBUG_puts("ppdCacheCreateWithFile: NumSources listed multiple "
"times.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if ((num_sources = atoi(value)) <= 0 || num_sources > 65536)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumSources value %d on "
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad NumSources value %d on "
"line %d.", num_sources, linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if ((pc->sources = calloc((size_t)num_sources, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d sources.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Unable to allocate %d sources.",
num_sources));
set_error(strerror(errno), 0);
goto create_error;
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad Source on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad Source on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if (pc->num_sources >= num_sources)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Too many Source's on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Too many Source's on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
{
if (num_types > 0)
{
- DEBUG_puts("_ppdCacheCreateWithFile: NumTypes listed multiple times.");
+ DEBUG_puts("ppdCacheCreateWithFile: NumTypes listed multiple times.");
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
if ((num_types = atoi(value)) <= 0 || num_types > 65536)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad NumTypes value %d on "
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad NumTypes value %d on "
"line %d.", num_types, linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if ((pc->types = calloc((size_t)num_types, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Unable to allocate %d types.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Unable to allocate %d types.",
num_types));
set_error(strerror(errno), 0);
goto create_error;
{
if (sscanf(value, "%127s%40s", pwg_keyword, ppd_keyword) != 2)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad Type on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad Type on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if (pc->num_types >= num_types)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Too many Type's on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Too many Type's on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
print_quality >= _PPD_PWG_PRINT_QUALITY_MAX ||
valueptr == value || !*valueptr)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Bad Preset on line %d.",
+ DEBUG_printf(("ppdCacheCreateWithFile: Bad Preset on line %d.",
linenum));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
}
else
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Unknown %s on line %d.", line,
+ DEBUG_printf(("ppdCacheCreateWithFile: Unknown %s on line %d.", line,
linenum));
}
}
if (pc->num_sizes < num_sizes)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Not enough sizes (%d < %d).",
+ DEBUG_printf(("ppdCacheCreateWithFile: Not enough sizes (%d < %d).",
pc->num_sizes, num_sizes));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if (pc->num_sources < num_sources)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Not enough sources (%d < %d).",
+ DEBUG_printf(("ppdCacheCreateWithFile: Not enough sources (%d < %d).",
pc->num_sources, num_sources));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
if (pc->num_types < num_types)
{
- DEBUG_printf(("_ppdCacheCreateWithFile: Not enough types (%d < %d).",
+ DEBUG_printf(("ppdCacheCreateWithFile: Not enough types (%d < %d).",
pc->num_types, num_types));
set_error(_("Bad PPD cache file."), 1);
goto create_error;
create_error:
cupsFileClose(fp);
- _ppdCacheDestroy(pc);
+ ppdCacheDestroy(pc);
if (attrs)
{
/*
- * '_ppdCacheCreateWithPPD()' - Create PWG mapping data from a PPD file.
+ * 'ppdCacheCreateWithPPD()' - Create PWG mapping data from a PPD file.
*/
_ppd_cache_t * /* O - PPD cache and mapping data */
-_ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
+ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
{
int i, j, k; /* Looping vars */
_ppd_cache_t *pc; /* PWG mapping data */
char msg_id[256]; /* Message identifier */
- DEBUG_printf(("_ppdCacheCreateWithPPD(ppd=%p)", ppd));
+ DEBUG_printf(("ppdCacheCreateWithPPD(ppd=%p)", ppd));
/*
* Range check input...
if ((pc = calloc(1, sizeof(_ppd_cache_t))) == NULL)
{
- DEBUG_puts("_ppdCacheCreateWithPPD: Unable to allocate _ppd_cache_t.");
+ DEBUG_puts("ppdCacheCreateWithPPD: Unable to allocate _ppd_cache_t.");
goto create_error;
}
{
if ((pc->sizes = calloc((size_t)ppd->num_sizes, sizeof(pwg_size_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
+ DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
"pwg_size_t's.", ppd->num_sizes));
goto create_error;
}
if ((pc->sources = calloc((size_t)input_slot->num_choices, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
+ DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
"pwg_map_t's for InputSlot.", input_slot->num_choices));
goto create_error;
}
{
if ((pc->types = calloc((size_t)media_type->num_choices, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
+ DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
"pwg_map_t's for MediaType.", media_type->num_choices));
goto create_error;
}
{
if ((pc->bins = calloc((size_t)output_bin->num_choices, sizeof(pwg_map_t))) == NULL)
{
- DEBUG_printf(("_ppdCacheCreateWithPPD: Unable to allocate %d "
+ DEBUG_printf(("ppdCacheCreateWithPPD: Unable to allocate %d "
"pwg_map_t's for OutputBin.", output_bin->num_choices));
goto create_error;
}
* Get the options for this preset...
*/
- num_options = _ppdParseOptions(ppd_attr->value, 0, &options,
+ num_options = ppdParseOptions(ppd_attr->value, 0, &options,
_PPD_PARSE_ALL);
if ((quality = cupsGetOption("com.apple.print.preset.quality",
if (!pc->num_presets[pwg_print_color_mode][pwg_print_quality])
pc->num_presets[pwg_print_color_mode][pwg_print_quality] =
- _ppdParseOptions(ppd_attr->value, 0,
+ ppdParseOptions(ppd_attr->value, 0,
pc->presets[pwg_print_color_mode] +
pwg_print_quality, _PPD_PARSE_OPTIONS);
}
goto create_error;
finishings->value = (ipp_finishings_t)atoi(ppd_attr->spec);
- finishings->num_options = _ppdParseOptions(ppd_attr->value, 0,
+ finishings->num_options = ppdParseOptions(ppd_attr->value, 0,
&(finishings->options),
_PPD_PARSE_OPTIONS);
create_error:
set_error(_("Out of memory."), 1);
- _ppdCacheDestroy(pc);
+ ppdCacheDestroy(pc);
return (NULL);
}
/*
- * '_ppdCacheDestroy()' - Free all memory used for PWG mapping data.
+ * 'ppdCacheDestroy()' - Free all memory used for PWG mapping data.
*/
void
-_ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
+ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
{
int i; /* Looping var */
pwg_map_t *map; /* Current map */
/*
- * '_ppdCacheGetBin()' - Get the PWG output-bin keyword associated with a PPD
+ * 'ppdCacheGetBin()' - Get the PWG output-bin keyword associated with a PPD
* OutputBin.
*/
const char * /* O - output-bin or NULL */
-_ppdCacheGetBin(
+ppdCacheGetBin(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *output_bin) /* I - PPD OutputBin string */
{
/*
- * '_ppdCacheGetFinishingOptions()' - Get PPD finishing options for the given
+ * 'ppdCacheGetFinishingOptions()' - Get PPD finishing options for the given
* IPP finishings value(s).
*/
int /* O - New number of options */
-_ppdCacheGetFinishingOptions(
+ppdCacheGetFinishingOptions(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
ipp_t *job, /* I - Job attributes or NULL */
ipp_finishings_t value, /* I - IPP finishings value of IPP_FINISHINGS_NONE */
/*
- * '_ppdCacheGetFinishingValues()' - Get IPP finishings value(s) from the given
+ * 'ppdCacheGetFinishingValues()' - Get IPP finishings value(s) from the given
* PPD options.
*/
int /* O - Number of finishings values */
-_ppdCacheGetFinishingValues(
+ppdCacheGetFinishingValues(
ppd_file_t *ppd, /* I - Marked PPD file */
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
int max_values, /* I - Maximum number of finishings values */
* Range check input...
*/
- DEBUG_printf(("_ppdCacheGetFinishingValues(ppd=%p, pc=%p, max_values=%d, values=%p)", ppd, pc, max_values, values));
+ DEBUG_printf(("ppdCacheGetFinishingValues(ppd=%p, pc=%p, max_values=%d, values=%p)", ppd, pc, max_values, values));
if (!ppd || !pc || max_values < 1 || !values)
{
- DEBUG_puts("_ppdCacheGetFinishingValues: Bad arguments, returning 0.");
+ DEBUG_puts("ppdCacheGetFinishingValues: Bad arguments, returning 0.");
return (0);
}
else if (!pc->finishings)
{
- DEBUG_puts("_ppdCacheGetFinishingValues: No finishings support, returning 0.");
+ DEBUG_puts("ppdCacheGetFinishingValues: No finishings support, returning 0.");
return (0);
}
f;
f = (_ppd_pwg_finishings_t *)cupsArrayNext(pc->finishings))
{
- DEBUG_printf(("_ppdCacheGetFinishingValues: Checking %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
+ DEBUG_printf(("ppdCacheGetFinishingValues: Checking %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
for (i = f->num_options, option = f->options; i > 0; i --, option ++)
{
- DEBUG_printf(("_ppdCacheGetFinishingValues: %s=%s?", option->name, option->value));
+ DEBUG_printf(("ppdCacheGetFinishingValues: %s=%s?", option->name, option->value));
if ((choice = ppdFindMarkedChoice(ppd, option->name)) == NULL || _ppd_strcasecmp(option->value, choice->choice))
{
- DEBUG_puts("_ppdCacheGetFinishingValues: NO");
+ DEBUG_puts("ppdCacheGetFinishingValues: NO");
break;
}
}
if (i == 0)
{
- DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
+ DEBUG_printf(("ppdCacheGetFinishingValues: Adding %d (%s)", (int)f->value, ippEnumString("finishings", (int)f->value)));
values[num_values ++] = (int)f->value;
* Always have at least "finishings" = 'none'...
*/
- DEBUG_puts("_ppdCacheGetFinishingValues: Adding 3 (none).");
+ DEBUG_puts("ppdCacheGetFinishingValues: Adding 3 (none).");
values[0] = IPP_FINISHINGS_NONE;
num_values ++;
}
- DEBUG_printf(("_ppdCacheGetFinishingValues: Returning %d.", num_values));
+ DEBUG_printf(("ppdCacheGetFinishingValues: Returning %d.", num_values));
return (num_values);
}
/*
- * '_ppdCacheGetInputSlot()' - Get the PPD InputSlot associated with the job
+ * 'ppdCacheGetInputSlot()' - Get the PPD InputSlot associated with the job
* attributes or a keyword string.
*/
const char * /* O - PPD InputSlot or NULL */
-_ppdCacheGetInputSlot(
+ppdCacheGetInputSlot(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
ipp_t *job, /* I - Job attributes or NULL */
const char *keyword) /* I - Keyword string or NULL */
/*
- * '_ppdCacheGetMediaType()' - Get the PPD MediaType associated with the job
+ * 'ppdCacheGetMediaType()' - Get the PPD MediaType associated with the job
* attributes or a keyword string.
*/
const char * /* O - PPD MediaType or NULL */
-_ppdCacheGetMediaType(
+ppdCacheGetMediaType(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
ipp_t *job, /* I - Job attributes or NULL */
const char *keyword) /* I - Keyword string or NULL */
/*
- * '_ppdCacheGetOutputBin()' - Get the PPD OutputBin associated with the keyword
+ * 'ppdCacheGetOutputBin()' - Get the PPD OutputBin associated with the keyword
* string.
*/
const char * /* O - PPD OutputBin or NULL */
-_ppdCacheGetOutputBin(
+ppdCacheGetOutputBin(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *output_bin) /* I - Keyword string */
{
/*
- * '_ppdCacheGetPageSize()' - Get the PPD PageSize associated with the job
+ * 'ppdCacheGetPageSize()' - Get the PPD PageSize associated with the job
* attributes or a keyword string.
*/
const char * /* O - PPD PageSize or NULL */
-_ppdCacheGetPageSize(
+ppdCacheGetPageSize(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
ipp_t *job, /* I - Job attributes or NULL */
const char *keyword, /* I - Keyword string or NULL */
const char *ppd_name; /* PPD media name */
- DEBUG_printf(("_ppdCacheGetPageSize(pc=%p, job=%p, keyword=\"%s\", exact=%p)",
+ DEBUG_printf(("ppdCacheGetPageSize(pc=%p, job=%p, keyword=\"%s\", exact=%p)",
pc, job, keyword, exact));
/*
/*
- * '_ppdCacheGetSize()' - Get the PWG size associated with a PPD PageSize.
+ * 'ppdCacheGetSize()' - Get the PWG size associated with a PPD PageSize.
*/
pwg_size_t * /* O - PWG size or NULL */
-_ppdCacheGetSize(
+ppdCacheGetSize(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *page_size) /* I - PPD PageSize */
{
/*
- * '_ppdCacheGetSource()' - Get the PWG media-source associated with a PPD
+ * 'ppdCacheGetSource()' - Get the PWG media-source associated with a PPD
* InputSlot.
*/
const char * /* O - PWG media-source keyword */
-_ppdCacheGetSource(
+ppdCacheGetSource(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *input_slot) /* I - PPD InputSlot */
{
/*
- * '_ppdCacheGetType()' - Get the PWG media-type associated with a PPD
+ * 'ppdCacheGetType()' - Get the PWG media-type associated with a PPD
* MediaType.
*/
const char * /* O - PWG media-type keyword */
-_ppdCacheGetType(
+ppdCacheGetType(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *media_type) /* I - PPD MediaType */
{
/*
- * '_ppdCacheWriteFile()' - Write PWG mapping data to a file.
+ * 'ppdCacheWriteFile()' - Write PWG mapping data to a file.
*/
int /* O - 1 on success, 0 on failure */
-_ppdCacheWriteFile(
+ppdCacheWriteFile(
_ppd_cache_t *pc, /* I - PPD cache and mapping data */
const char *filename, /* I - File to write */
ipp_t *attrs) /* I - Attributes to write, if any */
/*
- * '_ppdCreateFromIPP()' - Create a PPD file describing the capabilities
+ * 'ppdCreateFromIPPCUPS()' - Create a PPD file describing the capabilities
* of an IPP printer.
*/
char * /* O - PPD filename or @code NULL@ on error */
-_ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
+ppdCreateFromIPPCUPS(char *buffer, /* I - Filename buffer */
size_t bufsize, /* I - Size of filename buffer */
ipp_t *response) /* I - Get-Printer-Attributes response */
{
/*
- * '_pwgInputSlotForSource()' - Get the InputSlot name for the given PWG
+ * 'ppdPwgInputSlotForSource()' - Get the InputSlot name for the given PWG
* media-source.
*/
const char * /* O - InputSlot name */
-_pwgInputSlotForSource(
+ppdPwgInputSlotForSource(
const char *media_source, /* I - PWG media-source */
char *name, /* I - Name buffer */
size_t namesize) /* I - Size of name buffer */
/*
- * '_pwgMediaTypeForType()' - Get the MediaType name for the given PWG
+ * 'ppdPwgMediaTypeForType()' - Get the MediaType name for the given PWG
* media-type.
*/
const char * /* O - MediaType name */
-_pwgMediaTypeForType(
+ppdPwgMediaTypeForType(
const char *media_type, /* I - PWG media-type */
char *name, /* I - Name buffer */
size_t namesize) /* I - Size of name buffer */
/*
- * '_pwgPageSizeForMedia()' - Get the PageSize name for the given media.
+ * 'ppdPwgPageSizeForMedia()' - Get the PageSize name for the given media.
*/
const char * /* O - PageSize name */
-_pwgPageSizeForMedia(
+ppdPwgPageSizeForMedia(
pwg_media_t *media, /* I - Media */
char *name, /* I - PageSize name buffer */
size_t namesize) /* I - Size of name buffer */
for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
{
- if ((locattr = _ppdLocalizedAttr(ppd, "Translation", group->name,
+ if ((locattr = ppdLocalizedAttr(ppd, "Translation", group->name,
ll_CC)) != NULL)
strlcpy(group->text, locattr->text, sizeof(group->text));
for (j = group->num_options, option = group->options; j > 0; j --, option ++)
{
- if ((locattr = _ppdLocalizedAttr(ppd, "Translation", option->keyword,
+ if ((locattr = ppdLocalizedAttr(ppd, "Translation", option->keyword,
ll_CC)) != NULL)
strlcpy(option->text, locattr->text, sizeof(option->text));
{
if (strcmp(choice->choice, "Custom") ||
!ppdFindCustomOption(ppd, option->keyword))
- locattr = _ppdLocalizedAttr(ppd, option->keyword, choice->choice,
+ locattr = ppdLocalizedAttr(ppd, option->keyword, choice->choice,
ll_CC);
else
{
snprintf(ckeyword, sizeof(ckeyword), "Custom%s", option->keyword);
- locattr = _ppdLocalizedAttr(ppd, ckeyword, "True", ll_CC);
+ locattr = ppdLocalizedAttr(ppd, ckeyword, "True", ll_CC);
}
if (locattr)
snprintf(ckeyword, sizeof(ckeyword), "ParamCustom%.29s",
coption->keyword);
- if ((locattr = _ppdLocalizedAttr(ppd, ckeyword, cparam->name,
+ if ((locattr = ppdLocalizedAttr(ppd, ckeyword, cparam->name,
ll_CC)) != NULL)
strlcpy(cparam->text, locattr->text, sizeof(cparam->text));
}
if ((attr = ppdFindAttr(ppd, "APCustomColorMatchingName", NULL)) != NULL)
{
- if ((locattr = _ppdLocalizedAttr(ppd, "APCustomColorMatchingName",
+ if ((locattr = ppdLocalizedAttr(ppd, "APCustomColorMatchingName",
attr->spec, ll_CC)) != NULL)
strlcpy(attr->text, locattr->text, sizeof(attr->text));
}
{
cupsArraySave(ppd->sorted_attrs);
- if ((locattr = _ppdLocalizedAttr(ppd, "cupsICCProfile", attr->spec,
+ if ((locattr = ppdLocalizedAttr(ppd, "cupsICCProfile", attr->spec,
ll_CC)) != NULL)
strlcpy(attr->text, locattr->text, sizeof(attr->text));
{
cupsArraySave(ppd->sorted_attrs);
- if ((locattr = _ppdLocalizedAttr(ppd, "APPrinterPreset", attr->spec,
+ if ((locattr = ppdLocalizedAttr(ppd, "APPrinterPreset", attr->spec,
ll_CC)) != NULL)
strlcpy(attr->text, locattr->text, sizeof(attr->text));
*/
if (spec)
- locattr = _ppdLocalizedAttr(ppd, keyword, spec, ll_CC);
+ locattr = ppdLocalizedAttr(ppd, keyword, spec, ll_CC);
else
- locattr = _ppdLocalizedAttr(ppd, "Translation", keyword, ll_CC);
+ locattr = ppdLocalizedAttr(ppd, "Translation", keyword, ll_CC);
if (!locattr)
locattr = ppdFindAttr(ppd, keyword, spec);
* Find the localized attribute...
*/
- if ((locattr = _ppdLocalizedAttr(ppd, "cupsIPPReason", reason,
+ if ((locattr = ppdLocalizedAttr(ppd, "cupsIPPReason", reason,
ll_CC)) == NULL)
locattr = ppdFindAttr(ppd, "cupsIPPReason", reason);
* Find the localized attribute...
*/
- if ((locattr = _ppdLocalizedAttr(ppd, "cupsMarkerName", name,
+ if ((locattr = ppdLocalizedAttr(ppd, "cupsMarkerName", name,
ll_CC)) == NULL)
locattr = ppdFindAttr(ppd, "cupsMarkerName", name);
/*
- * '_ppdFreeLanguages()' - Free an array of languages from _ppdGetLanguages.
+ * 'ppdFreeLanguages()' - Free an array of languages from ppdGetLanguages.
*/
void
-_ppdFreeLanguages(
+ppdFreeLanguages(
cups_array_t *languages) /* I - Languages array */
{
char *language; /* Current language */
/*
- * '_ppdGetLanguages()' - Get an array of languages from a PPD file.
+ * 'ppdGetLanguages()' - Get an array of languages from a PPD file.
*/
cups_array_t * /* O - Languages array */
-_ppdGetLanguages(ppd_file_t *ppd) /* I - PPD file */
+ppdGetLanguages(ppd_file_t *ppd) /* I - PPD file */
{
cups_array_t *languages; /* Languages array */
ppd_attr_t *attr; /* cupsLanguages attribute */
/*
- * '_ppdHashName()' - Generate a hash value for a device or profile name.
+ * 'ppdHashName()' - Generate a hash value for a device or profile name.
*
* This function is primarily used on macOS, but is generally accessible
* since cupstestppd needs to check for profile name collisions in PPD files...
*/
unsigned /* O - Hash value */
-_ppdHashName(const char *name) /* I - Name to hash */
+ppdHashName(const char *name) /* I - Name to hash */
{
unsigned mult, /* Multiplier */
hash = 0; /* Hash value */
/*
- * '_ppdLocalizedAttr()' - Find a localized attribute.
+ * 'ppdLocalizedAttr()' - Find a localized attribute.
*/
ppd_attr_t * /* O - Localized attribute or NULL */
-_ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
+ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
const char *keyword, /* I - Main keyword */
const char *spec, /* I - Option keyword */
const char *ll_CC) /* I - Language + country locale */
* Load PPD cache and mapping data as needed...
*/
- ppd->cache = _ppdCacheCreateWithPPD(ppd);
+ ppd->cache = ppdCacheCreateWithPPD(ppd);
}
cache = ppd->cache;
{
if (!_ppd_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s))
ppd_mark_option(ppd, "PageSize", s);
- else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
+ else if ((ppd_keyword = ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL)
ppd_mark_option(ppd, "PageSize", ppd_keyword);
}
if (cache && cache->source_option &&
!cupsGetOption(cache->source_option, num_options, options) &&
- (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL)
+ (ppd_keyword = ppdCacheGetInputSlot(cache, NULL, s)) != NULL)
ppd_mark_option(ppd, cache->source_option, ppd_keyword);
if (!cupsGetOption("MediaType", num_options, options) &&
- (ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL)
+ (ppd_keyword = ppdCacheGetMediaType(cache, NULL, s)) != NULL)
ppd_mark_option(ppd, "MediaType", ppd_keyword);
}
}
}
if (output_bin && !cupsGetOption("OutputBin", num_options, options) &&
- (ppd_keyword = _ppdCacheGetOutputBin(cache, output_bin)) != NULL)
+ (ppd_keyword = ppdCacheGetOutputBin(cache, output_bin)) != NULL)
{
/*
* Map output-bin to OutputBin...
/*
- * '_ppdParseOptions()' - Parse options from a PPD file.
+ * 'ppdParseOptions()' - Parse options from a PPD file.
*
* This function looks for strings of the form:
*
*/
int /* O - Number of options */
-_ppdParseOptions(
+ppdParseOptions(
const char *s, /* I - String to parse */
int num_options, /* I - Number of options */
cups_option_t **options, /* IO - Options */
return;
options = NULL;
- num_options = _ppdParseOptions(s, 0, &options, 0);
+ num_options = ppdParseOptions(s, 0, &options, 0);
for (i = num_options, option = options; i > 0; i --, option ++)
ppd_mark_option(ppd, option->name, option->value);
*/
if (ppd->cache)
- _ppdCacheDestroy(ppd->cache);
+ ppdCacheDestroy(ppd->cache);
/*
* Free the whole record...
/*
- * '_ppdGetEncoding()' - Get the CUPS encoding value for the given
+ * 'ppdGetEncoding()' - Get the CUPS encoding value for the given
* LanguageEncoding.
*/
cups_encoding_t /* O - CUPS encoding value */
-_ppdGetEncoding(const char *name) /* I - LanguageEncoding string */
+ppdGetEncoding(const char *name) /* I - LanguageEncoding string */
{
if (!_ppd_strcasecmp(name, "ISOLatin1"))
return (CUPS_ISO8859_1);
/*
- * '_ppdGlobals()' - Return a pointer to thread local storage
+ * 'ppdGlobals()' - Return a pointer to thread local storage
*/
_ppd_globals_t * /* O - Pointer to global data */
-_ppdGlobals(void)
+ppdGlobals(void)
{
_ppd_globals_t *pg; /* Pointer to global data */
ppd_status_t /* O - Status code */
ppdLastError(int *line) /* O - Line number */
{
- _ppd_globals_t *pg = _ppdGlobals();
+ _ppd_globals_t *pg = ppdGlobals();
/* Global data */
/*
- * '_ppdOpen()' - Read a PPD file into memory.
+ * 'ppdOpenWithLocalization()' - Read a PPD file into memory.
*
* @since CUPS 1.2/macOS 10.5@
*/
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-_ppdOpen(
+ppdOpenWithLocalization(
cups_file_t *fp, /* I - File to read from */
_ppd_localization_t localization) /* I - Localization to load */
{
int ui_keyword; /* Is this line a UI keyword? */
cups_lang_t *lang; /* Language data */
cups_encoding_t encoding; /* Encoding of PPD file */
- _ppd_globals_t *pg = _ppdGlobals();
+ _ppd_globals_t *pg = ppdGlobals();
/* Global data */
char custom_name[PPD_MAX_NAME];
/* CustomFoo attribute name */
};
- DEBUG_printf(("_ppdOpen(fp=%p)", fp));
+ DEBUG_printf(("ppdOpenWithLocalization(fp=%p)", fp));
/*
* Default to "OK" status...
ll_CC_len = strlen(ll_CC);
ll_len = strlen(ll);
- DEBUG_printf(("2_ppdOpen: Loading localizations matching \"%s\" and \"%s\"",
+ DEBUG_printf(("2ppdOpenWithLocalization: Loading localizations matching \"%s\" and \"%s\"",
ll_CC, ll));
}
mask = ppd_read(fp, &line, keyword, name, text, &string, 0, pg);
- DEBUG_printf(("2_ppdOpen: mask=%x, keyword=\"%s\"...", mask, keyword));
+ DEBUG_printf(("2ppdOpenWithLocalization: mask=%x, keyword=\"%s\"...", mask, keyword));
if (mask == 0 ||
strcmp(keyword, "PPD-Adobe") ||
return (NULL);
}
- DEBUG_printf(("2_ppdOpen: keyword=%s, string=%p", keyword, string));
+ DEBUG_printf(("2ppdOpenWithLocalization: keyword=%s, string=%p", keyword, string));
/*
* Allocate memory for the PPD file record...
while ((mask = ppd_read(fp, &line, keyword, name, text, &string, 1, pg)) != 0)
{
- DEBUG_printf(("2_ppdOpen: mask=%x, keyword=\"%s\", name=\"%s\", "
+ DEBUG_printf(("2ppdOpenWithLocalization: mask=%x, keyword=\"%s\", name=\"%s\", "
"text=\"%s\", string=%d chars...", mask, keyword, name, text,
string ? (int)strlen(string) : 0));
strncmp(ll_CC, keyword, ll_CC_len) &&
strncmp(ll, keyword, ll_len)))
{
- DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
+ DEBUG_printf(("2ppdOpenWithLocalization: Ignoring localization: \"%s\"\n", keyword));
free(string);
string = NULL;
continue;
if (i >= (int)(sizeof(color_keywords) / sizeof(color_keywords[0])))
{
- DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword));
+ DEBUG_printf(("2ppdOpenWithLocalization: Ignoring localization: \"%s\"\n", keyword));
free(string);
string = NULL;
continue;
ui_keyword = 1;
- DEBUG_printf(("2_ppdOpen: FOUND ADOBE UI KEYWORD %s WITHOUT OPENUI!",
+ DEBUG_printf(("2ppdOpenWithLocalization: FOUND ADOBE UI KEYWORD %s WITHOUT OPENUI!",
keyword));
if (!group)
encoding)) == NULL)
goto error;
- DEBUG_printf(("2_ppdOpen: Adding to group %s...", group->text));
+ DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...", group->text));
option = ppd_get_option(group, keyword);
group = NULL;
}
!strcmp(ppd->attrs[j]->name + 7, keyword) &&
ppd->attrs[j]->value)
{
- DEBUG_printf(("2_ppdOpen: Setting Default%s to %s via attribute...",
+ DEBUG_printf(("2ppdOpenWithLocalization: Setting Default%s to %s via attribute...",
option->keyword, ppd->attrs[j]->value));
strlcpy(option->defchoice, ppd->attrs[j]->value,
sizeof(option->defchoice));
*/
ppd->lang_encoding = strdup("UTF-8");
- encoding = _ppdGetEncoding(string);
+ encoding = ppdGetEncoding(string);
}
else if (!strcmp(keyword, "LanguageVersion"))
ppd->lang_version = string;
{
ppd_option_t *custom_option; /* Custom option */
- DEBUG_puts("2_ppdOpen: Processing Custom option...");
+ DEBUG_puts("2ppdOpenWithLocalization: Processing Custom option...");
/*
* Get the option and custom option...
if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL)
if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL)
{
- DEBUG_puts("1_ppdOpen: Unable to add Custom choice!");
+ DEBUG_puts("1ppdOpenWithLocalization: Unable to add Custom choice!");
pg->ppd_status = PPD_ALLOC_ERROR;
if ((choice = ppdFindChoice(custom_option, "Custom")) == NULL)
if ((choice = ppd_add_choice(custom_option, "Custom")) == NULL)
{
- DEBUG_puts("1_ppdOpen: Unable to add Custom choice!");
+ DEBUG_puts("1ppdOpenWithLocalization: Unable to add Custom choice!");
pg->ppd_status = PPD_ALLOC_ERROR;
* Add an option record to the current sub-group, group, or file...
*/
- DEBUG_printf(("2_ppdOpen: name=\"%s\" (%d)", name, (int)strlen(name)));
+ DEBUG_printf(("2ppdOpenWithLocalization: name=\"%s\" (%d)", name, (int)strlen(name)));
if (name[0] == '*')
_ppd_strcpy(name, name + 1); /* Eliminate leading asterisk */
for (i = (int)strlen(name) - 1; i > 0 && _ppd_isspace(name[i]); i --)
name[i] = '\0'; /* Eliminate trailing spaces */
- DEBUG_printf(("2_ppdOpen: OpenUI of %s in group %s...", name,
+ DEBUG_printf(("2ppdOpenWithLocalization: OpenUI of %s in group %s...", name,
group ? group->text : "(null)"));
if (subgroup != NULL)
encoding)) == NULL)
goto error;
- DEBUG_printf(("2_ppdOpen: Adding to group %s...", group->text));
+ DEBUG_printf(("2ppdOpenWithLocalization: Adding to group %s...", group->text));
option = ppd_get_option(group, name);
group = NULL;
}
!strcmp(ppd->attrs[j]->name + 7, name) &&
ppd->attrs[j]->value)
{
- DEBUG_printf(("2_ppdOpen: Setting Default%s to %s via attribute...",
+ DEBUG_printf(("2ppdOpenWithLocalization: Setting Default%s to %s via attribute...",
option->keyword, ppd->attrs[j]->value));
strlcpy(option->defchoice, ppd->attrs[j]->value,
sizeof(option->defchoice));
if ((choice = ppdFindChoice(option, "Custom")) == NULL)
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
{
- DEBUG_puts("1_ppdOpen: Unable to add Custom choice!");
+ DEBUG_puts("1ppdOpenWithLocalization: Unable to add Custom choice!");
pg->ppd_status = PPD_ALLOC_ERROR;
!strcmp(ppd->attrs[j]->name + 7, name) &&
ppd->attrs[j]->value)
{
- DEBUG_printf(("2_ppdOpen: Setting Default%s to %s via attribute...",
+ DEBUG_printf(("2ppdOpenWithLocalization: Setting Default%s to %s via attribute...",
option->keyword, ppd->attrs[j]->value));
strlcpy(option->defchoice, ppd->attrs[j]->value,
sizeof(option->defchoice));
{
if ((choice = ppd_add_choice(option, "Custom")) == NULL)
{
- DEBUG_puts("1_ppdOpen: Unable to add Custom choice!");
+ DEBUG_puts("1ppdOpenWithLocalization: Unable to add Custom choice!");
pg->ppd_status = PPD_ALLOC_ERROR;
* Set the default as part of the current option...
*/
- DEBUG_printf(("2_ppdOpen: Setting %s to %s...", keyword, string));
+ DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...", keyword, string));
strlcpy(option->defchoice, string, sizeof(option->defchoice));
- DEBUG_printf(("2_ppdOpen: %s is now %s...", keyword, option->defchoice));
+ DEBUG_printf(("2ppdOpenWithLocalization: %s is now %s...", keyword, option->defchoice));
}
else
{
if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL)
{
- DEBUG_printf(("2_ppdOpen: Setting %s to %s...", keyword, string));
+ DEBUG_printf(("2ppdOpenWithLocalization: Setting %s to %s...", keyword, string));
strlcpy(toption->defchoice, string, sizeof(toption->defchoice));
}
}
(PPD_KEYWORD | PPD_OPTION | PPD_STRING) &&
!strcmp(keyword, option->keyword))
{
- DEBUG_printf(("2_ppdOpen: group=%p, subgroup=%p", group, subgroup));
+ DEBUG_printf(("2ppdOpenWithLocalization: group=%p, subgroup=%p", group, subgroup));
if (!_ppd_strcasecmp(name, "custom") || !_ppd_strncasecmp(name, "custom.", 7))
{
#ifdef DEBUG
if (!cupsFileEOF(fp))
- DEBUG_printf(("1_ppdOpen: Premature EOF at %lu...\n",
+ DEBUG_printf(("1ppdOpenWithLocalization: Premature EOF at %lu...\n",
(unsigned long)cupsFileTell(fp)));
#endif /* DEBUG */
* Load the PPD file using the newer API...
*/
- ppd = _ppdOpen(cf, _PPD_LOCALIZATION_DEFAULT);
+ ppd = ppdOpenWithLocalization(cf, _PPD_LOCALIZATION_DEFAULT);
/*
* Close the CUPS file and return the PPD...
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
ppdOpen2(cups_file_t *fp) /* I - File to read from */
{
- return _ppdOpen(fp, _PPD_LOCALIZATION_DEFAULT);
+ return ppdOpenWithLocalization(fp, _PPD_LOCALIZATION_DEFAULT);
}
{
cups_file_t *fp; /* CUPS file pointer */
ppd_file_t *ppd; /* PPD file record */
- _ppd_globals_t *pg = _ppdGlobals();
+ _ppd_globals_t *pg = ppdGlobals();
/* Global data */
/*
- * '_ppdOpenFile()' - Read a PPD file into memory.
+ * 'ppdOpenFileWithLocalization()' - Read a PPD file into memory.
*/
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
-_ppdOpenFile(const char *filename, /* I - File to read from */
+ppdOpenFileWithLocalization(const char *filename, /* I - File to read from */
_ppd_localization_t localization) /* I - Localization to load */
{
cups_file_t *fp; /* File pointer */
ppd_file_t *ppd; /* PPD file record */
- _ppd_globals_t *pg = _ppdGlobals();
+ _ppd_globals_t *pg = ppdGlobals();
/* Global data */
if ((fp = cupsFileOpen(filename, "r")) != NULL)
{
- ppd = _ppdOpen(fp, localization);
+ ppd = ppdOpenWithLocalization(fp, localization);
cupsFileClose(fp);
}
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
ppdOpenFile(const char *filename) /* I - File to read from */
{
- return _ppdOpenFile(filename, _PPD_LOCALIZATION_DEFAULT);
+ return ppdOpenFileWithLocalization(filename, _PPD_LOCALIZATION_DEFAULT);
}
void
ppdSetConformance(ppd_conform_t c) /* I - Conformance level */
{
- _ppd_globals_t *pg = _ppdGlobals();
+ _ppd_globals_t *pg = ppdGlobals();
/* Global data */
/* PPD filename */
} _ppd_globals_t;
-typedef enum _ppd_localization_e /**** Selector for _ppdOpen ****/
+typedef enum _ppd_localization_e /**** Selector for ppdOpenWithLocalization ****/
{
_PPD_LOCALIZATION_DEFAULT, /* Load only the default localization */
_PPD_LOCALIZATION_ICC_PROFILES, /* Load only the color profile localization */
_PPD_LOCALIZATION_ALL /* Load all localizations */
} _ppd_localization_t;
-typedef enum _ppd_parse_e /**** Selector for _ppdParseOptions ****/
+typedef enum _ppd_parse_e /**** Selector for ppdParseOptions ****/
{
_PPD_PARSE_OPTIONS, /* Parse only the options */
_PPD_PARSE_PROPERTIES, /* Parse only the properties */
/**** New in libppd (cups-filters) ****/
/**** New in cups-filters 1.0.28 ****/
-extern int _ppdConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
-extern int _ppdRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code);
-extern int _ppdRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func);
+extern int ppdConvertOptions(ipp_t *request, ppd_file_t *ppd, _ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
+extern int ppdRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code);
+extern int ppdRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func);
-extern _ppd_cache_t *_ppdCacheCreateWithFile(const char *filename,
+extern _ppd_cache_t *ppdCacheCreateWithFile(const char *filename,
ipp_t **attrs);
-extern _ppd_cache_t *_ppdCacheCreateWithPPD(ppd_file_t *ppd);
-extern void _ppdCacheDestroy(_ppd_cache_t *pc);
-extern const char *_ppdCacheGetBin(_ppd_cache_t *pc,
+extern _ppd_cache_t *ppdCacheCreateWithPPD(ppd_file_t *ppd);
+extern void ppdCacheDestroy(_ppd_cache_t *pc);
+extern const char *ppdCacheGetBin(_ppd_cache_t *pc,
const char *output_bin);
-extern int _ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
+extern int ppdCacheGetFinishingOptions(_ppd_cache_t *pc,
ipp_t *job,
ipp_finishings_t value,
int num_options,
cups_option_t **options);
-extern int _ppdCacheGetFinishingValues(ppd_file_t *ppd, _ppd_cache_t *pc, int max_values, int *values);
-extern const char *_ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
+extern int ppdCacheGetFinishingValues(ppd_file_t *ppd, _ppd_cache_t *pc, int max_values, int *values);
+extern const char *ppdCacheGetInputSlot(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
-extern const char *_ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
+extern const char *ppdCacheGetMediaType(_ppd_cache_t *pc, ipp_t *job,
const char *keyword);
-extern const char *_ppdCacheGetOutputBin(_ppd_cache_t *pc,
+extern const char *ppdCacheGetOutputBin(_ppd_cache_t *pc,
const char *keyword);
-extern const char *_ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
+extern const char *ppdCacheGetPageSize(_ppd_cache_t *pc, ipp_t *job,
const char *keyword, int *exact);
-extern pwg_size_t *_ppdCacheGetSize(_ppd_cache_t *pc,
+extern pwg_size_t *ppdCacheGetSize(_ppd_cache_t *pc,
const char *page_size);
-extern const char *_ppdCacheGetSource(_ppd_cache_t *pc,
+extern const char *ppdCacheGetSource(_ppd_cache_t *pc,
const char *input_slot);
-extern const char *_ppdCacheGetType(_ppd_cache_t *pc,
+extern const char *ppdCacheGetType(_ppd_cache_t *pc,
const char *media_type);
-extern int _ppdCacheWriteFile(_ppd_cache_t *pc,
+extern int ppdCacheWriteFile(_ppd_cache_t *pc,
const char *filename, ipp_t *attrs);
-extern char *_ppdCreateFromIPP(char *buffer, size_t bufsize, ipp_t *response);
-extern void _ppdFreeLanguages(cups_array_t *languages);
-extern cups_encoding_t _ppdGetEncoding(const char *name);
-extern cups_array_t *_ppdGetLanguages(ppd_file_t *ppd);
-extern _ppd_globals_t *_ppdGlobals(void);
-extern unsigned _ppdHashName(const char *name);
-extern ppd_attr_t *_ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword,
+extern char *ppdCreateFromIPPCUPS(char *buffer, size_t bufsize, ipp_t *response);
+extern void ppdFreeLanguages(cups_array_t *languages);
+extern cups_encoding_t ppdGetEncoding(const char *name);
+extern cups_array_t *ppdGetLanguages(ppd_file_t *ppd);
+extern _ppd_globals_t *ppdGlobals(void);
+extern unsigned ppdHashName(const char *name);
+extern ppd_attr_t *ppdLocalizedAttr(ppd_file_t *ppd, const char *keyword,
const char *spec, const char *ll_CC);
-extern char *_ppdNormalizeMakeAndModel(const char *make_and_model,
+extern char *ppdNormalizeMakeAndModel(const char *make_and_model,
char *buffer,
size_t bufsize);
-extern ppd_file_t *_ppdOpen(cups_file_t *fp,
- _ppd_localization_t localization); /* XXX */
-extern ppd_file_t *_ppdOpenFile(const char *filename,
+extern ppd_file_t *ppdOpenWithLocalization(cups_file_t *fp,
+ _ppd_localization_t localization);
+extern ppd_file_t *ppdOpenFileWithLocalization(const char *filename,
_ppd_localization_t localization);
- /* XXX */
-extern int _ppdParseOptions(const char *s, int num_options,
+extern int ppdParseOptions(const char *s, int num_options,
cups_option_t **options,
_ppd_parse_t which);
-extern const char *_pwgInputSlotForSource(const char *media_source,
+extern const char *ppdPwgInputSlotForSource(const char *media_source,
char *name, size_t namesize);
-extern const char *_pwgMediaTypeForType(const char *media_type,
+extern const char *ppdPwgMediaTypeForType(const char *media_type,
char *name, size_t namesize);
-extern const char *_pwgPageSizeForMedia(pwg_media_t *media,
+extern const char *ppdPwgPageSizeForMedia(pwg_media_t *media,
char *name, size_t namesize);
/*
- * '_ppdRasterInterpretPPD()' - Interpret PPD commands to create a page header.
+ * 'ppdRasterInterpretPPD()' - Interpret PPD commands to create a page header.
*
* This function is used by raster image processing (RIP) filters like
* cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
*/
int /* O - 0 on success, -1 on failure */
-_ppdRasterInterpretPPD(
+ppdRasterInterpretPPD(
cups_page_header2_t *h, /* O - Page header to create */
ppd_file_t *ppd, /* I - PPD file */
int num_options, /* I - Number of options */
*/
if (ppd->patches)
- status |= _ppdRasterExecPS(h, &preferred_bits, ppd->patches);
+ status |= ppdRasterExecPS(h, &preferred_bits, ppd->patches);
/*
* Then apply printer options in the proper order...
if ((code = ppdEmitString(ppd, PPD_ORDER_DOCUMENT, 0.0)) != NULL)
{
- status |= _ppdRasterExecPS(h, &preferred_bits, code);
+ status |= ppdRasterExecPS(h, &preferred_bits, code);
free(code);
}
if ((code = ppdEmitString(ppd, PPD_ORDER_ANY, 0.0)) != NULL)
{
- status |= _ppdRasterExecPS(h, &preferred_bits, code);
+ status |= ppdRasterExecPS(h, &preferred_bits, code);
free(code);
}
if ((code = ppdEmitString(ppd, PPD_ORDER_PROLOG, 0.0)) != NULL)
{
- status |= _ppdRasterExecPS(h, &preferred_bits, code);
+ status |= ppdRasterExecPS(h, &preferred_bits, code);
free(code);
}
if ((code = ppdEmitString(ppd, PPD_ORDER_PAGE, 0.0)) != NULL)
{
- status |= _ppdRasterExecPS(h, &preferred_bits, code);
+ status |= ppdRasterExecPS(h, &preferred_bits, code);
free(code);
}
}
/*
- * '_ppdRasterExecPS()' - Execute PostScript code to initialize a page header.
+ * 'ppdRasterExecPS()' - Execute PostScript code to initialize a page header.
*/
int /* O - 0 on success, -1 on error */
-_ppdRasterExecPS(
+ppdRasterExecPS(
cups_page_header2_t *h, /* O - Page header */
int *preferred_bits,/* O - Preferred bits per color */
const char *code) /* I - PS code to execute */
*codeptr; /* Pointer into copy of code */
- DEBUG_printf(("_ppdRasterExecPS(h=%p, preferred_bits=%p, code=\"%s\")\n",
+ DEBUG_printf(("ppdRasterExecPS(h=%p, preferred_bits=%p, code=\"%s\")\n",
h, preferred_bits, code));
/*
while ((obj = ppd_scan_ps(st, &codeptr)) != NULL)
{
#ifdef DEBUG
- DEBUG_printf(("_ppdRasterExecPS: Stack (%d objects)", st->num_objs));
- ppd_DEBUG_object("_ppdRasterExecPS", obj);
+ DEBUG_printf(("ppdRasterExecPS: Stack (%d objects)", st->num_objs));
+ ppd_DEBUG_object("ppdRasterExecPS", obj);
#endif /* DEBUG */
switch (obj->type)
#ifdef DEBUG
DEBUG_puts("1_cupsRasterExecPS: dup");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
break;
ppd_copy_stack(st, (int)obj->value.number);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: copy");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: copy");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
}
break;
ppd_copy_stack(st, 1);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: dup");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: dup");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
break;
ppd_index_stack(st, (int)obj->value.number);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: index");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: index");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
}
break;
ppd_pop_stack(st);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: pop");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: pop");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
break;
ppd_roll_stack(st, (int)obj->value.number, c);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: roll");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: roll");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
}
}
ppd_setpagedevice(st, h, preferred_bits);
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: setpagedevice");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: setpagedevice");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
break;
case PPD_PS_OTHER :
_ppdRasterAddError("Unknown operator \"%s\".\n", obj->value.other);
error = 1;
- DEBUG_printf(("_ppdRasterExecPS: Unknown operator \"%s\".", obj->value.other));
+ DEBUG_printf(("ppdRasterExecPS: Unknown operator \"%s\".", obj->value.other));
break;
}
ppd_error_stack(st, "Stack not empty:");
#ifdef DEBUG
- DEBUG_puts("_ppdRasterExecPS: Stack not empty");
- ppd_DEBUG_stack("_ppdRasterExecPS", st);
+ DEBUG_puts("ppdRasterExecPS: Stack not empty");
+ ppd_DEBUG_stack("ppdRasterExecPS", st);
#endif /* DEBUG */
ppd_delete_stack(st);
/*
- * This stub wraps the _ppdRasterInterpretPPD function in libcups - this allows
+ * This stub wraps the ppdRasterInterpretPPD function in libcups - this allows
* one library to provide all of the CUPS API functions while still supporting
* the old split library organization...
*/
cups_option_t *options, /* I - Options */
cups_interpret_cb_t func) /* I - Optional page header callback (@code NULL@ for none) */
{
- return (_ppdRasterInterpretPPD(h, ppd, num_options, options, func));
+ return (ppdRasterInterpretPPD(h, ppd, num_options, options, func));
}
fputs("ppdOpenFile(test.ppd): ", stdout);
- if ((ppd = _ppdOpenFile("test.ppd", _PPD_LOCALIZATION_ALL)) != NULL)
+ if ((ppd = ppdOpenFileWithLocalization("test.ppd", _PPD_LOCALIZATION_ALL)) != NULL)
puts("PASS");
else
{
ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", sizeof(pattrs) / sizeof(pattrs[0]), NULL, pattrs);
response = cupsDoRequest(http, request, resource);
- if (_ppdCreateFromIPP(buffer, sizeof(buffer), response))
+ if (ppdCreateFromIPPCUPS(buffer, sizeof(buffer), response))
printf("Created PPD: %s\n", buffer);
else
puts("Unable to create PPD.");
attr->text, attr->value ? attr->value : "");
puts("\nPPD Cache:");
- if ((pc = _ppdCacheCreateWithPPD(ppd)) == NULL)
+ if ((pc = ppdCacheCreateWithPPD(ppd)) == NULL)
printf(" Unable to create: %s\n", cupsLastErrorString());
else
{
- _ppdCacheWriteFile(pc, "t.cache", NULL);
+ ppdCacheWriteFile(pc, "t.cache", NULL);
puts(" Wrote t.cache.");
}
}
* Test PS exec code...
*/
- fputs("_ppdRasterExecPS(\"setpagedevice\"): ", stdout);
+ fputs("ppdRasterExecPS(\"setpagedevice\"): ", stdout);
fflush(stdout);
memset(&header, 0, sizeof(header));
header.Collate = CUPS_TRUE;
preferred_bits = 0;
- if (_ppdRasterExecPS(&header, &preferred_bits, setpagedevice_code))
+ if (ppdRasterExecPS(&header, &preferred_bits, setpagedevice_code))
{
puts("FAIL (error from function)");
puts(_ppdRasterErrorString());
else
puts("PASS");
- fputs("_ppdRasterExecPS(\"roll\"): ", stdout);
+ fputs("ppdRasterExecPS(\"roll\"): ", stdout);
fflush(stdout);
- if (_ppdRasterExecPS(&header, &preferred_bits,
+ if (ppdRasterExecPS(&header, &preferred_bits,
"792 612 0 0 0\n"
"pop pop pop\n"
"<</PageSize[5 -2 roll]/ImagingBBox null>>"
else
puts("PASS");
- fputs("_ppdRasterExecPS(\"dup index\"): ", stdout);
+ fputs("ppdRasterExecPS(\"dup index\"): ", stdout);
fflush(stdout);
- if (_ppdRasterExecPS(&header, &preferred_bits,
+ if (ppdRasterExecPS(&header, &preferred_bits,
"true false dup\n"
"<</Collate 4 index"
"/Duplex 5 index"
puts("PASS");
}
- fputs("_ppdRasterExecPS(\"%%Begin/EndFeature code\"): ", stdout);
+ fputs("ppdRasterExecPS(\"%%Begin/EndFeature code\"): ", stdout);
fflush(stdout);
- if (_ppdRasterExecPS(&header, &preferred_bits, dsc_code))
+ if (ppdRasterExecPS(&header, &preferred_bits, dsc_code))
{
puts("FAIL (error from function)");
puts(_ppdRasterErrorString());