Debian Codegraph @

templates/man3/hsearch.3.pot

raw
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 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2026-06-05 06:27+0200\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <[email protected]>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
21 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
22 #, no-wrap
23 msgid "hsearch"
24 msgstr ""
25
26 #. type: TH
27 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
28 #: opensuse-tumbleweed
29 #, no-wrap
30 msgid "2026-02-08"
31 msgstr ""
32
33 #. type: TH
34 #: archlinux debian-unstable
35 #, no-wrap
36 msgid "Linux man-pages 6.18"
37 msgstr ""
38
39 #. type: SH
40 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
41 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
42 #, no-wrap
43 msgid "NAME"
44 msgstr ""
45
46 #. type: Plain text
47 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
48 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
49 msgid ""
50 "hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, hsearch_r - hash table "
51 "management"
52 msgstr ""
53
54 #. type: SH
55 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
56 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
57 #, no-wrap
58 msgid "LIBRARY"
59 msgstr ""
60
61 #. type: Plain text
62 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
63 #: opensuse-leap-16-1 opensuse-tumbleweed
64 msgid "Standard C library (I<libc>,\\ I<-lc>)"
65 msgstr ""
66
67 #. type: SH
68 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
69 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
70 #, no-wrap
71 msgid "SYNOPSIS"
72 msgstr ""
73
74 #. type: Plain text
75 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
76 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
77 #, no-wrap
78 msgid "B<#include E<lt>search.hE<gt>>\n"
79 msgstr ""
80
81 #. type: Plain text
82 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
83 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
84 #, no-wrap
85 msgid ""
86 "B<int hcreate(size_t >I<nel>B<);>\n"
87 "B<void hdestroy(void);>\n"
88 msgstr ""
89
90 #. type: Plain text
91 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
92 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
93 #, no-wrap
94 msgid "B<ENTRY *hsearch(ENTRY >I<item>B<, ACTION >I<action>B<);>\n"
95 msgstr ""
96
97 #. type: Plain text
98 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
99 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
100 #, no-wrap
101 msgid ""
102 "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n"
103 "B<#include E<lt>search.hE<gt>>\n"
104 msgstr ""
105
106 #. type: Plain text
107 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
108 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
109 #, no-wrap
110 msgid ""
111 "B<int hcreate_r(size_t >I<nel>B<, struct hsearch_data *>I<htab>B<);>\n"
112 "B<void hdestroy_r(struct hsearch_data *>I<htab>B<);>\n"
113 msgstr ""
114
115 #. type: Plain text
116 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
117 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
118 #, no-wrap
119 msgid ""
120 "B<int hsearch_r(ENTRY >I<item>B<, ACTION >I<action>B<, ENTRY **>I<retval>B<,>\n"
121 "B< struct hsearch_data *>I<htab>B<);>\n"
122 msgstr ""
123
124 #. type: SH
125 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
126 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
127 #, no-wrap
128 msgid "DESCRIPTION"
129 msgstr ""
130
131 #. type: Plain text
132 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
133 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
134 msgid ""
135 "The three functions B<hcreate>(), B<hsearch>(), and B<hdestroy>() allow the "
136 "caller to create and manage a hash search table containing entries "
137 "consisting of a key (a string) and associated data. Using these functions, "
138 "only one hash table can be used at a time."
139 msgstr ""
140
141 #. type: Plain text
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 msgid ""
145 "The three functions B<hcreate_r>(), B<hsearch_r>(), B<hdestroy_r>() are "
146 "reentrant versions that allow a program to use more than one hash search "
147 "table at the same time. The last argument, I<htab>, points to a structure "
148 "that describes the table on which the function is to operate. The "
149 "programmer should treat this structure as opaque (i.e., do not attempt to "
150 "directly access or modify the fields in this structure)."
151 msgstr ""
152
153 #. e.g., in glibc it is raised to the next higher prime number
154 #. type: Plain text
155 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
156 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
157 msgid ""
158 "First a hash table must be created using B<hcreate>(). The argument I<nel> "
159 "specifies the maximum number of entries in the table. (This maximum cannot "
160 "be changed later, so choose it wisely.) The implementation may adjust this "
161 "value upward to improve the performance of the resulting hash table."
162 msgstr ""
163
164 #. type: Plain text
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 msgid ""
168 "The B<hcreate_r>() function performs the same task as B<hcreate>(), but for "
169 "the table described by the structure I<*htab>. The structure pointed to by "
170 "I<htab> must be zeroed before the first call to B<hcreate_r>()."
171 msgstr ""
172
173 #. type: Plain text
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 msgid ""
177 "The function B<hdestroy>() frees the memory occupied by the hash table that "
178 "was created by B<hcreate>(). After calling B<hdestroy>(), a new hash table "
179 "can be created using B<hcreate>(). The B<hdestroy_r>() function performs "
180 "the analogous task for a hash table described by I<*htab>, which was "
181 "previously created using B<hcreate_r>()."
182 msgstr ""
183
184 #. type: Plain text
185 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
186 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
187 msgid ""
188 "The B<hsearch>() function searches the hash table for an item with the same "
189 "key as I<item> (where \"the same\" is determined using B<strcmp>(3)), and if "
190 "successful returns a pointer to it."
191 msgstr ""
192
193 #. type: Plain text
194 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
195 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
196 msgid ""
197 "The argument I<item> is of type I<ENTRY>, which is defined in "
198 "I<E<lt>search.hE<gt>> as follows:"
199 msgstr ""
200
201 #. type: Plain text
202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
204 #, no-wrap
205 msgid ""
206 "typedef struct entry {\n"
207 " char *key;\n"
208 " void *data;\n"
209 "} ENTRY;\n"
210 msgstr ""
211
212 #. type: Plain text
213 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
214 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
215 msgid ""
216 "The field I<key> points to a null-terminated string which is the search "
217 "key. The field I<data> points to data that is associated with that key."
218 msgstr ""
219
220 #. type: Plain text
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 msgid ""
224 "The argument I<action> determines what B<hsearch>() does after an "
225 "unsuccessful search. This argument must either have the value B<ENTER>, "
226 "meaning insert a copy of I<item> (and return a pointer to the new hash table "
227 "entry as the function result), or the value B<FIND>, meaning that NULL "
228 "should be returned. (If I<action> is B<FIND>, then I<data> is ignored.)"
229 msgstr ""
230
231 #. type: Plain text
232 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
233 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
234 msgid ""
235 "The B<hsearch_r>() function is like B<hsearch>() but operates on the hash "
236 "table described by I<*htab>. The B<hsearch_r>() function differs from "
237 "B<hsearch>() in that a pointer to the found item is returned in I<*retval>, "
238 "rather than as the function result."
239 msgstr ""
240
241 #. type: SH
242 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
243 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
244 #, no-wrap
245 msgid "RETURN VALUE"
246 msgstr ""
247
248 #. type: Plain text
249 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
250 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
251 msgid ""
252 "B<hcreate>() and B<hcreate_r>() return nonzero on success. They return 0 "
253 "on error, with I<errno> set to indicate the error."
254 msgstr ""
255
256 #. type: Plain text
257 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
258 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
259 msgid ""
260 "On success, B<hsearch>() returns a pointer to an entry in the hash table. "
261 "B<hsearch>() returns NULL on error, that is, if I<action> is B<ENTER> and "
262 "the hash table is full, or I<action> is B<FIND> and I<item> cannot be found "
263 "in the hash table. B<hsearch_r>() returns nonzero on success, and 0 on "
264 "error. In the event of an error, these two functions set I<errno> to "
265 "indicate the error."
266 msgstr ""
267
268 #. type: SH
269 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
270 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
271 #, no-wrap
272 msgid "ERRORS"
273 msgstr ""
274
275 #. type: Plain text
276 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
277 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
278 msgid ""
279 "B<hcreate_r>() and B<hdestroy_r>() can fail for the following reasons:"
280 msgstr ""
281
282 #. type: TP
283 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
284 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
285 #, no-wrap
286 msgid "B<EINVAL>"
287 msgstr ""
288
289 #. type: Plain text
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 msgid "I<htab> is NULL."
293 msgstr ""
294
295 #. type: Plain text
296 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
297 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
298 msgid "B<hsearch>() and B<hsearch_r>() can fail for the following reasons:"
299 msgstr ""
300
301 #. type: TP
302 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
303 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
304 #, no-wrap
305 msgid "B<ENOMEM>"
306 msgstr ""
307
308 #. type: Plain text
309 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
310 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
311 msgid ""
312 "I<action> was B<ENTER>, I<key> was not found in the table, and there was no "
313 "room in the table to add a new entry."
314 msgstr ""
315
316 #. type: TP
317 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
318 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
319 #, no-wrap
320 msgid "B<ESRCH>"
321 msgstr ""
322
323 #. type: Plain text
324 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
325 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
326 msgid "I<action> was B<FIND>, and I<key> was not found in the table."
327 msgstr ""
328
329 #. PROX.1-2001, POSIX.1-2008
330 #. type: Plain text
331 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
332 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
333 msgid "POSIX.1 specifies only the B<ENOMEM> error."
334 msgstr ""
335
336 #. type: SH
337 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
338 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
339 #, no-wrap
340 msgid "ATTRIBUTES"
341 msgstr ""
342
343 #. type: Plain text
344 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
345 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
346 msgid ""
347 "For an explanation of the terms used in this section, see B<attributes>(7)."
348 msgstr ""
349
350 #. type: tbl table
351 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
352 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
353 #, no-wrap
354 msgid "Interface"
355 msgstr ""
356
357 #. type: tbl table
358 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
359 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
360 #, no-wrap
361 msgid "Attribute"
362 msgstr ""
363
364 #. type: tbl table
365 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
366 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
367 #, no-wrap
368 msgid "Value"
369 msgstr ""
370
371 #. type: tbl table
372 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
373 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
374 #, no-wrap
375 msgid ".na\n"
376 msgstr ""
377
378 #. type: tbl table
379 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
380 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
381 #, no-wrap
382 msgid ".nh\n"
383 msgstr ""
384
385 #. type: tbl table
386 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
387 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
388 #, no-wrap
389 msgid ""
390 "B<hcreate>(),\n"
391 "B<hsearch>(),\n"
392 "B<hdestroy>()"
393 msgstr ""
394
395 #. type: tbl table
396 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
397 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
398 #, no-wrap
399 msgid "Thread safety"
400 msgstr ""
401
402 #. type: tbl table
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 #, no-wrap
406 msgid "MT-Unsafe race:hsearch"
407 msgstr ""
408
409 #. type: tbl table
410 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
411 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
412 #, no-wrap
413 msgid ""
414 "B<hcreate_r>(),\n"
415 "B<hsearch_r>(),\n"
416 "B<hdestroy_r>()"
417 msgstr ""
418
419 #. type: tbl table
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 #, no-wrap
423 msgid "MT-Safe race:htab"
424 msgstr ""
425
426 #. type: SH
427 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
428 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
429 #, no-wrap
430 msgid "STANDARDS"
431 msgstr ""
432
433 #. type: TP
434 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
435 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
436 #, no-wrap
437 msgid "B<hcreate>()"
438 msgstr ""
439
440 #. type: TQ
441 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
442 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
443 #, no-wrap
444 msgid "B<hsearch>()"
445 msgstr ""
446
447 #. type: TQ
448 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
449 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
450 #, no-wrap
451 msgid "B<hdestroy>()"
452 msgstr ""
453
454 #. type: Plain text
455 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
456 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
457 msgid "POSIX.1-2008."
458 msgstr ""
459
460 #. type: TP
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 #, no-wrap
464 msgid "B<hcreate_r>()"
465 msgstr ""
466
467 #. type: TQ
468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
470 #, no-wrap
471 msgid "B<hsearch_r>()"
472 msgstr ""
473
474 #. type: TQ
475 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
476 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
477 #, no-wrap
478 msgid "B<hdestroy_r>()"
479 msgstr ""
480
481 #. type: Plain text
482 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
483 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
484 msgid "GNU."
485 msgstr ""
486
487 #. type: SH
488 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
489 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
490 #, no-wrap
491 msgid "HISTORY"
492 msgstr ""
493
494 #. type: Plain text
495 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
496 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
497 msgid "SVr4, POSIX.1-2001."
498 msgstr ""
499
500 #. type: SH
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 #, no-wrap
504 msgid "NOTES"
505 msgstr ""
506
507 #. type: Plain text
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 msgid ""
511 "Hash table implementations are usually more efficient when the table "
512 "contains enough free space to minimize collisions. Typically, this means "
513 "that I<nel> should be at least 25% larger than the maximum number of "
514 "elements that the caller expects to store in the table."
515 msgstr ""
516
517 #. type: Plain text
518 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
519 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
520 msgid ""
521 "The B<hdestroy>() and B<hdestroy_r>() functions do not free the buffers "
522 "pointed to by the I<key> and I<data> elements of the hash table entries. "
523 "(It can't do this because it doesn't know whether these buffers were "
524 "allocated dynamically.) If these buffers need to be freed (perhaps because "
525 "the program is repeatedly creating and destroying hash tables, rather than "
526 "creating a single table whose lifetime matches that of the program), then "
527 "the program must maintain bookkeeping data structures that allow it to free "
528 "them."
529 msgstr ""
530
531 #. type: SH
532 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
533 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
534 #, no-wrap
535 msgid "BUGS"
536 msgstr ""
537
538 #. type: Plain text
539 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
540 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
541 msgid ""
542 "SVr4 and POSIX.1-2001 specify that I<action> is significant only for "
543 "unsuccessful searches, so that an B<ENTER> should not do anything for a "
544 "successful search. In libc and glibc (before glibc 2.3), the implementation "
545 "violates the specification, updating the I<data> for the given I<key> in "
546 "this case."
547 msgstr ""
548
549 #. type: Plain text
550 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
551 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
552 msgid "Individual hash table entries can be added, but not deleted."
553 msgstr ""
554
555 #. type: SH
556 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
557 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
558 #, no-wrap
559 msgid "EXAMPLES"
560 msgstr ""
561
562 #. type: Plain text
563 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
564 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
565 msgid ""
566 "The following program inserts 24 items into a hash table, then prints some "
567 "of them."
568 msgstr ""
569
570 #. type: Plain text
571 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
572 #: opensuse-leap-16-1 opensuse-tumbleweed
573 #, no-wrap
574 msgid ""
575 "#include E<lt>search.hE<gt>\n"
576 "#include E<lt>stdio.hE<gt>\n"
577 "#include E<lt>stdlib.hE<gt>\n"
578 "\\&\n"
579 "static char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n"
580 " \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n"
581 " \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n"
582 " \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n"
583 " \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n"
584 "};\n"
585 "\\&\n"
586 "int\n"
587 "main(void)\n"
588 "{\n"
589 " ENTRY e;\n"
590 " ENTRY *ep;\n"
591 "\\&\n"
592 " hcreate(30);\n"
593 "\\&\n"
594 " for (size_t i = 0; i E<lt> 24; i++) {\n"
595 " e.key = data[i];\n"
596 " /* data is just an integer, instead of a\n"
597 " pointer to something */\n"
598 " e.data = (void *) i;\n"
599 " ep = hsearch(e, ENTER);\n"
600 " /* there should be no failures */\n"
601 " if (ep == NULL) {\n"
602 " fprintf(stderr, \"entry failed\\[rs]n\");\n"
603 " exit(EXIT_FAILURE);\n"
604 " }\n"
605 " }\n"
606 "\\&\n"
607 " for (size_t i = 22; i E<lt> 26; i++) {\n"
608 " /* print two entries from the table, and\n"
609 " show that two are not in the table */\n"
610 " e.key = data[i];\n"
611 " ep = hsearch(e, FIND);\n"
612 " printf(\"%9.9s -E<gt> %9.9s:%d\\[rs]n\", e.key,\n"
613 " ep ? ep-E<gt>key : \"NULL\", ep ? (int) ep-E<gt>data : 0);\n"
614 " }\n"
615 " hdestroy();\n"
616 " exit(EXIT_SUCCESS);\n"
617 "}\n"
618 msgstr ""
619
620 #. SRC END
621 #. type: SH
622 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
623 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
624 #, no-wrap
625 msgid "SEE ALSO"
626 msgstr ""
627
628 #. type: Plain text
629 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
630 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
631 msgid "B<bsearch>(3), B<lsearch>(3), B<malloc>(3), B<tsearch>(3)"
632 msgstr ""
633
634 #. type: TH
635 #: debian-trixie
636 #, no-wrap
637 msgid "2024-06-15"
638 msgstr ""
639
640 #. type: TH
641 #: debian-trixie
642 #, no-wrap
643 msgid "Linux man-pages 6.9.1"
644 msgstr ""
645
646 #. type: Plain text
647 #: debian-trixie
648 msgid "Standard C library (I<libc>, I<-lc>)"
649 msgstr ""
650
651 #. type: Plain text
652 #: debian-trixie
653 #, no-wrap
654 msgid ""
655 "#include E<lt>search.hE<gt>\n"
656 "#include E<lt>stdio.hE<gt>\n"
657 "#include E<lt>stdlib.hE<gt>\n"
658 "\\&\n"
659 "static char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n"
660 " \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n"
661 " \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n"
662 " \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n"
663 " \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n"
664 "};\n"
665 "\\&\n"
666 "int\n"
667 "main(void)\n"
668 "{\n"
669 " ENTRY e;\n"
670 " ENTRY *ep;\n"
671 "\\&\n"
672 " hcreate(30);\n"
673 "\\&\n"
674 " for (size_t i = 0; i E<lt> 24; i++) {\n"
675 " e.key = data[i];\n"
676 " /* data is just an integer, instead of a\n"
677 " pointer to something */\n"
678 " e.data = (void *) i;\n"
679 " ep = hsearch(e, ENTER);\n"
680 " /* there should be no failures */\n"
681 " if (ep == NULL) {\n"
682 " fprintf(stderr, \"entry failed\\[rs]n\");\n"
683 " exit(EXIT_FAILURE);\n"
684 " }\n"
685 " }\n"
686 "\\&\n"
687 " for (size_t i = 22; i E<lt> 26; i++) {\n"
688 " /* print two entries from the table, and\n"
689 " show that two are not in the table */\n"
690 " e.key = data[i];\n"
691 " ep = hsearch(e, FIND);\n"
692 " printf(\"%9.9s -E<gt> %9.9s:%d\\[rs]n\", e.key,\n"
693 " ep ? ep-E<gt>key : \"NULL\", ep ? (int)(ep-E<gt>data) : 0);\n"
694 " }\n"
695 " hdestroy();\n"
696 " exit(EXIT_SUCCESS);\n"
697 "}\n"
698 msgstr ""
699
700 #. type: TH
701 #: fedora-44 fedora-rawhide
702 #, no-wrap
703 msgid "2025-01-05"
704 msgstr ""
705
706 #. type: TH
707 #: fedora-44 fedora-rawhide
708 #, no-wrap
709 msgid "Linux man-pages 6.13"
710 msgstr ""
711
712 #. type: TH
713 #: mageia-cauldron
714 #, no-wrap
715 msgid "Linux man-pages 6.17"
716 msgstr ""
717
718 #. type: TH
719 #: opensuse-leap-16-1 opensuse-tumbleweed
720 #, no-wrap
721 msgid "Linux man-pages (unreleased)"
722 msgstr ""