File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,8 @@ libshadow_la_SOURCES = \
186
186
string/strdup/xstrndup.h \
187
187
string/strftime.c \
188
188
string/strftime.h \
189
+ string/strtok/stpsep.c \
190
+ string/strtok/stpsep.h \
189
191
strtoday.c \
190
192
sub.c \
191
193
subordinateio.h \
Original file line number Diff line number Diff line change
1
+ // SPDX-FileCopyrightText: 2024, Alejandro Colomar <[email protected] >
2
+ // SPDX-License-Identifier: BSD-3-Clause
3
+
4
+
5
+ #include <config.h>
6
+
7
+ #include "string/strtok/stpsep.h"
8
+
9
+
10
+ extern inline char * stpsep (char * s , const char * delim );
Original file line number Diff line number Diff line change
1
+ // SPDX-FileCopyrightText: 2024, Alejandro Colomar <[email protected] >
2
+ // SPDX-License-Identifier: BSD-3-Clause
3
+
4
+
5
+ #ifndef SHADOW_INCLUDE_LIB_STRING_STRTOK_STPSEP_H_
6
+ #define SHADOW_INCLUDE_LIB_STRING_STRTOK_STPSEP_H_
7
+
8
+
9
+ #include <config.h>
10
+
11
+ #include <string.h>
12
+
13
+ #include "attr.h"
14
+
15
+
16
+ ATTR_STRING (1 ) ATTR_STRING (2 )
17
+ inline char * stpsep (char * s , const char * delim );
18
+
19
+
20
+ // Similar to strsep(3),
21
+ // but return the next token, and don't update the input pointer.
22
+ // Similar to strtok(3),
23
+ // but don't store a state, and don't skip empty fields.
24
+ inline char *
25
+ stpsep (char * s , const char * delim )
26
+ {
27
+ strsep (& s , delim );
28
+
29
+ return s ;
30
+ }
31
+
32
+
33
+ #endif // include guard
You can’t perform that action at this time.
0 commit comments