]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
e1d6a774 | 2 | * "$Id: i18n.h 5294 2006-03-15 21:09:32Z mike $" |
ef416fc2 | 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 | ||
e1d6a774 | 34 | # include "transcode.h" |
ef416fc2 | 35 | |
36 | # ifdef __cplusplus | |
37 | extern "C" { | |
38 | # endif /* __cplusplus */ | |
39 | ||
40 | ||
41 | /* | |
42 | * Macro for localized text... | |
43 | */ | |
44 | ||
45 | # define _(x) x | |
46 | ||
47 | ||
48 | /* | |
49 | * Types... | |
50 | */ | |
51 | ||
52 | typedef struct _cups_message_s /**** Message catalog entry ****/ | |
53 | { | |
54 | char *id, /* Original string */ | |
55 | *str; /* Localized string */ | |
56 | } _cups_message_t; | |
57 | ||
e1d6a774 | 58 | typedef struct _cups_cmap_s /**** SBCS Charmap Struct ****/ |
59 | { | |
60 | struct _cups_cmap_s *next; /* Next charmap in cache */ | |
61 | int used; /* Number of times entry used */ | |
62 | cups_encoding_t encoding; /* Legacy charset encoding */ | |
63 | cups_ucs2_t char2uni[256]; /* Map Legacy SBCS -> UCS-2 */ | |
64 | cups_sbcs_t *uni2char[256]; /* Map UCS-2 -> Legacy SBCS */ | |
65 | } _cups_cmap_t; | |
66 | ||
67 | typedef struct _cups_wide2uni_s /**** Wide to Unicode ****/ | |
68 | { | |
69 | cups_vbcs_t widechar; /* VBCS 32-bit Char (EUC) */ | |
70 | cups_ucs2_t unichar; /* UCS-2 Char */ | |
71 | } _cups_wide2uni_t; | |
72 | ||
73 | typedef struct _cups_vmap_s /**** VBCS Charmap Struct ****/ | |
74 | { | |
75 | struct _cups_vmap_s *next; /* Next charmap in cache */ | |
76 | int used; /* Number of times entry used */ | |
77 | cups_encoding_t encoding; /* Legacy charset encoding */ | |
78 | cups_ucs2_t *char2uni[256]; /* Map 16-bit Char -> UCS-2 */ | |
79 | int charcount; /* Count of 16-bit VBCS Chars */ | |
80 | _cups_wide2uni_t *wide2uni; /* Map 32-bit Char -> UCS-2 */ | |
81 | int widecount; /* Count of 32-bit VBCS Chars */ | |
82 | cups_vbcs_t *uni2char[256]; /* Map UCS-2 -> 32-bit VBCS */ | |
83 | cups_sbcs_t lead2char[256]; /* Legacy Lead Char - 2-byte */ | |
84 | cups_sbcs_t lead3char[256]; /* Legacy Lead Char - 3-byte */ | |
85 | cups_sbcs_t lead4char[256]; /* Legacy Lead Char - 4-byte */ | |
86 | } _cups_vmap_t; | |
87 | ||
ef416fc2 | 88 | |
89 | /* | |
90 | * Prototypes... | |
91 | */ | |
92 | ||
e1d6a774 | 93 | extern void _cupsCharmapFree(const cups_encoding_t encoding); |
94 | extern void *_cupsCharmapGet(const cups_encoding_t encoding); | |
ef416fc2 | 95 | extern const char *_cupsEncodingName(cups_encoding_t encoding); |
fa73b229 | 96 | extern int _cupsLangPrintf(FILE *fp, const char *message, ...) |
ef416fc2 | 97 | # ifdef __GNUC__ |
fa73b229 | 98 | __attribute__ ((__format__ (__printf__, 2, 3))) |
ef416fc2 | 99 | # endif /* __GNUC__ */ |
100 | ; | |
fa73b229 | 101 | extern int _cupsLangPuts(FILE *fp, const char *message); |
ef416fc2 | 102 | extern const char *_cupsLangString(cups_lang_t *lang, const char *message); |
103 | extern void _cupsMessageFree(cups_array_t *a); | |
104 | extern cups_array_t *_cupsMessageLoad(const char *filename); | |
105 | extern const char *_cupsMessageLookup(cups_array_t *a, const char *m); | |
106 | ||
107 | # ifdef __cplusplus | |
108 | } | |
109 | # endif /* __cplusplus */ | |
110 | ||
111 | #endif /* !_CUPS_I18N_H_ */ | |
112 | ||
113 | /* | |
e1d6a774 | 114 | * End of "$Id: i18n.h 5294 2006-03-15 21:09:32Z mike $". |
ef416fc2 | 115 | */ |