stringutil.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * StringUtil.h
8  *
9  * Contains utility functions for working with char strings.
10  *
11  * Created on: 26.01.2017
12  * Author: (github.com/)ADiea
13  *
14  ****/
15 
16 #pragma once
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "stddef.h"
23 
29 const char* strstri(const char* pString, const char* pToken);
30 
31 #ifndef _GNU_SOURCE
35 int strcasecmp(const char* s1, const char* s2);
36 
45 void* memmem(const void* haystack, size_t haystacklen, const void* needle, size_t needlelen);
46 
47 void* memrchr(const void* s, int c, size_t n);
48 
49 #endif
50 
54 int memicmp(const void* buf1, const void* buf2, size_t len);
55 
61 char hexchar(unsigned char c);
62 
68 signed char unhex(char c);
69 
70 #ifndef ARRAY_SIZE
71 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
72 #endif
73 
74 #ifdef __cplusplus
75 }
76 #endif
signed char unhex(char c)
Return numeric value corresponding to given hex character.
void * memrchr(const void *s, int c, size_t n)
void * memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
char hexchar(unsigned char c)
Return hex character corresponding to given value.
int strcasecmp(const char *s1, const char *s2)
A case-insensitive strcmp().
const char * strstri(const char *pString, const char *pToken)
Return pointer to occurrence of substring in string. Case insensitive.
int memicmp(const void *buf1, const void *buf2, size_t len)
Compare block of memory without case sensitivity.