source: branches/GNU/src/binutils/intl/bindtextdom.c@ 781

Last change on this file since 781 was 609, checked in by bird, 22 years ago

binutils v2.14 - offical sources.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 5.2 KB
Line 
1/* Implementation of the bindtextdomain(3) function
2 Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
17
18#ifdef HAVE_CONFIG_H
19# include <config.h>
20#endif
21
22#if defined STDC_HEADERS || defined _LIBC
23# include <stdlib.h>
24#else
25# ifdef HAVE_MALLOC_H
26# include <malloc.h>
27# else
28void free ();
29# endif
30#endif
31
32#if defined HAVE_STRING_H || defined _LIBC
33# include <string.h>
34#else
35# include <strings.h>
36# ifndef memcpy
37# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
38# endif
39#endif
40
41#ifdef _LIBC
42# include <libintl.h>
43#else
44# include "libgettext.h"
45#endif
46#include "gettext.h"
47#include "gettextP.h"
48
49/* @@ end of prolog @@ */
50
51/* Contains the default location of the message catalogs. */
52extern const char _nl_default_dirname[];
53
54/* List with bindings of specific domains. */
55extern struct binding *_nl_domain_bindings;
56
57
58/* Names for the libintl functions are a problem. They must not clash
59 with existing names and they should follow ANSI C. But this source
60 code is also used in GNU C Library where the names have a __
61 prefix. So we have to make a difference here. */
62#ifdef _LIBC
63# define BINDTEXTDOMAIN __bindtextdomain
64# ifndef strdup
65# define strdup(str) __strdup (str)
66# endif
67#else
68# define BINDTEXTDOMAIN bindtextdomain__
69#endif
70
71/* Specify that the DOMAINNAME message catalog will be found
72 in DIRNAME rather than in the system locale data base. */
73char *
74BINDTEXTDOMAIN (domainname, dirname)
75 const char *domainname;
76 const char *dirname;
77{
78 struct binding *binding;