2 * Copyright (C) 1991, 1992 Linus Torvalds
3 * Copyright (C) 2004 Tobias Lorenz
5 * string handling functions
6 * based on linux/include/linux/ctype.h
7 * and linux/include/linux/string.h
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #ifndef ETHERBOOT_STRING_H
15 #define ETHERBOOT_STRING_H
18 #include "bits/string.h"
21 /* *** FROM ctype.h *** */
23 #define isdigit(c) ((c & 0x04) != 0)
24 #define islower(c) ((c & 0x02) != 0)
25 //#define isspace(c) ((c & 0x20) != 0)
26 #define isupper(c) ((c & 0x01) != 0)
28 static inline unsigned char tolower(unsigned char c)
35 static inline unsigned char toupper(unsigned char c)
43 /* *** FROM string.h *** */
45 int strnicmp(const char *s1, const char *s2, size_t len);
46 char * strcpy(char * dest,const char *src);
47 char * strncpy(char * dest,const char *src,size_t count);
48 char * strcat(char * dest, const char * src);
49 char * strncat(char *dest, const char *src, size_t count);
50 int strcmp(const char * cs,const char * ct);
51 int strncmp(const char * cs,const char * ct,size_t count);
52 char * strchr(const char * s, int c);
53 char * strrchr(const char * s, int c);
54 size_t strlen(const char * s);
55 size_t strnlen(const char * s, size_t count);
56 size_t strspn(const char *s, const char *accept);
57 char * strpbrk(const char * cs,const char * ct);
58 char * strtok(char * s,const char * ct);
59 char * strsep(char **s, const char *ct);
60 void * memset(void * s,int c,size_t count);
61 char * bcopy(const char * src, char * dest, int count);
62 void * memcpy(void * dest,const void *src,size_t count);
63 void * memmove(void * dest,const void *src,size_t count);
64 int memcmp(const void * cs,const void * ct,size_t count);
65 void * memscan(void * addr, int c, size_t size);
66 char * strstr(const char * s1,const char * s2);
67 void * memchr(const void *s, int c, size_t n);
69 #endif /* ETHERBOOT_STRING */