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);
35} IL;
36
37typedef struct {
39
48 IL_FUNCTION int (*_open)(const char __far *name, IL __far *buffer);
49
58 IL_FUNCTION int (*_open_system)(const char __far *name, IL __far *buffer);
59} IlibIL;
60
61typedef struct _ProcIL {
63
67 IL_FUNCTION void __far (*_load)(const char __far *name);
68
73 IL_FUNCTION int (*_run)(void __far *entrypoint, int argc, const char __far* __far* argv);
74
78 IL_FUNCTION int (*_exec)(const char __far *name, int argc, const char __far* __far* argv);
79
83 IL_FUNCTION void (*_exit)(int code);
84
85 IL_FUNCTION void (*_yield)(void);
86 IL_FUNCTION int (*_suspend)(int i);
87 IL_FUNCTION void (*_resume)(int i);
88 IL_FUNCTION int (*_swap)(int i);
90
91typedef struct _FsIL {
93
97 IL_FUNCTION fent_t __far *(*_entries)(FS fs);
98
103
107 IL_FUNCTION int (*_getent)(FS fs, int index, fent_t __far *entry);
108
112 IL_FUNCTION int (*_findent)(FS fs, const char __far *filename, fent_t __far *entry);
113
117 IL_FUNCTION void __far *(*_mmap)(FS fs, const char __far *filename);
118
119 IL_FUNCTION int (*_open)(FS fs, const char __far *filename, int mode, int perms);
120 IL_FUNCTION int (*_close)(int fd);
121 IL_FUNCTION int (*_read)(int fd, char __far *data, int length);
122 IL_FUNCTION int (*_write)(int fd, const char __far *data, int length);
123 IL_FUNCTION long (*_lseek)(int fd, long offset, int whence);
124 IL_FUNCTION int (*_chmod)(FS fs, const char __far *filename, int mode);
125 IL_FUNCTION int (*_freeze)(FS fs, const char __far *filename);
126 IL_FUNCTION int (*_melt)(FS fs, const char __far *filename);
127 IL_FUNCTION int (*_creat)(FS fs, fent_t __far *entry);
128 IL_FUNCTION int (*_unlink)(FS fs, const char __far *filename);
129
135
143
148 IL_FUNCTION unsigned long (*_space)(FS fs);
150
151#endif /* __LIBWW_SYS_INDIRECT_H__ */
struct _ProcIL ProcIL
struct _FsIL FsIL
#define IL_FUNCTION
Definition indirect.h:8
IL super
Definition indirect.h:92
IL_FUNCTION int(* _newfs)(FS fs)
Definition indirect.h:134
IL_FUNCTION int(* _unlink)(FS fs, const char __far *filename)
Definition indirect.h:128
IL_FUNCTION long(* _lseek)(int fd, long offset, int whence)
Definition indirect.h:123
IL_FUNCTION int(* _chmod)(FS fs, const char __far *filename, int mode)
Definition indirect.h:124
IL_FUNCTION int(* _defrag)(FS fs)
Definition indirect.h:142
IL_FUNCTION int(* _melt)(FS fs, const char __far *filename)
Definition indirect.h:126
IL_FUNCTION int(* _freeze)(FS fs, const char __far *filename)
Definition indirect.h:125
IL_FUNCTION int(* _n_entries)(FS fs)
Definition indirect.h:102
IL_FUNCTION unsigned long(* _space)(FS fs)
Definition indirect.h:148
IL_FUNCTION int(* _findent)(FS fs, const char __far *filename, fent_t __far *entry)
Definition indirect.h:112
IL_FUNCTION int(* _getent)(FS fs, int index, fent_t __far *entry)
Definition indirect.h:107
IL_FUNCTION int(* _read)(int fd, char __far *data, int length)
Definition indirect.h:121
IL_FUNCTION int(* _write)(int fd, const char __far *data, int length)
Definition indirect.h:122
IL_FUNCTION int(* _close)(int fd)
Definition indirect.h:120
IL_FUNCTION int(* _open)(FS fs, const char __far *filename, int mode, int perms)
Definition indirect.h:119
IL_FUNCTION int(* _creat)(FS fs, fent_t __far *entry)
Definition indirect.h:127
IL super
Definition indirect.h:62
IL_FUNCTION int(* _exec)(const char __far *name, int argc, const char __far *__far *argv)
Definition indirect.h:78
IL_FUNCTION void __far(* _load)(const char __far *name)
Definition indirect.h:67
IL_FUNCTION void(* _exit)(int code)
Definition indirect.h:83
IL_FUNCTION int(* _suspend)(int i)
Definition indirect.h:86
IL_FUNCTION void(* _yield)(void)
Definition indirect.h:85
IL_FUNCTION int(* _swap)(int i)
Definition indirect.h:88
IL_FUNCTION int(* _run)(void __far *entrypoint, int argc, const char __far *__far *argv)
Definition indirect.h:73
IL_FUNCTION void(* _resume)(int i)
Definition indirect.h:87
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:38
IL_FUNCTION int(* _open_system)(const char __far *name, IL __far *buffer)
Definition indirect.h:58
IL_FUNCTION int(* _open)(const char __far *name, IL __far *buffer)
Definition indirect.h:48
fent_t __far * FS
Definition filesys.h:119