error.c, md5.c, regex.c: Use '#if USE_UNLOCKED_IO' instead of
[gnulib.git] / lib / strsep.h
1 /* Copyright (C) 2004 Free Software Foundation, Inc.
2  * Written by Yoann Vandoorselaere <yoann@prelude-ids.org>
3  *
4  * The file is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This file is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this file; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA.
18  */
19
20 #ifndef GNULIB_STRSEP_H_
21 #define GNULIB_STRSEP_H_
22
23 /*
24  * Get strsep, if available.
25  */
26 #include <string.h>
27
28 /* Searches the next delimiter (char listed in DELIM) starting at *STRINGP.
29    If one is found, it is overwritten with a NUL, and *STRINGP is advanced
30    to point to the next char after it.  Otherwise, *STRINGP is set to NULL.
31    If *STRINGP was already NULL, nothing happens.
32    Returns the old value of *STRINGP.
33
34    This is a variant of strtok() that is multithread-safe and supports
35    empty fields.
36
37    Caveat: It modifies the original string.
38    Caveat: It doesn't work with multibyte strings unless all of the delimiter
39            characters are ASCII characters < 0x30.  */
40
41 extern char *strsep (char **stringp, const char *delim);
42
43 #endif /* GNULIB_STRSEP_H_ */