OSDN Git Service

962da5b4a125e5df49482fd786b5028ccfe12146
[linuxjm/LDP_man-pages.git] / po4a / search / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2012-04-25 05:36+0900\n"
10 "PO-Revision-Date: 2012-04-29 23:39+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man3/bsearch.3:29
20 #, no-wrap
21 msgid "BSEARCH"
22 msgstr "BSEARCH"
23
24 #. type: TH
25 #: build/C/man3/bsearch.3:29
26 #, no-wrap
27 msgid "2003-11-01"
28 msgstr "2003-11-01"
29
30 #. type: TH
31 #: build/C/man3/bsearch.3:29 build/C/man3/hsearch.3:35
32 #: build/C/man3/insque.3:34 build/C/man3/lsearch.3:25 build/C/man3/qsort.3:35
33 #: build/C/man3/tsearch.3:24
34 #, no-wrap
35 msgid "Linux Programmer's Manual"
36 msgstr "Linux Programmer's Manual"
37
38 #. type: SH
39 #: build/C/man3/bsearch.3:30 build/C/man3/hsearch.3:36
40 #: build/C/man3/insque.3:35 build/C/man3/lsearch.3:26 build/C/man3/qsort.3:36
41 #: build/C/man3/tsearch.3:25
42 #, no-wrap
43 msgid "NAME"
44 msgstr "名前"
45
46 #. type: Plain text
47 #: build/C/man3/bsearch.3:32
48 msgid "bsearch - binary search of a sorted array"
49 msgstr "bsearch - ソートされた配列を二分木検索 (binary search) する"
50
51 #. type: SH
52 #: build/C/man3/bsearch.3:32 build/C/man3/hsearch.3:39
53 #: build/C/man3/insque.3:37 build/C/man3/lsearch.3:28 build/C/man3/qsort.3:38
54 #: build/C/man3/tsearch.3:27
55 #, no-wrap
56 msgid "SYNOPSIS"
57 msgstr "書式"
58
59 #. type: Plain text
60 #: build/C/man3/bsearch.3:35 build/C/man3/qsort.3:41
61 #, no-wrap
62 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
63 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
64
65 #. type: Plain text
66 #: build/C/man3/bsearch.3:39
67 #, no-wrap
68 msgid ""
69 "B<void *bsearch(const void *>I<key>B<, const void *>I<base>B<,>\n"
70 "B<              size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
71 "B<              int (*>I<compar>B<)(const void *, const void *));>\n"
72 msgstr ""
73 "B<void *bsearch(const void *>I<key>B<, const void *>I<base>B<,>\n"
74 "B<              size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
75 "B<              int (*>I<compar>B<)(const void *, const void *));>\n"
76
77 #. type: SH
78 #: build/C/man3/bsearch.3:40 build/C/man3/hsearch.3:60
79 #: build/C/man3/insque.3:59 build/C/man3/lsearch.3:38 build/C/man3/qsort.3:59
80 #: build/C/man3/tsearch.3:50
81 #, no-wrap
82 msgid "DESCRIPTION"
83 msgstr "説明"
84
85 #. type: Plain text
86 #: build/C/man3/bsearch.3:48
87 msgid ""
88 "The B<bsearch>()  function searches an array of I<nmemb> objects, the "
89 "initial member of which is pointed to by I<base>, for a member that matches "
90 "the object pointed to by I<key>.  The size of each member of the array is "
91 "specified by I<size>."
92 msgstr ""
93 "B<bsearch>()  関数は I<nmemb> 個のオブジェクトからなる配列を検索 する。配列の"
94 "最初のメンバーへのポインタは I<base> によって与える。 ポインタ I<key> で参照"
95 "されるオブジェクトと一致するメンバーが返される。 配列中の各々のメンバーのサイ"
96 "ズは I<size> によって指定する。"
97
98 #. type: Plain text
99 #: build/C/man3/bsearch.3:57
100 msgid ""
101 "The contents of the array should be in ascending sorted order according to "
102 "the comparison function referenced by I<compar>.  The I<compar> routine is "
103 "expected to have two arguments which point to the I<key> object and to an "
104 "array member, in that order, and should return an integer less than, equal "
105 "to, or greater than zero if the I<key> object is found, respectively, to be "
106 "less than, to match, or be greater than the array member."
107 msgstr ""
108 "配列の内容は比較関数 I<compar> に基づき、昇順にソートされていなけれ ばならな"
109 "い。 I<compar> ルーチンは二つの引数を取る関数で、一つ 目に I<key> へのポイン"
110 "タ、次に配列のメンバーへのポインタを取る。 この順に指定したとき、 I<key> が配"
111 "列メンバーより小さいときには 負の整数を、大きいときには正の整数を、一致したと"
112 "きには 0 を、それぞれ I<compar> は返さなければならない。"
113
114 #. type: SH
115 #: build/C/man3/bsearch.3:57 build/C/man3/hsearch.3:174
116 #: build/C/man3/lsearch.3:58 build/C/man3/qsort.3:89
117 #: build/C/man3/tsearch.3:132
118 #, no-wrap
119 msgid "RETURN VALUE"
120 msgstr "返り値"
121
122 #. type: Plain text
123 #: build/C/man3/bsearch.3:64
124 msgid ""
125 "The B<bsearch>()  function returns a pointer to a matching member of the "
126 "array, or NULL if no match is found.  If there are multiple elements that "
127 "match the key, the element returned is unspecified."
128 msgstr ""
129 "B<bsearch>()  関数は、配列のメンバーのうち、一致したものへのポインタを 返す。"
130 "見つからなかったときは NULL を返す。 I<key> と一致したメンバーが 複数あると"
131 "き、そのうちのどのメンバーが返されるかはわからない。"
132
133 #. type: SH
134 #: build/C/man3/bsearch.3:64 build/C/man3/hsearch.3:226
135 #: build/C/man3/insque.3:97 build/C/man3/lsearch.3:66 build/C/man3/qsort.3:98
136 #: build/C/man3/tsearch.3:153
137 #, no-wrap
138 msgid "CONFORMING TO"
139 msgstr "準拠"
140
141 #. type: Plain text
142 #: build/C/man3/bsearch.3:66
143 msgid "SVr4, 4.3BSD, POSIX.1-2001, C89, C99."
144 msgstr "SVr4, 4.3BSD, POSIX.1-2001, C89, C99."
145
146 #. type: SH
147 #: build/C/man3/bsearch.3:66 build/C/man3/hsearch.3:273
148 #: build/C/man3/insque.3:132 build/C/man3/qsort.3:114
149 #: build/C/man3/tsearch.3:181
150 #, no-wrap
151 msgid "EXAMPLE"
152 msgstr "例"
153
154 #. type: Plain text
155 #: build/C/man3/bsearch.3:71
156 msgid ""
157 "The example below first sorts an array of structures using B<qsort>(3), then "
158 "retrieves desired elements using B<bsearch>()."
159 msgstr ""
160 "以下の例は、 B<qsort>(3)  を使って構造体の配列の並び換えを行った後、 所望の要"
161 "素を B<bsearch>()  を使って取得するものである。"
162
163 #. type: Plain text
164 #: build/C/man3/bsearch.3:76 build/C/man3/qsort.3:125
165 #, no-wrap
166 msgid ""
167 "#include E<lt>stdio.hE<gt>\n"
168 "#include E<lt>stdlib.hE<gt>\n"
169 "#include E<lt>string.hE<gt>\n"
170 msgstr ""
171 "#include E<lt>stdio.hE<gt>\n"
172 "#include E<lt>stdlib.hE<gt>\n"
173 "#include E<lt>string.hE<gt>\n"
174
175 #. type: Plain text
176 #: build/C/man3/bsearch.3:85
177 #, no-wrap
178 msgid ""
179 "struct mi {\n"
180 "    int nr;\n"
181 "    char *name;\n"
182 "} months[] = {\n"
183 "    { 1, \"jan\" }, { 2, \"feb\" }, { 3, \"mar\" }, { 4, \"apr\" },\n"
184 "    { 5, \"may\" }, { 6, \"jun\" }, { 7, \"jul\" }, { 8, \"aug\" },\n"
185 "    { 9, \"sep\" }, {10, \"oct\" }, {11, \"nov\" }, {12, \"dec\" }\n"
186 "};\n"
187 msgstr ""
188 "struct mi {\n"
189 "    int nr;\n"
190 "    char *name;\n"
191 "} months[] = {\n"
192 "    { 1, \"jan\" }, { 2, \"feb\" }, { 3, \"mar\" }, { 4, \"apr\" },\n"
193 "    { 5, \"may\" }, { 6, \"jun\" }, { 7, \"jul\" }, { 8, \"aug\" },\n"
194 "    { 9, \"sep\" }, {10, \"oct\" }, {11, \"nov\" }, {12, \"dec\" }\n"
195 "};\n"
196
197 #. type: Plain text
198 #: build/C/man3/bsearch.3:87
199 #, no-wrap
200 msgid "#define nr_of_months (sizeof(months)/sizeof(months[0]))\n"
201 msgstr "#define nr_of_months (sizeof(months)/sizeof(months[0]))\n"
202
203 #. type: Plain text
204 #: build/C/man3/bsearch.3:95
205 #, no-wrap
206 msgid ""
207 "static int\n"
208 "compmi(const void *m1, const void *m2)\n"
209 "{\n"
210 "    struct mi *mi1 = (struct mi *) m1;\n"
211 "    struct mi *mi2 = (struct mi *) m2;\n"
212 "    return strcmp(mi1-E<gt>name, mi2-E<gt>name);\n"
213 "}\n"
214 msgstr ""
215 "static int\n"
216 "compmi(const void *m1, const void *m2)\n"
217 "{\n"
218 "    struct mi *mi1 = (struct mi *) m1;\n"
219 "    struct mi *mi2 = (struct mi *) m2;\n"
220 "    return strcmp(mi1-E<gt>name, mi2-E<gt>name);\n"
221 "}\n"
222
223 #. type: Plain text
224 #: build/C/man3/bsearch.3:100
225 #, no-wrap
226 msgid ""
227 "int\n"
228 "main(int argc, char **argv)\n"
229 "{\n"
230 "    int i;\n"
231 msgstr ""
232 "int\n"
233 "main(int argc, char **argv)\n"
234 "{\n"
235 "    int i;\n"
236
237 #. type: Plain text
238 #: build/C/man3/bsearch.3:114
239 #, no-wrap
240 msgid ""
241 "    qsort(months, nr_of_months, sizeof(struct mi), compmi);\n"
242 "    for (i = 1; i E<lt> argc; i++) {\n"
243 "        struct mi key, *res;\n"
244 "        key.name = argv[i];\n"
245 "        res = bsearch(&key, months, nr_of_months,\n"
246 "                      sizeof(struct mi), compmi);\n"
247 "        if (res == NULL)\n"
248 "            printf(\"\\(aq%s\\(aq: unknown month\\en\", argv[i]);\n"
249 "        else\n"
250 "            printf(\"%s: month #%d\\en\", res-E<gt>name, res-E<gt>nr);\n"
251 "    }\n"
252 "    exit(EXIT_SUCCESS);\n"
253 "}\n"
254 msgstr ""
255 "    qsort(months, nr_of_months, sizeof(struct mi), compmi);\n"
256 "    for (i = 1; i E<lt> argc; i++) {\n"
257 "        struct mi key, *res;\n"
258 "        key.name = argv[i];\n"
259 "        res = bsearch(&key, months, nr_of_months,\n"
260 "                      sizeof(struct mi), compmi);\n"
261 "        if (res == NULL)\n"
262 "            printf(\"\\(aq%s\\(aq: unknown month\\en\", argv[i]);\n"
263 "        else\n"
264 "            printf(\"%s: month #%d\\en\", res-E<gt>name, res-E<gt>nr);\n"
265 "    }\n"
266 "    exit(EXIT_SUCCESS);\n"
267 "}\n"
268
269 #. type: SH
270 #: build/C/man3/bsearch.3:116 build/C/man3/hsearch.3:323
271 #: build/C/man3/lsearch.3:71 build/C/man3/qsort.3:153
272 #: build/C/man3/tsearch.3:258
273 #, no-wrap
274 msgid "SEE ALSO"
275 msgstr "関連項目"
276
277 #. type: Plain text
278 #: build/C/man3/bsearch.3:120
279 msgid "B<hsearch>(3), B<lsearch>(3), B<qsort>(3), B<tsearch>(3)"
280 msgstr "B<hsearch>(3), B<lsearch>(3), B<qsort>(3), B<tsearch>(3)"
281
282 #. type: TH
283 #: build/C/man3/hsearch.3:35
284 #, no-wrap
285 msgid "HSEARCH"
286 msgstr "HSEARCH"
287
288 #. type: TH
289 #: build/C/man3/hsearch.3:35
290 #, no-wrap
291 msgid "2011-09-10"
292 msgstr "2011-09-10"
293
294 #. type: TH
295 #: build/C/man3/hsearch.3:35 build/C/man3/lsearch.3:25
296 #: build/C/man3/tsearch.3:24
297 #, no-wrap
298 msgid "GNU"
299 msgstr "GNU"
300
301 #. type: Plain text
302 #: build/C/man3/hsearch.3:39
303 msgid ""
304 "hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, hsearch_r - hash table "
305 "management"
306 msgstr ""
307 "hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, hsearch_r - ハッシュテーブ"
308 "ルの管理"
309
310 #. type: Plain text
311 #: build/C/man3/hsearch.3:42 build/C/man3/hsearch.3:52
312 #: build/C/man3/insque.3:40 build/C/man3/lsearch.3:31
313 #: build/C/man3/tsearch.3:30 build/C/man3/tsearch.3:47
314 #, no-wrap
315 msgid "B<#include E<lt>search.hE<gt>>\n"
316 msgstr "B<#include E<lt>search.hE<gt>>\n"
317
318 #. type: Plain text
319 #: build/C/man3/hsearch.3:44
320 #, no-wrap
321 msgid "B<int hcreate(size_t >I<nel>B<);>\n"
322 msgstr "B<int hcreate(size_t >I<nel>B<);>\n"
323
324 #. type: Plain text
325 #: build/C/man3/hsearch.3:46
326 #, no-wrap
327 msgid "B<ENTRY *hsearch(ENTRY >I<item>B<, ACTION >I<action>B<);>\n"
328 msgstr "B<ENTRY *hsearch(ENTRY >I<item>B<, ACTION >I<action>B<);>\n"
329
330 #. type: Plain text
331 #: build/C/man3/hsearch.3:48
332 #, no-wrap
333 msgid "B<void hdestroy(void);>\n"
334 msgstr "B<void hdestroy(void);>\n"
335
336 #. type: Plain text
337 #: build/C/man3/hsearch.3:50 build/C/man3/tsearch.3:45
338 #, no-wrap
339 msgid "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
340 msgstr "B<#define _GNU_SOURCE>         /* feature_test_macros(7) 参照 */\n"
341
342 #. type: Plain text
343 #: build/C/man3/hsearch.3:54
344 #, no-wrap
345 msgid "B<int hcreate_r(size_t >I<nel>B<, struct hsearch_data *>I<htab>B<);>\n"
346 msgstr "B<int hcreate_r(size_t >I<nel>B<, struct hsearch_data *>I<htab>B<);>\n"
347
348 #. type: Plain text
349 #: build/C/man3/hsearch.3:57
350 #, no-wrap
351 msgid ""
352 "B<int hsearch_r(ENTRY >I<item>B<, ACTION >I<action>B<, ENTRY **>I<retval>B<,>\n"
353 "B<              struct hsearch_data *>I<htab>B<);>\n"
354 msgstr ""
355 "B<int hsearch_r(ENTRY >I<item>B<, ACTION >I<action>B<, ENTRY **>I<retval>B<,>\n"
356 "B<              struct hsearch_data *>I<htab>B<);>\n"
357
358 #. type: Plain text
359 #: build/C/man3/hsearch.3:59
360 #, no-wrap
361 msgid "B<void hdestroy_r(struct hsearch_data *>I<htab>B<);>\n"
362 msgstr "B<void hdestroy_r(struct hsearch_data *>I<htab>B<);>\n"
363
364 #. type: Plain text
365 #: build/C/man3/hsearch.3:69
366 msgid ""
367 "The three functions B<hcreate>(), B<hsearch>(), and B<hdestroy>()  allow the "
368 "caller to create and manage a hash search table containing entries "
369 "consisting of a key (a string) and associated data.  Using these functions, "
370 "only one hash table can be used at a time."
371 msgstr ""
372 "B<hcreate>(), B<hsearch>(), B<hdestroy>()  の 3 つの関数を利用すると、キー "
373 "(文字列) と対応するデータから構成される エントリを格納できるハッシュ検索テー"
374 "ブルを作成、管理することができる。 これらの関数を使って、一度に使用できるのは"
375 "一つのハッシュテーブルだけである。"
376
377 #. type: Plain text
378 #: build/C/man3/hsearch.3:83
379 msgid ""
380 "The three functions B<hcreate_r>(), B<hsearch_r>(), B<hdestroy_r>()  are "
381 "reentrant versions that allow a program to use more than one hash search "
382 "table at the same time.  The last argument, I<htab>, points to a structure "
383 "that describes the table on which the function is to operate.  The "
384 "programmer should treat this structure as opaque (i.e., do not attempt to "
385 "directly access or modify the fields in this structure)."
386 msgstr ""
387 "B<hcreate_r>(), B<hsearch_r>(), B<hdestroy_r>()  の 3 つの関数はリエントラン"
388 "ト版で、これらを利用すると、 一つのプログラムで同時に複数のハッシュテーブルを"
389 "使うことができる。 最後の引き数 I<htab> は関数の操作対象となるテーブルを示す"
390 "構造体へのポインタである。 プログラマはこの構造体をブラックボックスとして扱う"
391 "べきである (つまり、この構造体のフィールドに直接アクセスしたり変更したり しな"
392 "いこと)。"
393
394 #.  e.g., in glibc it is raised to the next higher prime number
395 #. type: Plain text
396 #: build/C/man3/hsearch.3:92
397 msgid ""
398 "First a hash table must be created using B<hcreate>().  The argument I<nel> "
399 "specifies the maximum number of entries in the table.  (This maximum cannot "
400 "be changed later, so choose it wisely.)  The implementation may adjust this "
401 "value upward to improve the performance of the resulting hash table."
402 msgstr ""
403 "最初に、 B<hcreate>()  関数によってハッシュテーブルを作成しなければならな"
404 "い。 引き数 I<nel> でテーブルの最大エントリ数を指定する (この最大値は後で変更"
405 "することはできないので、よく考えて選択すること)。 作成されるハッシュテーブル"
406 "の性能を向上させるために、 関数内部の実装によりこの値は増やされる場合もある。"
407
408 #. type: Plain text
409 #: build/C/man3/hsearch.3:103
410 msgid ""
411 "The B<hcreate_r>()  function performs the same task as B<hcreate>(), but for "
412 "the table described by the structure I<*htab>.  The structure pointed to by "
413 "I<htab> must be zeroed before the first call to B<hcreate_r>()."
414 msgstr ""
415 "B<hcreate_r>()  関数は B<hcreate>()  と同じ動作をするが、構造体 I<*htab> で示"
416 "されるテーブルを対象として動作する。 I<htab> が指し示す構造体は、 "
417 "B<hcreate_r>()  を初めて呼び出す前に 0 で埋めておかなければならない。"
418
419 #. type: Plain text
420 #: build/C/man3/hsearch.3:118
421 msgid ""
422 "The function B<hdestroy>()  frees the memory occupied by the hash table that "
423 "was created by B<hcreate>().  After calling B<hdestroy>()  a new hash table "
424 "can be created using B<hcreate>().  The B<hdestroy_r>()  function performs "
425 "the analogous task for a hash table described by I<*htab>, which was "
426 "previously created using B<hcreate_r>()."
427 msgstr ""
428 "B<hdestroy>()  関数は、 B<hcreate>()  で作成されたハッシュテーブルが占有して"
429 "いたメモリを解放する。 ハッシュテーブルによって占有されていたメモリを解放"
430 "し、 新しいテーブルを作成できるようにする。 B<hdestroy>()  を呼び出すと、その"
431 "後は B<hcreate>()  を使って新しいハッシュテーブルを作成することができる。 "
432 "B<hdestroy_r>()  関数は、同様の処理を、それ以前に B<hcreate_r>()  を使って作"
433 "成した I<*htab> で示されるハッシュテーブルに対して実行する。"
434
435 #. type: Plain text
436 #: build/C/man3/hsearch.3:125
437 msgid ""
438 "The B<hsearch>()  function searches the hash table for an item with the same "
439 "key as I<item> (where \"the same\" is determined using B<strcmp>(3)), and if "
440 "successful returns a pointer to it."
441 msgstr ""
442 "B<hsearch>()  関数は、I<item> と同じキーを持つ項目をハッシュテーブルから 検索"
443 "し、項目が見つかった場合にはその項目へのポインタを返す (「同じ」かどうかは "
444 "B<strcmp>(3)  を使って判定する)。"
445
446 #. type: Plain text
447 #: build/C/man3/hsearch.3:128
448 msgid ""
449 "The argument I<item> is of type I<ENTRY>, which is defined in I<E<lt>search."
450 "hE<gt>> as follows:"
451 msgstr ""
452 "引き数 I<item> は B<ENTRY> 型であり、I<E<lt>search.hE<gt>> の中で 以下のよう"
453 "に定義されている。"
454
455 #. type: Plain text
456 #: build/C/man3/hsearch.3:135
457 #, no-wrap
458 msgid ""
459 "typedef struct entry {\n"
460 "    char *key;\n"
461 "    void *data;\n"
462 "} ENTRY;\n"
463 msgstr ""
464 "typedef struct entry {\n"
465 "    char *key;\n"
466 "    void *data;\n"
467 "} ENTRY;\n"
468
469 #. type: Plain text
470 #: build/C/man3/hsearch.3:141
471 msgid ""
472 "The field I<key> points to a null-terminated string which is the search "
473 "key.  The field I<data> points to data that is associated with that key."
474 msgstr ""
475 "フィールド I<key> は検索キーとなる NULL 終端された文字列を指す。 フィールド "
476 "I<data> は、このキーに対応するデータを指す。"
477
478 #. type: Plain text
479 #: build/C/man3/hsearch.3:160
480 msgid ""
481 "The argument I<action> determines what B<hsearch>()  does after an "
482 "unsuccessful search.  This argument must either have the value B<ENTER>, "
483 "meaning insert a copy of I<item> (and return a pointer to the new hash table "
484 "entry as the function result), or the value B<FIND>, meaning that NULL "
485 "should be returned.  (If I<action> is B<FIND>, then I<data> is ignored.)"
486 msgstr ""
487 "検索が失敗した後の動作は、引き数 I<action> により決まる。 この引き数には "
488 "B<ENTER> か B<FIND> のいずれかの値を指定しなければならない。 B<ENTER> は "
489 "I<item> のコピーを挿入することを (関数の結果として新しいハッシュテーブルエン"
490 "トリへのポインタを返す)、 B<FIND> は NULL を返すことを意味する (I<action> が "
491 "B<FIND> の場合、 I<data> は無視される)。"
492
493 #. type: Plain text
494 #: build/C/man3/hsearch.3:174
495 msgid ""
496 "The B<hsearch_r>()  function is like B<hsearch>()  but operates on the hash "
497 "table described by I<*htab>.  The B<hsearch_r>()  function differs from "
498 "B<hsearch>()  in that a pointer to the found item is returned in I<*retval>, "
499 "rather than as the function result."
500 msgstr ""
501 "B<hsearch_r>()  関数は B<hsearch>()  と同様だが、 I<*htab> で示されるハッシュ"
502 "テーブルに対して処理を行う。 B<hsearch_r>()  関数が B<hsearch>()  と異なるの"
503 "は、見つかった項目へのポインタを、 関数の結果としてではなく、 I<*retval> に格"
504 "納して返す点である。"
505
506 #. type: Plain text
507 #: build/C/man3/hsearch.3:180
508 msgid ""
509 "B<hcreate>()  and B<hcreate_r>()  return nonzero on success.  They return 0 "
510 "on error."
511 msgstr ""
512 "B<hcreate>()  と B<hcreate_r>()  は、成功した場合 0 以外の値を返し、 エラーの"
513 "場合 0 を返す。"
514
515 #. type: Plain text
516 #: build/C/man3/hsearch.3:191
517 msgid ""
518 "On success, B<hsearch>()  returns a pointer to an entry in the hash table.  "
519 "B<hsearch>()  returns NULL on error, that is, if I<action> is B<ENTER> and "
520 "the hash table is full, or I<action> is B<FIND> and I<item> cannot be found "
521 "in the hash table.  B<hsearch_r>()  returns nonzero on success, and 0 on "
522 "error."
523 msgstr ""
524 "成功すると、 B<hsearch>()  は、ハッシュテーブル内のエントリへのポインタを返"
525 "す。 エラーの場合、 B<hsearch>()  は NULL を返す。 エラーとなるのは、 "
526 "I<action> が B<ENTER> でハッシュテーブルがいっぱいの場合か、 I<action> が "
527 "B<FIND> で I<item> がハッシュテーブル内に 見つからない場合である。 "
528 "B<hsearch_r>()  は、成功すると 0 以外を返し、エラーの場合 0 を返す。"
529
530 #. type: SH
531 #: build/C/man3/hsearch.3:191
532 #, no-wrap
533 msgid "ERRORS"
534 msgstr "エラー"
535
536 #. type: Plain text
537 #: build/C/man3/hsearch.3:197
538 msgid ""
539 "B<hcreate_r>()  and B<hdestroy_r>()  can fail for the following reasons:"
540 msgstr ""
541 "B<hcreate_r>()  と B<hdestroy_r>()  は以下の理由で失敗する可能性がある。"
542
543 #. type: TP
544 #: build/C/man3/hsearch.3:197
545 #, no-wrap
546 msgid "B<EINVAL>"
547 msgstr "B<EINVAL>"
548
549 #. type: Plain text
550 #: build/C/man3/hsearch.3:201
551 msgid "I<htab> is NULL."
552 msgstr "I<htab> が NULL である。"
553
554 #. type: Plain text
555 #: build/C/man3/hsearch.3:206
556 msgid "B<hsearch>()  and B<hsearch_r>()  can fail for the following reasons:"
557 msgstr "B<hsearch>()  と B<hsearch_r>()  は以下の理由で失敗する可能性がある。"
558
559 #. type: TP
560 #: build/C/man3/hsearch.3:206
561 #, no-wrap
562 msgid "B<ENOMEM>"
563 msgstr "B<ENOMEM>"
564
565 #. type: Plain text
566 #: build/C/man3/hsearch.3:214
567 msgid ""
568 "I<action> was B<ENTER>, I<key> was not found in the table, and there was no "
569 "room in the table to add a new entry."
570 msgstr ""
571 "I<action> が B<ENTER> で、 I<key> がテーブル内に見つからず、 テーブルに新しい"
572 "エントリを追加する余地がなかった。"
573
574 #. type: TP
575 #: build/C/man3/hsearch.3:214
576 #, no-wrap
577 msgid "B<ESRCH>"
578 msgstr "B<ESRCH>"
579
580 #. type: Plain text
581 #: build/C/man3/hsearch.3:222
582 msgid "I<action> was B<FIND>, and I<key> was not found in the table."
583 msgstr "I<action> が B<FIND> で、 I<key> がテーブル内に見つからなかった。"
584
585 #. type: Plain text
586 #: build/C/man3/hsearch.3:226
587 msgid "POSIX.1-2001 only specifies the B<ENOMEM> error."
588 msgstr "POSIX.1-2001 が規定しているのは、エラー B<ENOMEM> だけである。"
589
590 #. type: Plain text
591 #: build/C/man3/hsearch.3:239
592 msgid ""
593 "The functions B<hcreate>(), B<hsearch>(), and B<hdestroy>()  are from SVr4, "
594 "and are described in POSIX.1-2001.  The functions B<hcreate_r>(), "
595 "B<hsearch_r>(), and B<hdestroy_r>()  are GNU extensions."
596 msgstr ""
597 "関数 B<hcreate>(), B<hsearch>(), B<hdestroy>()  は SVr4 から導入されたもの"
598 "で、POSIX.1-2001 に記述されている。 関数 B<hcreate_r>, B<hsearch_r>, "
599 "B<hdestroy_r> は GNU の拡張である。"
600
601 #. type: SH
602 #: build/C/man3/hsearch.3:239 build/C/man3/insque.3:99
603 #: build/C/man3/qsort.3:102 build/C/man3/tsearch.3:158
604 #, no-wrap
605 msgid "NOTES"
606 msgstr "注意"
607
608 #. type: Plain text
609 #: build/C/man3/hsearch.3:246
610 msgid ""
611 "Hash table implementations are usually more efficient when the table "
612 "contains enough free space to minimize collisions.  Typically, this means "
613 "that I<nel> should be at least 25% larger than the maximum number of "
614 "elements that the caller expects to store in the table."
615 msgstr ""
616 "通常、ハッシュテーブルの実装は、衝突を最小限にするために テーブルに十分な空き"
617 "領域がある場合に効率がよくなる。 このため、普通は、 I<nel> を、呼び出し側が"
618 "テーブルに格納しようと思っている エントリの最大数より少なくとも 25% は大きな"
619 "値にすべきである。"
620
621 #. type: Plain text
622 #: build/C/man3/hsearch.3:264
623 msgid ""
624 "The B<hdestroy>()  and B<hdestroy_r>()  functions do not free the buffers "
625 "pointed to by the I<key> and I<data> elements of the hash table entries.  "
626 "(It can't do this because it doesn't know whether these buffers were "
627 "allocated dynamically.)  If these buffers need to be freed (perhaps because "
628 "the program is repeatedly creating and destroying hash tables, rather than "
629 "creating a single table whose lifetime matches that of the program), then "
630 "the program must maintain bookkeeping data structures that allow it to free "
631 "them."
632 msgstr ""
633 "B<hdestroy>()  と B<hdestroy_r>()  は、ハッシュテーブルのエントリの要素であ"
634 "る I<key> と I<data> が指すバッファを解放しない (これができないのは、これらの"
635 "バッファが動的に割り当てられたのかを 知ることができないからである)。 これらの"
636 "バッファを解放する必要がある場合、 プログラムでは、これらのバッファを解放でき"
637 "るように管理用のデータ構造を 設けて、これを管理しなければならない (解放が必要"
638 "となる理由は、たいていは、プログラム自身と生存期間が同じ ハッシュテーブルを一"
639 "つだけ作成するのではなく、そのプログラムでは複数の ハッシュテーブルを繰り返し"
640 "て作成したり破棄したりするからであろう)。"
641
642 #. type: SH
643 #: build/C/man3/hsearch.3:264 build/C/man3/insque.3:125
644 #: build/C/man3/lsearch.3:69
645 #, no-wrap
646 msgid "BUGS"
647 msgstr "バグ"
648
649 #. type: Plain text
650 #: build/C/man3/hsearch.3:271
651 msgid ""
652 "SVr4 and POSIX.1-2001 specify that I<action> is significant only for "
653 "unsuccessful searches, so that an B<ENTER> should not do anything for a "
654 "successful search.  In libc and glibc (before version 2.3), the "
655 "implementation violates the specification, updating the I<data> for the "
656 "given I<key> in this case."
657 msgstr ""
658 "SVr4 と POSIX.1-2001 の規定では、 I<action> は検索が失敗したときにだけ意味を"
659 "持つとなっている。 よって、検索が成功した場合、I<action> の値が B<ENTER> で"
660 "も 何もすべきではない。 (バージョン 2.3 より前の) libc と glibc の実装はこの"
661 "規格に違反しており、 この状況で、指定された I<key> に対応する I<data> が更新"
662 "される。"
663
664 #. type: Plain text
665 #: build/C/man3/hsearch.3:273
666 msgid "Individual hash table entries can be added, but not deleted."
667 msgstr "ハッシュテーブルエントリーの追加はできるが、削除ができない。"
668
669 #. type: Plain text
670 #: build/C/man3/hsearch.3:277
671 msgid ""
672 "The following program inserts 24 items into a hash table, then prints some "
673 "of them."
674 msgstr ""
675 "次のプログラムは、ハッシュテーブルに 24 個の項目を挿入し、 それからそのうちの"
676 "いくつかを表示する。"
677
678 #. type: Plain text
679 #: build/C/man3/hsearch.3:282
680 #, no-wrap
681 msgid ""
682 "#include E<lt>stdio.hE<gt>\n"
683 "#include E<lt>stdlib.hE<gt>\n"
684 "#include E<lt>search.hE<gt>\n"
685 msgstr ""
686 "#include E<lt>stdio.hE<gt>\n"
687 "#include E<lt>stdlib.hE<gt>\n"
688 "#include E<lt>search.hE<gt>\n"
689
690 #. type: Plain text
691 #: build/C/man3/hsearch.3:289
692 #, no-wrap
693 msgid ""
694 "char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n"
695 "     \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n"
696 "     \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n"
697 "     \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n"
698 "     \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n"
699 "};\n"
700 msgstr ""
701 "char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n"
702 "     \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n"
703 "     \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n"
704 "     \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n"
705 "     \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n"
706 "};\n"
707
708 #. type: Plain text
709 #: build/C/man3/hsearch.3:295
710 #, no-wrap
711 msgid ""
712 "int\n"
713 "main(void)\n"
714 "{\n"
715 "    ENTRY e, *ep;\n"
716 "    int i;\n"
717 msgstr ""
718 "int main()\n"
719 "{\n"
720 "    ENTRY e, *ep;\n"
721 "    int i;\n"
722
723 #. type: Plain text
724 #: build/C/man3/hsearch.3:297
725 #, no-wrap
726 msgid "    hcreate(30);\n"
727 msgstr "    hcreate(30);\n"
728
729 #. type: Plain text
730 #: build/C/man3/hsearch.3:310
731 #, no-wrap
732 msgid ""
733 "    for (i = 0; i E<lt> 24; i++) {\n"
734 "        e.key = data[i];\n"
735 "        /* data is just an integer, instead of a\n"
736 "           pointer to something */\n"
737 "        e.data = (void *) i;\n"
738 "        ep = hsearch(e, ENTER);\n"
739 "        /* there should be no failures */\n"
740 "        if (ep == NULL) {\n"
741 "            fprintf(stderr, \"entry failed\\en\");\n"
742 "            exit(EXIT_FAILURE);\n"
743 "        }\n"
744 "    }\n"
745 msgstr ""
746 "    for (i = 0; i E<lt> 24; i++) {\n"
747 "        e.key = data[i];\n"
748 "        /* データは、ポインタではなく、単なる整数値である。 */\n"
749 "        e.data = (void *) i;\n"
750 "        ep = hsearch(e, ENTER);\n"
751 "        /* エラーは起こらないはずである。 */\n"
752 "        if (ep == NULL) {\n"
753 "            fprintf(stderr, \"entry failed\\en\");\n"
754 "            exit(EXIT_FAILURE);\n"
755 "        }\n"
756 "    }\n"
757
758 #. type: Plain text
759 #: build/C/man3/hsearch.3:322
760 #, no-wrap
761 msgid ""
762 "    for (i = 22; i E<lt> 26; i++) {\n"
763 "        /* print two entries from the table, and\n"
764 "           show that two are not in the table */\n"
765 "        e.key = data[i];\n"
766 "        ep = hsearch(e, FIND);\n"
767 "        printf(\"%9.9s -E<gt> %9.9s:%d\\en\", e.key,\n"
768 "               ep ? ep-E<gt>key : \"NULL\", ep ? (int)(ep-E<gt>data) : 0);\n"
769 "    }\n"
770 "    hdestroy();\n"
771 "    exit(EXIT_SUCCESS);\n"
772 "}\n"
773 msgstr ""
774 "    for (i = 22; i E<lt> 26; i++) {\n"
775 "        /* テーブルにある 2 つのエントリを表示し、\n"
776 "           あとの 2 つがテーブルにないことを示す。 */\n"
777 "        e.key = data[i];\n"
778 "        ep = hsearch(e, FIND);\n"
779 "        printf(\"%9.9s -E<gt> %9.9s:%d\\en\", e.key,\n"
780 "               ep ? ep-E<gt>key : \"NULL\", ep ? (int)(ep-E<gt>data) : 0);\n"
781 "    }\n"
782 "    hdestroy();\n"
783 "    exit(EXIT_SUCCESS);\n"
784 "}\n"
785
786 #. type: Plain text
787 #: build/C/man3/hsearch.3:327
788 msgid "B<bsearch>(3), B<lsearch>(3), B<malloc>(3), B<tsearch>(3)"
789 msgstr "B<bsearch>(3), B<lsearch>(3), B<malloc>(3), B<tsearch>(3)"
790
791 #. type: TH
792 #: build/C/man3/insque.3:34
793 #, no-wrap
794 msgid "INSQUE"
795 msgstr "INSQUE"
796
797 #. type: TH
798 #: build/C/man3/insque.3:34
799 #, no-wrap
800 msgid "2010-09-09"
801 msgstr "2010-09-09"
802
803 #. type: Plain text
804 #: build/C/man3/insque.3:37
805 msgid "insque, remque - insert/remove an item from a queue"
806 msgstr "insque, remque - キューにアイテムを挿入/削除する"
807
808 #. type: Plain text
809 #: build/C/man3/insque.3:42
810 #, no-wrap
811 msgid "B<void insque(void *>I<elem>B<, void *>I<prev>B<);>\n"
812 msgstr "B<void insque(void *>I<elem>B<, void *>I<prev>B<);>\n"
813
814 #. type: Plain text
815 #: build/C/man3/insque.3:44
816 #, no-wrap
817 msgid "B<void remque(void *>I<elem>B<);>\n"
818 msgstr "B<void remque(void *>I<elem>B<);>\n"
819
820 #. type: Plain text
821 #: build/C/man3/insque.3:49 build/C/man3/qsort.3:53
822 msgid ""
823 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
824 msgstr "glibc 向けの機能検査マクロの要件 (B<feature_test_macros>(7)  参照):"
825
826 #. type: Plain text
827 #: build/C/man3/insque.3:54
828 msgid "B<insque>(), B<remque>():"
829 msgstr "B<insque>(), B<remque>():"
830
831 #. type: Plain text
832 #: build/C/man3/insque.3:57
833 msgid ""
834 "_SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
835 "_XOPEN_SOURCE_EXTENDED"
836 msgstr "_SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ _XOPEN_SOURCE_EXTENDED"
837
838 #. type: Plain text
839 #: build/C/man3/insque.3:71
840 msgid ""
841 "The B<insque>()  and B<remque>()  functions manipulate doubly-linked lists.  "
842 "Each element in the list is a structure of which the first two elements are "
843 "a forward and a backward pointer.  The linked list may be linear (i.e., NULL "
844 "forward pointer at the end of the list and NULL backward pointer at the "
845 "start of the list)  or circular."
846 msgstr ""
847 "関数 B<insque>() と B<remque>() は双方向連結リスト (doubly-linked list) を\n"
848 "操作する。リスト中のそれぞれの要素は、最初の二つの要素がそれぞれ次と前への\n"
849 "ポインタであるような構造体である。\n"
850 "リンクリストは、線形 (linear) か環状 (circular) のどちらかになる\n"
851 "(線形の場合には、リストの末尾では次へのポインタが NULL になり、\n"
852 "リストの先頭では前へのポインタが NULL になる)。"
853
854 #. type: Plain text
855 #: build/C/man3/insque.3:76
856 msgid ""
857 "The B<insque>()  function inserts the element pointed to by I<elem> "
858 "immediately after the element pointed to by I<prev>."
859 msgstr ""
860 "B<insque>() 関数は I<elem> で示される要素を I<prev> で示される\n"
861 "要素の直後に挿入する。"
862
863 #. type: Plain text
864 #: build/C/man3/insque.3:83
865 msgid ""
866 "If the list is linear, then the call I<insque(elem, NULL)> can be used to "
867 "insert the initial list element, and the call sets the forward and backward "
868 "pointers of I<elem> to NULL."
869 msgstr ""
870 "リストが線形の場合、I<insque(elem, NULL)> を呼び出すと、\n"
871 "リストの最初の要素を挿入することができる。\n"
872 "この呼び出しを行うと I<elem> の次へのポインタと前へのポインタに\n"
873 "共に NULL が設定される。"
874
875 #. type: Plain text
876 #: build/C/man3/insque.3:92
877 msgid ""
878 "If the list is circular, the caller should ensure that the forward and "
879 "backward pointers of the first element are initialized to point to that "
880 "element, and the I<prev> argument of the B<insque>()  call should also point "
881 "to the element."
882 msgstr ""
883 "リストが環状の場合、呼び出す側が、最初の要素の次へのポインタと前へのポインタ\n"
884 "が自分自身を指し、また  B<insque>() の呼び出しで I<prev> 引き数が最初の要素\n"
885 "を指すように保証しなければならない。"
886
887 #. type: Plain text
888 #: build/C/man3/insque.3:97
889 msgid ""
890 "The B<remque>()  function removes the element pointed to by I<elem> from the "
891 "doubly-linked list."
892 msgstr "B<remque>() 関数は I<elem> で示される要素を双方向連結リストから取り除く。"
893
894 #. type: Plain text
895 #: build/C/man3/insque.3:99
896 msgid "POSIX.1-2001."
897 msgstr "POSIX.1-2001."
898
899 #. type: Plain text
900 #: build/C/man3/insque.3:103
901 msgid ""
902 "Traditionally (e.g., SunOS, Linux libc 4 and libc 5), the arguments of these "
903 "functions were of type I<struct qelem *>, defined as:"
904 msgstr ""
905 "伝統的に (SunOS, Linux libc 4,5 では) これらの関数の引数は I<struct qelem *>"
906 "型であり、これは以下のように定義されている。"
907
908 #. type: Plain text
909 #: build/C/man3/insque.3:111
910 #, no-wrap
911 msgid ""
912 "struct qelem {\n"
913 "    struct qelem *q_forw;\n"
914 "    struct qelem *q_back;\n"
915 "    char          q_data[1];\n"
916 "};\n"
917 msgstr ""
918 "struct qelem {\n"
919 "    struct qelem *q_forw;\n"
920 "    struct qelem *q_back;\n"
921 "    char          q_data[1];\n"
922 "};\n"
923
924 #. type: Plain text
925 #: build/C/man3/insque.3:118
926 msgid ""
927 "This is still what you will get if B<_GNU_SOURCE> is defined before "
928 "including I<E<lt>search.hE<gt>>."
929 msgstr ""
930 "この定義は I<E<lt>search.hE<gt>> をインクルードする前に B<_GNU_SOURCE> を定義"
931 "することで得られる。"
932
933 #. type: Plain text
934 #: build/C/man3/insque.3:125
935 msgid ""
936 "The location of the prototypes for these functions differs among several "
937 "versions of UNIX.  The above is the POSIX version.  Some systems place them "
938 "in I<E<lt>string.hE<gt>>.  Linux libc4 and libc 5 placed them in "
939 "I<E<lt>stdlib.hE<gt>>."
940 msgstr ""
941 "これらの関数のプロトタイプの置かれる場所は、UNIX の種類により異なる。\n"
942 "上記は POSIX 版である。 I<E<lt>string.hE<gt>> にあるシステムもある。\n"
943 "Linux libc4 と libc5 ではプロトタイプは I<E<lt>stdlib.hE<gt>> に置かれている。"
944
945 #. type: Plain text
946 #: build/C/man3/insque.3:132
947 msgid ""
948 "In glibc 2.4 and earlier, it was not possible to specify I<prev> as NULL.  "
949 "Consequently, to build a linear list, the caller had to build a list using "
950 "an initial call that contained the first two elements of the list, with the "
951 "forward and backward pointers in each element suitably initialized."
952 msgstr ""
953 "glibc 2.4 以前では I<prev> に NULL を指定することができなかった。\n"
954 "その結果、線形のリストを作成するためには、\n"
955 "呼び出し側は、最初の呼び出しで、リストの最初の 2 つの要素を持ち、\n"
956 "各要素の次へのポインタと前へのポインタを適切に初期化したリストを\n"
957 "作成しなければならなかった。"
958
959 #. type: Plain text
960 #: build/C/man3/insque.3:136
961 msgid ""
962 "The program below demonstrates the use of B<insque>().  Here is an example "
963 "run of the program:"
964 msgstr ""
965 "次のプログラムは B<insque>() の使用法を示したものである。\n"
966 "下記はプログラムの実行例である。"
967
968 #. type: Plain text
969 #: build/C/man3/insque.3:145
970 #, no-wrap
971 msgid ""
972 "$ B<./a.out -c a b c>\n"
973 "Traversing completed list:\n"
974 "    a\n"
975 "    b\n"
976 "    c\n"
977 "That was a circular list\n"
978 msgstr ""
979 "$ B<./a.out -c a b c>\n"
980 "Traversing completed list:\n"
981 "    a\n"
982 "    b\n"
983 "    c\n"
984 "That was a circular list\n"
985
986 #. type: SS
987 #: build/C/man3/insque.3:147
988 #, no-wrap
989 msgid "Program source"
990 msgstr "プログラムのソース"
991
992 #. type: Plain text
993 #: build/C/man3/insque.3:154
994 #, no-wrap
995 msgid ""
996 "#include E<lt>stdio.hE<gt>\n"
997 "#include E<lt>stdlib.hE<gt>\n"
998 "#include E<lt>unistd.hE<gt>\n"
999 "#include E<lt>search.hE<gt>\n"
1000 msgstr ""
1001 "#include E<lt>stdio.hE<gt>\n"
1002 "#include E<lt>stdlib.hE<gt>\n"
1003 "#include E<lt>unistd.hE<gt>\n"
1004 "#include E<lt>search.hE<gt>\n"
1005
1006 #. type: Plain text
1007 #: build/C/man3/insque.3:160
1008 #, no-wrap
1009 msgid ""
1010 "struct element {\n"
1011 "    struct element *forward;\n"
1012 "    struct element *backward;\n"
1013 "    char *name;\n"
1014 "};\n"
1015 msgstr ""
1016 "struct element {\n"
1017 "    struct element *forward;\n"
1018 "    struct element *backward;\n"
1019 "    char *name;\n"
1020 "};\n"
1021
1022 #. type: Plain text
1023 #: build/C/man3/insque.3:165
1024 #, no-wrap
1025 msgid ""
1026 "static struct element *\n"
1027 "new_element(void)\n"
1028 "{\n"
1029 "    struct element *e;\n"
1030 msgstr ""
1031 "static struct element *\n"
1032 "new_element(void)\n"
1033 "{\n"
1034 "    struct element *e;\n"
1035
1036 #. type: Plain text
1037 #: build/C/man3/insque.3:171
1038 #, no-wrap
1039 msgid ""
1040 "    e = malloc(sizeof(struct element));\n"
1041 "    if (e == NULL) {\n"
1042 "        fprintf(stderr, \"malloc() failed\\en\");\n"
1043 "        exit(EXIT_FAILURE);\n"
1044 "    }\n"
1045 msgstr ""
1046 "    e = malloc(sizeof(struct element));\n"
1047 "    if (e == NULL) {\n"
1048 "        fprintf(stderr, \"malloc() failed\\en\");\n"
1049 "        exit(EXIT_FAILURE);\n"
1050 "    }\n"
1051
1052 #. type: Plain text
1053 #: build/C/man3/insque.3:174
1054 #, no-wrap
1055 msgid ""
1056 "    return e;\n"
1057 "}\n"
1058 msgstr ""
1059 "    return e;\n"
1060 "}\n"
1061
1062 #. type: Plain text
1063 #: build/C/man3/insque.3:180
1064 #, no-wrap
1065 msgid ""
1066 "int\n"
1067 "main(int argc, char *argv[])\n"
1068 "{\n"
1069 "    struct element *first, *elem, *prev;\n"
1070 "    int circular, opt, errfnd;\n"
1071 msgstr ""
1072 "int\n"
1073 "main(int argc, char *argv[])\n"
1074 "{\n"
1075 "    struct element *first, *elem, *prev;\n"
1076 "    int circular, opt, errfnd;\n"
1077
1078 #. type: Plain text
1079 #: build/C/man3/insque.3:183
1080 #, no-wrap
1081 msgid ""
1082 "    /* The \"-c\" command-line option can be used to specify that the\n"
1083 "       list is circular */\n"
1084 msgstr ""
1085 "    /* The \"-c\" command-line option can be used to specify that the\n"
1086 "       list is circular */\n"
1087
1088 #. type: Plain text
1089 #: build/C/man3/insque.3:196
1090 #, no-wrap
1091 msgid ""
1092 "    errfnd = 0;\n"
1093 "    circular = 0;\n"
1094 "    while ((opt = getopt(argc, argv, \"c\")) != -1) {\n"
1095 "        switch (opt) {\n"
1096 "        case 'c':\n"
1097 "            circular = 1;\n"
1098 "            break;\n"
1099 "        default:\n"
1100 "            errfnd = 1;\n"
1101 "            break;\n"
1102 "        }\n"
1103 "    }\n"
1104 msgstr ""
1105 "    errfnd = 0;\n"
1106 "    circular = 0;\n"
1107 "    while ((opt = getopt(argc, argv, \"c\")) != -1) {\n"
1108 "        switch (opt) {\n"
1109 "        case 'c':\n"
1110 "            circular = 1;\n"
1111 "            break;\n"
1112 "        default:\n"
1113 "            errfnd = 1;\n"
1114 "            break;\n"
1115 "        }\n"
1116 "    }\n"
1117
1118 #. type: Plain text
1119 #: build/C/man3/insque.3:201
1120 #, no-wrap
1121 msgid ""
1122 "    if (errfnd || optind E<gt>= argc) {\n"
1123 "        fprintf(stderr,  \"Usage: %s [-c] string...\\en\", argv[0]);\n"
1124 "        exit(EXIT_FAILURE);\n"
1125 "    }\n"
1126 msgstr ""
1127 "    if (errfnd || optind E<gt>= argc) {\n"
1128 "        fprintf(stderr,  \"Usage: %s [-c] string...\\en\", argv[0]);\n"
1129 "        exit(EXIT_FAILURE);\n"
1130 "    }\n"
1131
1132 #. type: Plain text
1133 #: build/C/man3/insque.3:203
1134 #, no-wrap
1135 msgid "    /* Create first element and place it in the linked list */\n"
1136 msgstr "    /* Create first element and place it in the linked list */\n"
1137
1138 #. type: Plain text
1139 #: build/C/man3/insque.3:206
1140 #, no-wrap
1141 msgid ""
1142 "    elem = new_element();\n"
1143 "    first = elem;\n"
1144 msgstr ""
1145 "    elem = new_element();\n"
1146 "    first = elem;\n"
1147
1148 #. type: Plain text
1149 #: build/C/man3/insque.3:208
1150 #, no-wrap
1151 msgid "    elem-E<gt>name = argv[optind];\n"
1152 msgstr "    elem-E<gt>name = argv[optind];\n"
1153
1154 #. type: Plain text
1155 #: build/C/man3/insque.3:216
1156 #, no-wrap
1157 msgid ""
1158 "    if (circular) {\n"
1159 "        elem-E<gt>forward = elem;\n"
1160 "        elem-E<gt>backward = elem;\n"
1161 "        insque(elem, elem);\n"
1162 "    } else {\n"
1163 "        insque(elem, NULL);\n"
1164 "    }\n"
1165 msgstr ""
1166 "    if (circular) {\n"
1167 "        elem-E<gt>forward = elem;\n"
1168 "        elem-E<gt>backward = elem;\n"
1169 "        insque(elem, elem);\n"
1170 "    } else {\n"
1171 "        insque(elem, NULL);\n"
1172 "    }\n"
1173
1174 #. type: Plain text
1175 #: build/C/man3/insque.3:218
1176 #, no-wrap
1177 msgid "    /* Add remaining command-line arguments as list elements */\n"
1178 msgstr "    /* Add remaining command-line arguments as list elements */\n"
1179
1180 #. type: Plain text
1181 #: build/C/man3/insque.3:221
1182 #, no-wrap
1183 msgid ""
1184 "    while (++optind E<lt> argc) {\n"
1185 "        prev = elem;\n"
1186 msgstr ""
1187 "    while (++optind E<lt> argc) {\n"
1188 "        prev = elem;\n"
1189
1190 #. type: Plain text
1191 #: build/C/man3/insque.3:226
1192 #, no-wrap
1193 msgid ""
1194 "        elem = new_element();\n"
1195 "        elem-E<gt>name = argv[optind];\n"
1196 "        insque(elem, prev);\n"
1197 "    }\n"
1198 msgstr ""
1199 "        elem = new_element();\n"
1200 "        elem-E<gt>name = argv[optind];\n"
1201 "        insque(elem, prev);\n"
1202 "    }\n"
1203
1204 #. type: Plain text
1205 #: build/C/man3/insque.3:228
1206 #, no-wrap
1207 msgid "    /* Traverse the list from the start, printing element names */\n"
1208 msgstr "    /* Traverse the list from the start, printing element names */\n"
1209
1210 #. type: Plain text
1211 #: build/C/man3/insque.3:235
1212 #, no-wrap
1213 msgid ""
1214 "    printf(\"Traversing completed list:\\en\");\n"
1215 "    elem = first;\n"
1216 "    do {\n"
1217 "        printf(\"    %s\\en\", elem-E<gt>name);\n"
1218 "        elem = elem-E<gt>forward;\n"
1219 "    } while (elem != NULL && elem != first);\n"
1220 msgstr ""
1221 "    printf(\"Traversing completed list:\\en\");\n"
1222 "    elem = first;\n"
1223 "    do {\n"
1224 "        printf(\"    %s\\en\", elem-E<gt>name);\n"
1225 "        elem = elem-E<gt>forward;\n"
1226 "    } while (elem != NULL && elem != first);\n"
1227
1228 #. type: Plain text
1229 #: build/C/man3/insque.3:238
1230 #, no-wrap
1231 msgid ""
1232 "    if (elem == first)\n"
1233 "        printf(\"That was a circular list\\en\");\n"
1234 msgstr ""
1235 "    if (elem == first)\n"
1236 "        printf(\"That was a circular list\\en\");\n"
1237
1238 #. type: Plain text
1239 #: build/C/man3/insque.3:241
1240 #, no-wrap
1241 msgid ""
1242 "    exit(EXIT_SUCCESS);\n"
1243 "}\n"
1244 msgstr ""
1245 "    exit(EXIT_SUCCESS);\n"
1246 "}\n"
1247
1248 #. type: TH
1249 #: build/C/man3/lsearch.3:25
1250 #, no-wrap
1251 msgid "LSEARCH"
1252 msgstr "LSEARCH"
1253
1254 #. type: TH
1255 #: build/C/man3/lsearch.3:25
1256 #, no-wrap
1257 msgid "1999-09-27"
1258 msgstr "1999-09-27"
1259
1260 #. type: Plain text
1261 #: build/C/man3/lsearch.3:28
1262 msgid "lfind, lsearch - linear search of an array"
1263 msgstr "lfind, lsearch - 配列を線形検索する"
1264
1265 #. type: Plain text
1266 #: build/C/man3/lsearch.3:34
1267 #, no-wrap
1268 msgid ""
1269 "B<void *lfind(const void *>I<key>B<, const void *>I<base>B<, size_t *>I<nmemb>B<,>\n"
1270 "B<         size_t >I<size>B<, int(*>I<compar>B<)(const void *, const void *));>\n"
1271 msgstr ""
1272 "B<void *lfind(const void *>I<key>B<, const void *>I<base>B<, size_t *>I<nmemb>B<,>\n"
1273 "B<         size_t >I<size>B<, int(*>I<compar>B<)(const void *, const void *));>\n"
1274
1275 #. type: Plain text
1276 #: build/C/man3/lsearch.3:37
1277 #, no-wrap
1278 msgid ""
1279 "B<void *lsearch(const void *>I<key>B<, void *>I<base>B<, size_t *>I<nmemb>B<,>\n"
1280 "B<         size_t >I<size>B<, int(*>I<compar>B<)(const void *, const void *));>\n"
1281 msgstr ""
1282 "B<void *lsearch(const void *>I<key>B<, void *>I<base>B<, size_t *>I<nmemb>B<,>\n"
1283 "B<         size_t >I<size>B<, int(*>I<compar>B<)(const void *, const void *));>\n"
1284
1285 #. type: Plain text
1286 #: build/C/man3/lsearch.3:50
1287 msgid ""
1288 "B<lfind>()  and B<lsearch>()  perform a linear search for I<key> in the "
1289 "array I<base> which has I<*nmemb> elements of I<size> bytes each.  The "
1290 "comparison function referenced by I<compar> is expected to have two "
1291 "arguments which point to the I<key> object and to an array member, in that "
1292 "order, and which returns zero if the I<key> object matches the array member, "
1293 "and nonzero otherwise."
1294 msgstr ""
1295 "B<lfind>()  と B<lsearch>()  は、 I<size> バイトの要素 I<*nmemb> 個からなる配"
1296 "列 I<base> から、 I<key> を線形検索する。比較を行うのは I<compar> が参照して"
1297 "いる関数で、 これは 2つの引き数を持ち、1つめの引き数が I<key> を、2つめの引き"
1298 "数は配列メンバーを指す。また I<compar> は、 I<key> が配列のメンバーとマッチし"
1299 "たなら 0、そうでなければ 0 以外を返すことが期待されている。"
1300
1301 #. type: Plain text
1302 #: build/C/man3/lsearch.3:58
1303 msgid ""
1304 "If B<lsearch>()  does not find a matching element, then the I<key> object is "
1305 "inserted at the end of the table, and I<*nmemb> is incremented.  In "
1306 "particular, one should know that a matching element exists, or that more "
1307 "room is available."
1308 msgstr ""
1309 "B<lsearch>()  は、マッチする要素を見つけられなかったとき、 配列の最後に "
1310 "I<key> をつけ加える。そして I<*nmemb> を 1 ふやす。 したがって、この関数を使"
1311 "用する際には、マッチする要素が存在するか、 もしくは配列に要素を追加するための"
1312 "領域があるか、を把握しておく必要がある。"
1313
1314 #. type: Plain text
1315 #: build/C/man3/lsearch.3:66
1316 msgid ""
1317 "B<lfind>()  returns a pointer to a matching member of the array, or NULL if "
1318 "no match is found.  B<lsearch>()  returns a pointer to a matching member of "
1319 "the array, or to the newly added member if no match is found."
1320 msgstr ""
1321 "B<lfind>()  の返り値は、配列のマッチしたメンバーへのポインタである。 もしマッ"
1322 "チするメンバーが見つからないと NULL を返す。 B<lsearch>()  の返り値も、配列の"
1323 "マッチしたメンバーへのポインタである。 マッチするメンバーが見つからなかったと"
1324 "きは、 新たにつけ加えたメンバーへのポインタを返す。"
1325
1326 #. type: Plain text
1327 #: build/C/man3/lsearch.3:69
1328 msgid "SVr4, 4.3BSD, POSIX.1-2001.  Present in libc since libc-4.6.27."
1329 msgstr ""
1330 "SVr4, 4.3BSD, POSIX.1-2001.  libc には libc-4.6.27 以降で実装されている。"
1331
1332 #. type: Plain text
1333 #: build/C/man3/lsearch.3:71
1334 msgid "The naming is unfortunate."
1335 msgstr "関数の名前の選び方がよくない。"
1336
1337 #. type: Plain text
1338 #: build/C/man3/lsearch.3:74
1339 msgid "B<bsearch>(3), B<hsearch>(3), B<tsearch>(3)"
1340 msgstr "B<bsearch>(3), B<hsearch>(3), B<tsearch>(3)"
1341
1342 #. type: TH
1343 #: build/C/man3/qsort.3:35
1344 #, no-wrap
1345 msgid "QSORT"
1346 msgstr "QSORT"
1347
1348 #. type: TH
1349 #: build/C/man3/qsort.3:35
1350 #, no-wrap
1351 msgid "2012-03-08"
1352 msgstr "2012-03-08"
1353
1354 #. type: Plain text
1355 #: build/C/man3/qsort.3:38
1356 msgid "qsort, qsort_r - sort an array"
1357 msgstr "qsort, qsort_r - 配列を並べ変える"
1358
1359 #. type: Plain text
1360 #: build/C/man3/qsort.3:44
1361 #, no-wrap
1362 msgid ""
1363 "B<void qsort(void *>I<base>B<, size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
1364 "B<           int (*>I<compar>B<)(const void *, const void *));>\n"
1365 msgstr ""
1366 "B<void qsort(void *>I<base>B<, size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
1367 "B<           int (*>I<compar>B<)(const void *, const void *));>\n"
1368
1369 #. type: Plain text
1370 #: build/C/man3/qsort.3:48
1371 #, no-wrap
1372 msgid ""
1373 "B<void qsort_r(void *>I<base>B<, size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
1374 "B<           int (*>I<compar>B<)(const void *, const void *, void *),>\n"
1375 "B<           void *>I<arg>B<);>\n"
1376 msgstr ""
1377 "B<void qsort_r(void *>I<base>B<, size_t >I<nmemb>B<, size_t >I<size>B<,>\n"
1378 "B<           int (*>I<compar>B<)(const void *, const void *, void *),>\n"
1379 "B<           void *>I<arg>B<);>\n"
1380
1381 #. type: Plain text
1382 #: build/C/man3/qsort.3:58
1383 msgid "B<qsort_r>(): _GNU_SOURCE"
1384 msgstr "B<qsort_r>(): _GNU_SOURCE"
1385
1386 #. type: Plain text
1387 #: build/C/man3/qsort.3:66
1388 msgid ""
1389 "The B<qsort>()  function sorts an array with I<nmemb> elements of size "
1390 "I<size>.  The I<base> argument points to the start of the array."
1391 msgstr ""
1392 "B<qsort>()  関数は、 I<nmemb> 個の大きさ I<size> の要素をもつ配列を並べ変え"
1393 "る。 I<base> 引き数は配列の先頭へのポインタである。"
1394
1395 #. type: Plain text
1396 #: build/C/man3/qsort.3:70
1397 msgid ""
1398 "The contents of the array are sorted in ascending order according to a "
1399 "comparison function pointed to by I<compar>, which is called with two "
1400 "arguments that point to the objects being compared."
1401 msgstr ""
1402 "I<compar> をポインタとする比較関数によって、 配列の中身は昇順 (値の大きいもの"
1403 "ほど後に並ぶ順番) に並べられる。 比較関数の引き数は比較されるふたつのオブジェ"
1404 "クトのポインタである。"
1405
1406 #. type: Plain text
1407 #: build/C/man3/qsort.3:76
1408 msgid ""
1409 "The comparison function must return an integer less than, equal to, or "
1410 "greater than zero if the first argument is considered to be respectively "
1411 "less than, equal to, or greater than the second.  If two members compare as "
1412 "equal, their order in the sorted array is undefined."
1413 msgstr ""
1414 "比較関数は、第一引き数が第二引き数に対して、 1) 小さい、2) 等しい、3) 大きい"
1415 "のそれぞれに応じて、 1) ゼロより小さい整数、2) ゼロ、3) ゼロより大きい整数の "
1416 "いずれかを返さなければならない。 二つの要素の比較結果が等しいとき、 並べ変え"
1417 "た後の配列では、これら二つの順序は規定されていない。"
1418
1419 #. type: Plain text
1420 #: build/C/man3/qsort.3:89
1421 msgid ""
1422 "The B<qsort_r>()  function is identical to B<qsort>()  except that the "
1423 "comparison function I<compar> takes a third argument.  A pointer is passed "
1424 "to the comparison function via I<arg>.  In this way, the comparison function "
1425 "does not need to use global variables to pass through arbitrary arguments, "
1426 "and is therefore reentrant and safe to use in threads."
1427 msgstr ""
1428 "B<qsort_r>() 関数は B<qsort>() と同じだが、比較関数 I<compar> が第 3 引き数を\n"
1429 "取る点が異なる。ポインタが I<arg> 経由で比較関数に渡される。\n"
1430 "これにより、比較関数は任意の引き数を渡すためにグローバル変数を使う必要がなくなり、\n"
1431 "そのため、リエントラント (再入可能) で安全にスレッドで使用できるようになる。"
1432
1433 #. type: Plain text
1434 #: build/C/man3/qsort.3:95
1435 msgid "The B<qsort>()  and B<qsort_r>()  functions return no value."
1436 msgstr "関数 B<qsort>() と B<qsort_r>() は値を返さない。"
1437
1438 #. type: SH
1439 #: build/C/man3/qsort.3:95
1440 #, no-wrap
1441 msgid "VERSIONS"
1442 msgstr "バージョン"
1443
1444 #. type: Plain text
1445 #: build/C/man3/qsort.3:98
1446 msgid "B<qsort_r>()  was added to glibc in version 2.8."
1447 msgstr "B<qsort_r>() は glibc バージョン 2.8 で追加された。"
1448
1449 #. type: Plain text
1450 #: build/C/man3/qsort.3:102
1451 msgid "The B<qsort>()  function conforms to SVr4, 4.3BSD, C89, C99."
1452 msgstr "B<qsort>() 関数は SVr4, 4.3BSD, C89, C99 に準拠している。"
1453
1454 #. type: Plain text
1455 #: build/C/man3/qsort.3:114
1456 msgid ""
1457 "Library routines suitable for use as the I<compar> argument to B<qsort>()  "
1458 "include B<alphasort>(3)  and B<versionsort>(3).  To compare C strings, the "
1459 "comparison function can call B<strcmp>(3), as shown in the example below."
1460 msgstr ""
1461 "B<qsort>() の I<compar> 引き数に使用するのに適しているライブラリルーチンと\n"
1462 "しては B<alphasort>(3), B<versionsort>(3) がある。 C の文字列を比較する場合、\n"
1463 "以下の例にあるように比較関数で B<strcmp>(3) を呼び出すこともできる。"
1464
1465 #. type: Plain text
1466 #: build/C/man3/qsort.3:117
1467 msgid "For one example of use, see the example under B<bsearch>(3)."
1468 msgstr "使用例については、 B<bsearch>(3)  にある例を参照すること。"
1469
1470 #. type: Plain text
1471 #: build/C/man3/qsort.3:120
1472 msgid ""
1473 "Another example is the following program, which sorts the strings given in "
1474 "its command-line arguments:"
1475 msgstr ""
1476 "以下のプログラムに別の使用例を示す。このプログラムは、 コマンドライン引き数で"
1477 "指定された文字列の並び換えを行う。"
1478
1479 #. type: Plain text
1480 #: build/C/man3/qsort.3:132
1481 #, no-wrap
1482 msgid ""
1483 "static int\n"
1484 "cmpstringp(const void *p1, const void *p2)\n"
1485 "{\n"
1486 "    /* The actual arguments to this function are \"pointers to\n"
1487 "       pointers to char\", but strcmp(3) arguments are \"pointers\n"
1488 "       to char\", hence the following cast plus dereference */\n"
1489 msgstr ""
1490 "static int\n"
1491 "cmpstringp(const void *p1, const void *p2)\n"
1492 "{\n"
1493 "    /* この関数の実際の引き数は \"char 型へのポインタのポインタ\" だが、\n"
1494 "       strcmp(3) の引き数は \"char 型へのポインタ\" である。\n"
1495 "       そこで、以下のようにキャストをしてからポインタの逆参照を行う。*/\n"
1496
1497 #. type: Plain text
1498 #: build/C/man3/qsort.3:135
1499 #, no-wrap
1500 msgid ""
1501 "    return strcmp(* (char * const *) p1, * (char * const *) p2);\n"
1502 "}\n"
1503 msgstr ""
1504 "    return strcmp(* (char * const *) p1, * (char * const *) p2);\n"
1505 "}\n"
1506
1507 #. type: Plain text
1508 #: build/C/man3/qsort.3:140
1509 #, no-wrap
1510 msgid ""
1511 "int\n"
1512 "main(int argc, char *argv[])\n"
1513 "{\n"
1514 "    int j;\n"
1515 msgstr ""
1516 "int\n"
1517 "main(int argc, char *argv[])\n"
1518 "{\n"
1519 "    int j;\n"
1520
1521 #. type: Plain text
1522 #: build/C/man3/qsort.3:145
1523 #, no-wrap
1524 msgid ""
1525 "    if (argc E<lt> 2) {\n"
1526 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>...\\en\", argv[0]);\n"
1527 "\texit(EXIT_FAILURE);\n"
1528 "    }\n"
1529 msgstr ""
1530 "    if (argc E<lt> 2) {\n"
1531 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>...\\en\", argv[0]);\n"
1532 "\texit(EXIT_FAILURE);\n"
1533 "    }\n"
1534
1535 #. type: Plain text
1536 #: build/C/man3/qsort.3:147
1537 #, no-wrap
1538 msgid "    qsort(&argv[1], argc - 1, sizeof(char *), cmpstringp);\n"
1539 msgstr "    qsort(&argv[1], argc - 1, sizeof(char *), cmpstringp);\n"
1540
1541 #. type: Plain text
1542 #: build/C/man3/qsort.3:152
1543 #, no-wrap
1544 msgid ""
1545 "    for (j = 1; j E<lt> argc; j++)\n"
1546 "        puts(argv[j]);\n"
1547 "    exit(EXIT_SUCCESS);\n"
1548 "}\n"
1549 msgstr ""
1550 "    for (j = 1; j E<lt> argc; j++)\n"
1551 "        puts(argv[j]);\n"
1552 "    exit(EXIT_SUCCESS);\n"
1553 "}\n"
1554
1555 #. type: Plain text
1556 #: build/C/man3/qsort.3:157
1557 msgid "B<sort>(1), B<alphasort>(3), B<strcmp>(3), B<versionsort>(3)"
1558 msgstr "B<sort>(1), B<alphasort>(3), B<strcmp>(3), B<versionsort>(3)"
1559
1560 #. type: TH
1561 #: build/C/man3/tsearch.3:24
1562 #, no-wrap
1563 msgid "TSEARCH"
1564 msgstr "TSEARCH"
1565
1566 #. type: TH
1567 #: build/C/man3/tsearch.3:24
1568 #, no-wrap
1569 msgid "2008-09-23"
1570 msgstr "2008-09-23"
1571
1572 #. type: Plain text
1573 #: build/C/man3/tsearch.3:27
1574 msgid "tsearch, tfind, tdelete, twalk, tdestroy - manage a binary tree"
1575 msgstr "tsearch, tfind, tdelete, twalk, tdestroy - 二分木 (binary tree) の操作"
1576
1577 #. type: Plain text
1578 #: build/C/man3/tsearch.3:33
1579 #, no-wrap
1580 msgid ""
1581 "B<void *tsearch(const void *>I<key>B<, void **>I<rootp>B<,>\n"
1582 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1583 msgstr ""
1584 "B<void *tsearch(const void *>I<key>B<, void **>I<rootp>B<,>\n"
1585 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1586
1587 #. type: Plain text
1588 #: build/C/man3/tsearch.3:36
1589 #, no-wrap
1590 msgid ""
1591 "B<void *tfind(const void *>I<key>B<, const void **>I<rootp>B<,>\n"
1592 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1593 msgstr ""
1594 "B<void *tfind(const void *>I<key>B<, const void **>I<rootp>B<,>\n"
1595 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1596
1597 #. type: Plain text
1598 #: build/C/man3/tsearch.3:39
1599 #, no-wrap
1600 msgid ""
1601 "B<void *tdelete(const void *>I<key>B<, void **>I<rootp>B<,>\n"
1602 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1603 msgstr ""
1604 "B<void *tdelete(const void *>I<key>B<, void **>I<rootp>B<,>\n"
1605 "B<                int (*>I<compar>B<)(const void *, const void *));>\n"
1606
1607 #. type: Plain text
1608 #: build/C/man3/tsearch.3:43
1609 #, no-wrap
1610 msgid ""
1611 "B<void twalk(const void *>I<root>B<, void (*>I<action>B<)(const void *>I<nodep>B<,>\n"
1612 "B<                                   const VISIT >I<which>B<,>\n"
1613 "B<                                   const int >I<depth>B<));>\n"
1614 msgstr ""
1615 "B<void twalk(const void *>I<root>B<, void (*>I<action>B<)(const void *>I<nodep>B<,>\n"
1616 "B<                                   const VISIT >I<which>B<,>\n"
1617 "B<                                   const int >I<depth>B<));>\n"
1618
1619 #. type: Plain text
1620 #: build/C/man3/tsearch.3:49
1621 #, no-wrap
1622 msgid "B<void tdestroy(void *>I<root>B<, void (*>I<free_node>B<)(void *>I<nodep>B<));>\n"
1623 msgstr "B<void tdestroy(void *>I<root>B<, void (*>I<free_node>B<)(void *>I<nodep>B<));>\n"
1624
1625 #. type: Plain text
1626 #: build/C/man3/tsearch.3:67
1627 msgid ""
1628 "B<tsearch>(), B<tfind>(), B<twalk>(), and B<tdelete>()  manage a binary "
1629 "tree.  They are generalized from Knuth (6.2.2) Algorithm T.  The first field "
1630 "in each node of the tree is a pointer to the corresponding data item.  (The "
1631 "calling program must store the actual data.)  I<compar> points to a "
1632 "comparison routine, which takes pointers to two items.  It should return an "
1633 "integer which is negative, zero, or positive, depending on whether the first "
1634 "item is less than, equal to, or greater than the second."
1635 msgstr ""
1636 "B<tsearch>(), B<tfind>(), B<twalk>(), B<tdelete>()  は 二分木を操作する関数で"
1637 "ある。 これらの関数は Knuth (6.2.2) Algorithm T に基づいている。 木構造におけ"
1638 "る各ノードの最初のフィールドは、対応するデータ・ アイテムへのポインタであ"
1639 "る。 (参照先のデータは、呼び出しプログラムで用意する。)  I<compar> は比較ルー"
1640 "チンへのポインタである。 比較ルーチンは、アイテムへのポインタ 2 つを引数に持"
1641 "つ。 比較ルーチンの返り値は、1 つ目のアイテムが 2 つ目のアイテムよりも 「小さ"
1642 "い、等しい、大きい」によって、 「負、0、正」の整数値でなければならない。"
1643
1644 #. type: Plain text
1645 #: build/C/man3/tsearch.3:82
1646 msgid ""
1647 "B<tsearch>()  searches the tree for an item.  I<key> points to the item to "
1648 "be searched for.  I<rootp> points to a variable which points to the root of "
1649 "the tree.  If the tree is empty, then the variable that I<rootp> points to "
1650 "should be set to NULL.  If the item is found in the tree, then B<tsearch>()  "
1651 "returns a pointer to it.  If it is not found, then B<tsearch>()  adds it, "
1652 "and returns a pointer to the newly added item."
1653 msgstr ""
1654 "B<tsearch>()  は、木構造からアイテムを検索する関数である。 I<key> は、検索す"
1655 "るアイテムへのポインタである。 I<rootp> は木構造の根へのポインタへのポインタ"
1656 "である。 木構造がノードを含まない場合、I<rootp> の参照している変数は NULL に"
1657 "設定されていなければならない。 木構造にアイテムが見つかった場合、 B<tsearch>"
1658 "()  はそのアイテムへのポインタを返す。 見つからなかった場合は、アイテムを木構"
1659 "造に追加し、 追加したアイテムへのポインタを返す。"
1660
1661 #. type: Plain text
1662 #: build/C/man3/tsearch.3:90
1663 msgid ""
1664 "B<tfind>()  is like B<tsearch>(), except that if the item is not found, then "
1665 "B<tfind>()  returns NULL."
1666 msgstr ""
1667 "B<tfind>()  は、 B<tsearch>()  に似ているが、 アイテムが見つからなかった場合 "
1668 "NULL を返す点が異なる。"
1669
1670 #. type: Plain text
1671 #: build/C/man3/tsearch.3:95
1672 msgid ""
1673 "B<tdelete>()  deletes an item from the tree.  Its arguments are the same as "
1674 "for B<tsearch>()."
1675 msgstr ""
1676 "B<tdelete>()  は木構造からアイテムを削除する。 引数は B<tsearch>()  と同じで"
1677 "ある。"
1678
1679 #. type: Plain text
1680 #: build/C/man3/tsearch.3:115
1681 msgid ""
1682 "B<twalk>()  performs depth-first, left-to-right traversal of a binary tree.  "
1683 "I<root> points to the starting node for the traversal.  If that node is not "
1684 "the root, then only part of the tree will be visited.  B<twalk>()  calls the "
1685 "user function I<action> each time a node is visited (that is, three times "
1686 "for an internal node, and once for a leaf).  I<action>, in turn, takes three "
1687 "arguments.  The first is a pointer to the node being visited.  The second is "
1688 "an integer which takes on the values B<preorder>, B<postorder>, and "
1689 "B<endorder> depending on whether this is the first, second, or third visit "
1690 "to the internal node, or B<leaf> if it is the single visit to a leaf node.  "
1691 "(These symbols are defined in I<E<lt>search.hE<gt>>.)  The third argument is "
1692 "the depth of the node, with zero being the root."
1693 msgstr ""
1694 "B<twalk>()  は、二分木を深さ優先 (depth-first) で、 左から右にたどっていく関"
1695 "数である。 I<root> は起点となるノードへのポインタである。 I<root> に根以外の"
1696 "ノードを指定すると、部分木が対象となる。 B<twalk>()  は、ノードを訪れる度に "
1697 "(つまり、内部ノードに対しては 3 回、葉に対しては 1 回)  ユーザ関数 I<action> "
1698 "を呼び出す。 I<action> には以下の順に 3 つの引数が与えられる。 最初の引数は訪"
1699 "れたノードへのポインタである。 2 つ目の引数には、内部ノードの場合は訪問回数に"
1700 "応じて B<preorder>, B<postorder>, B<endorder> が、 葉の場合は B<leaf> が与え"
1701 "られる。 (これらのシンボルは I<E<lt>search.hE<gt>> で定義されている。)  3 つ"
1702 "目の引数はノードの深さで、根の場合は 0 である。"
1703
1704 #. type: Plain text
1705 #: build/C/man3/tsearch.3:122
1706 msgid ""
1707 "(More commonly, B<preorder>, B<postorder>, and B<endorder> are known as "
1708 "B<preorder>, B<inorder>, and B<postorder>: before visiting the children, "
1709 "after the first and before the second, and after visiting the children.  "
1710 "Thus, the choice of name B<post\\%order> is rather confusing.)"
1711 msgstr ""
1712 "(より一般的には、B<preorder>, B<postorder>, B<endorder> は B<preorder>, "
1713 "B<inorder>, B<postorder> として知られている: それぞれ、子要素を辿る前・最初の"
1714 "子要素を辿った後かつ 2 番目の子要素を辿る前・ 子要素を辿った後ということを表"
1715 "している。 よって B<post\\%order> という名前を選ぶのは少し紛らわしい。)"
1716
1717 #. type: Plain text
1718 #: build/C/man3/tsearch.3:132
1719 msgid ""
1720 "B<tdestroy>()  removes the whole tree pointed to by I<root>, freeing all "
1721 "resources allocated by the B<tsearch>()  function.  For the data in each "
1722 "tree node the function I<free_node> is called.  The pointer to the data is "
1723 "passed as the argument to the function.  If no such work is necessary "
1724 "I<free_node> must point to a function doing nothing."
1725 msgstr ""
1726 "B<tdestroy>()  は I<root> が指す木構造全体を削除し、 B<tsearch>()  関数で確保"
1727 "されたリソースを全て解放する。 木構造の各ノードについて、関数 I<free_node> が"
1728 "呼び出される。 データへのポインタがこの関数の引数として渡される。 そのような"
1729 "動作が必要でなければ、 I<free_node> は何もしない関数へのポインタでなければな"
1730 "らない。"
1731
1732 #. type: Plain text
1733 #: build/C/man3/tsearch.3:142
1734 msgid ""
1735 "B<tsearch>()  returns a pointer to a matching item in the tree, or to the "
1736 "newly added item, or NULL if there was insufficient memory to add the item.  "
1737 "B<tfind>()  returns a pointer to the item, or NULL if no match is found.  If "
1738 "there are multiple elements that match the key, the element returned is "
1739 "unspecified."
1740 msgstr ""
1741 "B<tsearch>()  は、木構造に見つかったアイテムか、 新しく追加したアイテムへのポ"
1742 "インタを返す。 メモリの不足のためアイテムを追加できなかった場合は NULL を返"
1743 "す。 B<tfind>()  は、アイテムへのポインタを返す。 一致するアイテムが見つから"
1744 "ない場合は NULL を返す。 検索条件に一致する要素が複数ある場合、返される値は不"
1745 "定である。"
1746
1747 #. type: Plain text
1748 #: build/C/man3/tsearch.3:146
1749 msgid ""
1750 "B<tdelete>()  returns a pointer to the parent of the item deleted, or NULL "
1751 "if the item was not found."
1752 msgstr ""
1753 "B<tdelete>()  は削除したアイテムの親へのポインタを返す。 アイテムが見つからな"
1754 "かった場合は NULL を返す。"
1755
1756 #. type: Plain text
1757 #: build/C/man3/tsearch.3:153
1758 msgid ""
1759 "B<tsearch>(), B<tfind>(), and B<tdelete>()  also return NULL if I<rootp> was "
1760 "NULL on entry."
1761 msgstr ""
1762 "I<rootp> が NULL の場合、 B<tsearch>(), B<tfind>(), B<tdelete>()  は NULL を"
1763 "返す。"
1764
1765 #. type: Plain text
1766 #: build/C/man3/tsearch.3:158
1767 msgid "SVr4, POSIX.1-2001.  The function B<tdestroy>()  is a GNU extension."
1768 msgstr "SVr4, POSIX.1-2001.  関数 B<tdestroy>()  は GNU の拡張である。"
1769
1770 #. type: Plain text
1771 #: build/C/man3/tsearch.3:162
1772 msgid ""
1773 "B<twalk>()  takes a pointer to the root, while the other functions take a "
1774 "pointer to a variable which points to the root."
1775 msgstr ""
1776 "B<twalk>()  は根へのポインタを引数にとるが、 ほかの関数は根へのポインタへのポ"
1777 "インタである。"
1778
1779 #. type: Plain text
1780 #: build/C/man3/tsearch.3:168
1781 msgid ""
1782 "B<twalk>()  uses B<postorder> to mean \"after the left subtree, but before "
1783 "the right subtree\".  Some authorities would call this \"inorder\", and "
1784 "reserve \"postorder\" to mean \"after both subtrees\"."
1785 msgstr ""
1786 "B<twalk>()  においては、B<postorder> は 「左の部分木の後で、右の部分木の前」"
1787 "を意味している。 しかし、人によってはこれを \"inorder\" と呼んで、 "
1788 "\"postorder\" を「両方の部分木の後」とする場合もある。"
1789
1790 #. type: Plain text
1791 #: build/C/man3/tsearch.3:173
1792 msgid ""
1793 "B<tdelete>()  frees the memory required for the node in the tree.  The user "
1794 "is responsible for freeing the memory for the corresponding data."
1795 msgstr ""
1796 "B<tdelete>()  は、削除したノードの使用していたメモリを解放するが、 ノードに対"
1797 "応するデータのメモリは、ユーザが解放しなければならない。"
1798
1799 #. type: Plain text
1800 #: build/C/man3/tsearch.3:181
1801 msgid ""
1802 "The example program depends on the fact that B<twalk>()  makes no further "
1803 "reference to a node after calling the user function with argument \"endorder"
1804 "\" or \"leaf\".  This works with the GNU library implementation, but is not "
1805 "in the System V documentation."
1806 msgstr ""
1807 "下のプログラム例は、ユーザ関数が \"endorder\" か \"leaf\" を引数にして 呼び出"
1808 "されて以降は、 B<twalk>()  がそのノードを参照しないことを前提としている。 こ"
1809 "れは GNU ライブラリの実装では機能するが、System V のマニュアルには存在しな"
1810 "い。"
1811
1812 #. type: Plain text
1813 #: build/C/man3/tsearch.3:185
1814 msgid ""
1815 "The following program inserts twelve random numbers into a binary tree, "
1816 "where duplicate numbers are collapsed, then prints the numbers in order."
1817 msgstr ""
1818 "以下のプログラムは 12 個の乱数を二分木に挿入した後、 挿入した数を順番に出力す"
1819 "る (挿入の際、重複した乱数は 1 つにまとめられる)。"
1820
1821 #. type: Plain text
1822 #: build/C/man3/tsearch.3:192
1823 #, no-wrap
1824 msgid ""
1825 "#define _GNU_SOURCE     /* Expose declaration of tdestroy() */\n"
1826 "#include E<lt>search.hE<gt>\n"
1827 "#include E<lt>stdlib.hE<gt>\n"
1828 "#include E<lt>stdio.hE<gt>\n"
1829 "#include E<lt>time.hE<gt>\n"
1830 msgstr ""
1831 "#define _GNU_SOURCE     /* Expose declaration of tdestroy() */\n"
1832 "#include E<lt>search.hE<gt>\n"
1833 "#include E<lt>stdlib.hE<gt>\n"
1834 "#include E<lt>stdio.hE<gt>\n"
1835 "#include E<lt>time.hE<gt>\n"
1836
1837 #. type: Plain text
1838 #: build/C/man3/tsearch.3:194
1839 #, no-wrap
1840 msgid "void *root = NULL;\n"
1841 msgstr "void *root = NULL;\n"
1842
1843 #. type: Plain text
1844 #: build/C/man3/tsearch.3:205
1845 #, no-wrap
1846 msgid ""
1847 "void *\n"
1848 "xmalloc(unsigned n)\n"
1849 "{\n"
1850 "    void *p;\n"
1851 "    p = malloc(n);\n"
1852 "    if (p)\n"
1853 "        return p;\n"
1854 "    fprintf(stderr, \"insufficient memory\\en\");\n"
1855 "    exit(EXIT_FAILURE);\n"
1856 "}\n"
1857 msgstr ""
1858 "void *\n"
1859 "xmalloc(unsigned n)\n"
1860 "{\n"
1861 "    void *p;\n"
1862 "    p = malloc(n);\n"
1863 "    if (p)\n"
1864 "        return p;\n"
1865 "    fprintf(stderr, \"insufficient memory\\en\");\n"
1866 "    exit(EXIT_FAILURE);\n"
1867 "}\n"
1868
1869 #. type: Plain text
1870 #: build/C/man3/tsearch.3:215
1871 #, no-wrap
1872 msgid ""
1873 "int\n"
1874 "compare(const void *pa, const void *pb)\n"
1875 "{\n"
1876 "    if (*(int *) pa E<lt> *(int *) pb)\n"
1877 "        return -1;\n"
1878 "    if (*(int *) pa E<gt> *(int *) pb)\n"
1879 "        return 1;\n"
1880 "    return 0;\n"
1881 "}\n"
1882 msgstr ""
1883 "int\n"
1884 "compare(const void *pa, const void *pb)\n"
1885 "{\n"
1886 "    if (*(int *) pa E<lt> *(int *) pb)\n"
1887 "        return -1;\n"
1888 "    if (*(int *) pa E<gt> *(int *) pb)\n"
1889 "        return 1;\n"
1890 "    return 0;\n"
1891 "}\n"
1892
1893 #. type: Plain text
1894 #: build/C/man3/tsearch.3:220
1895 #, no-wrap
1896 msgid ""
1897 "void\n"
1898 "action(const void *nodep, const VISIT which, const int depth)\n"
1899 "{\n"
1900 "    int *datap;\n"
1901 msgstr ""
1902 "void\n"
1903 "action(const void *nodep, const VISIT which, const int depth)\n"
1904 "{\n"
1905 "    int *datap;\n"
1906
1907 #. type: Plain text
1908 #: build/C/man3/tsearch.3:236
1909 #, no-wrap
1910 msgid ""
1911 "    switch (which) {\n"
1912 "    case preorder:\n"
1913 "        break;\n"
1914 "    case postorder:\n"
1915 "        datap = *(int **) nodep;\n"
1916 "        printf(\"%6d\\en\", *datap);\n"
1917 "        break;\n"
1918 "    case endorder:\n"
1919 "        break;\n"
1920 "    case leaf:\n"
1921 "        datap = *(int **) nodep;\n"
1922 "        printf(\"%6d\\en\", *datap);\n"
1923 "        break;\n"
1924 "    }\n"
1925 "}\n"
1926 msgstr ""
1927 "    switch (which) {\n"
1928 "    case preorder:\n"
1929 "        break;\n"
1930 "    case postorder:\n"
1931 "        datap = *(int **) nodep;\n"
1932 "        printf(\"%6d\\en\", *datap);\n"
1933 "        break;\n"
1934 "    case endorder:\n"
1935 "        break;\n"
1936 "    case leaf:\n"
1937 "        datap = *(int **) nodep;\n"
1938 "        printf(\"%6d\\en\", *datap);\n"
1939 "        break;\n"
1940 "    }\n"
1941 "}\n"
1942
1943 #. type: Plain text
1944 #: build/C/man3/tsearch.3:242
1945 #, no-wrap
1946 msgid ""
1947 "int\n"
1948 "main(void)\n"
1949 "{\n"
1950 "    int i, *ptr;\n"
1951 "    void *val;\n"
1952 msgstr ""
1953 "int\n"
1954 "main(void)\n"
1955 "{\n"
1956 "    int i, *ptr;\n"
1957 "    void *val;\n"
1958
1959 #. type: Plain text
1960 #: build/C/man3/tsearch.3:257
1961 #, no-wrap
1962 msgid ""
1963 "    srand(time(NULL));\n"
1964 "    for (i = 0; i E<lt> 12; i++) {\n"
1965 "        ptr = (int *) xmalloc(sizeof(int));\n"
1966 "        *ptr = rand() & 0xff;\n"
1967 "        val = tsearch((void *) ptr, &root, compare);\n"
1968 "        if (val == NULL)\n"
1969 "            exit(EXIT_FAILURE);\n"
1970 "        else if ((*(int **) val) != ptr)\n"
1971 "            free(ptr);\n"
1972 "    }\n"
1973 "    twalk(root, action);\n"
1974 "    tdestroy(root, free);\n"
1975 "    exit(EXIT_SUCCESS);\n"
1976 "}\n"
1977 msgstr ""
1978 "    srand(time(NULL));\n"
1979 "    for (i = 0; i E<lt> 12; i++) {\n"
1980 "        ptr = (int *) xmalloc(sizeof(int));\n"
1981 "        *ptr = rand() & 0xff;\n"
1982 "        val = tsearch((void *) ptr, &root, compare);\n"
1983 "        if (val == NULL)\n"
1984 "            exit(EXIT_FAILURE);\n"
1985 "        else if ((*(int **) val) != ptr)\n"
1986 "            free(ptr);\n"
1987 "    }\n"
1988 "    twalk(root, action);\n"
1989 "    tdestroy(root, free);\n"
1990 "    exit(EXIT_SUCCESS);\n"
1991 "}\n"
1992
1993 #. type: Plain text
1994 #: build/C/man3/tsearch.3:262
1995 msgid "B<bsearch>(3), B<hsearch>(3), B<lsearch>(3), B<qsort>(3)"
1996 msgstr "B<bsearch>(3), B<hsearch>(3), B<lsearch>(3)  B<qsort>(3)"
1997
1998 #~ msgid "COLOPHON"
1999 #~ msgstr "この文書について"
2000
2001 #~ msgid ""
2002 #~ "This page is part of release 3.38 of the Linux I<man-pages> project.  A "
2003 #~ "description of the project, and information about reporting bugs, can be "
2004 #~ "found at http://www.kernel.org/doc/man-pages/."
2005 #~ msgstr ""
2006 #~ "この man ページは Linux I<man-pages> プロジェクトのリリース 3.38 の一部である。\n"
2007 #~ "プロジェクトの説明とバグ報告に関する情報は\n"
2008 #~ "http://www.kernel.org/doc/man-pages/ に書かれている。"
2009
2010 #~ msgid "SVr4, 4.3BSD, C89, C99."
2011 #~ msgstr "SVr4, 4.3BSD, C89, C99."
2012
2013 #~ msgid ""
2014 #~ "B<insque>(), B<remque>(): _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500"
2015 #~ msgstr ""
2016 #~ "B<insque>(), B<remque>(): _SVID_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500"