1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
10 .\" GNU gettext source code and manual
11 .\" LI18NUX 2000 Globalization Specification
14 .TH BINDTEXTDOMAIN 3 "May 2001" "GNU gettext 0.10.38"
16 bindtextdomain \- 设置 包括 消息条目 的 路径
20 .B #include <libintl.h>
22 .BI "char * bindtextdomain (const char * " domainname ", const char * " dirname );
25 .SH "描述 (DESCRIPTION)"
26 \fBbindtextdomain\fP 函数 的 作用 是 设置 指定消息域 里,包含 消息条目
27 (message catalog) 的 基本目录 层次结构。
30 一个 消息域 是 一套 可翻译的 \fImsgid\fP 消息。 通常,
31 每一个 软件包 有 它自己的 消息域。 提出 \fBbindtextdomain\fP 的 需求 是因为
32 软件包 安装 的 时候,并不总和 <libintl.h> 头文件 和 libc/libintl 库文件 的前缀
37 \fIdirname\fP/\fIlocale\fP/\fIcategory\fP/\fIdomainname\fP.mo,
38 其中 \fIlocale\fP 是 locale 名, 而 \fIcategory\fP 是 locale 面, 如
41 \fIdomainname\fP 必须 是 非空字符串。
43 如果 \fIdirname\fP 不是 NULL, 属于 \fIdomainname\fP 域 的
44 消息条目 的 基本目录 被设置为 \fIdirname\fP。 函数 能够 复制 参数字符串。
45 如果 程序 希望 调用 \fBchdir\fP 函数, \fIdirname\fP 必须 是 绝对路径名;
48 如果 \fIdirname\fP 是 NULL, 函数 返回 以前 为 \fIdomainname\fP 域 设置的
51 .SH "返回值 (RETURN VALUE)"
52 如果成功, \fBbindtextdomain\fP 函数 返回 当前 \fIdomainname\fP 域
53 的 基本目录, 如果 改变了 基本目录, 返回 改变后的 基本目录。
54 返回的 字符串 一直 有效, 直到 下一次 对 同一个 \fIdomainname\fP 调用
55 \fBbindtextdomain\fP; 这个 字符串 不应该 被修改 或 释放。
56 如果 发生 内存分配错误, \fBerrno\fP 设置为 \fBENOMEM\fP, 然后 返回 NULL.
65 返回类型 应该是 \fBconst char *\fP, 但是 为了 避免 较早版本 ANSI C 代码 的
66 警告, 返回类型 是 \fBchar *\fP.
79 .B Viamu <viamu@msn.com>
83 .B Xuming <xuming@users.sourceforge.net>
85 .BI http://cmpp.linuxforum.net