libww libww
WWitch compatibility library for the Wonderful toolchain
Loading...
Searching...
No Matches
indirect.h
Go to the documentation of this file.
1#include <sys/types.h>
2#include <sys/filesys.h>
3#include <wonderful.h>
4
5#ifndef __LIBWW_SYS_INDIRECT_H__
6#define __LIBWW_SYS_INDIRECT_H__
7
8#define IL_FUNCTION __attribute__((cdecl)) far
9
10typedef struct {
11 const char __far *className;
12 const char __far *name;
13 const char __far *version;
14 const char __far *description;
15 const char __far* __far* depends;
16} ILinfo;
17
18#define ilinfo_get_className(info) MK_FP(FP_SEG((info)), FP_OFF((info)->className))
19#define ilinfo_get_name(info) MK_FP(FP_SEG((info)), FP_OFF((info)->name))
20#define ilinfo_get_version(info) MK_FP(FP_SEG((info)), FP_OFF((info)->version))
21#define ilinfo_get_description(info) MK_FP(FP_SEG((info)), FP_OFF((info)->description))
22
23typedef struct {
24 uint32_t todo_1;
25
30
34 IL_FUNCTION ILinfo __far *(*_get_info)(void) __far;
35} IL;
36_Static_assert(sizeof(IL) == 10, "Invalid IL size");
37
38typedef struct {
40
49 IL_FUNCTION int (*_open)(const char __far *name, IL __far *buffer);
50
59 IL_FUNCTION int (*_open_system)(const char __far *name, IL __far *buffer);
60} IlibIL;
61_Static_assert(sizeof(IlibIL) == 18, "Invalid IlibIL size");
62
63typedef struct _ProcIL {
65
69 IL_FUNCTION void __far (*_load)(const char __far *name);
70
75 IL_FUNCTION int (*_run)(void __far *entrypoint, int argc, const char __far* __far* argv);
76
80 IL_FUNCTION int (*_exec)(const char __far *name, int argc, const char __far* __far* argv);
81
85 IL_FUNCTION void (*_exit)(int code);
86
87 IL_FUNCTION void (*_yield)(void);
88 IL_FUNCTION int (*_suspend)(int i);
89 IL_FUNCTION void (*_resume)(int i);
90 IL_FUNCTION int (*_swap)(int i);
92
93typedef struct _FsIL {
95
99 IL_FUNCTION fent_t __far *(*_entries)(FS fs);
100
105
109 IL_FUNCTION int (*_getent)(FS fs, int index, fent_t __far *entry);
110
114 IL_FUNCTION int (*_findent)(FS fs, const char __far *filename, fent_t __far *entry);
115
119 IL_FUNCTION void __far *(*_mmap)(FS fs, const char __far *filename);
120
121 IL_FUNCTION int (*_open)(FS fs, const char __far *filename, int mode, int perms);
122 IL_FUNCTION int (*_close)(int fd);
123 IL_FUNCTION int (*_read)(int fd, char __far *data, int length);
124 IL_FUNCTION int (*_write)(int fd, const char __far *data, int length);
125 IL_FUNCTION long (*_lseek)(int fd, long offset, int whence);
126 IL_FUNCTION int (*_chmod)(FS fs, const char __far *filename, int mode);
127 IL_FUNCTION int (*_freeze)(FS fs, const char __far *filename);
128 IL_FUNCTION int (*_melt)(FS fs, const char __far *filename);
129 IL_FUNCTION int (*_creat)(FS fs, fent_t __far *entry);
130 IL_FUNCTION int (*_unlink)(FS fs, const char __far *filename);
131
137
145
150 IL_FUNCTION unsigned long (*_space)(FS fs);
152
153#endif /* __LIBWW_SYS_INDIRECT_H__ */
struct _ProcIL ProcIL
struct _FsIL FsIL
#define IL_FUNCTION
Definition indirect.h:8
IL super
Definition indirect.h:94
IL_FUNCTION int(* _newfs)(FS fs)
Definition indirect.h:136
IL_FUNCTION int(* _unlink)(FS fs, const char __far *filename)
Definition indirect.h:130
IL_FUNCTION long(* _lseek)(int fd, long offset, int whence)
Definition indirect.h:125
IL_FUNCTION int(* _chmod)(FS fs, const char __far *filename, int mode)
Definition indirect.h:126
IL_FUNCTION int(* _defrag)(FS fs)
Definition indirect.h:144
IL_FUNCTION int(* _melt)(FS fs, const char __far *filename)
Definition indirect.h:128
IL_FUNCTION int(* _freeze)(FS fs, const char __far *filename)
Definition indirect.h:127
IL_FUNCTION int(* _n_entries)(FS fs)
Definition indirect.h:104
IL_FUNCTION unsigned long(* _space)(FS fs)
Definition indirect.h:150
IL_FUNCTION int(* _findent)(FS fs, const char __far *filename, fent_t __far *entry)
Definition indirect.h:114
IL_FUNCTION int(* _getent)(FS fs, int index, fent_t __far *entry)
Definition indirect.h:109
IL_FUNCTION int(* _read)(int fd, char __far *data, int length)
Definition indirect.h:123
IL_FUNCTION int(* _write)(int fd, const char __far *data, int length)
Definition indirect.h:124
IL_FUNCTION int(* _close)(int fd)
Definition indirect.h:122
IL_FUNCTION int(* _open)(FS fs, const char __far *filename, int mode, int perms)
Definition indirect.h:121
IL_FUNCTION int(* _creat)(FS fs, fent_t __far *entry)
Definition indirect.h:129
IL super
Definition indirect.h:64
IL_FUNCTION int(* _exec)(const char __far *name, int argc, const char __far *__far *argv)
Definition indirect.h:80
IL_FUNCTION void __far(* _load)(const char __far *name)
Definition indirect.h:69
IL_FUNCTION void(* _exit)(int code)
Definition indirect.h:85
IL_FUNCTION int(* _suspend)(int i)
Definition indirect.h:88
IL_FUNCTION void(* _yield)(void)
Definition indirect.h:87
IL_FUNCTION int(* _swap)(int i)
Definition indirect.h:90
IL_FUNCTION int(* _run)(void __far *entrypoint, int argc, const char __far *__far *argv)
Definition indirect.h:75
IL_FUNCTION void(* _resume)(int i)
Definition indirect.h:89
Definition indirect.h:23
uint32_t todo_1
Definition indirect.h:24
int n_methods
Definition indirect.h:29
const char __far * description
Definition indirect.h:14
const char __far * version
Definition indirect.h:13
const char __far * name
Definition indirect.h:12
const char __far *__far * depends
Definition indirect.h:15
const char __far * className
Definition indirect.h:11
IL super
Definition indirect.h:39
IL_FUNCTION int(* _open_system)(const char __far *name, IL __far *buffer)
Definition indirect.h:59
IL_FUNCTION int(* _open)(const char __far *name, IL __far *buffer)
Definition indirect.h:49
fent_t __far * FS
Definition filesys.h:119