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