1 #ifndef _STRING_H
2 #define _STRING_H
3 
4 /** @file
5  *
6  * String functions
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stddef.h>
13 
14 extern void * generic_memset ( void *dest, int character,
15 			       size_t len ) __nonnull;
16 extern void * generic_memcpy ( void *dest, const void *src,
17 			       size_t len ) __nonnull;
18 extern void * generic_memcpy_reverse ( void *dest, const void *src,
19 				       size_t len ) __nonnull;
20 extern void * generic_memmove ( void *dest, const void *src,
21 				size_t len ) __nonnull;
22 
23 #include <bits/string.h>
24 
25 /* Architecture-specific code is expected to provide these functions,
26  * but may instead explicitly choose to use the generic versions.
27  */
28 void * memset ( void *dest, int character, size_t len ) __nonnull;
29 void * memcpy ( void *dest, const void *src, size_t len ) __nonnull;
30 void * memmove ( void *dest, const void *src, size_t len ) __nonnull;
31 
32 extern int __pure memcmp ( const void *first, const void *second,
33 			   size_t len ) __nonnull;
34 extern void * __pure memchr ( const void *src, int character,
35 			      size_t len ) __nonnull;
36 extern void * memswap ( void *dest, void *src, size_t len ) __nonnull;
37 extern int __pure strcmp ( const char *first, const char *second ) __nonnull;
38 extern int __pure strncmp ( const char *first, const char *second,
39 			    size_t max ) __nonnull;
40 extern size_t __pure strlen ( const char *src ) __nonnull;
41 extern size_t __pure strnlen ( const char *src, size_t max ) __nonnull;
42 extern char * __pure strchr ( const char *src, int character ) __nonnull;
43 extern char * __pure strrchr ( const char *src, int character ) __nonnull;
44 extern char * __pure strstr ( const char *haystack,
45 			      const char *needle ) __nonnull;
46 extern char * strcpy ( char *dest, const char *src ) __nonnull;
47 extern char * strncpy ( char *dest, const char *src, size_t max ) __nonnull;
48 extern char * strcat ( char *dest, const char *src ) __nonnull;
49 extern char * __malloc strdup ( const char *src ) __nonnull;
50 extern char * __malloc strndup ( const char *src, size_t max ) __nonnull;
51 extern char * __pure strpbrk ( const char *string,
52 			       const char *delim ) __nonnull;
53 extern char * strsep ( char **string, const char *delim ) __nonnull;
54 
55 extern char * __pure strerror ( int errno );
56 
57 #endif /* _STRING_H */
58