~ubuntu-branches/ubuntu/hardy/prelude-manager/hardy

« back to all changes in this revision

Viewing changes to libmissing/gettext.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2007-03-22 18:09:27 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070322180927-tzvkkuk7yc5m0s9d
Tags: 0.9.7.2-2
* Fix permissions on configuration file (make sure it is not world-readable)
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
/* Get declarations of GNU message catalog functions.  */
25
25
# include <libintl.h>
26
26
 
 
27
/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
 
28
   the gettext() and ngettext() macros.  This is an alternative to calling
 
29
   textdomain(), and is useful for libraries.  */
 
30
# ifdef DEFAULT_TEXT_DOMAIN
 
31
#  undef gettext
 
32
#  define gettext(Msgid) \
 
33
     dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
 
34
#  undef ngettext
 
35
#  define ngettext(Msgid1, Msgid2, N) \
 
36
     dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
 
37
# endif
 
38
 
27
39
#else
28
40
 
29
41
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
52
64
   On pre-ANSI systems without 'const', the config.h file is supposed to
53
65
   contain "#define const".  */
54
66
# define gettext(Msgid) ((const char *) (Msgid))
55
 
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
56
 
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
 
67
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
 
68
# define dcgettext(Domainname, Msgid, Category) \
 
69
    ((void) (Category), dgettext (Domainname, Msgid))
57
70
# define ngettext(Msgid1, Msgid2, N) \
58
 
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
 
71
    ((N) == 1 \
 
72
     ? ((void) (Msgid2), (const char *) (Msgid1)) \
 
73
     : ((void) (Msgid1), (const char *) (Msgid2)))
59
74
# define dngettext(Domainname, Msgid1, Msgid2, N) \
60
 
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
 
75
    ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
61
76
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
62
 
    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
 
77
    ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
63
78
# define textdomain(Domainname) ((const char *) (Domainname))
64
 
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
65
 
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
 
79
# define bindtextdomain(Domainname, Dirname) \
 
80
    ((void) (Domainname), (const char *) (Dirname))
 
81
# define bind_textdomain_codeset(Domainname, Codeset) \
 
82
    ((void) (Domainname), (const char *) (Codeset))
66
83
 
67
84
#endif
68
85
 
82
99
   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
83
100
   short and rarely need to change.
84
101
   The letter 'p' stands for 'particular' or 'special'.  */
85
 
#define pgettext(Msgctxt, Msgid) \
86
 
  pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
 
102
#ifdef DEFAULT_TEXT_DOMAIN
 
103
# define pgettext(Msgctxt, Msgid) \
 
104
   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
 
105
#else
 
106
# define pgettext(Msgctxt, Msgid) \
 
107
   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
 
108
#endif
87
109
#define dpgettext(Domainname, Msgctxt, Msgid) \
88
110
  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
89
111
#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
90
112
  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
91
 
#define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
92
 
  npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
 
113
#ifdef DEFAULT_TEXT_DOMAIN
 
114
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
 
115
   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
 
116
#else
 
117
# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
 
118
   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
 
119
#endif
93
120
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
94
121
  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
95
122
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
142
169
#include <string.h>
143
170
 
144
171
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
145
 
  (__GNUC__ >= 3 || defined __cplusplus)
 
172
  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
 
173
   /* || __STDC_VERSION__ >= 199901L */ )
146
174
 
147
175
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
148
176
#include <stdlib.h>