.\" -*- coding: UTF-8 -*- '\" t .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 18:00:10 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Mon Jan 20 12:04:18 1997 by Andries Brouwer (aeb@cwi.nl) .\" Modified Tue Jan 23 20:23:07 2001 by Andries Brouwer (aeb@cwi.nl) .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH strsep 3 "23 juillet 2024" "Pages du manuel de Linux 6.12" .SH NOM strsep \- Extraction de séquence d'une chaîne .SH BIBLIOTHÈQUE Bibliothèque C standard (\fIlibc\fP,\ \fI\-lc\fP) .SH SYNOPSIS .nf \fB#include \fP .P \fBchar *strsep(char **restrict \fP\fIstringp\fP\fB, const char *restrict \fP\fIdelim\fP\fB);\fP .fi .P .RS -4 Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7)) : .RE .P \fBstrsep\fP() : .nf Depuis la glibc 2.19 : _DEFAULT_SOURCE glibc 2.19 et antérieures : _BSD_SOURCE .fi .SH DESCRIPTION If \fI*stringp\fP is NULL, the \fBstrsep\fP() function returns NULL and does nothing else. Otherwise, this function finds the first token in the string \fI*stringp\fP that is delimited by one of the bytes in the string \fIdelim\fP. This token is terminated by overwriting the delimiter with a null byte (\[aq]\[rs]0\[aq]), and \fI*stringp\fP is updated to point past the token. In case no delimiter was found, the token is taken to be the entire string \fI*stringp\fP, and \fI*stringp\fP is made NULL. .SH "VALEUR RENVOYÉE" La fonction \fBstrsep\fP() renvoie un pointeur sur la séquence, c'est\-à\-dire la valeur originelle de \fI*stringp\fP. .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 \fBstrsep\fP() T} Sécurité des threads MT\-Safe .TE .SH STANDARDS BSD. .SH HISTORIQUE 4.4BSD. .P The \fBstrsep\fP() function was introduced as a replacement for \fBstrtok\fP(3), since the latter cannot handle empty fields. .SH CAVEATS Faites attention quand vous utilisez cette fonction. Si vous l'utilisez, prenez note des informations suivantes\ : .IP \- 3 Cette fonction modifie son premier argument. .IP \- Cette fonction ne peut pas être utilisée avec des chaînes constantes. .IP \- L’identité du caractère délimiteur est perdue. .SH EXEMPLES Le programme ci\-dessous est un portage d'un programme trouvé dans \fBstrtok\fP(3), qui néanmoins n'adandonne pas délimiteurs multiples ou de séquences vides : .P .in +4n .EX $\fB ./a.out \[aq]a/bbb///cc;xxx:yyy:\[aq] \[aq]:;\[aq] \[aq]/\[aq]\fP 1: a/bbb///cc \-\-> a \-\-> bbb \-\-> \-\-> \-\-> cc 2: xxx \-\-> xxx 3: yyy \-\-> yyy 4: \-\-> .EE .in .SS "Source du programme" .\" SRC BEGIN (strsep.c) \& .EX #include #include #include \& int main(int argc, char *argv[]) { char *token, *subtoken; \& if (argc != 4) { fprintf(stderr, "Usage: %s string delim subdelim\[rs]n", argv[0]); exit(EXIT_FAILURE); } \& for (unsigned int j = 1; (token = strsep(&argv[1], argv[2])); j++) { printf("%u: %s\[rs]n", j, token); \& while ((subtoken = strsep(&token, argv[3]))) printf("\[rs]t \-\-> %s\[rs]n", subtoken); } \& exit(EXIT_SUCCESS); } .EE .\" SRC END .SH "VOIR AUSSI" \fBmemchr\fP(3), \fBstrchr\fP(3), \fBstring\fP(3), \fBstrpbrk\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\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 , Frédéric Hantrais 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 .