OSDN Git Service

21a53310df862823e51eaa3ba9b73cd925a43c47
[linuxjm/LDP_man-pages.git] / draft / man3 / getprotoent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
28 .\"
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>
32 .\"
33 .TH GETPROTOENT 3  2008-08-19 "GNU" "Linux Programmer's Manual"
34 .\"O .SH NAME
35 .\"O getprotoent, getprotobyname, getprotobynumber, setprotoent,
36 .\"O endprotoent \- get protocol entry
37 .SH 名前
38 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
39 プロトコルのエントリを取得する
40 .\"O .SH SYNOPSIS
41 .SH 書式
42 .nf
43 .B #include <netdb.h>
44 .sp
45 .B struct protoent *getprotoent(void);
46 .sp
47 .BI "struct protoent *getprotobyname(const char *" name );
48 .sp
49 .BI "struct protoent *getprotobynumber(int " proto );
50 .sp
51 .BI "void setprotoent(int " stayopen );
52 .sp
53 .B void endprotoent(void);
54 .fi
55 .\"O .SH DESCRIPTION
56 .SH 説明
57 .\"O The
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.
64 .BR getprotoent ()
65 関数は、プロトコルのデータベース
66 .RB ( protocols (5)
67 参照) から次のエントリを読み込み、
68 そのエントリを \fIprotoent\fP 構造体の要素別のフィールドに格納し、
69 その構造体を返す。
70 必要であれば、データベースへの接続がオープンされる。
71 .PP
72 .\"O The
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.
78 .BR getprotobyname ()
79 関数は、プロトコル名 \fIname\fP にマッチするエントリを
80 データベースから探し、そのエントリを収めた \fIprotoent\fP 構造体を返す。
81 必要であれば、データベースへの接続がオープンされる。
82 .PP
83 .\"O The
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 必要であれば、データベースへの接続がオープンされる。
93 .PP
94 .\"O The
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* ()
102 .\"O functions.
103 .BR setprotoent ()
104 関数はデータベースへの接続をオープンし、
105 次の読み込みエントリを先頭のエントリに設定する。
106 \fIstayopen\fP が 0 でない場合、
107 一つ一つの
108 .BR getproto* ()
109 関数の呼び出し間でデータベースへの接続をクローズしない。
110 .PP
111 .\"O The
112 .\"O .BR endprotoent ()
113 .\"O function closes the connection to the database.
114 .BR endprotoent ()
115 関数はデータベースへの接続をクローズする。
116 .PP
117 .\"O The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
118 \fIprotoent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
119 .sp
120 .in +4n
121 .nf
122 struct protoent {
123     char  *p_name;       /* official protocol name */
124     char **p_aliases;    /* alias list */
125     int    p_proto;      /* protocol number */
126 }
127 .fi
128 .in
129 .PP
130 .\"O The members of the \fIprotoent\fP structure are:
131 \fIprotoent\fP 構造体のメンバーは以下の通り。
132 .RS
133 .TP 12
134 .I p_name
135 .\"O The official name of the protocol.
136 プロトコルの正式名 (official name)。
137 .TP
138 .I p_aliases
139 .\"O A NULL-terminated list of alternative names for the protocol.
140 プロトコルの別名のリスト。
141 リストは NULL で終端される。
142 .TP
143 .I p_proto
144 .\"O The protocol number.
145 プロトコルの番号
146 .RE
147 .\"O .SH "RETURN VALUE"
148 .SH 返り値
149 .\"O The
150 .\"O .BR getprotoent (),
151 .\"O .BR getprotobyname ()
152 .\"O and
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.
157 .BR getprotoent (),
158 .BR getprotobyname (),
159 .BR getprotobynumber ()
160 関数は、静的に割り当てられた \fIprotoent\fP 構造体へのポインタを返す。
161 エラーが起こったり、ファイルの最後に達した場合は NULL ポインタを返す。
162 .\"O .SH FILES
163 .SH ファイル
164 .PD 0
165 .TP
166 .I /etc/protocols
167 .\"O protocol database file
168 プロトコルのデータベースファイル
169 .PD
170 .\"O .SH "CONFORMING TO"
171 .SH 準拠
172 4.3BSD, POSIX.1-2001.
173 .\"O .SH "SEE ALSO"
174 .SH 関連項目
175 .BR getnetent (3),
176 .BR getprotoent_r (3),
177 .BR getservent (3),
178 .BR protocols (5)