bindtextdomain 中文man页面

系统
bindtextdomain 函数 的 作用 是 设置 指定消息域 里,包含 消息条目 (message catalog) 的 基本目录 层次结构。

NAME

bindtextdomain - 设置 包括 消息条目 的 路径

总览 (SYNOPSIS)

#include <libintl.h>

char * bindtextdomain (const char * domainname, const char * dirname);

描述 (DESCRIPTION)

bindtextdomain 函数 的 作用 是 设置 指定消息域 里,包含 消息条目 (message catalog) 的 基本目录 层次结构。

一个 消息域 是 一套 可翻译的 msgid 消息。 通常,每一个 软件包 有 它自己的 消息域。 提出 bindtextdomain 的 需求 是因为软件包 安装 的 时候,并不总和 <libintl.h> 头文件 和 libc/libintl 库文件 的前缀保持一致.

消息条目 期望的 路径名 是 dirname/locale/category/domainname.mo, 其中 locale 是 locale 名, 而 category 是 locale 面, 如 LC_MESSAGES.

domainname 必须 是 非空字符串。

如果 dirname 不是 NULL, 属于 domainname 域 的消息条目 的 基本目录 被设置为 dirname。 函数 能够 复制 参数字符串。如果 程序 希望 调用 chdir 函数, dirname 必须 是 绝对路径名;否则 程序 无法 保证 找到 消息条目。

如果 dirname 是 NULL, 函数 返回 以前 为 domainname 域 设置的 基本目录。

返回值 (RETURN VALUE)

如果成功, bindtextdomain 函数 返回 当前 domainname 域的 基本目录, 如果 改变了 基本目录, 返回 改变后的 基本目录。 返回的 字符串 一直 有效, 直到 下一次 对 同一个 domainname 调用 bindtextdomain; 这个 字符串 不应该 被修改 或 释放。如果 发生 内存分配错误, errno 设置为 ENOMEM, 然后 返回 NULL.

错误 (ERRORS)

下列 错误 可能 发生, 包括 其它的:

ENOMEM
没有 足够的 内存 可用。

BUGS

返回类型 应该是 const char *, 但是 为了 避免 较早版本 ANSI C 代码 的 警告, 返回类型 是 char *.

另见 (SEE ALSO)

gettext(3), dgettext(3), dcgettext(3), ngettext(3), dngettext(3), dcngettext(3), textdomain(3), realpath(3)

#p#

NAME

bindtextdomain - set directory containing message catalogs  

SYNOPSIS

#include <libintl.h>

char * bindtextdomain (const char * domainname, const char * dirname);

DESCRIPTION

The bindtextdomain function sets the base directory of the hierarchy containing message catalogs for a given message domain.

A message domain is a set of translatable msgid messages. Usually, every software package has its own message domain. The need for calling bindtextdomain arises because packages are not always installed with the same prefix as the <libintl.h> header and the libc/libintl libraries.

Message catalogs will be expected at the pathnames dirname/locale/category/domainname.mo, where locale is a locale name and category is a locale facet such as LC_MESSAGES.

domainname must be a non-empty string.

If dirname is not NULL, the base directory for message catalogs belonging to domain domainname is set to dirname. The function makes copies of the argument strings as needed. If the program wishes to call the chdir function, it is important that dirname be an absolute pathname; otherwise it cannot be guaranteed that the message catalogs will be found.

If dirname is NULL, the function returns the previously set base directory for domain domainname.  

RETURN VALUE

If successful, the bindtextdomain function returns the current base directory for domain domainname, after possibly changing it. The resulting string is valid until the next bindtextdomain call for the same domainname and must not be modified or freed. If a memory allocation failure occurs, it sets errno to ENOMEM and returns NULL.  

ERRORS

The following error can occur, among others:

ENOMEM
Not enough memory available.

BUGS

The return type ought to be const char *, but is char * to avoid warnings in C code predating ANSI C.  

SEE ALSO

gettext(3), dgettext(3), dcgettext(3), ngettext(3), dngettext(3), dcngettext(3), textdomain(3), realpath(3)

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 13:58:08

bind中文man

2011-08-25 18:34:55

ungetc中文man

2011-08-19 18:25:49

inittab中文man

2011-08-25 17:20:37

putchar中文man

2011-08-16 09:56:22

groupdel中文man

2011-08-23 16:56:57

swapon中文man

2011-08-23 10:34:22

convertquot中文man

2011-08-23 10:21:40

blockdev中文man

2011-08-24 15:08:18

EXECUTE中文man

2011-08-15 11:15:06

newgrp中文man

2011-08-24 09:54:45

ANALYZE中文man

2011-08-24 15:29:06

grant中文man

2011-08-16 09:19:05

rmt中文man

2011-08-15 10:04:26

mail中文man

2011-08-23 15:27:21

route中文man

2011-08-29 10:39:12

fifo中文man
点赞
收藏

51CTO技术栈公众号