lsearch(3) | Library Functions Manual | lsearch(3) |
NOM
lsearch, lfind - Recherche linéaire dans un tableau
BIBLIOTHÈQUE
Bibliothèque C standard (libc, -lc)
SYNOPSIS
#include <search.h>
void *lfind(const void key[.size], const void base[*.n * .size], size_t *n, size_t size, typeof(int (const void [.size], const void [.size])) *compar); void *lsearch(const void key[.size], void base[*.n * .size], size_t *n, size_t size, typeof(int (const void [.size], const void [.size])) *compar);
DESCRIPTION
lfind() and lsearch() perform a linear search for key in the array base which has *n elements of size bytes each. The comparison function referenced by compar is expected to have two arguments which point to the key object and to an array member, in that order, and which returns zero if the key object matches the array member, and nonzero otherwise.
If lsearch() does not find a matching element, then the key object is inserted at the end of the table, and *n is incremented. In particular, one should know that a matching element exists, or that more room is available.
VALEUR RENVOYÉE
lfind() renvoie un pointeur sur l'élément du tableau correspondant, ou NULL si aucune correspondance n'est trouvée. lsearch() renvoie un pointeur sur un élément correspondant du tableau, ou sinon sur le nouvel élément ajouté.
ATTRIBUTS
Pour une explication des termes utilisés dans cette section, consulter attributes(7).
Interface | Attribut | Valeur |
lfind(), lsearch() | Sécurité des threads | MT-Safe |
STANDARDS
POSIX.1-2008.
HISTORIQUE
POSIX.1-2001, SVr4, 4.3BSD. libc-4.6.27.
BOGUES
L'appellation est malheureuse.
VOIR AUSSI
TRADUCTION
La traduction française de cette page de manuel a été créée par Christophe Blaess https://www.blaess.fr/christophe/, Stéphan Rafin <stephan.rafin@laposte.net>, Thierry Vignaud <tvignaud@mandriva.com>, François Micaux, Alain Portal <aportal@univ-montp2.fr>, Jean-Philippe Guérard <fevrier@tigreraye.org>, Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>, Julien Cristau <jcristau@debian.org>, Thomas Huriaux <thomas.huriaux@gmail.com>, Nicolas François <nicolas.francois@centraliens.net>, Florentin Duneau <fduneau@gmail.com>, Simon Paillard <simon.paillard@resel.enst-bretagne.fr>, Denis Barbier <barbier@debian.org>, David Prévot <david@tilapin.org>, Jean-Baptiste Holcroft <jean-baptiste@holcroft.fr> et Grégoire Scano <gregoire.scano@malloc.fr>
Cette traduction est une documentation libre ; veuillez vous reporter à la GNU General Public License version 3 concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE.
Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à debian-l10n-french@lists.debian.org.
13 décembre 2024 | Pages du manuel de Linux 6.12 |