home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue6 / SDL.ZIP / !gcc / include / libscl / h / string < prev    next >
Encoding:
Text File  |  2006-09-17  |  4.4 KB  |  121 lines

  1. /* string.h standard header for the RISC OS SharedCLibrary.
  2.    Copyright (c) 1997-2005 Nick Burrett
  3.    All rights reserved.
  4.  
  5.    Redistribution and use in source and binary forms, with or without
  6.    modification, are permitted provided that the following conditions
  7.    are met:
  8.    1. Redistributions of source code must retain the above copyright
  9.       notice, this list of conditions and the following disclaimer.
  10.    2. Redistributions in binary form must reproduce the above copyright
  11.       notice, this list of conditions and the following disclaimer in the
  12.       documentation and/or other materials provided with the distribution.
  13.    3. The name of the author may not be used to endorse or promote products
  14.       derived from this software without specific prior written permission.
  15.  
  16.    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  17.    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  18.    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19.    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20.    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21.    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22.    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23.    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24.    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25.    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  26.  
  27. #ifndef __STRING_H
  28. #define __STRING_H
  29.  
  30. #ifndef __STDDEF_H
  31. #include <stddef.h>
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. /* Copy n bytes from src to dest.  */
  39. extern void *memcpy (void *__dest, const void *__src, size_t __n);
  40.  
  41. /* Copy n bytes from src to dest, guaranteeing correct
  42.    behaviour for overlapping data.  */
  43. extern void *memmove (void *__dest, const void *__src, size_t __n);
  44.  
  45. /* Copy src to dest. */
  46. extern char *strcpy (char *__dest, const char *__src);
  47.  
  48. /* Copy no more than n chars of src to dest.  */
  49. extern char *strncpy (char *__dest, const char *__src, size_t __n);
  50.  
  51. /* Append src onto dest.  */
  52. extern char *strcat (char *__dest, const char *__src);
  53.  
  54. /* Append no more than n chars from src to dest. */
  55. extern char *strncat (char *__dest, const char *__src, size_t __n);
  56.  
  57. /* Compare n bytes of s1 and s2.  */
  58. extern int memcmp (const void *__s1, const void *__s2, size_t __n);
  59.  
  60. /* Compare s1 and s2.  */
  61. extern int strcmp (const char *__s1, const char *__s2);
  62.  
  63. /* Compare n chars of s1 and s2.  */
  64. extern int strncmp (const char *__s1, const char *__s2, size_t __n);
  65.  
  66. /* Similar to strcmp but uses the collating sequence of the
  67.    current locale for collation (LC_COLLATE).  */
  68. extern int strcoll (const char *__s1, const char *__s2);
  69.  
  70. /* Transforms 'string' using the collation transformation
  71.    determined by the locale currently selected for collation,
  72.    and stores the transformed string in the array 'to'. Up
  73.    to 'size' characters are stored (including terminating null
  74.    character).  */
  75. extern size_t strxfrm (char *__to, const char *__string, size_t __size);
  76.  
  77. /* Search n bytes of s for c.  */
  78. extern void *memchr (const void *__s, int __c, size_t __n);
  79.  
  80. /* Find the first occurrence of c in s. */
  81. extern char *strchr (const char *__s, int __c);
  82.  
  83. /* Return the length of the initial segment of s that consists
  84.    entirely of chars not in reject.  */
  85. extern size_t strcspn (const char *__s, const char *__reject);
  86.  
  87. /* Find the first occurence in s of any char in accept.  */
  88. extern char *strpbrk (const char *__s, const char *__accept);
  89.  
  90. /* Find the last occurrence of c in s.  */
  91. extern char *strrchr (const char *__s, int __c);
  92.  
  93. /* Return the length of the initial segment of s that consists
  94.    entirely of chars in accept.  */
  95. extern size_t strspn (const char *__s, const char *__accept);
  96.  
  97. /* Find the first occurrence of s in s1.  */
  98. extern char *strstr (const char *__s, const char *__s1);
  99.  
  100. /* Divide s into tokens separated by chars in delim.  */
  101. extern char *strtok (char *__s, const char *__delim);
  102.  
  103. /* Set n bytes of s to c.  */
  104. extern void *memset (void *__s, int __c, size_t __n);
  105.  
  106. /* Return the descriptive error message string for an error code.  */
  107. extern char *strerror (int __errnum);
  108.  
  109. /* Return the length of s. */
  110. extern size_t strlen (const char *__s);
  111.  
  112. /* Duplicate s, returning an identical malloc'd string.  */
  113. extern char *strdup (const char *__s);
  114.  
  115.  
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119.  
  120. #endif
  121.