1
1
/* Implementation of the textdomain(3) function.
2
Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
2
Copyright (C) 1995-1998, 2000-2003, 2005-2006 Free Software Foundation, Inc.
4
4
This program is free software; you can redistribute it and/or modify it
5
5
under the terms of the GNU Library General Public License as published
14
14
You should have received a copy of the GNU Library General Public
15
15
License along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
19
#ifdef HAVE_CONFIG_H
23
23
#include <stdlib.h>
24
24
#include <string.h>
27
28
# include <libintl.h>
29
30
# include "libgnuintl.h"
33
/* Handle multi-threaded applications. */
34
/* We have to handle multi-threaded applications. */
35
35
# include <bits/libc-lock.h>
36
# define gl_rwlock_define __libc_rwlock_define
37
# define gl_rwlock_wrlock __libc_rwlock_wrlock
38
# define gl_rwlock_unlock __libc_rwlock_unlock
37
/* Provide dummy implementation if this is outside glibc. */
38
# define __libc_rwlock_define(CLASS, NAME)
39
# define __libc_rwlock_wrlock(NAME)
40
# define __libc_rwlock_unlock(NAME)
43
/* The internal variables in the standalone libintl.a must have different
44
names than the internal variables in GNU libc, otherwise programs
45
using libintl.a cannot be linked statically. */
47
# define _nl_default_default_domain libintl_nl_default_default_domain
48
# define _nl_current_default_domain libintl_nl_current_default_domain
51
43
/* @@ end of prolog @@ */
53
/* Name of the default text domain. */
54
extern const char _nl_default_default_domain[] attribute_hidden;
56
/* Default text domain in which entries for gettext(3) are to be found. */
57
extern const char *_nl_current_default_domain attribute_hidden;
60
46
/* Names for the libintl functions are a problem. They must not clash
61
47
with existing names and they should follow ANSI C. But this source
73
59
/* Lock variable to protect the global data in the gettext implementation. */
74
__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
60
gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
76
62
/* Set the current default message catalog to DOMAINNAME.
77
63
If DOMAINNAME is null, return the current default.