Imported upstream version 1.5
[manpages-zh.git] / src / man3 / bindtextdomain.3
blobb7890cde9db6dab9786b2c151012ec656c4af76c
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
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.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"   GNU gettext source code and manual
11 .\"   LI18NUX 2000 Globalization Specification
12 .\"
14 .TH BINDTEXTDOMAIN 3 "May 2001" "GNU gettext 0.10.38"
15 .SH NAME
16 bindtextdomain \- 设置 包括 消息条目 的 路径
18 .SH "总览 (SYNOPSIS)"
19 .nf
20 .B #include <libintl.h>
21 .sp
22 .BI "char * bindtextdomain (const char * " domainname ", const char * " dirname );
23 .fi
25 .SH "描述 (DESCRIPTION)"
26 \fBbindtextdomain\fP 函数 的 作用 是 设置 指定消息域 里,包含 消息条目
27 (message catalog) 的 基本目录 层次结构。
29 .PP
30 一个 消息域 是 一套 可翻译的 \fImsgid\fP 消息。 通常,
31 每一个 软件包 有 它自己的 消息域。 提出 \fBbindtextdomain\fP 的 需求 是因为
32 软件包 安装 的 时候,并不总和 <libintl.h> 头文件 和 libc/libintl 库文件 的前缀
33 保持一致.
35 .PP
36 消息条目 期望的 路径名 是
37 \fIdirname\fP/\fIlocale\fP/\fIcategory\fP/\fIdomainname\fP.mo,
38 其中 \fIlocale\fP 是 locale 名, 而 \fIcategory\fP 是 locale 面, 如 
39 \fBLC_MESSAGES\fP.
40 .PP
41 \fIdomainname\fP 必须 是 非空字符串。
42 .PP
43 如果 \fIdirname\fP 不是 NULL, 属于 \fIdomainname\fP 域 的
44 消息条目 的 基本目录 被设置为 \fIdirname\fP。 函数 能够 复制 参数字符串。
45 如果 程序 希望 调用 \fBchdir\fP 函数, \fIdirname\fP 必须 是 绝对路径名;
46 否则 程序 无法 保证 找到 消息条目。
47 .PP
48 如果 \fIdirname\fP 是 NULL, 函数 返回 以前 为 \fIdomainname\fP 域 设置的 
49 基本目录。
51 .SH "返回值 (RETURN VALUE)"
52 如果成功, \fBbindtextdomain\fP 函数 返回 当前 \fIdomainname\fP 域
53 的 基本目录, 如果 改变了 基本目录, 返回 改变后的 基本目录。 
54 返回的 字符串 一直 有效, 直到 下一次 对 同一个 \fIdomainname\fP 调用
55 \fBbindtextdomain\fP; 这个 字符串 不应该 被修改 或 释放。
56 如果 发生 内存分配错误, \fBerrno\fP 设置为 \fBENOMEM\fP, 然后 返回 NULL.
58 .SH "错误 (ERRORS)"
59 下列 错误 可能 发生, 包括 其它的:
60 .TP
61 .B ENOMEM
62 没有 足够的 内存 可用。
64 .SH BUGS
65 返回类型 应该是 \fBconst char *\fP, 但是 为了 避免 较早版本 ANSI C 代码 的 
66 警告, 返回类型 是 \fBchar *\fP.
68 .SH "另见 (SEE ALSO)"
69 .BR gettext (3),
70 .BR dgettext (3),
71 .BR dcgettext (3),
72 .BR ngettext (3),
73 .BR dngettext (3),
74 .BR dcngettext (3),
75 .BR textdomain (3),
76 .BR realpath (3)
78 .SH "[中文版维护人]"
79 .B Viamu <viamu@msn.com>
80 .SH "[中文版最新更新]"
81 2003/11/28
82 .SH "[中文版校对人]"
83 .B Xuming <xuming@users.sourceforge.net>
84 .SH "《中文MAN-PAGE计划》"
85 .BI http://cmpp.linuxforum.net