2009-10-11 13:44:19 +08:00
|
|
|
/*
|
2018-10-14 19:28:18 +08:00
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
2009-10-11 13:44:19 +08:00
|
|
|
*
|
2018-10-14 19:28:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2009-10-11 13:44:19 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2008-08-14 Bernard the first version
|
|
|
|
*/
|
|
|
|
#ifndef __STRING_H__
|
|
|
|
#define __STRING_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
/* replace for standard string library */
|
|
|
|
#if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC)
|
|
|
|
|
|
|
|
#define ZEROPAD (1 << 0) /* pad with zero */
|
|
|
|
#define SIGN (1 << 1) /* unsigned/signed long */
|
|
|
|
#define PLUS (1 << 2) /* show plus */
|
|
|
|
#define SPACE (1 << 3) /* space if plus */
|
|
|
|
#define LEFT (1 << 4) /* left justified */
|
|
|
|
#define SPECIAL (1 << 5) /* 0x */
|
|
|
|
#define LARGE (1 << 6) /* use 'ABCDEF' instead of 'abcdef' */
|
|
|
|
|
|
|
|
#define _U 0x01 /* upper */
|
|
|
|
#define _L 0x02 /* lower */
|
|
|
|
#define _D 0x04 /* digit */
|
|
|
|
#define _C 0x08 /* cntrl */
|
|
|
|
#define _P 0x10 /* punct */
|
|
|
|
#define _S 0x20 /* white space (space/lf/tab) */
|
|
|
|
#define _X 0x40 /* hex digit */
|
|
|
|
#define _SP 0x80 /* hard space (0x20) */
|
|
|
|
|
|
|
|
void* memset(void *s, int c, size_t n);
|
|
|
|
void* memcpy(void *dest, const void *src, size_t n);
|
|
|
|
void* memmove(void *dest, const void *src, size_t n);
|
|
|
|
int memcmp(const void *s1, const void *s2, size_t n);
|
|
|
|
|
|
|
|
int tolower(int c);
|
|
|
|
int toupper(int c);
|
|
|
|
|
|
|
|
int strcmp (const char *s1, const char *s2);
|
2010-03-17 12:23:11 +08:00
|
|
|
int strncmp(const char *cs,const char *ct, size_t count);
|
2009-10-11 13:44:19 +08:00
|
|
|
int strcasecmp(const char *a, const char *b);
|
|
|
|
int strncasecmp(const char *cs, const char *ct, size_t count);
|
|
|
|
int sscanf(const char * buf, const char * fmt, ...);
|
|
|
|
size_t strlen(const char *s);
|
2010-03-14 20:00:55 +08:00
|
|
|
char *strstr(const char * s1,const char * s2);
|
2009-10-11 13:44:19 +08:00
|
|
|
char *strcpy(char *dest, const char *src);
|
|
|
|
char *strncpy(char *dest, const char *src, size_t n);
|
2010-03-17 12:23:11 +08:00
|
|
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
2010-03-14 20:00:55 +08:00
|
|
|
char *strncat(char *dest, const char *src, size_t count);
|
|
|
|
char *strcat(char * dest, const char * src);
|
2010-03-24 15:33:00 +08:00
|
|
|
char *strchr(const char *s1, int i);
|
2009-10-11 13:44:19 +08:00
|
|
|
char *strrchr(const char *t, int c);
|
|
|
|
char *strdup(const char *s);
|
2010-03-24 15:33:00 +08:00
|
|
|
char *strtok(char *s, const char *delim);
|
|
|
|
char*strtok_r(char*s, const char*delim, char**ptrptr);
|
2009-10-11 13:44:19 +08:00
|
|
|
|
2010-03-24 15:51:53 +08:00
|
|
|
size_t strcspn(const char *s, const char *reject);
|
|
|
|
size_t strspn (const char *s, const char *accept);
|
|
|
|
|
2014-08-22 09:02:35 +08:00
|
|
|
long strtol(const char *str, char **endptr, int base);
|
|
|
|
long long strtoll(const char *str, char **endptr, int base);
|
2009-10-11 13:44:19 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|