]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/language-private.h
Last of the media improvements (Issue #5167)
[thirdparty/cups.git] / cups / language-private.h
1 /*
2 * Private localization support for CUPS.
3 *
4 * Copyright 2007-2017 by Apple Inc.
5 * Copyright 1997-2006 by Easy Software Products.
6 *
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
8 */
9
10 #ifndef _CUPS_LANGUAGE_PRIVATE_H_
11 # define _CUPS_LANGUAGE_PRIVATE_H_
12
13 /*
14 * Include necessary headers...
15 */
16
17 # include <stdio.h>
18 # include <cups/transcode.h>
19 # ifdef __APPLE__
20 # include <CoreFoundation/CoreFoundation.h>
21 # endif /* __APPLE__ */
22
23 # ifdef __cplusplus
24 extern "C" {
25 # endif /* __cplusplus */
26
27
28 /*
29 * Macro for localized text...
30 */
31
32 # define _(x) x
33
34
35 /*
36 * Constants...
37 */
38
39 # define _CUPS_MESSAGE_PO 0 /* Message file is in GNU .po format */
40 # define _CUPS_MESSAGE_UNQUOTE 1 /* Unescape \foo in strings? */
41 # define _CUPS_MESSAGE_STRINGS 2 /* Message file is in Apple .strings format */
42
43
44 /*
45 * Types...
46 */
47
48 typedef struct _cups_message_s /**** Message catalog entry ****/
49 {
50 char *msg, /* Original string */
51 *str; /* Localized string */
52 } _cups_message_t;
53
54
55 /*
56 * Prototypes...
57 */
58
59 # ifdef __APPLE__
60 extern const char *_cupsAppleLanguage(const char *locale, char *language, size_t langsize);
61 extern const char *_cupsAppleLocale(CFStringRef languageName, char *locale, size_t localesize);
62 # endif /* __APPLE__ */
63 extern void _cupsCharmapFlush(void);
64 extern const char *_cupsEncodingName(cups_encoding_t encoding);
65 extern void _cupsLangPrintError(const char *prefix,
66 const char *message);
67 extern int _cupsLangPrintFilter(FILE *fp, const char *prefix,
68 const char *message, ...)
69 __attribute__ ((__format__ (__printf__, 3, 4)));
70 extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
71 __attribute__ ((__format__ (__printf__, 2, 3)));
72 extern int _cupsLangPuts(FILE *fp, const char *message);
73 extern const char *_cupsLangString(cups_lang_t *lang,
74 const char *message);
75 extern void _cupsMessageFree(cups_array_t *a);
76 extern cups_array_t *_cupsMessageLoad(const char *filename, int flags);
77 extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
78 extern cups_array_t *_cupsMessageNew(void *context);
79 extern void _cupsSetLocale(char *argv[]);
80
81
82 # ifdef __cplusplus
83 }
84 # endif /* __cplusplus */
85
86 #endif /* !_CUPS_LANGUAGE_PRIVATE_H_ */