9 static char *current_domain
;
11 char *__gettextdomain()
13 return current_domain
? current_domain
: "messages";
16 char *textdomain(const char *domainname
)
18 if (!domainname
) return __gettextdomain();
20 size_t domlen
= strlen(domainname
);
21 if (domlen
> NAME_MAX
) {
26 if (!current_domain
) {
27 current_domain
= malloc(NAME_MAX
+1);
28 if (!current_domain
) return 0;
31 memcpy(current_domain
, domainname
, domlen
+1);
33 return current_domain
;
36 char *gettext(const char *msgid
)
38 return dgettext(0, msgid
);
41 char *ngettext(const char *msgid1
, const char *msgid2
, unsigned long int n
)
43 return dngettext(0, msgid1
, msgid2
, n
);