| 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:49+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 "tsearch" |
| 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 |
"tsearch, tfind, tdelete, twalk, twalk_r, tdestroy - manage a binary search " |
| 51 |
"tree" |
| 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 "B<typedef enum { preorder, postorder, endorder, leaf } VISIT;>\n" |
| 86 |
msgstr "" |
| 87 |
|
| 88 |
#. type: Plain text |
| 89 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 90 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 91 |
#, no-wrap |
| 92 |
msgid "" |
| 93 |
"B<void *tfind(const void *>I<key>B<, void *const *>I<rootp>B<,>\n" |
| 94 |
"B< typeof(int (const void *, const void *)) *>I<compar>B<);>\n" |
| 95 |
"B<void *tsearch(const void *>I<key>B<, void **>I<rootp>B<,>\n" |
| 96 |
"B< typeof(int (const void *, const void *)) *>I<compar>B<);>\n" |
| 97 |
"B<void *tdelete(const void *restrict >I<key>B<, void **restrict >I<rootp>B<,>\n" |
| 98 |
"B< typeof(int (const void *, const void *)) *>I<compar>B<);>\n" |
| 99 |
"B<void twalk(const void *>I<root>B<,>\n" |
| 100 |
"B< typeof(void (const void *>I<nodep>B<, VISIT >I<which>B<, int >I<depth>B<))>\n" |
| 101 |
"B< *>I<action>B<);>\n" |
| 102 |
msgstr "" |
| 103 |
|
| 104 |
#. type: Plain text |
| 105 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 106 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 107 |
#, no-wrap |
| 108 |
msgid "" |
| 109 |
"B<#define _GNU_SOURCE> /* See feature_test_macros(7) */\n" |
| 110 |
"B<#include E<lt>search.hE<gt>>\n" |
| 111 |
msgstr "" |
| 112 |
|
| 113 |
#. type: Plain text |
| 114 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 115 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 116 |
#, no-wrap |
| 117 |
msgid "" |
| 118 |
"B<void twalk_r(const void *>I<root>B<,>\n" |
| 119 |
"B< typeof(void (const void *>I<nodep>B<, VISIT >I<which>B<, void *>I<closure>B<))>\n" |
| 120 |
"B< *>I<action>B<,>\n" |
| 121 |
"B< void *>I<closure>B<);>\n" |
| 122 |
"B<void tdestroy(void *>I<root>B<,>\n" |
| 123 |
"B< typeof(void (void *>I<nodep>B<)) *>I<free_node>B<);>\n" |
| 124 |
msgstr "" |
| 125 |
|
| 126 |
#. type: SH |
| 127 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 128 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 129 |
#, no-wrap |
| 130 |
msgid "DESCRIPTION" |
| 131 |
msgstr "" |
| 132 |
|
| 133 |
#. type: Plain text |
| 134 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 135 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 136 |
msgid "" |
| 137 |
"B<tsearch>(), B<tfind>(), B<twalk>(), and B<tdelete>() manage a binary " |
| 138 |
"search tree. They are generalized from Knuth (6.2.2) Algorithm T. The " |
| 139 |
"first field in each node of the tree is a pointer to the corresponding data " |
| 140 |
"item. (The calling program must store the actual data.) I<compar> points " |
| 141 |
"to a comparison routine, which takes pointers to two items. It should " |
| 142 |
"return an integer which is negative, zero, or positive, depending on whether " |
| 143 |
"the first item is less than, equal to, or greater than the second." |
| 144 |
msgstr "" |
| 145 |
|
| 146 |
#. type: Plain text |
| 147 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 148 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 149 |
msgid "" |
| 150 |
"B<tsearch>() searches the tree for an item. I<key> points to the item to " |
| 151 |
"be searched for. I<rootp> points to a variable which points to the root of " |
| 152 |
"the tree. If the tree is empty, then the variable that I<rootp> points to " |
| 153 |
"should be set to NULL. If the item is found in the tree, then B<tsearch>() " |
| 154 |
"returns a pointer to the corresponding tree node. (In other words, " |
| 155 |
"B<tsearch>() returns a pointer to a pointer to the data item.) If the item " |
| 156 |
"is not found, then B<tsearch>() adds it, and returns a pointer to the " |
| 157 |
"corresponding tree node." |
| 158 |
msgstr "" |
| 159 |
|
| 160 |
#. type: Plain text |
| 161 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 162 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 163 |
msgid "" |
| 164 |
"B<tfind>() is like B<tsearch>(), except that if the item is not found, then " |
| 165 |
"B<tfind>() returns NULL." |
| 166 |
msgstr "" |
| 167 |
|
| 168 |
#. type: Plain text |
| 169 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 170 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 171 |
msgid "" |
| 172 |
"B<tdelete>() deletes an item from the tree. Its arguments are the same as " |
| 173 |
"for B<tsearch>()." |
| 174 |
msgstr "" |
| 175 |
|
| 176 |
#. type: Plain text |
| 177 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 178 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 179 |
msgid "" |
| 180 |
"B<twalk>() performs depth-first, left-to-right traversal of a binary tree. " |
| 181 |
"I<root> points to the starting node for the traversal. If that node is not " |
| 182 |
"the root, then only part of the tree will be visited. B<twalk>() calls the " |
| 183 |
"user function I<action> each time a node is visited (that is, three times " |
| 184 |
"for an internal node, and once for a leaf). I<action>, in turn, takes three " |
| 185 |
"arguments. The first argument is a pointer to the node being visited. The " |
| 186 |
"structure of the node is unspecified, but it is possible to cast the pointer " |
| 187 |
"to a pointer-to-pointer-to-element in order to access the element stored " |
| 188 |
"within the node. The application must not modify the structure pointed to " |
| 189 |
"by this argument. The second argument is an integer which takes one of the " |
| 190 |
"values B<preorder>, B<postorder>, or B<endorder> depending on whether this " |
| 191 |
"is the first, second, or third visit to the internal node, or the value " |
| 192 |
"B<leaf> if this is the single visit to a leaf node. (These symbols are " |
| 193 |
"defined in I<E<lt>search.hE<gt>>.) The third argument is the depth of the " |
| 194 |
"node; the root node has depth zero." |
| 195 |
msgstr "" |
| 196 |
|
| 197 |
#. type: Plain text |
| 198 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 199 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 200 |
msgid "" |
| 201 |
"(More commonly, B<preorder>, B<postorder>, and B<endorder> are known as " |
| 202 |
"B<preorder>, B<inorder>, and B<postorder>: before visiting the children, " |
| 203 |
"after the first and before the second, and after visiting the children. " |
| 204 |
"Thus, the choice of name B<post\\%order> is rather confusing.)" |
| 205 |
msgstr "" |
| 206 |
|
| 207 |
#. type: Plain text |
| 208 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 209 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 210 |
msgid "" |
| 211 |
"B<twalk_r>() is similar to B<twalk>(), but instead of the I<depth> " |
| 212 |
"argument, the I<closure> argument pointer is passed to each invocation of " |
| 213 |
"the action callback, unchanged. This pointer can be used to pass " |
| 214 |
"information to and from the callback function in a thread-safe fashion, " |
| 215 |
"without resorting to global variables." |
| 216 |
msgstr "" |
| 217 |
|
| 218 |
#. type: Plain text |
| 219 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 220 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 221 |
msgid "" |
| 222 |
"B<tdestroy>() removes the whole tree pointed to by I<root>, freeing all " |
| 223 |
"resources allocated by the B<tsearch>() function. For the data in each " |
| 224 |
"tree node the function I<free_node> is called. The pointer to the data is " |
| 225 |
"passed as the argument to the function. If no such work is necessary, " |
| 226 |
"I<free_node> must point to a function doing nothing." |
| 227 |
msgstr "" |
| 228 |
|
| 229 |
#. type: SH |
| 230 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 231 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 232 |
#, no-wrap |
| 233 |
msgid "RETURN VALUE" |
| 234 |
msgstr "" |
| 235 |
|
| 236 |
#. type: Plain text |
| 237 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 238 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 239 |
msgid "" |
| 240 |
"B<tsearch>() returns a pointer to a matching node in the tree, or to the " |
| 241 |
"newly added node, or NULL if there was insufficient memory to add the item. " |
| 242 |
"B<tfind>() returns a pointer to the node, or NULL if no match is found. If " |
| 243 |
"there are multiple items that match the key, the item whose node is returned " |
| 244 |
"is unspecified." |
| 245 |
msgstr "" |
| 246 |
|
| 247 |
#. type: Plain text |
| 248 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 249 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 250 |
msgid "" |
| 251 |
"B<tdelete>() returns a pointer to the parent of the node deleted, or NULL " |
| 252 |
"if the item was not found. If the deleted node was the root node, " |
| 253 |
"B<tdelete>() returns a dangling pointer that must not be accessed." |
| 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 |
"B<tsearch>(), B<tfind>(), and B<tdelete>() also return NULL if I<rootp> was " |
| 261 |
"NULL on entry." |
| 262 |
msgstr "" |
| 263 |
|
| 264 |
#. type: SH |
| 265 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 266 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 267 |
#, no-wrap |
| 268 |
msgid "ATTRIBUTES" |
| 269 |
msgstr "" |
| 270 |
|
| 271 |
#. type: Plain text |
| 272 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 273 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 274 |
msgid "" |
| 275 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 276 |
msgstr "" |
| 277 |
|
| 278 |
#. type: tbl table |
| 279 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 280 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 281 |
#, no-wrap |
| 282 |
msgid "Interface" |
| 283 |
msgstr "" |
| 284 |
|
| 285 |
#. type: tbl table |
| 286 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 287 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 288 |
#, no-wrap |
| 289 |
msgid "Attribute" |
| 290 |
msgstr "" |
| 291 |
|
| 292 |
#. type: tbl table |
| 293 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 294 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 295 |
#, no-wrap |
| 296 |
msgid "Value" |
| 297 |
msgstr "" |
| 298 |
|
| 299 |
#. type: tbl table |
| 300 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 301 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 302 |
#, no-wrap |
| 303 |
msgid ".na\n" |
| 304 |
msgstr "" |
| 305 |
|
| 306 |
#. type: tbl table |
| 307 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 308 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 309 |
#, no-wrap |
| 310 |
msgid ".nh\n" |
| 311 |
msgstr "" |
| 312 |
|
| 313 |
#. type: tbl table |
| 314 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 315 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 316 |
#, no-wrap |
| 317 |
msgid "" |
| 318 |
"B<tsearch>(),\n" |
| 319 |
"B<tfind>(),\n" |
| 320 |
"B<tdelete>()" |
| 321 |
msgstr "" |
| 322 |
|
| 323 |
#. type: tbl table |
| 324 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 325 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 326 |
#, no-wrap |
| 327 |
msgid "Thread safety" |
| 328 |
msgstr "" |
| 329 |
|
| 330 |
#. type: tbl table |
| 331 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 332 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 333 |
#, no-wrap |
| 334 |
msgid "MT-Safe race:rootp" |
| 335 |
msgstr "" |
| 336 |
|
| 337 |
#. type: TQ |
| 338 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 339 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 340 |
#, no-wrap |
| 341 |
msgid "B<twalk>()" |
| 342 |
msgstr "" |
| 343 |
|
| 344 |
#. type: tbl table |
| 345 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 346 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 347 |
#, no-wrap |
| 348 |
msgid "MT-Safe race:root" |
| 349 |
msgstr "" |
| 350 |
|
| 351 |
#. type: TP |
| 352 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 353 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 354 |
#, no-wrap |
| 355 |
msgid "B<twalk_r>()" |
| 356 |
msgstr "" |
| 357 |
|
| 358 |
#. type: TP |
| 359 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 360 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 361 |
#, no-wrap |
| 362 |
msgid "B<tdestroy>()" |
| 363 |
msgstr "" |
| 364 |
|
| 365 |
#. type: tbl table |
| 366 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 367 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 368 |
#, no-wrap |
| 369 |
msgid "MT-Safe" |
| 370 |
msgstr "" |
| 371 |
|
| 372 |
#. type: SH |
| 373 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 374 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 375 |
#, no-wrap |
| 376 |
msgid "STANDARDS" |
| 377 |
msgstr "" |
| 378 |
|
| 379 |
#. type: TP |
| 380 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 381 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 382 |
#, no-wrap |
| 383 |
msgid "B<tsearch>()" |
| 384 |
msgstr "" |
| 385 |
|
| 386 |
#. type: TQ |
| 387 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 388 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 389 |
#, no-wrap |
| 390 |
msgid "B<tfind>()" |
| 391 |
msgstr "" |
| 392 |
|
| 393 |
#. type: TQ |
| 394 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 395 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 396 |
#, no-wrap |
| 397 |
msgid "B<tdelete>()" |
| 398 |
msgstr "" |
| 399 |
|
| 400 |
#. type: Plain text |
| 401 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 402 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 403 |
msgid "POSIX.1-2008." |
| 404 |
msgstr "" |
| 405 |
|
| 406 |
#. type: Plain text |
| 407 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 408 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 409 |
msgid "GNU." |
| 410 |
msgstr "" |
| 411 |
|
| 412 |
#. type: SH |
| 413 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 414 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 415 |
#, no-wrap |
| 416 |
msgid "HISTORY" |
| 417 |
msgstr "" |
| 418 |
|
| 419 |
#. type: Plain text |
| 420 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 421 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 422 |
msgid "POSIX.1-2001, POSIX.1-2008, SVr4." |
| 423 |
msgstr "" |
| 424 |
|
| 425 |
#. type: Plain text |
| 426 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 427 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 428 |
msgid "glibc 2.30." |
| 429 |
msgstr "" |
| 430 |
|
| 431 |
#. type: SH |
| 432 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 433 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 434 |
#, no-wrap |
| 435 |
msgid "NOTES" |
| 436 |
msgstr "" |
| 437 |
|
| 438 |
#. type: Plain text |
| 439 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 440 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 441 |
msgid "" |
| 442 |
"B<twalk>() takes a pointer to the root, while the other functions take a " |
| 443 |
"pointer to a variable which points to the root." |
| 444 |
msgstr "" |
| 445 |
|
| 446 |
#. type: Plain text |
| 447 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 448 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 449 |
msgid "" |
| 450 |
"B<tdelete>() frees the memory required for the node in the tree. The user " |
| 451 |
"is responsible for freeing the memory for the corresponding data." |
| 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 "" |
| 458 |
"The example program depends on the fact that B<twalk>() makes no further " |
| 459 |
"reference to a node after calling the user function with argument " |
| 460 |
"\"endorder\" or \"leaf\". This works with the GNU library implementation, " |
| 461 |
"but is not in the System V documentation." |
| 462 |
msgstr "" |
| 463 |
|
| 464 |
#. type: SH |
| 465 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 466 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 467 |
#, no-wrap |
| 468 |
msgid "EXAMPLES" |
| 469 |
msgstr "" |
| 470 |
|
| 471 |
#. type: Plain text |
| 472 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 473 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 474 |
msgid "" |
| 475 |
"The following program inserts twelve random numbers into a binary tree, " |
| 476 |
"where duplicate numbers are collapsed, then prints the numbers in order." |
| 477 |
msgstr "" |
| 478 |
|
| 479 |
#. type: Plain text |
| 480 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 481 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 482 |
#, no-wrap |
| 483 |
msgid "" |
| 484 |
"#define _GNU_SOURCE /* Expose declaration of tdestroy() */\n" |
| 485 |
"#include E<lt>search.hE<gt>\n" |
| 486 |
"#include E<lt>stddef.hE<gt>\n" |
| 487 |
"#include E<lt>stdio.hE<gt>\n" |
| 488 |
"#include E<lt>stdlib.hE<gt>\n" |
| 489 |
"#include E<lt>time.hE<gt>\n" |
| 490 |
"\\&\n" |
| 491 |
"static void *root = NULL;\n" |
| 492 |
"\\&\n" |
| 493 |
"static void *\n" |
| 494 |
"xmalloc(size_t n)\n" |
| 495 |
"{\n" |
| 496 |
" void *p;\n" |
| 497 |
"\\&\n" |
| 498 |
" p = malloc(n);\n" |
| 499 |
" if (p)\n" |
| 500 |
" return p;\n" |
| 501 |
" fprintf(stderr, \"insufficient memory\\[rs]n\");\n" |
| 502 |
" exit(EXIT_FAILURE);\n" |
| 503 |
"}\n" |
| 504 |
"\\&\n" |
| 505 |
"static int\n" |
| 506 |
"compare(const void *pa, const void *pb)\n" |
| 507 |
"{\n" |
| 508 |
" if (*(int *) pa E<lt> *(int *) pb)\n" |
| 509 |
" return -1;\n" |
| 510 |
" if (*(int *) pa E<gt> *(int *) pb)\n" |
| 511 |
" return 1;\n" |
| 512 |
" return 0;\n" |
| 513 |
"}\n" |
| 514 |
"\\&\n" |
| 515 |
"static void\n" |
| 516 |
"action(const void *nodep, VISIT which, int depth)\n" |
| 517 |
"{\n" |
| 518 |
" int *datap;\n" |
| 519 |
"\\&\n" |
| 520 |
" switch (which) {\n" |
| 521 |
" case preorder:\n" |
| 522 |
" break;\n" |
| 523 |
" case postorder:\n" |
| 524 |
" datap = *(int **) nodep;\n" |
| 525 |
" printf(\"%6d\\[rs]n\", *datap);\n" |
| 526 |
" break;\n" |
| 527 |
" case endorder:\n" |
| 528 |
" break;\n" |
| 529 |
" case leaf:\n" |
| 530 |
" datap = *(int **) nodep;\n" |
| 531 |
" printf(\"%6d\\[rs]n\", *datap);\n" |
| 532 |
" break;\n" |
| 533 |
" }\n" |
| 534 |
"}\n" |
| 535 |
"\\&\n" |
| 536 |
"int\n" |
| 537 |
"main(void)\n" |
| 538 |
"{\n" |
| 539 |
" int *ptr;\n" |
| 540 |
" int **val;\n" |
| 541 |
"\\&\n" |
| 542 |
" srand(time(NULL));\n" |
| 543 |
" for (unsigned int i = 0; i E<lt> 12; i++) {\n" |
| 544 |
" ptr = xmalloc(sizeof(*ptr));\n" |
| 545 |
" *ptr = rand() & 0xff;\n" |
| 546 |
" val = tsearch(ptr, &root, compare);\n" |
| 547 |
" if (val == NULL)\n" |
| 548 |
" exit(EXIT_FAILURE);\n" |
| 549 |
" if (*val != ptr)\n" |
| 550 |
" free(ptr);\n" |
| 551 |
" }\n" |
| 552 |
" twalk(root, action);\n" |
| 553 |
" tdestroy(root, free);\n" |
| 554 |
" exit(EXIT_SUCCESS);\n" |
| 555 |
"}\n" |
| 556 |
msgstr "" |
| 557 |
|
| 558 |
#. SRC END |
| 559 |
#. type: SH |
| 560 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 561 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 562 |
#, no-wrap |
| 563 |
msgid "SEE ALSO" |
| 564 |
msgstr "" |
| 565 |
|
| 566 |
#. type: Plain text |
| 567 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 568 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 569 |
msgid "B<bsearch>(3), B<hsearch>(3), B<lsearch>(3), B<qsort>(3)" |
| 570 |
msgstr "" |
| 571 |
|
| 572 |
#. type: TH |
| 573 |
#: debian-trixie |
| 574 |
#, no-wrap |
| 575 |
msgid "2024-06-15" |
| 576 |
msgstr "" |
| 577 |
|
| 578 |
#. type: TH |
| 579 |
#: debian-trixie |
| 580 |
#, no-wrap |
| 581 |
msgid "Linux man-pages 6.9.1" |
| 582 |
msgstr "" |
| 583 |
|
| 584 |
#. type: Plain text |
| 585 |
#: debian-trixie |
| 586 |
msgid "Standard C library (I<libc>, I<-lc>)" |
| 587 |
msgstr "" |
| 588 |
|
| 589 |
#. type: Plain text |
| 590 |
#: debian-trixie |
| 591 |
#, no-wrap |
| 592 |
msgid "" |
| 593 |
"B<void *tsearch(const void *>I<key>B<, void **>I<rootp>B<,>\n" |
| 594 |
"B< int (*>I<compar>B<)(const void *, const void *));>\n" |
| 595 |
"B<void *tfind(const void *>I<key>B<, void *const *>I<rootp>B<,>\n" |
| 596 |
"B< int (*>I<compar>B<)(const void *, const void *));>\n" |
| 597 |
"B<void *tdelete(const void *restrict >I<key>B<, void **restrict >I<rootp>B<,>\n" |
| 598 |
"B< int (*>I<compar>B<)(const void *, const void *));>\n" |
| 599 |
"B<void twalk(const void *>I<root>B<,>\n" |
| 600 |
"B< void (*>I<action>B<)(const void *>I<nodep>B<, VISIT >I<which>B<,>\n" |
| 601 |
"B< int >I<depth>B<));>\n" |
| 602 |
msgstr "" |
| 603 |
|
| 604 |
#. type: Plain text |
| 605 |
#: debian-trixie |
| 606 |
#, no-wrap |
| 607 |
msgid "" |
| 608 |
"B<void twalk_r(const void *>I<root>B<,>\n" |
| 609 |
"B< void (*>I<action>B<)(const void *>I<nodep>B<, VISIT >I<which>B<,>\n" |
| 610 |
"B< void *>I<closure>B<),>\n" |
| 611 |
"B< void *>I<closure>B<);>\n" |
| 612 |
"B<void tdestroy(void *>I<root>B<, void (*>I<free_node>B<)(void *>I<nodep>B<));>\n" |
| 613 |
msgstr "" |
| 614 |
|
| 615 |
#. type: TH |
| 616 |
#: fedora-44 fedora-rawhide |
| 617 |
#, no-wrap |
| 618 |
msgid "2024-12-13" |
| 619 |
msgstr "" |
| 620 |
|
| 621 |
#. type: TH |
| 622 |
#: fedora-44 fedora-rawhide |
| 623 |
#, no-wrap |
| 624 |
msgid "Linux man-pages 6.13" |
| 625 |
msgstr "" |
| 626 |
|
| 627 |
#. type: TH |
| 628 |
#: mageia-cauldron |
| 629 |
#, no-wrap |
| 630 |
msgid "Linux man-pages 6.17" |
| 631 |
msgstr "" |
| 632 |
|
| 633 |
#. type: TH |
| 634 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 635 |
#, no-wrap |
| 636 |
msgid "Linux man-pages (unreleased)" |
| 637 |
msgstr "" |