~ubuntu-branches/ubuntu/karmic/centerim/karmic

« back to all changes in this revision

Viewing changes to intl/textdomain.c

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-03-26 19:51:53 UTC
  • mfrom: (1.1.5 upstream) (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090326195153-dxo63t1lwbp2m592
Tags: 4.22.7-1ubuntu1
* Merge from debian unstable, Ubuntu remaining changes:
  - Packages that Depend/Recommend/Suggest firefox (metapackage) must
    must alternatively Depend/Recommend/Suggest abrowser.
* Bugfix-only release, fixed bugs: LP: #146308 and LP: #186381.

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, 2005-2006 Free Software Foundation, Inc.
 
2
   Copyright (C) 1995-1998, 2000-2003 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
23
23
#include <stdlib.h>
24
24
#include <string.h>
25
25
 
26
 
#include "gettextP.h"
27
26
#ifdef _LIBC
28
27
# include <libintl.h>
29
28
#else
30
29
# include "libgnuintl.h"
31
30
#endif
 
31
#include "gettextP.h"
32
32
 
33
 
/* Handle multi-threaded applications.  */
34
33
#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
39
36
#else
40
 
# include "lock.h"
 
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
41
#endif
42
42
 
43
43
/* The internal variables in the standalone libintl.a must have different
71
71
#endif
72
72
 
73
73
/* Lock variable to protect the global data in the gettext implementation.  */
74
 
gl_rwlock_define (extern, _nl_state_lock attribute_hidden)
 
74
__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
75
75
 
76
76
/* Set the current default message catalog to DOMAINNAME.
77
77
   If DOMAINNAME is null, return the current default.
86
86
  if (domainname == NULL)
87
87
    return (char *) _nl_current_default_domain;
88
88
 
89
 
  gl_rwlock_wrlock (_nl_state_lock);
 
89
  __libc_rwlock_wrlock (_nl_state_lock);
90
90
 
91
91
  old_domain = (char *) _nl_current_default_domain;
92
92
 
130
130
        free (old_domain);
131
131
    }
132
132
 
133
 
  gl_rwlock_unlock (_nl_state_lock);
 
133
  __libc_rwlock_unlock (_nl_state_lock);
134
134
 
135
135
  return new_domain;
136
136
}