ast2firm: Factorise code to convert a value to its storage type.
[cparser] / adt / strutil.h
1 #ifndef STRUTIL_H
2 #define STRUTIL_H
3
4 #include <stdbool.h>
5 #include <string.h>
6
7 static inline bool streq(char const* a, char const* b)
8 {
9         return strcmp(a, b) == 0;
10 }
11
12 static inline char const* strstart(char const* str, char const* start)
13 {
14         do {
15                 if (*start == '\0')
16                         return str;
17         } while (*str++ == *start++);
18         return NULL;
19 }
20
21 /**
22  * Test two strings for equality, ignoring double underscores on the second.
23  */
24 bool streq_underscore(const char *s1, const char *s2);
25
26 #endif