]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/i18n.h
Import CUPS trunk (1.4svn) r7116.
[thirdparty/cups.git] / cups / i18n.h
CommitLineData
ef416fc2 1/*
bc44d920 2 * "$Id: i18n.h 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3 *
4 * (Private) localization support for the Common UNIX Printing System (CUPS).
5 *
bc44d920 6 * Copyright 2007 by Apple Inc.
ef416fc2 7 * Copyright 1997-2006 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 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
d6ae789d 25# include <stdio.h>
e1d6a774 26# include "transcode.h"
ef416fc2 27
28# ifdef __cplusplus
29extern "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
44typedef struct _cups_message_s /**** Message catalog entry ****/
45{
46 char *id, /* Original string */
47 *str; /* Localized string */
48} _cups_message_t;
49
e1d6a774 50typedef 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
59typedef 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
65typedef 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
ef416fc2 80
81/*
82 * Prototypes...
83 */
84
0a682745
MS
85#ifdef __APPLE__
86extern const char *_cupsAppleLanguage(const char *locale, char *language,
87 size_t langsize);
88#endif /* __APPLE__ */
d6ae789d 89extern void _cupsCharmapFlush(void);
e1d6a774 90extern void _cupsCharmapFree(const cups_encoding_t encoding);
91extern void *_cupsCharmapGet(const cups_encoding_t encoding);
ef416fc2 92extern const char *_cupsEncodingName(cups_encoding_t encoding);
fa73b229 93extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
ef416fc2 94# ifdef __GNUC__
fa73b229 95__attribute__ ((__format__ (__printf__, 2, 3)))
ef416fc2 96# endif /* __GNUC__ */
97;
fa73b229 98extern int _cupsLangPuts(FILE *fp, const char *message);
ef416fc2 99extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
100extern void _cupsMessageFree(cups_array_t *a);
101extern cups_array_t *_cupsMessageLoad(const char *filename);
102extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
07725fee 103extern void _cupsSetLocale(char *argv[]);
ef416fc2 104
105# ifdef __cplusplus
106}
107# endif /* __cplusplus */
108
109#endif /* !_CUPS_I18N_H_ */
110
111/*
bc44d920 112 * End of "$Id: i18n.h 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 113 */