]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/i18n.h
Load cups into easysw/current.
[thirdparty/cups.git] / cups / i18n.h
CommitLineData
ef416fc2 1/*
d09495fa 2 * "$Id: i18n.h 5833 2006-08-16 20:05:58Z 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
d6ae789d 34# include <stdio.h>
e1d6a774 35# include "transcode.h"
ef416fc2 36
37# ifdef __cplusplus
38extern "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
53typedef struct _cups_message_s /**** Message catalog entry ****/
54{
55 char *id, /* Original string */
56 *str; /* Localized string */
57} _cups_message_t;
58
e1d6a774 59typedef 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
68typedef 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
74typedef 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
ef416fc2 89
90/*
91 * Prototypes...
92 */
93
d6ae789d 94extern void _cupsCharmapFlush(void);
e1d6a774 95extern void _cupsCharmapFree(const cups_encoding_t encoding);
96extern void *_cupsCharmapGet(const cups_encoding_t encoding);
ef416fc2 97extern const char *_cupsEncodingName(cups_encoding_t encoding);
fa73b229 98extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
ef416fc2 99# ifdef __GNUC__
fa73b229 100__attribute__ ((__format__ (__printf__, 2, 3)))
ef416fc2 101# endif /* __GNUC__ */
102;
fa73b229 103extern int _cupsLangPuts(FILE *fp, const char *message);
ef416fc2 104extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
105extern void _cupsMessageFree(cups_array_t *a);
106extern cups_array_t *_cupsMessageLoad(const char *filename);
107extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
d09495fa 108extern void _cupsSetLocale(void);
ef416fc2 109
110# ifdef __cplusplus
111}
112# endif /* __cplusplus */
113
114#endif /* !_CUPS_I18N_H_ */
115
116/*
d09495fa 117 * End of "$Id: i18n.h 5833 2006-08-16 20:05:58Z mike $".
ef416fc2 118 */