*/
# include "config.h"
+# include <cups/language.h>
# include <stddef.h>
# include <stdlib.h>
size_t resolved_size, int options,
int (*cb)(void *context),
void *context);
+extern const char *_httpStatus(cups_lang_t *lang, http_status_t status);
extern int _httpUpdate(http_t *http, http_status_t *status);
extern int _httpWait(http_t *http, int msec, int usessl);
* components.
* httpSeparateURI() - Separate a Universal Resource Identifier into its
* components.
+ * _httpStatus() - Return the localized string describing a HTTP
+ * status code.
* httpStatus() - Return a short string describing a HTTP status
* code.
* _cups_hstrerror() - hstrerror() emulation function for Solaris and
/*
- * 'httpStatus()' - Return a short string describing a HTTP status code.
+ * '_httpStatus()' - Return the localized string describing a HTTP status code.
*
- * The returned string is localized to the current POSIX locale and is based
- * on the status strings defined in RFC 2616.
+ * The returned string is localized using the passed message catalog.
*/
const char * /* O - Localized status string */
-httpStatus(http_status_t status) /* I - HTTP status code */
+_httpStatus(cups_lang_t *lang, /* I - Language */
+ http_status_t status) /* I - HTTP status code */
{
const char *s; /* Status string */
- _cups_globals_t *cg = _cupsGlobals(); /* Global data */
-
- if (!cg->lang_default)
- cg->lang_default = cupsLangDefault();
switch (status)
{
break;
}
- return (_cupsLangString(cg->lang_default, s));
+ return (_cupsLangString(lang, s));
+}
+
+
+/*
+ * 'httpStatus()' - Return a short string describing a HTTP status code.
+ *
+ * The returned string is localized to the current POSIX locale and is based
+ * on the status strings defined in RFC 2616.
+ */
+
+const char * /* O - Localized status string */
+httpStatus(http_status_t status) /* I - HTTP status code */
+{
+ _cups_globals_t *cg = _cupsGlobals(); /* Global data */
+
+
+ if (!cg->lang_default)
+ cg->lang_default = cupsLangDefault();
+
+ return (_httpStatus(cg->lang_default, status));
}
"<P>%s</P>\n"
"</BODY>\n"
"</HTML>\n",
- httpStatus(code), redirect, httpStatus(code), text);
+ _httpStatus(con->language, code), redirect,
+ _httpStatus(con->language, code), text);
if (httpPrintf(HTTP(con), "Content-Type: text/html; charset=utf-8\r\n") < 0)
return (0);