Commit b42d25ed authored by Sergey Lyubka's avatar Sergey Lyubka

NOT exporting string functions

parent 39215f69
...@@ -588,7 +588,7 @@ const char *mg_version(void) { ...@@ -588,7 +588,7 @@ const char *mg_version(void) {
return MONGOOSE_VERSION; return MONGOOSE_VERSION;
} }
void mg_strlcpy(register char *dst, register const char *src, size_t n) { static void mg_strlcpy(register char *dst, register const char *src, size_t n) {
for (; *src != '\0' && n > 1; n--) { for (; *src != '\0' && n > 1; n--) {
*dst++ = *src++; *dst++ = *src++;
} }
...@@ -599,7 +599,7 @@ static int lowercase(const char *s) { ...@@ -599,7 +599,7 @@ static int lowercase(const char *s) {
return tolower(* (const unsigned char *) s); return tolower(* (const unsigned char *) s);
} }
int mg_strncasecmp(const char *s1, const char *s2, size_t len) { static int mg_strncasecmp(const char *s1, const char *s2, size_t len) {
int diff = 0; int diff = 0;
if (len > 0) if (len > 0)
...@@ -610,7 +610,7 @@ int mg_strncasecmp(const char *s1, const char *s2, size_t len) { ...@@ -610,7 +610,7 @@ int mg_strncasecmp(const char *s1, const char *s2, size_t len) {
return diff; return diff;
} }
int mg_strcasecmp(const char *s1, const char *s2) { static int mg_strcasecmp(const char *s1, const char *s2) {
int diff; int diff;
do { do {
...@@ -620,7 +620,7 @@ int mg_strcasecmp(const char *s1, const char *s2) { ...@@ -620,7 +620,7 @@ int mg_strcasecmp(const char *s1, const char *s2) {
return diff; return diff;
} }
char * mg_strndup(const char *ptr, size_t len) { static char * mg_strndup(const char *ptr, size_t len) {
char *p; char *p;
if ((p = (char *) malloc(len + 1)) != NULL) { if ((p = (char *) malloc(len + 1)) != NULL) {
...@@ -630,7 +630,7 @@ char * mg_strndup(const char *ptr, size_t len) { ...@@ -630,7 +630,7 @@ char * mg_strndup(const char *ptr, size_t len) {
return p; return p;
} }
char * mg_strdup(const char *str) { static char * mg_strdup(const char *str) {
return mg_strndup(str, strlen(str)); return mg_strndup(str, strlen(str));
} }
......
...@@ -255,14 +255,6 @@ int mg_start_thread(mg_thread_func_t f, void *p); ...@@ -255,14 +255,6 @@ int mg_start_thread(mg_thread_func_t f, void *p);
const char *mg_get_builtin_mime_type(const char *file_name); const char *mg_get_builtin_mime_type(const char *file_name);
// Platform independent string utility functions.
void mg_strlcpy(char *dst, const char *src, size_t n);
int mg_strncasecmp(const char *s1, const char *s2, size_t len);
int mg_strcasecmp(const char *s1, const char *s2);
char *mg_strndup(const char *ptr, size_t len);
char *mg_strdup(const char *str);
// Return Mongoose version. // Return Mongoose version.
const char *mg_version(void); const char *mg_version(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment