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