aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libc_compat/string.h
blob: ad74d9a6300f31b6a84e6ac3261e71c578bbf95c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include <stddef.h>
#include <ctype.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

#if !defined(__FreeBSD__) && !defined(__APPLE__)
size_t strlcpy(char* dst, const char* src, size_t len);
size_t strlcat(char* dst, const char* src, size_t len);
#endif

#if (!defined(__linux__) && !defined(__FreeBSD__) && !defined(__APPLE__)) || (defined(__ANDROID__) && __ANDROID_API__ < 21)
char* stpcpy(char* dst, const char* src);
#endif

#if !defined(_MSC_VER)

#define stricmp strcasecmp
#define strnicmp strncasecmp

char* strlwr(char*);
char* strupr(char*);

#else // _MSC_VER

#define strcasecmp stricmp
#define strncasecmp strnicmp

char* strcasestr(const char* s1, const char* s2);
char* strsep(char** stringp, const char* delim);

#endif // _MSC_VER

#if defined(_MSC_VER) || defined(__APPLE__)
void* memrchr(const void* s, int c, size_t n);
#endif

#ifdef __cplusplus
} //extern "C"
#endif