1 |
23 |
mcupro |
|
2 |
|
|
typedef unsigned int uint32;
|
3 |
|
|
typedef unsigned short uint16;
|
4 |
|
|
typedef unsigned char uint8;
|
5 |
|
|
|
6 |
|
|
#ifndef NULL
|
7 |
|
|
#define NULL (void*)0
|
8 |
|
|
#endif
|
9 |
|
|
|
10 |
|
|
#define assert(A) if((A)==0){OS_Assert();UartPrintfCritical("\r\nAssert %s:%d\r\n", __FILE__, __LINE__);}
|
11 |
|
|
|
12 |
|
|
#define isprint(c) (' '<=(c)&&(c)<='~')
|
13 |
|
|
#define isspace(c) ((c)==' '||(c)=='\t'||(c)=='\n'||(c)=='\r')
|
14 |
|
|
#define isdigit(c) ('0'<=(c)&&(c)<='9')
|
15 |
|
|
#define islower(c) ('a'<=(c)&&(c)<='z')
|
16 |
|
|
#define isupper(c) ('A'<=(c)&&(c)<='Z')
|
17 |
|
|
#define isalpha(c) (islower(c)||isupper(c))
|
18 |
|
|
#define isalnum(c) (isalpha(c)||isdigit(c))
|
19 |
|
|
#define min(a,b) ((a)<(b)?(a):(b))
|
20 |
|
|
#define strcpy strcpy2 //don't use intrinsic functions
|
21 |
|
|
#define strcat strcat2
|
22 |
|
|
#define strcmp strcmp2
|
23 |
|
|
#define strlen strlen2
|
24 |
|
|
#define memcpy memcpy2
|
25 |
|
|
#define memcmp memcmp2
|
26 |
|
|
#define memset memset2
|
27 |
|
|
#define abs abs2
|
28 |
|
|
|
29 |
|
|
char *strcpy(char *dst, const char *src);
|
30 |
|
|
char *strncpy(char *dst, const char *src, int count);
|
31 |
|
|
char *strcat(char *dst, const char *src);
|
32 |
|
|
char *strncat(char *dst, const char *src, int count);
|
33 |
|
|
int strcmp(const char *string1, const char *string2);
|
34 |
|
|
int strncmp(const char *string1, const char *string2, int count);
|
35 |
|
|
char *strstr(const char *string, const char *find);
|
36 |
|
|
int strlen(const char *string);
|
37 |
|
|
void *memcpy(void *dst, const void *src, unsigned long bytes);
|
38 |
|
|
void *memmove(void *dst, const void *src, unsigned long bytes);
|
39 |
|
|
int memcmp(const void *cs, const void *ct, unsigned long bytes);
|
40 |
|
|
void *memset(void *dst, int c, unsigned long bytes);
|
41 |
|
|
int abs(int n);
|
42 |
|
|
int rand(void);
|
43 |
|
|
void srand(unsigned int seed);
|
44 |
|
|
long strtol(const char *s, const char **end, int base);
|
45 |
|
|
int atoi(const char *s);
|
46 |
|
|
char *itoa(int num, char *dst, int base);
|
47 |
|
|
int sscanf(const char*s,const char*format,int arg0);
|
48 |
|
|
int sprintf(char*s,const char*format,int arg0);
|