diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/asm.h | 2 | ||||
| -rw-r--r-- | src/include/errno.h | 0 | ||||
| -rw-r--r-- | src/include/heap.h | 2 | ||||
| -rw-r--r-- | src/include/stdio.h | 26 | ||||
| -rw-r--r-- | src/include/stdlib.h | 15 | ||||
| -rw-r--r-- | src/include/string.h | 17 | ||||
| -rw-r--r-- | src/include/sys/types.h | 4 | ||||
| -rw-r--r-- | src/include/time.h | 0 | ||||
| -rw-r--r-- | src/include/unistd.h | 14 | ||||
| -rw-r--r-- | src/include/vga.h | 2 |
10 files changed, 74 insertions, 8 deletions
diff --git a/src/include/asm.h b/src/include/asm.h index 1d61b88..9f2a9e6 100644 --- a/src/include/asm.h +++ b/src/include/asm.h @@ -1,7 +1,7 @@ #ifndef ASM_H #define ASM_H -#include"types.h" +#include<types.h> extern uint8_t ioport_in(uint8_t port); extern void ioport_out(uint8_t port, char data); diff --git a/src/include/errno.h b/src/include/errno.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/include/errno.h diff --git a/src/include/heap.h b/src/include/heap.h index 11478aa..fa32f26 100644 --- a/src/include/heap.h +++ b/src/include/heap.h @@ -1,7 +1,7 @@ #ifndef HEAP_H #define HEAP_H -#include"types.h" +#include<types.h> void kheapinit(); int kheapaddblock(uintptr_t addr,uint32_t size,uint32_t bsize); diff --git a/src/include/stdio.h b/src/include/stdio.h index 2d0aa8a..45c9215 100644 --- a/src/include/stdio.h +++ b/src/include/stdio.h @@ -1,6 +1,28 @@ -#ifndef STDIO_H -#define STDIO_H +#ifndef _STDIO_H +#define _STDIO_H +#include <stdarg.h> +#include <stddef.h> +#define SEEK_SET 0 +typedef struct { int unused; } FILE; +#ifdef __cplusplus +extern "C" { +#endif +extern FILE* stderr; +#define stderr stderr +int fclose(FILE*); +int fflush(FILE*); +FILE* fopen(const char*, const char*); +int fprintf(FILE*, const char*, ...); +size_t fread(void*, size_t, size_t, FILE*); +int fseek(FILE*, long, int); +long ftell(FILE*); +size_t fwrite(const void*, size_t, size_t, FILE*); +void setbuf(FILE*, char*); +int vfprintf(FILE*, const char*, va_list); void printf(char *str, ...); +#ifdef __cplusplus +} +#endif #endif diff --git a/src/include/stdlib.h b/src/include/stdlib.h new file mode 100644 index 0000000..a0afe38 --- /dev/null +++ b/src/include/stdlib.h @@ -0,0 +1,15 @@ +#ifndef _STDLIB_H +#define _STDLIB_H +#ifdef __cplusplus +extern "C" { +#endif +void abort(void); +int atexit(void (*)(void)); +int atoi(const char*); +void free(void*); +char* getenv(const char*); +void* malloc(size_t); +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/include/string.h b/src/include/string.h index 500f545..bef5854 100644 --- a/src/include/string.h +++ b/src/include/string.h @@ -1,7 +1,18 @@ -#ifndef STRING_H -#define STRING_H +#ifndef _STRING_H +#define _STRING_H +#include <stddef.h> +#ifdef __cplusplus +extern "C" { +#endif +void* memcpy(void*, const void*, size_t); +void* memset(void*, int, size_t); +char* strcpy(char*, const char*); +size_t strlen(const char*); +#ifdef __cplusplus +} +#endif -#include"types.h" +#include<types.h> size_t stringlen(char *str); bool stringcmp(char *str1,char *str2); diff --git a/src/include/sys/types.h b/src/include/sys/types.h new file mode 100644 index 0000000..4f55189 --- /dev/null +++ b/src/include/sys/types.h @@ -0,0 +1,4 @@ +#ifndef _SYS_TYPES_H +#define _SYS_TYPES_H +typedef int pid_t; +#endif diff --git a/src/include/time.h b/src/include/time.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/include/time.h diff --git a/src/include/unistd.h b/src/include/unistd.h new file mode 100644 index 0000000..a6bfee0 --- /dev/null +++ b/src/include/unistd.h @@ -0,0 +1,14 @@ +#ifndef _UNISTD_H +#define _UNISTD_H +#include <sys/types.h> +#ifdef __cplusplus +extern "C" { +#endif +int execv(const char*, char* const[]); +int execve(const char*, char* const[], char* const[]); +int execvp(const char*, char* const[]); +pid_t fork(void); +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/include/vga.h b/src/include/vga.h index 93d5df3..eb43644 100644 --- a/src/include/vga.h +++ b/src/include/vga.h @@ -1,7 +1,7 @@ #ifndef VGA_H #define VGA_H -#include"types.h" +#include<types.h> static const size_t VGA_WIDTH = 80; static const size_t VGA_HEIGHT = 25; |
