File: libintl.h

package info (click to toggle)
recode 3.4.1-11
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,560 kB
  • ctags: 622
  • sloc: ansic: 10,572; perl: 339; makefile: 317; lisp: 243; sh: 173; lex: 165; awk: 127; sed: 10
file content (76 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef _gettext_h_
#define _gettext_h_ 1

/* gettext.h - decls and macros for GNU internationalization support

   Copyright (C) 1994 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

   Written by Jim Meyering <meyering@gnu.ai.mit.edu>.  */

struct _msg_ent
  {
    const char *_msg;
    int _msg_number;
  };

/* For those concerned about the overhead of the linear string look-up in
   the message table, consider the following GCC statement expression
   macros.  Then, if there were, for example, a `printf (LC_CATGETS(msg),
   arg1)' in a loop, the additional overhead of mapping from MSG to
   the other catgets arguments would be incurred only for the first
   invocation.  All subsequent references would get the proper string
   for the price of a simple pointer comparison.  */

/* #if defined (__GNUC__) && !defined (__STRICT_ANSI__)

#define gettext(Message)						\
  ({									\
    static const char *_translation;					\
									\
    if (!_translation)							\
      _translation = __gettext ((Message));				\
    _translation;							\
  })

#else */

/* If you don't use gcc, you'll incur the lookup cost every time.  */
#define gettext(msg) __gettext ((msg))

/* #endif */

#ifndef __P
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#  define __P(args) args
# else
# define __P(args) ()
# endif
#endif

const char *__gettext __P ((const char *_msg));

/* A table of (english-message, msg_code_number) pairs.  */
extern const struct _msg_ent _msg_tbl[];

/* Number of entries in _msg_tbl.  */
extern int _msg_tbl_length;

/* The file name of the message catalog to be used in the catopen
   call below.  */
extern const char *_msg_catalog_file_name;

#endif /* _gettext_h_ */