string.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * File : string.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2008, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2008-08-14 Bernard the first version
  13. */
  14. #ifndef __STRING_H__
  15. #define __STRING_H__
  16. #include <rtthread.h>
  17. #include <sys/types.h>
  18. /* replace for standard string library */
  19. #if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC)
  20. #define ZEROPAD (1 << 0) /* pad with zero */
  21. #define SIGN (1 << 1) /* unsigned/signed long */
  22. #define PLUS (1 << 2) /* show plus */
  23. #define SPACE (1 << 3) /* space if plus */
  24. #define LEFT (1 << 4) /* left justified */
  25. #define SPECIAL (1 << 5) /* 0x */
  26. #define LARGE (1 << 6) /* use 'ABCDEF' instead of 'abcdef' */
  27. #define INT_MAX ((int)(~0U>>1))
  28. #define INT_MIN (-INT_MAX - 1)
  29. #define UINT_MAX (~0U)
  30. #define LONG_MAX ((long)(~0UL>>1))
  31. #define LONG_MIN (-LONG_MAX - 1)
  32. #define ULONG_MAX (~0UL)
  33. #define _U 0x01 /* upper */
  34. #define _L 0x02 /* lower */
  35. #define _D 0x04 /* digit */
  36. #define _C 0x08 /* cntrl */
  37. #define _P 0x10 /* punct */
  38. #define _S 0x20 /* white space (space/lf/tab) */
  39. #define _X 0x40 /* hex digit */
  40. #define _SP 0x80 /* hard space (0x20) */
  41. void* memset(void *s, int c, size_t n);
  42. void* memcpy(void *dest, const void *src, size_t n);
  43. void* memmove(void *dest, const void *src, size_t n);
  44. int memcmp(const void *s1, const void *s2, size_t n);
  45. int tolower(int c);
  46. int toupper(int c);
  47. int strcmp (const char *s1, const char *s2);
  48. int strcasecmp(const char *a, const char *b);
  49. int strncasecmp(const char *cs, const char *ct, size_t count);
  50. int sscanf(const char * buf, const char * fmt, ...);
  51. size_t strlen(const char *s);
  52. char * strstr(const char * s1,const char * s2);
  53. char *strcpy(char *dest, const char *src);
  54. char *strncpy(char *dest, const char *src, size_t n);
  55. char *strncat(char *s, const char *t, size_t n) ;
  56. char* strcat(register char* s,register const char* t);
  57. char *strrchr(const char *t, int c);
  58. char *strdup(const char *s);
  59. #endif
  60. #endif