diff options
Diffstat (limited to '')
-rw-r--r-- | templates/man3/hsearch.3.pot | 754 |
1 files changed, 754 insertions, 0 deletions
diff --git a/templates/man3/hsearch.3.pot b/templates/man3/hsearch.3.pot new file mode 100644 index 00000000..e159908a --- /dev/null +++ b/templates/man3/hsearch.3.pot @@ -0,0 +1,754 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2024-03-01 16:58+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: TH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "hsearch" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "2023-10-31" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "Linux man-pages 6.06" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"hcreate, hdestroy, hsearch, hcreate_r, hdestroy_r, hsearch_r - hash table " +"management" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "LIBRARY" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Standard C library (I<libc>, I<-lc>)" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SYNOPSIS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<#include E<lt>search.hE<gt>>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<int hcreate(size_t >I<nel>B<);>\n" +"B<void hdestroy(void);>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENTRY *hsearch(ENTRY >I<item>B<, ACTION >I<action>B<);>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" +"B<#include E<lt>search.hE<gt>>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<int hcreate_r(size_t >I<nel>B<, struct hsearch_data *>I<htab>B<);>\n" +"B<void hdestroy_r(struct hsearch_data *>I<htab>B<);>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<int hsearch_r(ENTRY >I<item>B<, ACTION >I<action>B<, ENTRY **>I<retval>B<,>\n" +"B< struct hsearch_data *>I<htab>B<);>\n" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "DESCRIPTION" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The three functions B<hcreate>(), B<hsearch>(), and B<hdestroy>() allow the " +"caller to create and manage a hash search table containing entries " +"consisting of a key (a string) and associated data. Using these functions, " +"only one hash table can be used at a time." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The three functions B<hcreate_r>(), B<hsearch_r>(), B<hdestroy_r>() are " +"reentrant versions that allow a program to use more than one hash search " +"table at the same time. The last argument, I<htab>, points to a structure " +"that describes the table on which the function is to operate. The " +"programmer should treat this structure as opaque (i.e., do not attempt to " +"directly access or modify the fields in this structure)." +msgstr "" + +#. e.g., in glibc it is raised to the next higher prime number +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"First a hash table must be created using B<hcreate>(). The argument I<nel> " +"specifies the maximum number of entries in the table. (This maximum cannot " +"be changed later, so choose it wisely.) The implementation may adjust this " +"value upward to improve the performance of the resulting hash table." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<hcreate_r>() function performs the same task as B<hcreate>(), but for " +"the table described by the structure I<*htab>. The structure pointed to by " +"I<htab> must be zeroed before the first call to B<hcreate_r>()." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The function B<hdestroy>() frees the memory occupied by the hash table that " +"was created by B<hcreate>(). After calling B<hdestroy>(), a new hash table " +"can be created using B<hcreate>(). The B<hdestroy_r>() function performs " +"the analogous task for a hash table described by I<*htab>, which was " +"previously created using B<hcreate_r>()." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<hsearch>() function searches the hash table for an item with the same " +"key as I<item> (where \"the same\" is determined using B<strcmp>(3)), and if " +"successful returns a pointer to it." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The argument I<item> is of type I<ENTRY>, which is defined in I<E<lt>search." +"hE<gt>> as follows:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"typedef struct entry {\n" +" char *key;\n" +" void *data;\n" +"} ENTRY;\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The field I<key> points to a null-terminated string which is the search " +"key. The field I<data> points to data that is associated with that key." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The argument I<action> determines what B<hsearch>() does after an " +"unsuccessful search. This argument must either have the value B<ENTER>, " +"meaning insert a copy of I<item> (and return a pointer to the new hash table " +"entry as the function result), or the value B<FIND>, meaning that NULL " +"should be returned. (If I<action> is B<FIND>, then I<data> is ignored.)" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<hsearch_r>() function is like B<hsearch>() but operates on the hash " +"table described by I<*htab>. The B<hsearch_r>() function differs from " +"B<hsearch>() in that a pointer to the found item is returned in I<*retval>, " +"rather than as the function result." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "RETURN VALUE" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"B<hcreate>() and B<hcreate_r>() return nonzero on success. They return 0 " +"on error, with I<errno> set to indicate the error." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"On success, B<hsearch>() returns a pointer to an entry in the hash table. " +"B<hsearch>() returns NULL on error, that is, if I<action> is B<ENTER> and " +"the hash table is full, or I<action> is B<FIND> and I<item> cannot be found " +"in the hash table. B<hsearch_r>() returns nonzero on success, and 0 on " +"error. In the event of an error, these two functions set I<errno> to " +"indicate the error." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "ERRORS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"B<hcreate_r>() and B<hdestroy_r>() can fail for the following reasons:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<EINVAL>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "I<htab> is NULL." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "B<hsearch>() and B<hsearch_r>() can fail for the following reasons:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOMEM>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"I<action> was B<ENTER>, I<key> was not found in the table, and there was no " +"room in the table to add a new entry." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ESRCH>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "I<action> was B<FIND>, and I<key> was not found in the table." +msgstr "" + +#. PROX.1-2001, POSIX.1-2008 +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "POSIX.1 specifies only the B<ENOMEM> error." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "ATTRIBUTES" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"For an explanation of the terms used in this section, see B<attributes>(7)." +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Interface" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Attribute" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Value" +msgstr "" + +#. type: tbl table +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid ".na\n" +msgstr "" + +#. type: tbl table +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid ".nh\n" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<hcreate>(),\n" +"B<hsearch>(),\n" +"B<hdestroy>()" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Thread safety" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "MT-Unsafe race:hsearch" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<hcreate_r>(),\n" +"B<hsearch_r>(),\n" +"B<hdestroy_r>()" +msgstr "" + +#. type: tbl table +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "MT-Safe race:htab" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "STANDARDS" +msgstr "" + +#. type: TP +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hcreate>()" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hsearch>()" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hdestroy>()" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "POSIX.1-2008." +msgstr "" + +#. type: TP +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hcreate_r>()" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hsearch_r>()" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<hdestroy_r>()" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "GNU." +msgstr "" + +#. type: SH +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "HISTORY" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "SVr4, POSIX.1-2001." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NOTES" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Hash table implementations are usually more efficient when the table " +"contains enough free space to minimize collisions. Typically, this means " +"that I<nel> should be at least 25% larger than the maximum number of " +"elements that the caller expects to store in the table." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<hdestroy>() and B<hdestroy_r>() functions do not free the buffers " +"pointed to by the I<key> and I<data> elements of the hash table entries. " +"(It can't do this because it doesn't know whether these buffers were " +"allocated dynamically.) If these buffers need to be freed (perhaps because " +"the program is repeatedly creating and destroying hash tables, rather than " +"creating a single table whose lifetime matches that of the program), then " +"the program must maintain bookkeeping data structures that allow it to free " +"them." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "BUGS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"SVr4 and POSIX.1-2001 specify that I<action> is significant only for " +"unsuccessful searches, so that an B<ENTER> should not do anything for a " +"successful search. In libc and glibc (before glibc 2.3), the implementation " +"violates the specification, updating the I<data> for the given I<key> in " +"this case." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Individual hash table entries can be added, but not deleted." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "EXAMPLES" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following program inserts 24 items into a hash table, then prints some " +"of them." +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#include E<lt>search.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"\\&\n" +"static char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n" +" \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n" +" \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n" +" \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n" +" \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n" +"};\n" +"\\&\n" +"int\n" +"main(void)\n" +"{\n" +" ENTRY e;\n" +" ENTRY *ep;\n" +"\\&\n" +" hcreate(30);\n" +"\\&\n" +" for (size_t i = 0; i E<lt> 24; i++) {\n" +" e.key = data[i];\n" +" /* data is just an integer, instead of a\n" +" pointer to something */\n" +" e.data = (void *) i;\n" +" ep = hsearch(e, ENTER);\n" +" /* there should be no failures */\n" +" if (ep == NULL) {\n" +" fprintf(stderr, \"entry failed\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" }\n" +"\\&\n" +" for (size_t i = 22; i E<lt> 26; i++) {\n" +" /* print two entries from the table, and\n" +" show that two are not in the table */\n" +" e.key = data[i];\n" +" ep = hsearch(e, FIND);\n" +" printf(\"%9.9s -E<gt> %9.9s:%d\\en\", e.key,\n" +" ep ? ep-E<gt>key : \"NULL\", ep ? (int)(ep-E<gt>data) : 0);\n" +" }\n" +" hdestroy();\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. SRC END +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SEE ALSO" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "B<bsearch>(3), B<lsearch>(3), B<malloc>(3), B<tsearch>(3)" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "2022-12-15" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "Linux man-pages 6.03" +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "" +"The functions B<hcreate>(), B<hsearch>(), and B<hdestroy>() are from SVr4, " +"and are described in POSIX.1-2001 and POSIX.1-2008." +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "" +"The functions B<hcreate_r>(), B<hsearch_r>(), and B<hdestroy_r>() are GNU " +"extensions." +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#include E<lt>search.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"static char *data[] = { \"alpha\", \"bravo\", \"charlie\", \"delta\",\n" +" \"echo\", \"foxtrot\", \"golf\", \"hotel\", \"india\", \"juliet\",\n" +" \"kilo\", \"lima\", \"mike\", \"november\", \"oscar\", \"papa\",\n" +" \"quebec\", \"romeo\", \"sierra\", \"tango\", \"uniform\",\n" +" \"victor\", \"whisky\", \"x-ray\", \"yankee\", \"zulu\"\n" +"};\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(void)\n" +"{\n" +" ENTRY e;\n" +" ENTRY *ep;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " hcreate(30);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" for (size_t i = 0; i E<lt> 24; i++) {\n" +" e.key = data[i];\n" +" /* data is just an integer, instead of a\n" +" pointer to something */\n" +" e.data = (void *) i;\n" +" ep = hsearch(e, ENTER);\n" +" /* there should be no failures */\n" +" if (ep == NULL) {\n" +" fprintf(stderr, \"entry failed\\en\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" for (size_t i = 22; i E<lt> 26; i++) {\n" +" /* print two entries from the table, and\n" +" show that two are not in the table */\n" +" e.key = data[i];\n" +" ep = hsearch(e, FIND);\n" +" printf(\"%9.9s -E<gt> %9.9s:%d\\en\", e.key,\n" +" ep ? ep-E<gt>key : \"NULL\", ep ? (int)(ep-E<gt>data) : 0);\n" +" }\n" +" hdestroy();\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "2023-07-20" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "Linux man-pages 6.05.01" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "2023-03-30" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "Linux man-pages 6.04" +msgstr "" |