OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[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 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH GETPROTOENT 3 2008\-08\-19 GNU "Linux Programmer's Manual"
34 .SH 名前
35 getprotoent, getprotobyname, getprotobynumber, setprotoent, endprotoent \-
36 プロトコルのエントリを取得する
37 .SH 書式
38 .nf
39 \fB#include <netdb.h>\fP
40 .sp
41 \fBstruct protoent *getprotoent(void);\fP
42 .sp
43 \fBstruct protoent *getprotobyname(const char *\fP\fIname\fP\fB);\fP
44 .sp
45 \fBstruct protoent *getprotobynumber(int \fP\fIproto\fP\fB);\fP
46 .sp
47 \fBvoid setprotoent(int \fP\fIstayopen\fP\fB);\fP
48 .sp
49 \fBvoid endprotoent(void);\fP
50 .fi
51 .SH 説明
52 \fBgetprotoent\fP()  関数は、プロトコルのデータベース (\fBprotocols\fP(5)  参照) から次のエントリを読み込み、
53 そのエントリを \fIprotoent\fP 構造体の要素別のフィールドに格納し、 その構造体を返す。 必要であれば、データベースへの接続がオープンされる。
54 .PP
55 \fBgetprotobyname\fP()  関数は、プロトコル名 \fIname\fP にマッチするエントリを データベースから探し、そのエントリを収めた
56 \fIprotoent\fP 構造体を返す。 必要であれば、データベースへの接続がオープンされる。
57 .PP
58 \fBgetprotobynumber\fP()  関数は、プロトコル番号 \fInumber\fP にマッチするエントリを
59 データベースから探し、そのエントリを収めた \fIprotoent\fP 構造体を返す。 必要であれば、データベースへの接続がオープンされる。
60 .PP
61 \fBsetprotoent\fP()  関数はデータベースへの接続をオープンし、 次の読み込みエントリを先頭のエントリに設定する。 \fIstayopen\fP
62 が 0 でない場合、 一つ一つの \fBgetproto*\fP()  関数の呼び出し間でデータベースへの接続をクローズしない。
63 .PP
64 \fBendprotoent\fP()  関数はデータベースへの接続をクローズする。
65 .PP
66 \fIprotoent\fP 構造体は \fI<netdb.h>\fP で以下のように定義されている。
67 .sp
68 .in +4n
69 .nf
70 struct protoent {
71     char  *p_name;       /* official protocol name */
72     char **p_aliases;    /* alias list */
73     int    p_proto;      /* protocol number */
74 }
75 .fi
76 .in
77 .PP
78 \fIprotoent\fP 構造体のメンバーは以下の通り。
79 .TP 
80 \fIp_name\fP
81 プロトコルの正式名 (official name)。
82 .TP 
83 \fIp_aliases\fP
84 プロトコルの別名のリスト。 リストは NULL で終端される。
85 .TP 
86 \fIp_proto\fP
87 プロトコルの番号
88 .SH 返り値
89 \fBgetprotoent\fP(), \fBgetprotobyname\fP(), \fBgetprotobynumber\fP()  関数は、静的に割り当てられた
90 \fIprotoent\fP 構造体へのポインタを返す。 エラーが起こったり、ファイルの最後に達した場合は NULL ポインタを返す。
91 .SH ファイル
92 .PD 0
93 .TP 
94 \fI/etc/protocols\fP
95 プロトコルのデータベースファイル
96 .PD
97 .SH 準拠
98 4.3BSD, POSIX.1\-2001.
99 .SH 関連項目
100 \fBgetnetent\fP(3), \fBgetprotoent_r\fP(3), \fBgetservent\fP(3), \fBprotocols\fP(5)