| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #ifndef STRING_H |
|---|
| 20 | #define STRING_H |
|---|
| 21 | |
|---|
| 22 | #include <stdarg.h> |
|---|
| 23 | #include <typedefs.h> |
|---|
| 24 | |
|---|
| 25 | int strncpy(char* dest,char* src,int len); |
|---|
| 26 | int strcpy(char* dest,char* src); |
|---|
| 27 | int strncmp(const char* s1,const char* s2,int num); |
|---|
| 28 | int strlen(char* str); |
|---|
| 29 | static inline int strcmp(const char* s1,const char* s2) {return strncmp(s1,s2,0xFFFFFFFF);} |
|---|
| 30 | int strnicmp(const char* s1,const char* s2,int num); |
|---|
| 31 | char* strcat(char* s1,const char* s2); |
|---|
| 32 | char* strchr(char* string,int c); |
|---|
| 33 | void* memcpy(void* dest,void* src,long size); |
|---|
| 34 | |
|---|
| 35 | #if 0 |
|---|
| 36 | static inline void* memcpy(void* dest,void* src,long size) |
|---|
| 37 | { |
|---|
| 38 | return ((__builtin_constant_p(size) ? __builtin_memcpy(dest,src,size) : var_memcpy(dest,src,size))); |
|---|
| 39 | } |
|---|
| 40 | #endif |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | void* memset(void* pointer,int size,char value); |
|---|
| 44 | void* memsetw(void* pointer,int size ,WORD value); |
|---|
| 45 | int memcmp(const void* s1, const void* s2, int n); |
|---|
| 46 | #define ZeroMemory(p,sz) memset((char*)(p),(sz),0) |
|---|
| 47 | |
|---|
| 48 | int sprintf(char* buf,const char* fmt,...); |
|---|
| 49 | int vsprintf(char* buf,const char* fmt,va_list args); |
|---|
| 50 | int toupper(char c); |
|---|
| 51 | |
|---|
| 52 | static inline int isupper(char c) |
|---|
| 53 | { |
|---|
| 54 | return (c >= 'A' && c <= 'Z'); |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | static inline int tolower(char c) |
|---|
| 58 | { |
|---|
| 59 | if (isupper(c)) |
|---|
| 60 | c|=0x20; |
|---|
| 61 | |
|---|
| 62 | return c; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | #endif |
|---|