.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1995, James R. Van Zandt .\" Copyright, the authors of the Linux man-pages project .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH lsearch 3 "8 février 2026" "Pages du manuel de Linux 6.18" .SH NOM lsearch, lfind \- Recherche linéaire dans un tableau .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBvoid *lfind(\fPsize_t *n, size_t size; \fB const void \fP\fIkey\fP\fB[\fP\fIsize\fP\fB],\fP \fB const void \fP\fIbase\fP\fB[*\fP\fIn\fP\fB * \fP\fIsize\fP\fB],\fP \fB size_t *\fP\fIn\fP\fB, size_t \fP\fIsize\fP\fB,\fP \fB typeof(int (const void [\fP\fIsize\fP\fB], const void [\fP\fIsize\fP\fB]))\fP \fB *\fP\fIcompar\fP\fB);\fP \fBvoid *lsearch(\fPsize_t *n, size_t size; \fB const void \fP\fIkey\fP\fB[\fP\fIsize\fP\fB],\fP \fB void \fP\fIbase\fP\fB[*\fP\fIn\fP\fB * \fP\fIsize\fP\fB],\fP \fB size_t *\fP\fIn\fP\fB, size_t \fP\fIsize\fP\fB,\fP \fB typeof(int (const void [\fP\fIsize\fP\fB], const void [\fP\fIsize\fP\fB]))\fP \fB *\fP\fIcompar\fP\fB);\fP .fi .SH DESCRIPTION \fBlfind\fP() and \fBlsearch\fP() perform a linear search for \fIkey\fP in the array \fIbase\fP which has \fI*n\fP elements of \fIsize\fP bytes each. The comparison function referenced by \fIcompar\fP is expected to have two arguments which point to the \fIkey\fP object and to an array member, in that order, and which returns zero if the \fIkey\fP object matches the array member, and nonzero otherwise. .P If \fBlsearch\fP() does not find a matching element, then the \fIkey\fP object is inserted at the end of the table, and \fI*n\fP is incremented. In particular, one should know that a matching element exists, or that more room is available. .SH "VALEUR RENVOYÉE" \fBlfind\fP() renvoie un pointeur sur l'élément du tableau correspondant, ou NULL si aucune correspondance n'est trouvée. \fBlsearch\fP() renvoie un pointeur sur un élément correspondant du tableau, ou sinon sur le nouvel élément ajouté. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbx lb lb l l l. Interface Attribut Valeur T{ .na .nh \fBlfind\fP(), \fBlsearch\fP() T} Sécurité des threads MT\-Safe .TE .SH NORMES POSIX.1\-2008. .SH HISTORIQUE POSIX.1\-2001, SVr4, 4.3BSD. libc\-4.6.27. .SH BOGUES L'appellation est malheureuse. .SH "VOIR AUSSI" \fBbsearch\fP(3), \fBhsearch\fP(3), \fBtsearch\fP(3) .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot , Jean-Baptiste Holcroft et Grégoire Scano . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .