/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. #ifndef _CUPS_I18N_H_
  18. # define _CUPS_I18N_H_
  19. /*
  20. * Include necessary headers...
  21. */
  22. # include <stdio.h>
  23. # include "transcode.h"
  24. # ifdef __cplusplus
  25. extern "C" {
  26. # endif /* __cplusplus */
  27. /*
  28. * Macro for localized text...
  29. */
  30. # define _(x) x
  31. /*
  32. * Types...
  33. */
  34. typedef struct _cups_message_s /**** Message catalog entry ****/
  35. {
  36. char *id, /* Original string */
  37. *str; /* Localized string */
  38. } _cups_message_t;
  39. typedef struct _cups_cmap_s /**** SBCS Charmap Struct ****/
  40. {
  41. struct _cups_cmap_s *next; /* Next charmap in cache */
  42. int used; /* Number of times entry used */
  43. cups_encoding_t encoding; /* Legacy charset encoding */
  44. cups_ucs2_t char2uni[256]; /* Map Legacy SBCS -> UCS-2 */
  45. cups_sbcs_t *uni2char[256]; /* Map UCS-2 -> Legacy SBCS */
  46. } _cups_cmap_t;
  47. typedef struct _cups_wide2uni_s /**** Wide to Unicode ****/
  48. {
  49. cups_vbcs_t widechar; /* VBCS 32-bit Char (EUC) */
  50. cups_ucs2_t unichar; /* UCS-2 Char */
  51. } _cups_wide2uni_t;
  52. typedef struct _cups_vmap_s /**** VBCS Charmap Struct ****/
  53. {
  54. struct _cups_vmap_s *next; /* Next charmap in cache */
  55. int used; /* Number of times entry used */
  56. cups_encoding_t encoding; /* Legacy charset encoding */
  57. cups_ucs2_t *char2uni[256]; /* Map 16-bit Char -> UCS-2 */
  58. int charcount; /* Count of 16-bit VBCS Chars */
  59. _cups_wide2uni_t *wide2uni; /* Map 32-bit Char -> UCS-2 */
  60. int widecount; /* Count of 32-bit VBCS Chars */
  61. cups_vbcs_t *uni2char[256]; /* Map UCS-2 -> 32-bit VBCS */
  62. cups_sbcs_t lead2char[256]; /* Legacy Lead Char - 2-byte */
  63. cups_sbcs_t lead3char[256]; /* Legacy Lead Char - 3-byte */
  64. cups_sbcs_t lead4char[256]; /* Legacy Lead Char - 4-byte */
  65. } _cups_vmap_t;
  66. /*
  67. * Prototypes...
  68. */
  69. #ifdef __APPLE__
  70. extern const char *_cupsAppleLanguage(const char *locale, char *language,
  71. size_t langsize);
  72. #endif /* __APPLE__ */
  73. extern void _cupsCharmapFlush(void);
  74. extern void _cupsCharmapFree(const cups_encoding_t encoding);
  75. extern void *_cupsCharmapGet(const cups_encoding_t encoding);
  76. extern const char *_cupsEncodingName(cups_encoding_t encoding);
  77. extern void _cupsLangPrintError(const char *message);
  78. extern int _cupsLangPrintf(FILE *fp, const char *message, ...)
  79. # ifdef __GNUC__
  80. __attribute__ ((__format__ (__printf__, 2, 3)))
  81. # endif /* __GNUC__ */
  82. ;
  83. extern int _cupsLangPuts(FILE *fp, const char *message);
  84. extern const char *_cupsLangString(cups_lang_t *lang, const char *message);
  85. extern void _cupsMessageFree(cups_array_t *a);
  86. extern cups_array_t *_cupsMessageLoad(const char *filename, int unquote);
  87. extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
  88. extern void _cupsSetLocale(char *argv[]);
  89. # ifdef __cplusplus
  90. }
  91. # endif /* __cplusplus */
  92. #endif /* !_CUPS_I18N_H_ */
  93. /*
  94. * End of "$Id: i18n.h 8431 2009-03-12 22:59:58Z mike $".
  95. */