1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References consulted:
24 .\" Linux libc source code
25 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
27 .\" Modified Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
29 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
30 .\" Translated Fri Mar 15 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
33 .TH GETPROTOENT 3 2008-08-19 "GNU" "Linux Programmer's Manual"
35 .\"O getprotoent, getprotobyname, getprotobynumber, setprotoent,
36 .\"O endprotoent \- get protocol entry
38 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
45 .B struct protoent *getprotoent(void);
47 .BI "struct protoent *getprotobyname(const char *" name );
49 .BI "struct protoent *getprotobynumber(int " proto );
51 .BI "void setprotoent(int " stayopen );
53 .B void endprotoent(void);
58 .\"O .BR getprotoent ()
59 .\"O function reads the next entry from the protocols database (see
60 .\"O .BR protocols (5))
61 .\"O and returns a \fIprotoent\fP structure
62 .\"O containing the broken-out fields from the entry.
63 .\"O A connection is opened to the database if necessary.
68 そのエントリを \fIprotoent\fP 構造体の要素別のフィールドに格納し、
70 必要であれば、データベースへの接続がオープンされる。
73 .\"O .BR getprotobyname ()
74 .\"O function returns a \fIprotoent\fP structure
75 .\"O for the entry from the database
76 .\"O that matches the protocol name \fIname\fP.
77 .\"O A connection is opened to the database if necessary.
79 関数は、プロトコル名 \fIname\fP にマッチするエントリを
80 データベースから探し、そのエントリを収めた \fIprotoent\fP 構造体を返す。
81 必要であれば、データベースへの接続がオープンされる。
84 .\"O .BR getprotobynumber ()
85 .\"O function returns a \fIprotoent\fP structure
86 .\"O for the entry from the database
87 .\"O that matches the protocol number \fInumber\fP.
88 .\"O A connection is opened to the database if necessary.
89 .BR getprotobynumber ()
90 関数は、プロトコル番号 \fInumber\fP にマッチするエントリを
91 データベースから探し、そのエントリを収めた \fIprotoent\fP 構造体を返す。
92 必要であれば、データベースへの接続がオープンされる。
95 .\"O .BR setprotoent ()
96 .\"O function opens a connection to the database,
97 .\"O and sets the next entry to the first entry.
98 .\"O If \fIstayopen\fP is nonzero,
99 .\"O then the connection to the database
100 .\"O will not be closed between calls to one of the
101 .\"O .BR getproto* ()
105 次の読み込みエントリを先頭のエントリに設定する。
106 \fIstayopen\fP が 0 でない場合、
109 関数の呼び出し間でデータベースへの接続をクローズしない。
112 .\"O .BR endprotoent ()
113 .\"O function closes the connection to the database.
115 関数はデータベースへの接続をクローズする。
117 .\"O The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
118 \fIprotoent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
123 char *p_name; /* official protocol name */
124 char **p_aliases; /* alias list */
125 int p_proto; /* protocol number */
130 .\"O The members of the \fIprotoent\fP structure are:
131 \fIprotoent\fP 構造体のメンバーは以下の通り。
135 .\"O The official name of the protocol.
136 プロトコルの正式名 (official name)。
139 .\"O A NULL-terminated list of alternative names for the protocol.
144 .\"O The protocol number.
147 .\"O .SH "RETURN VALUE"
150 .\"O .BR getprotoent (),
151 .\"O .BR getprotobyname ()
153 .\"O .BR getprotobynumber ()
154 .\"O functions return a pointer to a
155 .\"O statically allocated \fIprotoent\fP structure, or a NULL pointer if an
156 .\"O error occurs or the end of the file is reached.
158 .BR getprotobyname (),
159 .BR getprotobynumber ()
160 関数は、静的に割り当てられた \fIprotoent\fP 構造体へのポインタを返す。
161 エラーが起こったり、ファイルの最後に達した場合は NULL ポインタを返す。
167 .\"O protocol database file
170 .\"O .SH "CONFORMING TO"
172 4.3BSD, POSIX.1-2001.
176 .BR getprotoent_r (3),