OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / getprotoent.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified Sat Jul 24 19:26:03 1993 by Rik Faith (faith@cs.unc.edu)
30 .\"*******************************************************************
31 .\"
32 .\" This file was generated with po4a. Translate the source file.
33 .\"
34 .\"*******************************************************************
35 .\"
36 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
37 .\" Translated Fri Mar 15 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
38 .\" Updated 2008-09-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
39 .\"
40 .TH GETPROTOENT 3 2008\-08\-19 GNU "Linux Programmer's Manual"
41 .SH 名前
42 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
43 プロトコルのエントリを取得する
44 .SH 書式
45 .nf
46 \fB#include <netdb.h>\fP
47 .sp
48 \fBstruct protoent *getprotoent(void);\fP
49 .sp
50 \fBstruct protoent *getprotobyname(const char *\fP\fIname\fP\fB);\fP
51 .sp
52 \fBstruct protoent *getprotobynumber(int \fP\fIproto\fP\fB);\fP
53 .sp
54 \fBvoid setprotoent(int \fP\fIstayopen\fP\fB);\fP
55 .sp
56 \fBvoid endprotoent(void);\fP
57 .fi
58 .SH 説明
59 \fBgetprotoent\fP()  関数は、プロトコルのデータベース (\fBprotocols\fP(5)  参照) から次のエントリを読み込み、
60 そのエントリを \fIprotoent\fP 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
61 .PP
62 \fBgetprotobyname\fP()  関数は、プロトコル名 \fIname\fP にマッチするエントリを データベースから探し、そのエントリを収めた
63 \fIprotoent\fP 構造体を返す。 必要であれば、データベースへの接続がオープンされる。
64 .PP
65 \fBgetprotobynumber\fP()  関数は、プロトコル番号 \fInumber\fP にマッチするエントリを
66 データベースから探し、そのエントリを収めた \fIprotoent\fP 構造体を返す。 必要であれば、データベースへの接続がオープンされる。
67 .PP
68 \fBsetprotoent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリを先頭のエントリに設定する。 \fIstayopen\fP
69 が 0 でない場合、 一つ一つの \fBgetproto*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
70 .PP
71 \fBendprotoent\fP()  関数はデータベースへの接続をクローズする。
72 .PP
73 \fIprotoent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
74 .sp
75 .in +4n
76 .nf
77 struct protoent {
78     char  *p_name;       /* official protocol name */
79     char **p_aliases;    /* alias list */
80     int    p_proto;      /* protocol number */
81 }
82 .fi
83 .in
84 .PP
85 \fIprotoent\fP 構造体のメンバーは以下の通り。
86 .TP 
87 \fIp_name\fP
88 プロトコルの正式名 (official name)。
89 .TP 
90 \fIp_aliases\fP
91 プロトコルの別名のリスト。 リストは NULL で終端される。
92 .TP 
93 \fIp_proto\fP
94 プロトコルの番号
95 .SH 返り値
96 \fBgetprotoent\fP(), \fBgetprotobyname\fP(), \fBgetprotobynumber\fP()  関数は、静的に割り当てられた
97 \fIprotoent\fP 構造体へのポインタを返す。 エラーが起こったり、ファイルの最後に達した場合は NULL ポインタを返す。
98 .SH ファイル
99 .PD 0
100 .TP 
101 \fI/etc/protocols\fP
102 プロトコルのデータベースファイル
103 .PD
104 .SH 準拠
105 4.3BSD, POSIX.1\-2001.
106 .SH 関連項目
107 \fBgetnetent\fP(3), \fBgetprotoent_r\fP(3), \fBgetservent\fP(3), \fBprotocols\fP(5)
108 .SH この文書について
109 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
110 である。プロジェクトの説明とバグ報告に関する情報は
111 http://www.kernel.org/doc/man\-pages/ に書かれている。