blob: 131b158f3f2dda45531e4d882b8de58d9b1b5126 (
plain)
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
77
78
|
// aptitude.h
//
// Copyright 2000 Masato Taruishi <taru@debian.org>,
// Daniel Burrows <dburrows@debian.org>
//
/** \brief common header
*
*
* \file aptitude.h
*/
#ifndef APTITUDE_H
#define APTITUDE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Take care of NLS matters. */
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
#ifndef HAVE_SETLOCALE
inline void setlocale(int, const char *)
{
}
#endif
# include <string.h>
#if ENABLE_NLS
# include <libintl.h>
# include <cwidget/generic/util/transcode.h>
# define _(Text) gettext (Text)
# define W_(Text) cwidget::util::transcode (gettext (Text) )
# define N_(Text) Text
/** Strips everything up to and including the first pipe character
* from the translated string. Translations without a pipe character are unchanged.
*/
#ifdef __GNUG__
__attribute__ ((format_arg(1)))
#endif
inline const char *P_(const char *Text)
{
const char * const translation = gettext(Text);
const char * const stripto = strchr(translation, '|');
if(stripto == NULL)
return translation;
else
return stripto+1;
}
#else
# undef bindtextdomain
# define bindtextdomain(Domain, Directory) /* empty */
# undef textdomain
# define textdomain(Domain) /* empty */
# define _(Text) Text
# define N_(Text) Text
inline const char *P_(const char *Text)
{
const char * const stripto = strchr(Text, '|');
return stripto+1;
}
# define gettext(Text) Text
# define dgettext(Domain, Text) Text
#endif
// This is used to store the location of the binary as determined by
// argv[0].
extern const char *argv0;
#endif
|