[hackers] [scc] [libc] Make string.h portable between architectures || Roberto E. Vargas Caballero
commit 198ec83d42347068375399482925d91ee94abe32
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Thu Feb 16 17:12:07 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Thu Feb 16 17:12:07 2017 +0100
[libc] Make string.h portable between architectures
diff --git a/libc/include/amd64-sysv/arch/string.h b/libc/include/amd64-sysv/arch/string.h
new file mode 100644
index 0000000..3f462d2
--- /dev/null
+++ b/libc/include/amd64-sysv/arch/string.h
_AT_@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned size_t;
+#endif
diff --git a/libc/include/amd64-sysv/string.h b/libc/include/amd64-sysv/string.h
deleted file mode 100644
index bd50063..0000000
--- a/libc/include/amd64-sysv/string.h
+++ /dev/null
_AT_@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STRING_H
-#define _STRING_H
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#ifndef _SIZET
-typedef unsigned size_t;
-#endif
-
-extern char *strcpy(char *dst, const char *src);
-extern char *strncpy(char *dst, const char *src, size_t n);
-extern char *strcat(char *dst, const char *src);
-extern char *strncat(char *dst, const char *src, size_t n);
-extern size_t strxfrm(char *dst, const char *src, size_t n);
-extern size_t strlen(const char *s);
-extern int strcmp(const char *s1, const char *s2);
-extern int strcoll(const char *s1, const char *s2);
-extern char *strchr(const char *s, int c);
-extern char *strrchr(const char *s, int c);
-extern size_t strspn(const char *s, const char *accept);
-extern size_t strcspn(const char *s, const char *reject);
-extern size_t strpbrk(const char *s, const char *accept);
-extern size_t strstr(const char *s, const char *sub);
-extern char *strtok(const char *s, const char *delim);
-
-extern void *memset(void *s, int c, size_t n);
-extern void *memcpy(void *dst, const void *src, size_t n);
-extern void *memmove(void *dst, const void *src, size_t n);
-extern int memcmp(const void *s1, const void *s2, size_t n);
-extern void *memchr(const void *s, int c, size_t n);
-
-#endif
diff --git a/libc/include/i386-sysv/arch/string.h b/libc/include/i386-sysv/arch/string.h
new file mode 100644
index 0000000..3f462d2
--- /dev/null
+++ b/libc/include/i386-sysv/arch/string.h
_AT_@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned size_t;
+#endif
diff --git a/libc/include/i386-sysv/string.h b/libc/include/i386-sysv/string.h
deleted file mode 100644
index bd50063..0000000
--- a/libc/include/i386-sysv/string.h
+++ /dev/null
_AT_@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STRING_H
-#define _STRING_H
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#ifndef _SIZET
-typedef unsigned size_t;
-#endif
-
-extern char *strcpy(char *dst, const char *src);
-extern char *strncpy(char *dst, const char *src, size_t n);
-extern char *strcat(char *dst, const char *src);
-extern char *strncat(char *dst, const char *src, size_t n);
-extern size_t strxfrm(char *dst, const char *src, size_t n);
-extern size_t strlen(const char *s);
-extern int strcmp(const char *s1, const char *s2);
-extern int strcoll(const char *s1, const char *s2);
-extern char *strchr(const char *s, int c);
-extern char *strrchr(const char *s, int c);
-extern size_t strspn(const char *s, const char *accept);
-extern size_t strcspn(const char *s, const char *reject);
-extern size_t strpbrk(const char *s, const char *accept);
-extern size_t strstr(const char *s, const char *sub);
-extern char *strtok(const char *s, const char *delim);
-
-extern void *memset(void *s, int c, size_t n);
-extern void *memcpy(void *dst, const void *src, size_t n);
-extern void *memmove(void *dst, const void *src, size_t n);
-extern int memcmp(const void *s1, const void *s2, size_t n);
-extern void *memchr(const void *s, int c, size_t n);
-
-#endif
diff --git a/libc/include/qbe/arch/string.h b/libc/include/qbe/arch/string.h
new file mode 100644
index 0000000..3f462d2
--- /dev/null
+++ b/libc/include/qbe/arch/string.h
_AT_@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned size_t;
+#endif
diff --git a/libc/include/qbe/string.h b/libc/include/qbe/string.h
deleted file mode 100644
index bd50063..0000000
--- a/libc/include/qbe/string.h
+++ /dev/null
_AT_@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STRING_H
-#define _STRING_H
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#ifndef _SIZET
-typedef unsigned size_t;
-#endif
-
-extern char *strcpy(char *dst, const char *src);
-extern char *strncpy(char *dst, const char *src, size_t n);
-extern char *strcat(char *dst, const char *src);
-extern char *strncat(char *dst, const char *src, size_t n);
-extern size_t strxfrm(char *dst, const char *src, size_t n);
-extern size_t strlen(const char *s);
-extern int strcmp(const char *s1, const char *s2);
-extern int strcoll(const char *s1, const char *s2);
-extern char *strchr(const char *s, int c);
-extern char *strrchr(const char *s, int c);
-extern size_t strspn(const char *s, const char *accept);
-extern size_t strcspn(const char *s, const char *reject);
-extern size_t strpbrk(const char *s, const char *accept);
-extern size_t strstr(const char *s, const char *sub);
-extern char *strtok(const char *s, const char *delim);
-
-extern void *memset(void *s, int c, size_t n);
-extern void *memcpy(void *dst, const void *src, size_t n);
-extern void *memmove(void *dst, const void *src, size_t n);
-extern int memcmp(const void *s1, const void *s2, size_t n);
-extern void *memchr(const void *s, int c, size_t n);
-
-#endif
diff --git a/libc/include/string.h b/libc/include/string.h
new file mode 100644
index 0000000..6fa675f
--- /dev/null
+++ b/libc/include/string.h
_AT_@ -0,0 +1,29 @@
+/* See LICENSE file for copyright and license details. */
+#ifndef _STRING_H
+#define _STRING_H
+
+#include <arch/string.h>
+
+extern char *strcpy(char *dst, const char *src);
+extern char *strncpy(char *dst, const char *src, size_t n);
+extern char *strcat(char *dst, const char *src);
+extern char *strncat(char *dst, const char *src, size_t n);
+extern size_t strxfrm(char *dst, const char *src, size_t n);
+extern size_t strlen(const char *s);
+extern int strcmp(const char *s1, const char *s2);
+extern int strcoll(const char *s1, const char *s2);
+extern char *strchr(const char *s, int c);
+extern char *strrchr(const char *s, int c);
+extern size_t strspn(const char *s, const char *accept);
+extern size_t strcspn(const char *s, const char *reject);
+extern size_t strpbrk(const char *s, const char *accept);
+extern size_t strstr(const char *s, const char *sub);
+extern char *strtok(const char *s, const char *delim);
+
+extern void *memset(void *s, int c, size_t n);
+extern void *memcpy(void *dst, const void *src, size_t n);
+extern void *memmove(void *dst, const void *src, size_t n);
+extern int memcmp(const void *s1, const void *s2, size_t n);
+extern void *memchr(const void *s, int c, size_t n);
+
+#endif
diff --git a/libc/include/z80/arch/string.h b/libc/include/z80/arch/string.h
new file mode 100644
index 0000000..3f462d2
--- /dev/null
+++ b/libc/include/z80/arch/string.h
_AT_@ -0,0 +1,9 @@
+/* See LICENSE file for copyright and license details. */
+
+#ifndef NULL
+#define NULL ((void *) 0)
+#endif
+
+#ifndef _SIZET
+typedef unsigned size_t;
+#endif
diff --git a/libc/include/z80/string.h b/libc/include/z80/string.h
deleted file mode 100644
index bd50063..0000000
--- a/libc/include/z80/string.h
+++ /dev/null
_AT_@ -1,35 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#ifndef _STRING_H
-#define _STRING_H
-
-#ifndef NULL
-#define NULL ((void *) 0)
-#endif
-
-#ifndef _SIZET
-typedef unsigned size_t;
-#endif
-
-extern char *strcpy(char *dst, const char *src);
-extern char *strncpy(char *dst, const char *src, size_t n);
-extern char *strcat(char *dst, const char *src);
-extern char *strncat(char *dst, const char *src, size_t n);
-extern size_t strxfrm(char *dst, const char *src, size_t n);
-extern size_t strlen(const char *s);
-extern int strcmp(const char *s1, const char *s2);
-extern int strcoll(const char *s1, const char *s2);
-extern char *strchr(const char *s, int c);
-extern char *strrchr(const char *s, int c);
-extern size_t strspn(const char *s, const char *accept);
-extern size_t strcspn(const char *s, const char *reject);
-extern size_t strpbrk(const char *s, const char *accept);
-extern size_t strstr(const char *s, const char *sub);
-extern char *strtok(const char *s, const char *delim);
-
-extern void *memset(void *s, int c, size_t n);
-extern void *memcpy(void *dst, const void *src, size_t n);
-extern void *memmove(void *dst, const void *src, size_t n);
-extern int memcmp(const void *s1, const void *s2, size_t n);
-extern void *memchr(const void *s, int c, size_t n);
-
-#endif
Received on Thu Feb 16 2017 - 17:24:34 CET
This archive was generated by hypermail 2.3.0
: Thu Feb 16 2017 - 17:36:27 CET