]>
Commit | Line | Data |
---|---|---|
705db0b5 | 1 | /* Implementation of gettext(3) function. |
1e24cc5b | 2 | Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. |
705db0b5 AD |
3 | |
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published by | |
6 | the Free Software Foundation; either version 2, or (at your option) | |
7 | any later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
15 | along with this program; if not, write to the Free Software Foundation, | |
16 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
17 | ||
18 | #ifdef HAVE_CONFIG_H | |
19 | # include <config.h> | |
20 | #endif | |
21 | ||
22 | #ifdef _LIBC | |
23 | # define __need_NULL | |
24 | # include <stddef.h> | |
25 | #else | |
1e24cc5b | 26 | # include <stdlib.h> /* Just for NULL. */ |
705db0b5 AD |
27 | #endif |
28 | ||
1e24cc5b | 29 | #include "gettextP.h" |
705db0b5 AD |
30 | #ifdef _LIBC |
31 | # include <libintl.h> | |
32 | #else | |
1e24cc5b | 33 | # include "libgnuintl.h" |
705db0b5 AD |
34 | #endif |
35 | ||
36 | /* @@ end of prolog @@ */ | |
37 | ||
38 | /* Names for the libintl functions are a problem. They must not clash | |
39 | with existing names and they should follow ANSI C. But this source | |
40 | code is also used in GNU C Library where the names have a __ | |
41 | prefix. So we have to make a difference here. */ | |
42 | #ifdef _LIBC | |
43 | # define GETTEXT __gettext | |
1e24cc5b | 44 | # define DCGETTEXT __dcgettext |
705db0b5 AD |
45 | #else |
46 | # define GETTEXT gettext__ | |
1e24cc5b | 47 | # define DCGETTEXT dcgettext__ |
705db0b5 AD |
48 | #endif |
49 | ||
50 | /* Look up MSGID in the current default message catalog for the current | |
51 | LC_MESSAGES locale. If not found, returns MSGID itself (the default | |
52 | text). */ | |
53 | char * | |
54 | GETTEXT (msgid) | |
55 | const char *msgid; | |
56 | { | |
1e24cc5b | 57 | return DCGETTEXT (NULL, msgid, LC_MESSAGES); |
705db0b5 AD |
58 | } |
59 | ||
60 | #ifdef _LIBC | |
61 | /* Alias for function name in GNU C Library. */ | |
62 | weak_alias (__gettext, gettext); | |
63 | #endif |