]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/i18n.h
Merge changes from CUPS 1.5svn-r9000.
[thirdparty/cups.git] / cups / i18n.h
1 /*
2 * "$Id: i18n.h 7363 2008-03-03 22:19:24Z mike $"
3 *
4 * (Private) localization support for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 2007-2008 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
18 #ifndef _CUPS_I18N_H_
19 # define _CUPS_I18N_H_
20
21 /*
22 * Include necessary headers...
23 */
24
25 # include <stdio.h>
26 # include "transcode.h"
27
28 # ifdef __cplusplus
29 extern "C" {
30 # endif /* __cplusplus */
31
32
33 /*
34 * Macro for localized text...
35 */
36
37 # define _(x) x
38
39
40 /*
41 * Types...
42 */
43
44 typedef struct _cups_message_s /**** Message catalog entry ****/
45 {
46 char *id, /* Original string */
47 *str; /* Localized string */
48 } _cups_message_t;
49
50 typedef struct _cups_cmap_s /**** SBCS Charmap Struct ****/
51 {
52 struct _cups_cmap_s *next; /* Next charmap in cache */
53 int used; /* Number of times entry used */
54 cups_encoding_t encoding; /* Legacy charset encoding */
55 cups_ucs2_t char2uni[256]; /* Map Legacy SBCS -> UCS-2 */
56 cups_sbcs_t *uni2char[256]; /* Map UCS-2 -> Legacy SBCS */
57 } _cups_cmap_t;
58
59 typedef struct _cups_wide2uni_s /**** Wide to Unicode ****/
60 {
61 cups_vbcs_t widechar; /* VBCS 32-bit Char (EUC) */
62 cups_ucs2_t unichar; /* UCS-2 Char */
63 } _cups_wide2uni_t;
64
65 typedef struct _cups_vmap_s /**** VBCS Charmap Struct ****/
66 {
67 struct _cups_vmap_s *next; /* Next charmap in cache */
68 int used; /* Number of times entry used */
69 cups_encoding_t encoding; /* Legacy charset encoding */
70 cups_ucs2_t *char2uni[256]; /* Map 16-bit Char -> UCS-2 */
71 int charcount; /* Count of 16-bit VBCS Chars */
72 _cups_wide2uni_t *wide2uni; /* Map 32-bit Char -> UCS-2 */
73 int widecount; /* Count of 32-bit VBCS Chars */
74 cups_vbcs_t *uni2char[256]; /* Map UCS-2 -> 32-bit VBCS */
75 cups_sbcs_t lead2char[256]; /* Legacy Lead Char - 2-byte */
76 cups_sbcs_t lead3char[256]; /* Legacy Lead Char - 3-byte */
77 cups_sbcs_t lead4char[256]; /* Legacy Lead Char - 4-byte */
78 } _cups_vmap_t;
79
80
81 /*
82 * Prototypes...
83 */
84
85 # ifdef __APPLE__
86 extern const char *_cupsAppleLanguage(const char *locale, char *language,
87 size_t langsize);
88 # endif /* __APPLE__ */
89 extern void _cupsCharmapFlush(void);
90 extern void _cupsCharmapFree(const cups_encoding_t encoding);
91 extern void *_cupsCharmapGet(const cups_encoding_t encoding);
92 extern const char *_cupsEncodingName(cups_encoding_t encoding);
93 extern void _cupsLangPrintError(const char *message);
94 extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
95 # ifdef __GNUC__
96 __attribute__ ((__format__ (__printf__, 2, 3)))
97 # endif /* __GNUC__ */
98 ;
99 extern int _cupsLangPuts(FILE *fp, const char *message);
100 extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
101 extern void _cupsMessageFree(cups_array_t *a);
102 extern cups_array_t *_cupsMessageLoad(const char *filename, int unquote);
103 extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
104 extern void _cupsSetLocale(char *argv[]);
105
106
107 # ifdef __cplusplus
108 }
109 # endif /* __cplusplus */
110
111 #endif /* !_CUPS_I18N_H_ */
112
113 /*
114 * End of "$Id: i18n.h 7363 2008-03-03 22:19:24Z mike $".
115 */