~ubuntu-branches/ubuntu/gutsy/findutils/gutsy-proposed

« back to all changes in this revision

Viewing changes to intl/intl-compat.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2005-07-04 11:37:37 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050704113737-ll89ui8be35r0pir
Tags: 4.2.22-2
* Remove locatedb on purge. (Closes: #315343)
* revert regex-syntax back to emacs-re. (Closes: #315136) Future versions
  will allow to select this by commandline parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
2
 
   Library.
3
 
   Copyright (C) 1995, 2000, 2001 Software Foundation, Inc.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify
6
 
it under the terms of the GNU General Public License as published by
7
 
the Free Software Foundation; either version 2, or (at your option)
8
 
any later version.
9
 
 
10
 
This program is distributed in the hope that it will be useful,
11
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
GNU General Public License for more details.
14
 
 
15
 
You should have received a copy of the GNU General Public License
16
 
along with this program; if not, write to the Free Software
17
 
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18
 
 
19
 
#ifdef HAVE_CONFIG_H
20
 
# include <gnulib/config.h>
21
 
# undef VERSION
22
 
# undef PACKAGE_VERSION
23
 
# undef PACKAGE_TARNAME
24
 
# undef PACKAGE_STRING
25
 
# include <config.h>
26
 
#endif
27
 
 
28
 
#include "libgnuintl.h"
29
 
#include "gettextP.h"
30
 
 
31
 
/* @@ end of prolog @@ */
32
 
 
33
 
/* This file redirects the gettext functions (without prefix or suffix) to
34
 
   those defined in the included GNU gettext library (with "__" suffix).
35
 
   It is compiled into libintl when the included GNU gettext library is
36
 
   configured --with-included-gettext.
37
 
 
38
 
   This redirection works also in the case that the system C library or
39
 
   the system libintl library contain gettext/textdomain/... functions.
40
 
   If it didn't, we would need to add preprocessor level redirections to
41
 
   libgnuintl.h of the following form:
42
 
 
43
 
#    define gettext gettext__
44
 
#    define dgettext dgettext__
45
 
#    define dcgettext dcgettext__
46
 
#    define ngettext ngettext__
47
 
#    define dngettext dngettext__
48
 
#    define dcngettext dcngettext__
49
 
#    define textdomain textdomain__
50
 
#    define bindtextdomain bindtextdomain__
51
 
#    define bind_textdomain_codeset bind_textdomain_codeset__
52
 
 
53
 
   How does this redirection work? There are two cases.
54
 
   A. When libintl.a is linked into an executable, it works because
55
 
      functions defined in the executable always override functions in
56
 
      the shared libraries.
57
 
   B. When libintl.so is used, it works because
58
 
      1. those systems defining gettext/textdomain/... in the C library
59
 
         (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are
60
 
         ELF systems and define these symbols as weak, thus explicitly
61
 
         letting other shared libraries override it.
62
 
      2. those systems defining gettext/textdomain/... in a standalone
63
 
         libintl.so library (namely, Solaris 2.3 and newer) have this
64
 
         shared library in /usr/lib, and the linker will search /usr/lib
65
 
         *after* the directory where the GNU gettext library is installed.
66
 
 
67
 
   A third case, namely when libintl.a is linked into a shared library
68
 
   whose name is not libintl.so, is not supported. In this case, on
69
 
   Solaris, when -lintl precedes the linker option for the shared library
70
 
   containing GNU gettext, the system's gettext would indeed override
71
 
   the GNU gettext. Anyone doing this kind of stuff must be clever enough
72
 
   to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker
73
 
   command line.  */
74
 
 
75
 
 
76
 
#undef gettext
77
 
#undef dgettext
78
 
#undef dcgettext
79
 
#undef ngettext
80
 
#undef dngettext
81
 
#undef dcngettext
82
 
#undef textdomain
83
 
#undef bindtextdomain
84
 
#undef bind_textdomain_codeset
85
 
 
86
 
 
87
 
char *
88
 
gettext (msgid)
89
 
     const char *msgid;
90
 
{
91
 
  return gettext__ (msgid);
92
 
}
93
 
 
94
 
 
95
 
char *
96
 
dgettext (domainname, msgid)
97
 
     const char *domainname;
98
 
     const char *msgid;
99
 
{
100
 
  return dgettext__ (domainname, msgid);
101
 
}
102
 
 
103
 
 
104
 
char *
105
 
dcgettext (domainname, msgid, category)
106
 
     const char *domainname;
107
 
     const char *msgid;
108
 
     int category;
109
 
{
110
 
  return dcgettext__ (domainname, msgid, category);
111
 
}
112
 
 
113
 
 
114
 
char *
115
 
ngettext (msgid1, msgid2, n)
116
 
     const char *msgid1;
117
 
     const char *msgid2;
118
 
     unsigned long int n;
119
 
{
120
 
  return ngettext__ (msgid1, msgid2, n);
121
 
}
122
 
 
123
 
 
124
 
char *
125
 
dngettext (domainname, msgid1, msgid2, n)
126
 
     const char *domainname;
127
 
     const char *msgid1;
128
 
     const char *msgid2;
129
 
     unsigned long int n;
130
 
{
131
 
  return dngettext__ (domainname, msgid1, msgid2, n);
132
 
}
133
 
 
134
 
 
135
 
char *
136
 
dcngettext (domainname, msgid1, msgid2, n, category)
137
 
     const char *domainname;
138
 
     const char *msgid1;
139
 
     const char *msgid2;
140
 
     unsigned long int n;
141
 
     int category;
142
 
{
143
 
  return dcngettext__ (domainname, msgid1, msgid2, n, category);
144
 
}
145
 
 
146
 
 
147
 
char *
148
 
textdomain (domainname)
149
 
     const char *domainname;
150
 
{
151
 
  return textdomain__ (domainname);
152
 
}
153
 
 
154
 
 
155
 
char *
156
 
bindtextdomain (domainname, dirname)
157
 
     const char *domainname;
158
 
     const char *dirname;
159
 
{
160
 
  return bindtextdomain__ (domainname, dirname);
161
 
}
162
 
 
163
 
 
164
 
char *
165
 
bind_textdomain_codeset (domainname, codeset)
166
 
     const char *domainname;
167
 
     const char *codeset;
168
 
{
169
 
  return bind_textdomain_codeset__ (domainname, codeset);
170
 
}