diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-04-22 17:28:12 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-04-22 17:28:12 +0000 |
commit | e07d4801f9846b9155d4c63872f51b18d8537d01 (patch) | |
tree | 5d86f7517a23788405e78b36d0a91c6898d3390d /cups/language.c | |
parent | 38e73f87814ea3029636fb1850b0483884b3cbbe (diff) | |
download | cups-e07d4801f9846b9155d4c63872f51b18d8537d01.tar.gz |
Merge changes from CUPS 1.4svn-r8540.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1432 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/language.c')
-rw-r--r-- | cups/language.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/cups/language.c b/cups/language.c index 02efaac0f..39ef43569 100644 --- a/cups/language.c +++ b/cups/language.c @@ -3,7 +3,7 @@ * * I18N/language support for the Common UNIX Printing System (CUPS). * - * Copyright 2007-2008 by Apple Inc. + * Copyright 2007-2009 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -429,7 +429,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ }; - DEBUG_printf(("cupsLangGet(language=\"%s\")\n", language ? language : "(null)")); + DEBUG_printf(("cupsLangGet(language=\"%s\")", language)); #ifdef __APPLE__ /* @@ -448,7 +448,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ if ((language = getenv("LANG")) == NULL) language = appleLangDefault(); - DEBUG_printf(("cupsLangGet: language=\"%s\"\n", language)); + DEBUG_printf(("2cupsLangGet: language=\"%s\"", language)); } #else @@ -477,8 +477,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ ptr = setlocale(LC_ALL, NULL); # endif /* LC_MESSAGES */ - DEBUG_printf(("cupsLangGet: current locale is \"%s\"\n", - ptr ? ptr : "(null)")); + DEBUG_printf(("2cupsLangGet: current locale is \"%s\"", ptr)); if (!ptr || !strcmp(ptr, "C") || !strcmp(ptr, "POSIX")) { @@ -526,7 +525,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ if (!strncmp(locale, "nb", 2)) locale[1] = 'o'; - DEBUG_printf(("cupsLangGet: new language value is \"%s\"\n", language)); + DEBUG_printf(("2cupsLangGet: new language value is \"%s\"", language)); } } #endif /* __APPLE__ */ @@ -563,8 +562,8 @@ cupsLangGet(const char *language) /* I - Language or locale */ *ptr = '\0'; - DEBUG_printf(("cupsLangGet: charset set to \"%s\" via nl_langinfo(CODESET)...\n", - charset)); + DEBUG_printf(("2cupsLangGet: charset set to \"%s\" via " + "nl_langinfo(CODESET)...", charset)); } #endif /* CODESET */ @@ -643,7 +642,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ } } - DEBUG_printf(("cupsLangGet: langname=\"%s\", country=\"%s\", charset=\"%s\"\n", + DEBUG_printf(("2cupsLangGet: langname=\"%s\", country=\"%s\", charset=\"%s\"", langname, country, charset)); /* @@ -681,7 +680,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ } } - DEBUG_printf(("cupsLangGet: encoding=%d(%s)\n", encoding, + DEBUG_printf(("2cupsLangGet: encoding=%d(%s)", encoding, encoding == CUPS_AUTO_ENCODING ? "auto" : lang_encodings[encoding])); @@ -712,7 +711,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ pthread_mutex_unlock(&lang_mutex); #endif /* HAVE_PTHREAD_H */ - DEBUG_printf(("cupsLangGet: Using cached copy of \"%s\"...\n", real)); + DEBUG_printf(("1cupsLangGet: Using cached copy of \"%s\"...", real)); return (lang); } @@ -732,7 +731,7 @@ cupsLangGet(const char *language) /* I - Language or locale */ * No generic localization, so use POSIX... */ - DEBUG_printf(("cupsLangGet: access(\"%s\", 0): %s\n", filename, + DEBUG_printf(("2cupsLangGet: access(\"%s\", 0): %s", filename, strerror(errno))); snprintf(filename, sizeof(filename), "%s/C/cups_C.po", cg->localedir); @@ -895,7 +894,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */ int length; /* Length of combined strings */ - DEBUG_printf(("_cupsMessageLoad(filename=\"%s\")\n", filename)); + DEBUG_printf(("4_cupsMessageLoad(filename=\"%s\")", filename)); /* * Create an array to hold the messages... @@ -903,7 +902,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */ if ((a = cupsArrayNew((cups_array_func_t)cups_message_compare, NULL)) == NULL) { - DEBUG_puts("_cupsMessageLoad: Unable to allocate array!"); + DEBUG_puts("5_cupsMessageLoad: Unable to allocate array!"); return (NULL); } @@ -913,7 +912,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */ if ((fp = cupsFileOpen(filename, "r")) == NULL) { - DEBUG_printf(("_cupsMessageLoad: Unable to open file: %s\n", + DEBUG_printf(("5_cupsMessageLoad: Unable to open file: %s", strerror(errno))); return (a); } @@ -1068,7 +1067,7 @@ _cupsMessageLoad(const char *filename, /* I - Message catalog to load */ cupsFileClose(fp); - DEBUG_printf(("_cupsMessageLoad: Returning %d messages...\n", + DEBUG_printf(("5_cupsMessageLoad: Returning %d messages...", cupsArrayCount(a))); return (a); @@ -1165,7 +1164,7 @@ appleLangDefault(void) kCFStringEncodingASCII); CFRelease(localeName); - DEBUG_printf(("appleLangDefault: cg->language=\"%s\"\n", + DEBUG_printf(("9appleLangDefault: cg->language=\"%s\"", cg->language)); /* @@ -1179,7 +1178,7 @@ appleLangDefault(void) { if (!strcmp(cg->language, apple_language_locale[i].language)) { - DEBUG_printf(("appleLangDefault: mapping \"%s\" to \"%s\"...\n", + DEBUG_printf(("9appleLangDefault: mapping \"%s\" to \"%s\"...", cg->language, apple_language_locale[i].locale)); strlcpy(cg->language, apple_language_locale[i].locale, sizeof(cg->language)); @@ -1232,7 +1231,7 @@ cups_cache_lookup(const char *name,/* I - Name of locale */ cups_lang_t *lang; /* Current language */ - DEBUG_printf(("cups_cache_lookup(name=\"%s\", encoding=%d(%s))\n", name, + DEBUG_printf(("7cups_cache_lookup(name=\"%s\", encoding=%d(%s))", name, encoding, encoding == CUPS_AUTO_ENCODING ? "auto" : lang_encodings[encoding])); @@ -1242,8 +1241,8 @@ cups_cache_lookup(const char *name,/* I - Name of locale */ for (lang = lang_cache; lang != NULL; lang = lang->next) { - DEBUG_printf(("cups_cache_lookup: lang=%p, language=\"%s\", encoding=%d(%s)\n", - lang, lang->language, lang->encoding, + DEBUG_printf(("9cups_cache_lookup: lang=%p, language=\"%s\", " + "encoding=%d(%s)", lang, lang->language, lang->encoding, lang_encodings[lang->encoding])); if (!strcmp(lang->language, name) && @@ -1251,13 +1250,13 @@ cups_cache_lookup(const char *name,/* I - Name of locale */ { lang->used ++; - DEBUG_puts("cups_cache_lookup: returning match!"); + DEBUG_puts("8cups_cache_lookup: returning match!"); return (lang); } } - DEBUG_puts("cups_cache_lookup: returning NULL!"); + DEBUG_puts("8cups_cache_lookup: returning NULL!"); return (NULL); } |