1 .\" Copyright 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
4 .\" Polished a bit, added a little, aeb
6 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
7 .\" all rights reserved.
8 .\" Translated Sun Sep 5 20:44:27 JST 2004
9 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
11 .TH SETALIASENT 3 2003-09-09 "GNU" "Linux Programmer's Manual"
14 .\"O setaliasent, endaliasent, getaliasent, getaliasent_r,
15 .\"O getaliasbyname, getaliasbyname_r \- read an alias entry
16 setaliasent, endaliasent, getaliasent, getaliasent_r, getaliasbyname, getaliasbyname_r \- エイリアスエントリを読み込む
19 .B #include <aliases.h>
21 .B "void setaliasent(void);"
23 .B "void endaliasent(void);"
25 .B "struct aliasent *getaliasent(void);"
27 .BI "int getaliasent_r(struct aliasent *" result ","
29 .BI " char *" buffer ", size_t " buflen ", struct aliasent **" res );
31 .BI "struct aliasent *getaliasbyname(const char *" name );
33 .BI "int getaliasbyname_r(const char *" name ", struct aliasent *" result ,
35 .BI " char *" buffer ", size_t " buflen ", struct aliasent **" res );
38 .\"O One of the databases available with the Name Service Switch (NSS)
39 .\"O is the aliases database, that contains mail aliases.
40 .\"O (To find out which databases are supported, try getent \-\-help .)
41 ネームサービススイッチ (Name Service Switch, NSS) で
43 メールエイリアスを保持するエイリアスデータベースがある。
44 (どのデータベースがサポートされているかを調べるには、
45 getent \-\-help を実行すること。)
46 .\"O Six functions are provided to access the aliases database.
47 エイリアスデータベースにアクセスするために、
51 .\"O .BR getaliasent ()
52 .\"O function returns a pointer to a structure containing
53 .\"O the group information from the aliases database.
56 グループ情報を含む構造体へのポインタを返す。
57 .\"O The first time it is called it returns the first entry;
58 .\"O thereafter, it returns successive entries.
59 1 回目に関数が呼ばれたときには、最初のエントリを返す;
63 .\"O .BR setaliasent ()
64 .\"O function rewinds the file pointer to the beginning of the
65 .\"O aliases database.
67 関数はファイルポインタをエイリアスデータベースの先頭に巻き戻す。
70 .\"O .BR endaliasent ()
71 .\"O function closes the aliases database.
73 関数はエイリアスデータベースをクローズする。
75 .\"O .BR getaliasent_r ()
76 .\"O is the reentrant version of the previous function.
77 .\"O The requested structure
78 .\"O is stored via the first argument but the programmer needs to fill the other
80 .\"O Not providing enough space causes the function to fail.
83 要求された構造体は第 1 引き数に格納されるが、
84 プログラマは他の引き数も埋めてやる必要がある。
85 充分な領域が与えられないと、この関数は失敗する。
88 .\"O .BR getaliasbyname ()
89 .\"O takes the name argument and searches the aliases database.
90 .\"O The entry is returned as a pointer to a
91 .\"O .IR "struct aliasent" .
94 は name 引き数をとり、エイリアスデータベースを検索する。
99 .\"O .BR getaliasbyname_r ()
100 .\"O is the reentrant version of the previous function.
101 .\"O The requested structure
102 .\"O is stored via the second argument but the programmer needs to fill the other
104 .\"O Not providing enough space causes the function to fail.
105 .BR getaliasbyname_r ()
107 要求された構造体は第 2 引き数に格納されるが、
108 プログラマは他の引き数も埋めてやる必要がある。
109 充分な領域が与えられないと、この関数は失敗する。
112 .\"O .I "struct aliasent"
114 .\"O .IR <aliases.h> :
123 .\"O char *alias_name; /* alias name */
124 .\"O size_t alias_members_len;
125 .\"O char **alias_members; /* alias name list */
126 .\"O int alias_local;
127 char *alias_name; /* エイリアス名 */
128 size_t alias_members_len;
129 char **alias_members; /* エイリアス名のリスト */
134 .\"O .SH "RETURN VALUE"
137 .\"O .BR getaliasent_r ()
139 .\"O .BR getaliasbyname_r ()
140 .\"O return a nonzero value on error.
144 .BR getaliasbyname_r ()
148 .\"O The default alias database is the file
149 .\"O .IR /etc/aliases .
150 デフォルトのエイリアスデータベースは、ファイル
153 .\"O This can be changed in the
154 .\"O .I /etc/nsswitch.conf
157 .I /etc/nsswitch.conf
159 .\"O .SH "CONFORMING TO"
161 .\"O These routines are glibc-specific.
162 このルーチンは glibc 固有のものである。
163 .\"O The NeXT system has similar routines:
164 NeXT システムには同様のルーチンがある。
171 void alias_setent(void);
172 void alias_endent(void);
173 alias_ent *alias_getent(void);
174 alias_ent *alias_getbyname(char *name);
179 .\"O The following example compiles with
180 .\"O .IR "gcc example.c -o example" .
182 .I "gcc example.c -o example"
184 .\"O It will dump all names in the alias database.
185 これはエイリアスデータベースにある全ての名前をダンプする。
202 printf("Name: %s\\n", al\->alias_name);
205 perror("reading alias");
218 .\" /etc/sendmail/aliases
220 .\" newaliases, postalias