forked from PoliEcho-holding-org/kern
Changed libc structure, shouldn't've added anything new
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef MATH_H
|
||||
#define MATH_H
|
||||
#ifndef _MATH_H
|
||||
#define _MATH_H
|
||||
|
||||
// Constants
|
||||
#define PI 3.141592653589 // Should be good enough
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef STDARG_H
|
||||
#define STDARG_H
|
||||
#ifndef _STDARG_H
|
||||
#define _STDARG_H
|
||||
|
||||
typedef char* va_list;
|
||||
#define va_start(ap, paramn) (void)((ap) = (char*)(&(paramn) + 1))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef BOOL_H
|
||||
#define BOOL_H
|
||||
#ifndef _BOOL_H
|
||||
#define _BOOL_H
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef STDDEF_H
|
||||
#define STDDEF_H
|
||||
#ifndef _STDDEF_H
|
||||
#define _STDDEF_H
|
||||
|
||||
#define NULL ((void*)0)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef STDINT_H
|
||||
#define STDINT_H
|
||||
#ifndef _STDINT_H
|
||||
#define _STDINT_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -15,6 +15,4 @@ typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
|
||||
// TODO: floats
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef STDIO_H
|
||||
#define STDIO_H
|
||||
#ifndef _STDIO_H
|
||||
#define _STDIO_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#ifndef STDLIB_H
|
||||
#define STDLIB_H
|
||||
#ifndef _STDLIB_H
|
||||
#define _STDLIB_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <syscall.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void* malloc(const uint32_t size);
|
||||
void* malloc(const size_t size);
|
||||
void free(const void* ptr);
|
||||
|
||||
#endif
|
||||
|
||||
+14
-8
@@ -1,23 +1,29 @@
|
||||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
#ifndef _STRING_H
|
||||
#define _STRING_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void* memcpy(void* src, void* dst, uint32_t length);
|
||||
void* memcpy32(void* src, void* dst, uint32_t length);
|
||||
void* memset(void* dst, uint8_t value, uint32_t length);
|
||||
void* memcpy(void* src, void* dst, size_t length);
|
||||
void* memcpy32(void* src, void* dst, size_t length);
|
||||
void* memset(void* dst, uint8_t value, size_t length);
|
||||
void* memset32(void* dst, uint32_t value, size_t length);
|
||||
|
||||
char* itoa(uint32_t val, uint8_t base);
|
||||
char* itoa(size_t val, int base);
|
||||
uint32_t atoi(const char* str);
|
||||
int isSpace(char c);
|
||||
|
||||
char* strcpy(char* str1, const char* str2);
|
||||
char* strncpy(char* str1, const char* str2, size_t n);
|
||||
|
||||
char* strcat(char* str1, const char* str2);
|
||||
char* strncat(char* str1, const char* str2, size_t n);
|
||||
|
||||
char* strchr(const char* str, char c);
|
||||
char* strrchr(const char* str, char c);
|
||||
|
||||
int strcmp(const char* str1, const char* str2);
|
||||
int strncmp(const char* str1, const char* str2, size_t n);
|
||||
uint32_t strlen(const char* str);
|
||||
|
||||
size_t strlen(const char* str);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef _SYS_GFX_H
|
||||
#define _SYS_GFX_H
|
||||
|
||||
#define BLACK 0x00000000 // 0
|
||||
#define RED 0x00ff0000 // 1
|
||||
#define GREEN 0x0000ff00 // 2
|
||||
#define YELLOW 0x00ffff00 // 3
|
||||
#define BLUE 0x000000ff // 4
|
||||
#define MAGENTA 0x00ff00ff // 5
|
||||
#define CYAN 0x0000ffff // 6
|
||||
#define WHITE 0x00ffffff // 7
|
||||
|
||||
uint32_t codeToColor(uint8_t code);
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SYSCALL_H
|
||||
#define SYSCALL_H
|
||||
#ifndef _SYSCALL_H
|
||||
#define _SYSCALL_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
#ifndef TIME_H
|
||||
#define TIME_H
|
||||
#ifndef _TIME_H
|
||||
#define _TIME_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void sleep(uint32_t ms);
|
||||
void sleep(size_t ms);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user