[smsc75xx] Expose functionality shared with LAN78xx devices
[ipxe.git] / src / include / string.h
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_memmove ( void *dest, const void *src,
19 size_t len ) __nonnull;
20
21 #include <bits/string.h>
22
23 /* Architecture-specific code is expected to provide these functions,
24 * but may instead explicitly choose to use the generic versions.
25 */
26 void * memset ( void *dest, int character, size_t len ) __nonnull;
27 void * memcpy ( void *dest, const void *src, size_t len ) __nonnull;
28 void * memmove ( void *dest, const void *src, size_t len ) __nonnull;
29
30 extern int __pure memcmp ( const void *first, const void *second,
31 size_t len ) __nonnull;
32 extern void * __pure memchr ( const void *src, int character,
33 size_t len ) __nonnull;
34 extern void * memswap ( void *dest, void *src, size_t len ) __nonnull;
35 extern int __pure strcmp ( const char *first, const char *second ) __nonnull;
36 extern int __pure strncmp ( const char *first, const char *second,
37 size_t max ) __nonnull;
38 extern size_t __pure strlen ( const char *src ) __nonnull;
39 extern size_t __pure strnlen ( const char *src, size_t max ) __nonnull;
40 extern char * __pure strchr ( const char *src, int character ) __nonnull;
41 extern char * __pure strrchr ( const char *src, int character ) __nonnull;
42 extern char * __pure strstr ( const char *haystack,
43 const char *needle ) __nonnull;
44 extern char * strcpy ( char *dest, const char *src ) __nonnull;
45 extern char * strncpy ( char *dest, const char *src, size_t max ) __nonnull;
46 extern char * strcat ( char *dest, const char *src ) __nonnull;
47 extern char * __malloc strdup ( const char *src ) __nonnull;
48 extern char * __malloc strndup ( const char *src, size_t max ) __nonnull;
49 extern char * __pure strpbrk ( const char *string,
50 const char *delim ) __nonnull;
51 extern char * strsep ( char **string, const char *delim ) __nonnull;
52
53 extern char * __pure strerror ( int errno );
54
55 #endif /* _STRING_H */