1 /**
2  * Compatibility layer for string operations on different platforms.
3  */
4 
5 #ifndef __helper__string_h__
6 #define __helper__string_h__
7 
8 #ifndef _GNU_SOURCE
9 #  define _GNU_SOURCE
10 #endif
11 
12 #include <gammu-config.h>
13 
14 #include <string.h>
15 
16 #ifdef HAVE_STRINGS_H
17 #include <strings.h>
18 #endif
19 
20 
21 #ifndef HAVE_STRCASESTR
22 /**
23  * Case insensitive substring location, libc compatibility.
24  *
25  * \ingroup Unicode
26  */
27 extern char *strcasestr(const char *s, const char *find);
28 #endif
29 
30 #ifndef HAVE_STRCHRNUL
31 extern char *strchrnul(char *s, int find);
32 #endif
33 
34 #ifndef HAVE_STRNCASECMP
35 #ifdef HAVE_STRNICMP
36 #define strncasecmp _strnicmp
37 #else
38 # define INTERNAL_STRNCASECMP
39 extern int strncasecmp (const char *s1, const char *s2, size_t n);
40 #endif
41 #endif
42 
43 #ifndef HAVE_STRCASECMP
44 #ifdef HAVE_STRICMP
45 #define strcasecmp _stricmp
46 #else
47 # define INTERNAL_STRCASECMP
48 /**
49  * Case insensitive string comparing, libc compatibility.
50  *
51  * \ingroup Unicode
52  */
53 extern int strcasecmp (const char *s1, const char *s2);
54 #endif
55 #endif
56 
57 #ifndef HAVE_TOWLOWER
58 wchar_t		towlower			(wchar_t c);
59 #endif
60 #endif
61