File: gettext.xs

package info (click to toggle)
liblocale-gettext-perl 1.07-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 140 kB
  • ctags: 21
  • sloc: perl: 248; makefile: 16
file content (118 lines) | stat: -rw-r--r-- 2,431 bytes parent folder | download | duplicates (6)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <string.h>
#include <libintl.h>
#include "config.h"

static double
constant(char *name, int arg)
{
	errno = 0;
	if (strEQ(name, "LC_CTYPE")) return LC_CTYPE;
	if (strEQ(name, "LC_NUMERIC")) return LC_NUMERIC;
	if (strEQ(name, "LC_COLLATE")) return LC_COLLATE;
	if (strEQ(name, "LC_MONETARY")) return LC_MONETARY;
	if (strEQ(name, "LC_MESSAGES")) return LC_MESSAGES;
	if (strEQ(name, "LC_ALL")) return LC_ALL;
	errno = EINVAL;
	return 0;
}

#define ANY_MISSING 0

#ifndef HAVE_DGETTEXT
/* if dgettext is not there, neither will
   dcgettext, dngettext and dcngettext be.
   But only deal with dngettext and
   dcngettext if they will not be dealt
   with later because of ngettext */
#define dgettext(a,b) not_here("dgettext")
#define dcgettext(a,b,c) not_here("dcgettext")
#ifdef HAVE_NGETTEXT
#define dngettext(a,b,c,d) not_here("dngettext")
#define dcngettext(a,b,c,d,e) not_here("dcngettext")
#endif
#undef ANY_MISSING
#define ANY_MISSING 1
#endif

#ifndef HAVE_NGETTEXT
#define ngettext(a,b,c) not_here("ngettext")
#define dngettext(a,b,c,d) not_here("dngettext")
#define dncgettext(a,b,c,d,e) not_here("dcngettext")
#undef ANY_MISSING
#define ANY_MISSING 1
#endif

#ifndef HAVE_BIND_TEXTDOMAIN_CODESET
#define bind_textdomain_codeset(a,b) not_here("bind_textdomain_codeset")
#undef ANY_MISSING
#define ANY_MISSING 1
#endif

#if ANY_MISSING
static int
not_here(char *s)
{
	croak("Locale::gettext::%s not implemented on this architecture", s);
	return -1;
}
#endif

MODULE = Locale::gettext	PACKAGE = Locale::gettext

double
constant(name,arg)
	char *		name
	int		arg

char *
gettext(msgid)
	char *		msgid

char *
dcgettext(domainname, msgid, category)
	char *		domainname
	char *		msgid
	int		category

char *
dgettext(domainname, msgid)
	char *		domainname
	char *		msgid

char *
ngettext(msgid, msgid_plural, n)
	char *		msgid
	char *		msgid_plural
	unsigned long	n

char *
dcngettext(domainname, msgid, msgid_plural, n, category)
	char *		domainname
	char *		msgid
	char *		msgid_plural
	unsigned long	n
	int		category

char *
dngettext(domainname, msgid, msgid_plural, n)
	char *		domainname
	char *		msgid
	char *		msgid_plural
	unsigned long	n

char *
textdomain(domain)
	char *		domain

char *
bindtextdomain(domain, dirname = NULL)
	char *		domain
	char *		dirname

char *
bind_textdomain_codeset(domain, codeset = NULL)
	char *		domain
	char *		codeset