string.h
Upload User: fy98168
Upload Date: 2015-06-26
Package Size: 13771k
Code Size: 4k
Category:

DVD

Development Platform:

C/C++

  1. /* $Id$ */
  2. /* string.h: ANSI X3.159 1989 library header, section 4.11 */
  3. /* Copyright (C) Codemist Ltd. */
  4. /* Copyright (C) SGS-THOMSON Microelectronics Ltd. 1996 */
  5. #ifndef __string_h
  6. #define __string_h
  7. #ifdef __cplusplus
  8.  extern "C" {
  9. #endif
  10. #ifndef __size_t
  11. #define __size_t 1
  12. typedef unsigned int size_t;   /* from <stddef.h> */
  13. #endif
  14. #ifndef NULL
  15. # ifdef __cplusplus
  16. #  define NULL 0
  17. # else
  18. #  define NULL (void *)0
  19. # endif
  20. #endif
  21. extern void  *memcpy(void * /*s1*/, const void * /*s2*/, size_t /*n*/);
  22. extern void  *memmove(void * /*s1*/, const void * /*s2*/, size_t /*n*/);
  23. extern char  *strcpy(char * /*s1*/, const char * /*s2*/);
  24. extern char  *strncpy(char * /*s1*/, const char * /*s2*/, size_t /*n*/);
  25. extern char  *strcat(char * /*s1*/, const char * /*s2*/);
  26. extern char  *strncat(char * /*s1*/, const char * /*s2*/, size_t /*n*/);
  27. extern int    memcmp(const void * /*s1*/, const void * /*s2*/, size_t /*n*/);
  28. extern int    strcmp(const char * /*s1*/, const char * /*s2*/);
  29. extern int    strncmp(const char * /*s1*/, const char * /*s2*/, size_t /*n*/);
  30. extern int    strcoll(const char * /*s1*/, const char * /*s2*/);
  31. extern size_t strxfrm(char * /*s1*/, const char * /*s2*/, size_t /*n*/);
  32. #ifdef __cplusplus
  33. extern const void* memchr(const void* s, int c, size_t n);
  34. extern const char* strchr(const char* s, int c);
  35. extern const char* strrchr(const char* s, int c);
  36. extern const char* strpbrk(const char* s1, const char* s2);
  37. extern const char* strstr(const char* s1, const char* s2);
  38. #pragma ST_nosideeffects(memchr(const void*, int, unsigned int))
  39. #pragma ST_nosideeffects(strchr(const char*, int))
  40. #pragma ST_nosideeffects(strrchr(const char*, int))
  41. #pragma ST_nosideeffects(strpbrk(const char*, const char*))
  42. #pragma ST_nosideeffects(strstr(const char*, const char*))
  43. extern "C++" {
  44.   extern inline void* memchr(void* s, int c, size_t n)
  45.   {
  46.       return (void*) (memchr((const void*) s, c, n));
  47.   }
  48.   extern inline char* strchr(char* s, int c)
  49.   {
  50.       return (char*) (strchr((const char*) s, c));
  51.   }
  52.   extern inline char* strrchr(char* s, int c)
  53.   {
  54.       return (char*) (strrchr((const char*) s, c));
  55.   }
  56.   extern inline char* strpbrk(char* s1, const char* s2)
  57.   {
  58.       return (char*) (strpbrk((const char*) s1, s2));
  59.   }
  60.   extern inline char* strstr(char* s1, const char* s2)
  61.   {
  62.       return (char*) (strstr((const char*) s1, s2));
  63.   }
  64. }
  65. #else /* __cplusplus */
  66. extern void  *memchr(const void * /*s*/, int /*c*/, size_t /*n*/);
  67. extern char  *strchr(const char * /*s*/, int /*c*/);
  68. extern char  *strrchr(const char * /*s*/, int /*c*/);
  69. extern char  *strpbrk(const char * /*s1*/, const char * /*s2*/);
  70. extern char  *strstr(const char * /*s1*/, const char * /*s2*/);
  71. #pragma ST_nosideeffects(memchr)
  72. #pragma ST_nosideeffects(strchr)
  73. #pragma ST_nosideeffects(strrchr)
  74. #pragma ST_nosideeffects(strpbrk)
  75. #pragma ST_nosideeffects(strstr)
  76. #endif /* __cplusplus */
  77. extern size_t strcspn(const char * /*s1*/, const char * /*s2*/);
  78. extern size_t strspn(const char * /*s1*/, const char * /*s2*/);
  79. extern char  *strtok(char * /*s1*/, const char * /*s2*/);
  80. extern void  *memset(void * /*s*/, int /*c*/, size_t /*n*/);
  81. extern size_t strlen(const char * /*s*/);
  82. extern char  *strerror(int /*errnum*/);
  83. #if __CORE__ != 1
  84. #pragma ST_builtin_inline(memcpy)
  85. #pragma ST_builtin_inline(strcpy)
  86. #endif
  87. #pragma ST_nosideeffects(memcmp)
  88. #pragma ST_nosideeffects(strcmp)
  89. #pragma ST_nosideeffects(strcoll)
  90. #pragma ST_nosideeffects(strcspn)
  91. #pragma ST_nosideeffects(strlen)
  92. #pragma ST_nosideeffects(strncmp)
  93. #pragma ST_nosideeffects(strspn)
  94. #ifdef __cplusplus
  95.   }
  96. #endif
  97. #endif
  98. /* end of string.h */