#, fuzzy msgid "" msgstr "" "Project-Id-Version: man-pages-l10n VERSION\n" "POT-Creation-Date: 2014-07-17 17:54+0900\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: man-pages/man3/bsearch.3:31 #, no-wrap msgid "BSEARCH" msgstr "" #. type: TH #: man-pages/man3/bsearch.3:31 #, no-wrap msgid "2003-11-01" msgstr "" #. type: TH #: man-pages/man3/bsearch.3:31 #, no-wrap msgid "Linux Programmer's Manual" msgstr "" #. type: SH #: man-pages/man3/bsearch.3:32 #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:34 msgid "bsearch - binary search of a sorted array" msgstr "" #. type: SH #: man-pages/man3/bsearch.3:34 #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:37 #, no-wrap msgid "B<#include Estdlib.hE>\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:41 #, no-wrap msgid "" "BIB<, const void *>IB<,>\n" "B< size_t >IB<, size_t >IB<,>\n" "B< int (*>IB<)(const void *, const void *));>\n" msgstr "" #. type: SH #: man-pages/man3/bsearch.3:42 #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:56 msgid "" "The B() function searches an array of I objects, the " "initial member of which is pointed to by I, for a member that matches " "the object pointed to by I. The size of each member of the array is " "specified by I." msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:70 msgid "" "The contents of the array should be in ascending sorted order according to " "the comparison function referenced by I. The I routine is " "expected to have two arguments which point to the I object and to an " "array member, in that order, and should return an integer less than, equal " "to, or greater than zero if the I object is found, respectively, to be " "less than, to match, or be greater than the array member." msgstr "" #. type: SH #: man-pages/man3/bsearch.3:70 #, no-wrap msgid "RETURN VALUE" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:77 msgid "" "The B() function returns a pointer to a matching member of the " "array, or NULL if no match is found. If there are multiple elements that " "match the key, the element returned is unspecified." msgstr "" #. type: SH #: man-pages/man3/bsearch.3:77 #, no-wrap msgid "CONFORMING TO" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:79 msgid "SVr4, 4.3BSD, POSIX.1-2001, C89, C99." msgstr "" #. type: SH #: man-pages/man3/bsearch.3:79 #, no-wrap msgid "EXAMPLE" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:84 msgid "" "The example below first sorts an array of structures using B(3), then " "retrieves desired elements using B()." msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:89 #, no-wrap msgid "" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Estring.hE\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:98 #, no-wrap msgid "" "struct mi {\n" " int nr;\n" " char *name;\n" "} months[] = {\n" " { 1, \"jan\" }, { 2, \"feb\" }, { 3, \"mar\" }, { 4, \"apr\" },\n" " { 5, \"may\" }, { 6, \"jun\" }, { 7, \"jul\" }, { 8, \"aug\" },\n" " { 9, \"sep\" }, {10, \"oct\" }, {11, \"nov\" }, {12, \"dec\" }\n" "};\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:100 #, no-wrap msgid "#define nr_of_months (sizeof(months)/sizeof(months[0]))\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:108 #, no-wrap msgid "" "static int\n" "compmi(const void *m1, const void *m2)\n" "{\n" " struct mi *mi1 = (struct mi *) m1;\n" " struct mi *mi2 = (struct mi *) m2;\n" " return strcmp(mi1-Ename, mi2-Ename);\n" "}\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:113 #, no-wrap msgid "int\n" "main(int argc, char **argv)\n" "{\n" " int i;\n" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:127 #, no-wrap msgid "" " qsort(months, nr_of_months, sizeof(struct mi), compmi);\n" " for (i = 1; i E argc; i++) {\n" " struct mi key, *res;\n" " key.name = argv[i];\n" " res = bsearch(&key, months, nr_of_months,\n" " sizeof(struct mi), compmi);\n" " if (res == NULL)\n" " printf(\"\\(aq%s\\(aq: unknown month\\en\", argv[i]);\n" " else\n" " printf(\"%s: month #%d\\en\", res-Ename, res-Enr);\n" " }\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" #. this example referred to in qsort.3 #. type: SH #: man-pages/man3/bsearch.3:129 #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:134 msgid "B(3), B(3), B(3), B(3)" msgstr "" #. type: SH #: man-pages/man3/bsearch.3:134 #, no-wrap msgid "COLOPHON" msgstr "" #. type: Plain text #: man-pages/man3/bsearch.3:142 msgid "" "This page is part of release 3.70 of the Linux I project. A " "description of the project, information about reporting bugs, and the latest " "version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/" "." msgstr ""