e9a4b3ba6714fd8520f11b232d6d591d6c195342
[tpg/acess2.git] / AcessNative / ld-acess_src / exports.h
1 /*
2  * AcessNative Dymamic Linker
3  * - By John Hodge (thePowersGang)
4  *
5  * exports.h
6  * - Syscalls/Symbol definitions
7  */
8 #ifndef _EXPORTS_H_
9 #define _EXPORTS_H_
10
11 #include <stddef.h>
12
13 // Syscall request (used by acess_*)
14 extern uint64_t _Syscall(int SyscallID, const char *ArgTypes, ...);
15
16 extern int      acess__errno;
17
18 extern int      native_open(const char *Path, int Flags);
19 extern void     native_close(int FD);
20 extern size_t   native_read(int FD, void *Dest, size_t Bytes);
21 extern size_t   native_write(int FD, const void *Src, size_t Bytes);
22 extern int      native_seek(int FD, int64_t Offset, int Dir);
23 extern uint64_t native_tell(int FD);
24
25 extern int      native_execve(const char *filename, const char *const argv[], const char *const envp[]);
26 extern int      native_spawn(const char *filename, const char *const argv[], const char *const envp[]);
27
28 // Syscalls used by the linker
29 extern int      acess__SysOpen(const char *Path, int Flags);
30 extern void     acess__SysClose(int FD);
31 extern size_t   acess__SysRead(int FD, void *Dest, size_t Bytes);
32 extern int      acess__SysSeek(int FD, int64_t Offset, int Dir);
33
34 // Symbol type
35 typedef struct {
36         const char      *Name;
37         void    *Value;
38 }       tSym;
39
40 #endif
41

UCC git Repository :: git.ucc.asn.au