.\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" Distributed under GPL .\" .\" Polished a bit, added a little, aeb .\" .\" Japanese Version Copyright (c) 2004 Yuichi SATO .\" all rights reserved. .\" Translated Sun Sep 5 20:44:27 JST 2004 .\" by Yuichi SATO .\" .TH SETALIASENT 3 2003-09-09 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O setaliasent, endaliasent, getaliasent, getaliasent_r, .\"O getaliasbyname, getaliasbyname_r \- read an alias entry setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, getaliasbyname_r \- エイリアスエントリを読み込む .\"O .SH SYNOPSIS .SH 書式 .B #include .sp .B "void setaliasent(void);" .sp .B "void endaliasent(void);" .sp .B "struct aliasent *getaliasent(void);" .sp .BI "int getaliasent_r(struct aliasent *" result "," .br .BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); .sp .BI "struct aliasent *getaliasbyname(const char *" name ); .sp .BI "int getaliasbyname_r(const char *" name ", struct aliasent *" result , .br .BI " char *" buffer ", size_t " buflen ", struct aliasent **" res ); .\"O .SH DESCRIPTION .SH 説明 .\"O One of the databases available with the Name Service Switch (NSS) .\"O is the aliases database, that contains mail aliases. .\"O (To find out which databases are supported, try getent \-\-help .) ネームサービススイッチ (Name Service Switch, NSS) で 利用可能なデータベースの 1 つとして、 メールエイリアスを保持するエイリアスデータベースがある。 (どのデータベースがサポートされているかを調べるには、 getent \-\-help を実行すること。) .\"O Six functions are provided to access the aliases database. エイリアスデータベースにアクセスするために、 6 つの関数が提供されている。 .PP .\"O The .\"O .BR getaliasent () .\"O function returns a pointer to a structure containing .\"O the group information from the aliases database. .BR getaliasent () 関数はエイリアスデータベースから取り出した グループ情報を含む構造体へのポインタを返す。 .\"O The first time it is called it returns the first entry; .\"O thereafter, it returns successive entries. 1 回目に関数が呼ばれたときには、最初のエントリを返す; それ以降はその後のエントリを返す。 .PP .\"O The .\"O .BR setaliasent () .\"O function rewinds the file pointer to the beginning of the .\"O aliases database. .BR setaliasent () 関数はファイルポインタをエイリアスデータベースの先頭に巻き戻す。 .PP .\"O The .\"O .BR endaliasent () .\"O function closes the aliases database. .BR endaliasent () 関数はエイリアスデータベースをクローズする。 .PP .\"O .BR getaliasent_r () .\"O is the reentrant version of the previous function. .\"O The requested structure .\"O is stored via the first argument but the programmer needs to fill the other .\"O arguments also. .\"O Not providing enough space causes the function to fail. .BR getaliasent_r () 関数は上記の関数のリエントラント版である。 要求された構造体は第 1 引き数に格納されるが、 プログラマは他の引き数も埋めてやる必要がある。 充分な領域が与えられないと、この関数は失敗する。 .PP .\"O The function .\"O .BR getaliasbyname () .\"O takes the name argument and searches the aliases database. .\"O The entry is returned as a pointer to a .\"O .IR "struct aliasent" . 関数 .BR getaliasbyname () は name 引き数をとり、エイリアスデータベースを検索する。 エントリは .I "struct aliasent" へのポインタとして返される。 .PP .\"O .BR getaliasbyname_r () .\"O is the reentrant version of the previous function. .\"O The requested structure .\"O is stored via the second argument but the programmer needs to fill the other .\"O arguments also. .\"O Not providing enough space causes the function to fail. .BR getaliasbyname_r () は上記の関数のリエントラント版である。 要求された構造体は第 2 引き数に格納されるが、 プログラマは他の引き数も埋めてやる必要がある。 充分な領域が与えられないと、この関数は失敗する。 .PP .\"O The .\"O .I "struct aliasent" .\"O is defined in .\"O .IR : .I "struct aliasent" は .I で定義されている。 .in +4n .nf struct aliasent { .\"O char *alias_name; /* alias name */ .\"O size_t alias_members_len; .\"O char **alias_members; /* alias name list */ .\"O int alias_local; char *alias_name; /* エイリアス名 */ size_t alias_members_len; char **alias_members; /* エイリアス名のリスト */ int alias_local; }; .fi .in .\"O .SH "RETURN VALUE" .SH 返り値 .\"O The functions .\"O .BR getaliasent_r () .\"O and .\"O .BR getaliasbyname_r () .\"O return a nonzero value on error. 関数 .BR getaliasent_r () と .BR getaliasbyname_r () は、エラーの場合に 0 以外の値を返す。 .\"O .SH FILES .SH ファイル .\"O The default alias database is the file .\"O .IR /etc/aliases . デフォルトのエイリアスデータベースは、ファイル .I /etc/aliases である。 .\"O This can be changed in the .\"O .I /etc/nsswitch.conf .\"O file. これは .I /etc/nsswitch.conf ファイルで変更できる。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O These routines are glibc-specific. このルーチンは glibc 固有のものである。 .\"O The NeXT system has similar routines: NeXT システムには同様のルーチンがある。 .in +4n .sp .nf #include void alias_setent(void); void alias_endent(void); alias_ent *alias_getent(void); alias_ent *alias_getbyname(char *name); .fi .in .\"O .SH EXAMPLE .SH 例 .\"O The following example compiles with .\"O .IR "gcc example.c -o example" . 以下の例は .I "gcc example.c -o example" でコンパイルできる。 .\"O It will dump all names in the alias database. これはエイリアスデータベースにある全ての名前をダンプする。 .sp .nf #include #include #include #include int main(void) { struct aliasent *al; setaliasent(); for (;;) { al = getaliasent(); if (al == NULL) break; printf("Name: %s\\n", al\->alias_name); } if (errno) { perror("reading alias"); exit(EXIT_FAILURE); } endaliasent(); exit(EXIT_SUCCESS); .fi .\"O .SH "SEE ALSO" .SH 関連項目 .BR getgrent (3), .BR getpwent (3), .BR getspent (3), .BR aliases (5) .\" .\" /etc/sendmail/aliases .\" Yellow Pages .\" newaliases, postalias