summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-01-26 04:25:19 +0100
committerMichael Brown2007-01-26 04:25:19 +0100
commitafe4e011ac5ab49cb7a24c9c0da262b50ed68130 (patch)
tree174ca0a0ad8e9e56b889ceedb691a4e4436a96b8
parentAdd 64-bit rotates (diff)
downloadipxe-afe4e011ac5ab49cb7a24c9c0da262b50ed68130.tar.gz
ipxe-afe4e011ac5ab49cb7a24c9c0da262b50ed68130.tar.xz
ipxe-afe4e011ac5ab49cb7a24c9c0da262b50ed68130.zip
Move tolower() etc to ctype.h as per ISO C
-rw-r--r--src/core/string.c1
-rw-r--r--src/include/ctype.h28
-rw-r--r--src/include/string.h29
3 files changed, 31 insertions, 27 deletions
diff --git a/src/core/string.c b/src/core/string.c
index da35e208..353abd6f 100644
--- a/src/core/string.c
+++ b/src/core/string.c
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
/* *** FROM string.c *** */
diff --git a/src/include/ctype.h b/src/include/ctype.h
new file mode 100644
index 00000000..a79395d2
--- /dev/null
+++ b/src/include/ctype.h
@@ -0,0 +1,28 @@
+#ifndef _CTYPE_H
+#define _CTYPE_H
+
+/** @file
+ *
+ * Character types
+ */
+
+#define isdigit(c) ((c & 0x04) != 0)
+#define islower(c) ((c & 0x02) != 0)
+//#define isspace(c) ((c & 0x20) != 0)
+#define isupper(c) ((c & 0x01) != 0)
+
+static inline unsigned char tolower(unsigned char c)
+{
+ if (isupper(c))
+ c -= 'A'-'a';
+ return c;
+}
+
+static inline unsigned char toupper(unsigned char c)
+{
+ if (islower(c))
+ c -= 'a'-'A';
+ return c;
+}
+
+#endif /* _CTYPE_H */
diff --git a/src/include/string.h b/src/include/string.h
index 123e70cf..e02b5edb 100644
--- a/src/include/string.h
+++ b/src/include/string.h
@@ -14,33 +14,8 @@
#ifndef ETHERBOOT_STRING_H
#define ETHERBOOT_STRING_H
-#include "stddef.h"
-#include "bits/string.h"
-
-
-/* *** FROM ctype.h *** */
-
-#define isdigit(c) ((c & 0x04) != 0)
-#define islower(c) ((c & 0x02) != 0)
-//#define isspace(c) ((c & 0x20) != 0)
-#define isupper(c) ((c & 0x01) != 0)
-
-static inline unsigned char tolower(unsigned char c)
-{
- if (isupper(c))
- c -= 'A'-'a';
- return c;
-}
-
-static inline unsigned char toupper(unsigned char c)
-{
- if (islower(c))
- c -= 'a'-'A';
- return c;
-}
-
-
-/* *** FROM string.h *** */
+#include <stddef.h>
+#include <bits/string.h>
int strnicmp(const char *s1, const char *s2, size_t len);
char * strcpy(char * dest,const char *src);