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  * These coded instructions, statements, and computer programs are the
8  * property of Apple Inc. and are protected by Federal copyright
9  * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
10  * which should have been included with this file.  If this file is
11  * missing or damaged, see the license at "http://www.cups.org/".
12  *
13  * This file is subject to the Apple OS-Developed Software exception.
14  */
15 
16 #ifndef _CUPS_LANGUAGE_PRIVATE_H_
17 #  define _CUPS_LANGUAGE_PRIVATE_H_
18 
19 /*
20  * Include necessary headers...
21  */
22 
23 #  include <stdio.h>
24 #  include <cups/transcode.h>
25 #  ifdef __APPLE__
26 #    include <CoreFoundation/CoreFoundation.h>
27 #  endif /* __APPLE__ */
28 
29 #  ifdef __cplusplus
30 extern "C" {
31 #  endif /* __cplusplus */
32 
33 
34 /*
35  * Macro for localized text...
36  */
37 
38 #  define _(x) x
39 
40 
41 /*
42  * Types...
43  */
44 
45 typedef struct _cups_message_s		/**** Message catalog entry ****/
46 {
47   char	*id,				/* Original string */
48 	*str;				/* Localized string */
49 } _cups_message_t;
50 
51 
52 /*
53  * Prototypes...
54  */
55 
56 #  ifdef __APPLE__
57 extern const char	*_cupsAppleLanguage(const char *locale, char *language, size_t langsize);
58 extern const char	*_cupsAppleLocale(CFStringRef languageName, char *locale, size_t localesize);
59 #  endif /* __APPLE__ */
60 extern void		_cupsCharmapFlush(void);
61 extern const char	*_cupsEncodingName(cups_encoding_t encoding);
62 extern void		_cupsLangPrintError(const char *prefix,
63 			                    const char *message);
64 extern int		_cupsLangPrintFilter(FILE *fp, const char *prefix,
65 			                     const char *message, ...)
66 			__attribute__ ((__format__ (__printf__, 3, 4)));
67 extern int		_cupsLangPrintf(FILE *fp, const char *message, ...)
68 			__attribute__ ((__format__ (__printf__, 2, 3)));
69 extern int		_cupsLangPuts(FILE *fp, const char *message);
70 extern const char	*_cupsLangString(cups_lang_t *lang,
71 			                 const char *message);
72 extern void		_cupsMessageFree(cups_array_t *a);
73 extern cups_array_t	*_cupsMessageLoad(const char *filename, int unquote);
74 extern const char	*_cupsMessageLookup(cups_array_t *a, const char *m);
75 extern cups_array_t	*_cupsMessageNew(void *context);
76 extern void		_cupsSetLocale(char *argv[]);
77 
78 
79 #  ifdef __cplusplus
80 }
81 #  endif /* __cplusplus */
82 
83 #endif /* !_CUPS_LANGUAGE_PRIVATE_H_ */
84