Upload files to "include"

This commit is contained in:
2026-02-27 13:07:57 +00:00
parent c000f8a0d9
commit 835a372836
2 changed files with 60 additions and 9 deletions

View File

@@ -5,9 +5,35 @@
#ifndef LOCALHEADER_H
#define LOCALHEADER_H
// syscall macros
#ifdef __linux__
#define SYS_read 0
#define SYS_write 1
#define SYS_open 2
#define SYS_close 3
#define SYS_sleep 35
#define SYS_exit 60
#define SYS_mkdir 83
#elif __FreeBSD__
#define SYS_read 3
#define SYS_write 4
#define SYS_open 5
#define SYS_close 6
#define SYS_sleep 244
#define SYS_exit 1
#define SYS_mkdir 136
#endif
// local functions
void exit(int code);
// time spec for sleep
typedef struct timespec {
long tv_sec;
long tv_nsec;
} timespec;
// syscalls go here i dont want them exposed to the user
long syscall1(long number, long arg1);

View File

@@ -27,21 +27,46 @@
#define BCYAN "\x1b[46m"
#define BWHITE "\x1b[47m"
// SYS calls
#define SYS_read 0
#define SYS_write 1
#define SYS_open 2
#define SYS_close 3
#define SYS_exit 60
// gay ass glibc shit why in the fuck does this exist like that
#undef NULL
#define NULL 0
#define bool _Bool
#define true 1
#define false 0
// funcs
// text functions
void ColorPrint(char *string, char *color);
void BackgroundPrint(char *string, char *Bcolor);
void print(char *string);
// strlen implemenation
long unsigned lengthStr(char *string);
void upper(char string[]);
void lower(char string[]);
// file handling
long Wopen(const char *pathname, int flags, int mode);
long closeFile(long fd);
// basic funcs
void print(char *string);
long reader(long fd, char *string);
long mkdir(const char *filePath, int mode);
// memory
void Wmalloc();
// error handling
void safeError(char *error);
void riskyError();
// math
int intParser(char *rawInt);
float invSqrt(float x);
// misc
void sleeper(long seconds);
#endif