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