2006-04-14 Marcus Brinkmann <marcus@g10code.de>
[gnupg.git] / gl / strsep.h
blobca28a2ffef188db140c8937a22ac75495d4577d2
1 /* Copyright (C) 2004 Free Software Foundation, Inc.
3 Written by Yoann Vandoorselaere <yoann@prelude-ids.org>.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
19 #ifndef GNULIB_STRSEP_H_
20 #define GNULIB_STRSEP_H_
22 #if HAVE_STRSEP
25 * Get strsep() declaration.
27 #include <string.h>
29 #else
31 /* Searches the next delimiter (char listed in DELIM) starting at *STRINGP.
32 If one is found, it is overwritten with a NUL, and *STRINGP is advanced
33 to point to the next char after it. Otherwise, *STRINGP is set to NULL.
34 If *STRINGP was already NULL, nothing happens.
35 Returns the old value of *STRINGP.
37 This is a variant of strtok() that is multithread-safe and supports
38 empty fields.
40 Caveat: It modifies the original string.
41 Caveat: These functions cannot be used on constant strings.
42 Caveat: The identity of the delimiting character is lost.
43 Caveat: It doesn't work with multibyte strings unless all of the delimiter
44 characters are ASCII characters < 0x30.
46 See also strtok_r(). */
48 extern char *strsep (char **stringp, const char *delim);
50 #endif
52 #endif /* GNULIB_STRSEP_H_ */