13 #include <acess/sys.h>
15 typedef uintptr_t Uint;
16 typedef uint8_t Uint8;
17 typedef uint16_t Uint16;
18 typedef uint32_t Uint32;
20 // HACK: Replace with underscored
21 #define SysDebug _SysDebug
24 #define MAX_LOADED_LIBRARIES 64
25 #define MAX_STRINGS_BYTES 4096
26 #define SYSTEM_LIB_DIR "/Acess/Libs/"
35 extern tLoadedLib gLoadedLibraries[MAX_LOADED_LIBRARIES];
38 extern void *DoRelocate(void *Base, char **envp, const char *Filename);
40 // === Library/Symbol Manipulation ==
41 extern void *LoadLibrary(const char *Filename, const char *SearchDir, char **envp);
42 extern void AddLoaded(const char *File, void *base);
43 extern int GetSymbol(const char *Name, void **Value, size_t *size);
44 extern int GetSymbolFromBase(void *base, const char *name, void **ret, size_t *size);
46 // === Library Functions ===
47 extern char *strcpy(char *dest, const char *src);
48 extern char *strcat(char *dest, const char *src);
49 extern int strcmp(const char *s1, const char *s2);
50 extern int strlen(const char *str);
51 extern int file_exists(const char *filename);
52 extern void *memcpy(void *dest, const void *src, size_t len);
54 // === System Calls ===
57 extern void *ElfRelocate(void *Base, char **envp, const char *Filename);
58 extern int ElfGetSymbol(void *Base, const char *name, void **ret, size_t *Size);
61 extern void *PE_Relocate(void *Base, char **envp, const char *Filename);
62 extern int PE_GetSymbol(void *Base, const char *Name, void **ret, size_t *Size);