PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/vp_plugins/sptsd/cups/i18n.h

http://cupsfilter.googlecode.com/
C++ Header | 115 lines | 64 code | 20 blank | 31 comment | 0 complexity | 04c8c21b5e2daea56c327b6fd89afb20 MD5 | raw file
  1/*
  2 * "$Id: i18n.h 8431 2009-03-12 22:59:58Z mike $"
  3 *
  4 *   (Private) localization support for the Common UNIX Printing System (CUPS).
  5 *
  6 *   Copyright 2007-2008 by Apple Inc.
  7 *   Copyright 1997-2006 by Easy Software Products.
  8 *
  9 *   These coded instructions, statements, and computer programs are the
 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/".
 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
 25#  include <stdio.h>
 26#  include "transcode.h"
 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
 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
 80
 81/*
 82 * Prototypes...
 83 */
 84
 85#ifdef __APPLE__
 86extern const char	*_cupsAppleLanguage(const char *locale, char *language,
 87			                    size_t langsize);
 88#endif /* __APPLE__ */
 89extern void		_cupsCharmapFlush(void);
 90extern void		_cupsCharmapFree(const cups_encoding_t encoding);
 91extern void		*_cupsCharmapGet(const cups_encoding_t encoding);
 92extern const char	*_cupsEncodingName(cups_encoding_t encoding);
 93extern void		_cupsLangPrintError(const char *message);
 94extern int		_cupsLangPrintf(FILE *fp, const char *message, ...)
 95#    ifdef __GNUC__
 96__attribute__ ((__format__ (__printf__, 2, 3)))
 97#    endif /* __GNUC__ */
 98;
 99extern int		_cupsLangPuts(FILE *fp, const char *message);
100extern const char	*_cupsLangString(cups_lang_t *lang, const char *message);
101extern void		_cupsMessageFree(cups_array_t *a);
102extern cups_array_t	*_cupsMessageLoad(const char *filename, int unquote);
103extern const char	*_cupsMessageLookup(cups_array_t *a, const char *m);
104extern void		_cupsSetLocale(char *argv[]);
105
106
107#  ifdef __cplusplus
108}
109#  endif /* __cplusplus */
110
111#endif /* !_CUPS_I18N_H_ */
112
113/*
114 * End of "$Id: i18n.h 8431 2009-03-12 22:59:58Z mike $".
115 */