MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ppd_put_string

Function ppd_put_string

cups/ppd-cache.c:5448–5478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5446 */
5447
5448static void
5449ppd_put_string(cups_file_t *fp, /* I - PPD file */
5450 cups_lang_t *lang, /* I - Language */
5451 cups_array_t *strings, /* I - Strings */
5452 const char *ppd_option,/* I - PPD option */
5453 const char *ppd_choice,/* I - PPD choice */
5454 const char *pwg_msgid) /* I - PWG message ID */
5455{
5456 const char *text; /* Localized text */
5457
5458
5459 if ((text = _cupsLangString(lang, pwg_msgid)) == pwg_msgid || !strcmp(pwg_msgid, text))
5460 {
5461 if ((text = _cupsMessageLookup(strings, pwg_msgid)) == pwg_msgid)
5462 return;
5463 }
5464
5465 // Add the first line of localized text...
5466 cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice);
5467 while (*text && *text != '\n')
5468 {
5469 // Escape ":" and "<"...
5470 if (*text == ':' || *text == '<')
5471 cupsFilePrintf(fp, "<%02X>", *text);
5472 else
5473 cupsFilePutChar(fp, *text);
5474
5475 text ++;
5476 }
5477 cupsFilePuts(fp, ": \"\"\n");
5478}
5479
5480
5481/*

Callers 1

_ppdCreateFromIPP2Function · 0.85

Calls 5

_cupsLangStringFunction · 0.85
_cupsMessageLookupFunction · 0.85
cupsFilePrintfFunction · 0.85
cupsFilePutCharFunction · 0.85
cupsFilePutsFunction · 0.85

Tested by

no test coverage detected