]>
Commit | Line | Data |
---|---|---|
a501ad17 | 1 | /* |
2 | * "$Id$" | |
3 | * | |
4 | * (Private) localization support for the Common UNIX Printing System (CUPS). | |
5 | * | |
24c1b5ce | 6 | * Copyright 1997-2006 by Easy Software Products. |
a501ad17 | 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 | ||
26d63de4 | 34 | # include <stdio.h> |
6328324c | 35 | # include "transcode.h" |
a501ad17 | 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 | ||
ac340967 | 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 | ||
6328324c | 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 | ||
ac340967 | 89 | |
a501ad17 | 90 | /* |
91 | * Prototypes... | |
92 | */ | |
93 | ||
26d63de4 | 94 | extern void _cupsCharmapFlush(void); |
6328324c | 95 | extern void _cupsCharmapFree(const cups_encoding_t encoding); |
96 | extern void *_cupsCharmapGet(const cups_encoding_t encoding); | |
a501ad17 | 97 | extern const char *_cupsEncodingName(cups_encoding_t encoding); |
89fd567e | 98 | extern int _cupsLangPrintf(FILE *fp, const char *message, ...) |
a501ad17 | 99 | # ifdef __GNUC__ |
89fd567e | 100 | __attribute__ ((__format__ (__printf__, 2, 3))) |
a501ad17 | 101 | # endif /* __GNUC__ */ |
102 | ; | |
89fd567e | 103 | extern int _cupsLangPuts(FILE *fp, const char *message); |
a501ad17 | 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); | |
156dd8aa | 108 | extern void _cupsSetLocale(char *argv[]); |
a501ad17 | 109 | |
110 | # ifdef __cplusplus | |
111 | } | |
112 | # endif /* __cplusplus */ | |
113 | ||
114 | #endif /* !_CUPS_I18N_H_ */ | |
115 | ||
116 | /* | |
117 | * End of "$Id$". | |
118 | */ |