blob: 850acdee97b022b38db0fd3d0c4e595403db58c5 [file] [log] [blame]
Theodore Ts'o5bc5a892000-02-08 20:20:46 +00001/* Implementation of the dcgettext(3) function.
Theodore Ts'ob0cacab2004-11-30 19:00:19 -05002 Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
Theodore Ts'o5bc5a892000-02-08 20:20:46 +00003
Theodore Ts'oa04eba32003-05-03 16:35:17 -04004 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published
6 by the Free Software Foundation; either version 2, or (at your option)
Theodore Ts'o5bc5a892000-02-08 20:20:46 +00007 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
Theodore Ts'oa04eba32003-05-03 16:35:17 -040011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000013
Theodore Ts'oa04eba32003-05-03 16:35:17 -040014 You should have received a copy of the GNU Library General Public
15 License along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 USA. */
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000018
19#ifdef HAVE_CONFIG_H
20# include <config.h>
21#endif
22
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000023#include "gettextP.h"
24#ifdef _LIBC
25# include <libintl.h>
26#else
Theodore Ts'oa04eba32003-05-03 16:35:17 -040027# include "libgnuintl.h"
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000028#endif
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000029
30/* @@ end of prolog @@ */
31
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000032/* Names for the libintl functions are a problem. They must not clash
33 with existing names and they should follow ANSI C. But this source
34 code is also used in GNU C Library where the names have a __
35 prefix. So we have to make a difference here. */
36#ifdef _LIBC
37# define DCGETTEXT __dcgettext
Theodore Ts'oa04eba32003-05-03 16:35:17 -040038# define DCIGETTEXT __dcigettext
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000039#else
Theodore Ts'oa04eba32003-05-03 16:35:17 -040040# define DCGETTEXT libintl_dcgettext
41# define DCIGETTEXT libintl_dcigettext
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000042#endif
43
44/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
45 locale. */
46char *
Theodore Ts'ob0cacab2004-11-30 19:00:19 -050047DCGETTEXT (const char *domainname, const char *msgid, int category)
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000048{
Theodore Ts'oa04eba32003-05-03 16:35:17 -040049 return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000050}
51
52#ifdef _LIBC
53/* Alias for function name in GNU C Library. */
Theodore Ts'oa04eba32003-05-03 16:35:17 -040054INTDEF(__dcgettext)
Theodore Ts'o5bc5a892000-02-08 20:20:46 +000055weak_alias (__dcgettext, dcgettext);
56#endif