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

Function pwg_ppdize_name

cups/ppd-cache.c:5585–5620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5583 */
5584
5585static void
5586pwg_ppdize_name(const char *ipp, /* I - IPP keyword */
5587 char *name, /* I - Name buffer */
5588 size_t namesize) /* I - Size of name buffer */
5589{
5590 char *ptr, /* Pointer into name buffer */
5591 *end; /* End of name buffer */
5592
5593
5594 if (!ipp || !_cups_isalnum(*ipp))
5595 {
5596 *name = '\0';
5597 return;
5598 }
5599
5600 *name = (char)toupper(*ipp++);
5601
5602 for (ptr = name + 1, end = name + namesize - 1; *ipp && ptr < end;)
5603 {
5604 if (*ipp == '-' && _cups_isalnum(ipp[1]))
5605 {
5606 ipp ++;
5607 *ptr++ = (char)toupper(*ipp++ & 255);
5608 }
5609 else if (*ipp == '_' || *ipp == '.' || *ipp == '-' || _cups_isalnum(*ipp))
5610 {
5611 *ptr++ = *ipp++;
5612 }
5613 else
5614 {
5615 ipp ++;
5616 }
5617 }
5618
5619 *ptr = '\0';
5620}
5621
5622
5623/*

Callers 3

_ppdCreateFromIPP2Function · 0.85
_pwgInputSlotForSourceFunction · 0.85
_pwgMediaTypeForTypeFunction · 0.85

Calls 1

_cups_isalnumFunction · 0.85

Tested by

no test coverage detected