File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,8 @@ libshadow_la_SOURCES = \
204204 string/strchr/strnul.h \
205205 string/strchr/strrspn.c \
206206 string/strchr/strrspn.h \
207+ string/strcmp/strcaseeq.c \
208+ string/strcmp/strcaseeq.h \
207209 string/strcmp/streq.c \
208210 string/strcmp/streq.h \
209211 string/strcpy/stpecpy.c \
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 <stdbool.h>
8+
9+ #include "string/strcmp/strcaseeq.h"
10+
11+
12+ extern inline bool strcaseeq (const char * s1 , const char * s2 );
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_STRCMP_STRCASEEQ_H_
6+ #define SHADOW_INCLUDE_LIB_STRING_STRCMP_STRCASEEQ_H_
7+
8+
9+ #include <config.h>
10+
11+ #include <stdbool.h>
12+ #include <strings.h>
13+
14+ #include "attr.h"
15+
16+
17+ ATTR_STRING (1 )
18+ ATTR_STRING (2 )
19+ inline bool strcaseeq (const char * s1 , const char * s2 );
20+
21+
22+ // streq(), but case-insensitive.
23+ inline bool
24+ strcaseeq (const char * s1 , const char * s2 )
25+ {
26+ return strcasecmp (s1 , s2 ) == 0 ;
27+ }
28+
29+
30+ #endif // include guard
You can’t perform that action at this time.
0 commit comments