94987d0b49e4eaa3791ba7679ff240f02cebe310
[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 #include <stdint.h>
13
14 // Syscall request (used by acess_*)
15 extern uint64_t _Syscall(int SyscallID, const char *ArgTypes, ...);
16
17 extern int      acess__errno;
18
19 extern int      native_open(const char *Path, int Flags);
20 extern int      native_shm(const char *Tag, int Flags);
21 extern void     native_close(int FD);
22 extern size_t   native_read(int FD, void *Dest, size_t Bytes);
23 extern size_t   native_write(int FD, const void *Src, size_t Bytes);
24 extern int      native_seek(int FD, int64_t Offset, int Dir);
25 extern uint64_t native_tell(int FD);
26
27 extern int      native_execve(const char *filename, const char *const argv[], const char *const envp[]);
28 extern int      native_spawn(const char *filename, const char *const argv[], const char *const envp[]);
29
30 extern int64_t  native_timestamp(void);
31
32 // Syscalls used by the linker
33 extern int      acess__SysOpen(const char *Path, unsigned int Flags);
34 extern void     acess__SysClose(int FD);
35 extern size_t   acess__SysRead(int FD, void *Dest, size_t Bytes);
36 extern int      acess__SysSeek(int FD, int64_t Offset, int Dir);
37
38 // Symbol type
39 typedef struct {
40         const char      *Name;
41         void    *Value;
42 }       tSym;
43
44 #endif
45

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