--- /dev/null
+#ifndef _C_STDIO_H
+#define _C_STDIO_H
+
+#include <stdint.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ size_t vsnprintf(char *buf, size_t size, const char *str, va_list args);
+
+ size_t snprintf(char *buf, size_t size, const char *str, ...)
+ __attribute__((format(printf, 3, 4)));
+
+ size_t sprintf(char *buf, const char *str, ...)
+ __attribute__((format(printf, 2, 3)));
+
+ size_t printf(const char *str, ...)
+ __attribute__((format(printf, 1, 2)));
+
+#ifdef __cplusplus
+}
+#endif
+#endif
#include <kern/types.h>
#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
extern "C" {
- size_t vsnprintf(char *buf, size_t size, const char *str, va_list args);
- size_t snprintf(char *buf, size_t size, const char *str, ...)
- __attribute__((format(printf, 3, 4)));
- size_t sprintf(char *buf, const char *str, ...)
- __attribute__((format(printf, 2, 3)));
- size_t printf(const char *str, ...)
- __attribute__((format(printf, 1, 2)));
-
// FIXME: template/alignof versions
void *memcpy(void *dest, const void *src, size_t len);
void *memmove(void *dest, const void *src, size_t len);
int memcmp(const void *b1, const void *b2, size_t len);
void *memset(void *b, int ch, size_t len);
- size_t strnlen(const char *s, size_t n);
- size_t strlen(const char *s);
-
- char *strcpy(char *dest, const char *src);
- char *strncpy(char *dest, const char *src, size_t len);
- char *strcat(char *dest, const char *src);
- char *strncat(char *dest, const char *src, size_t len);
-
void bzero(void *b, size_t len);
void *malloc(size_t size);