OpenCOBOL 1.1pre-rel
gettext.h
Go to the documentation of this file.
00001 /* Convenience header for conditional use of GNU <libintl.h>.
00002    Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
00003 
00004    This program is free software; you can redistribute it and/or modify it
00005    under the terms of the GNU Library General Public License as published
00006    by the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public
00015    License along with this program; if not, write to
00016    the Free Software Foundation, 51 Franklin Street, Fifth Floor
00017    Boston, MA 02110-1301 USA */
00018 
00019 #ifndef _LIBGETTEXT_H
00020 #define _LIBGETTEXT_H 1
00021 
00022 /* NLS can be disabled through the configure --disable-nls option.  */
00023 #if ENABLE_NLS
00024 
00025 /* Get declarations of GNU message catalog functions.  */
00026 # include <locale.h>
00027 # include <libintl.h>
00028 
00029 #else
00030 
00031 /* Disabled NLS.
00032    The casts to 'const char *' serve the purpose of producing warnings
00033    for invalid uses of the value returned from these functions.
00034    On pre-ANSI systems without 'const', the config.h file is supposed to
00035    contain "#define const".  */
00036 # define gettext(Msgid) ((const char *) (Msgid))
00037 # define dgettext(Domainname, Msgid) ((const char *) (Msgid))
00038 # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
00039 # define ngettext(Msgid1, Msgid2, N) \
00040     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
00041 # define dngettext(Domainname, Msgid1, Msgid2, N) \
00042     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
00043 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
00044     ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
00045 # define textdomain(Domainname) ((const char *) (Domainname))
00046 # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
00047 # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
00048 
00049 #endif
00050 
00051 /* A pseudo function call that serves as a marker for the automated
00052    extraction of messages, but does not call gettext().  The run-time
00053    translation is done at a different place in the code.
00054    The argument, String, should be a literal string.  Concatenated strings
00055    and other string expressions won't work.
00056    The macro's expansion is not parenthesized, so that it is suitable as
00057    initializer for static 'char[]' or 'const char[]' variables.  */
00058 #define gettext_noop(String) String
00059 
00060 #define _(s)    gettext(s)
00061 #define N_(s)   gettext_noop(s)
00062 
00063 #endif /* _LIBGETTEXT_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines