~ubuntu-branches/ubuntu/precise/sitecopy/precise

« back to all changes in this revision

Viewing changes to intl/textdomain.c

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2008-07-22 07:31:05 UTC
  • mfrom: (1.1.4 upstream) (4.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080722073105-cbqs1hnc2wvqejfd
Tags: 1:0.16.6-1
* New upstream release
  - fix a crash with progress bar enabled; Closes: #486378
* debian/control
  - set myself as maintainer, Kartik as uploader
  - set Vcs-{Browser,Git} fields
  - bump Standards-Version to 3.8.0
    + debian/README.source added
  - added DM-Upload-Allowed flag
* debian/patches/05_libneon27_transition.dpatch
  - removed since merged upstream
* debian/copyrightdebian/copyright
  - updated upstream email and copyright years
* debian/patches/10_bts410703_preserve_storage_files_sigint.dpatch
  - added to preserve storage files if SIGINT (Ctrl+C) is sent to sitecopy;
    thanks to Andreas Henriksson for the patch; Closes: #410703

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
3
3
 
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
13
13
 
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,
17
17
   USA.  */
18
18
 
19
19
#ifdef HAVE_CONFIG_H
23
23
#include <stdlib.h>
24
24
#include <string.h>
25
25
 
 
26
#include "gettextP.h"
26
27
#ifdef _LIBC
27
28
# include <libintl.h>
28
29
#else
29
30
# include "libgnuintl.h"
30
31
#endif
31
 
#include "gettextP.h"
32
32
 
 
33
/* Handle multi-threaded applications.  */
33
34
#ifdef _LIBC
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
36
39
#else
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)
41
 
#endif
42
 
 
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.  */
46
 
#if !defined _LIBC
47
 
# define _nl_default_default_domain libintl_nl_default_default_domain
48
 
# define _nl_current_default_domain libintl_nl_current_default_domain
 
40
# include "lock.h"
49
41
#endif
50
42
 
51
43
/* @@ end of prolog @@ */
52
44
 
53
 
/* Name of the default text domain.  */
54
 
extern const char _nl_default_default_domain[] attribute_hidden;
55
 
 
56
 
/* Default text domain in which entries for gettext(3) are to be found.  */
57
 
extern const char *_nl_current_default_domain attribute_hidden;
58
 
 
59
45
 
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
71
57
#endif
72
58
 
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)
75
61
 
76
62
/* Set the current default message catalog to DOMAINNAME.
77
63
   If DOMAINNAME is null, return the current default.
86
72
  if (domainname == NULL)
87
73
    return (char *) _nl_current_default_domain;
88
74
 
89
 
  __libc_rwlock_wrlock (_nl_state_lock);
 
75
  gl_rwlock_wrlock (_nl_state_lock);
90
76
 
91
77
  old_domain = (char *) _nl_current_default_domain;
92
78
 
130
116
        free (old_domain);
131
117
    }
132
118
 
133
 
  __libc_rwlock_unlock (_nl_state_lock);
 
119
  gl_rwlock_unlock (_nl_state_lock);
134
120
 
135
121
  return new_domain;
136
122
}