diff --git a/cups/http.c b/cups/http.c index c827099cb..669195e60 100644 --- a/cups/http.c +++ b/cups/http.c @@ -639,6 +639,18 @@ httpFieldValue(const char *name) // I - String name return (HTTP_FIELD_UNKNOWN); } +// +// 'httpFieldString()' - Return the field name for a HTTP field enumeration. +// + +const char * // O - Field name +httpFieldString(http_field_t field) // I - Field index +{ + if (field >= HTTP_FIELD_ACCEPT && field < HTTP_FIELD_MAX) + return (http_fields[field]); + else + return (NULL); +} // // 'httpFlush()' - Flush data read from a HTTP connection. diff --git a/cups/http.h b/cups/http.h index 543b13117..b2fc464da 100644 --- a/cups/http.h +++ b/cups/http.h @@ -445,6 +445,7 @@ extern char *httpDecode64(char *out, size_t *outlen, const char *in, const char extern char *httpEncode64(char *out, size_t outlen, const char *in, size_t inlen, bool url) _CUPS_PUBLIC; extern http_field_t httpFieldValue(const char *name) _CUPS_PUBLIC; +extern const char *httpFieldString(http_field_t field) _CUPS_PUBLIC; extern void httpFlush(http_t *http) _CUPS_PUBLIC; extern int httpFlushWrite(http_t *http) _CUPS_PUBLIC; diff --git a/cups/libcups3.def b/cups/libcups3.def index 5dd05acf7..2923542cd 100644 --- a/cups/libcups3.def +++ b/cups/libcups3.def @@ -375,6 +375,7 @@ httpCopyPeerCredentials httpDecode64 httpEncode64 httpFieldValue +httpFieldString httpFlush httpFlushWrite httpGetActivity