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

Function ipp_get_code

cups/ipp.c:5622–5650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5620 */
5621
5622static char * /* O - Language code string */
5623ipp_get_code(const char *value, /* I - Locale/charset string */
5624 char *buffer, /* I - String buffer */
5625 size_t bufsize) /* I - Size of string buffer */
5626{
5627 char *bufptr, /* Pointer into buffer */
5628 *bufend; /* End of buffer */
5629
5630
5631 /*
5632 * Convert values to lowercase and change _ to - as needed...
5633 */
5634
5635 for (bufptr = buffer, bufend = buffer + bufsize - 1;
5636 *value && bufptr < bufend;
5637 value ++)
5638 if (*value == '_')
5639 *bufptr++ = '-';
5640 else
5641 *bufptr++ = (char)_cups_tolower(*value);
5642
5643 *bufptr = '\0';
5644
5645 /*
5646 * Return the converted string...
5647 */
5648
5649 return (buffer);
5650}
5651
5652
5653/*

Callers 3

ippAddStringFunction · 0.85
ippAddStringsFunction · 0.85
ipp_lang_codeFunction · 0.85

Calls 1

_cups_tolowerFunction · 0.85

Tested by

no test coverage detected