| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#ifndef LIN_INCLUDED |
| 26 |
#define LIN_INCLUDED |
| 27 |
|
| 28 |
#ifndef LIB_INCLUDED |
| 29 |
#include "lib.h" |
| 30 |
#endif |
| 31 |
#ifndef OS_INCLUDED |
| 32 |
#include "os.h" |
| 33 |
#endif |
| 34 |
#ifndef OBJ_INCLUDED |
| 35 |
#include "obj.h" |
| 36 |
#endif |
| 37 |
|
| 38 |
#ifdef __cplusplus |
| 39 |
extern "C" { |
| 40 |
#endif |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
typedef struct lindef lindef; |
| 45 |
struct lindef |
| 46 |
{ |
| 47 |
int (*lingetp)(lindef *lin); |
| 48 |
void (*linclsp)(lindef *lin); |
| 49 |
void (*linppos)(lindef *lin, char *buf, uint buflen); |
| 50 |
|
| 51 |
void (*linglop)(lindef *lin, uchar *buf); |
| 52 |
|
| 53 |
int (*linwrtp)(lindef *lin, osfildef *fp); |
| 54 |
|
| 55 |
void (*lincmpp)(lindef *lin, uchar *buf); |
| 56 |
|
| 57 |
void (*linactp)(lindef *lin); |
| 58 |
void (*lindisp)(lindef *lin); |
| 59 |
void (*lintellp)(lindef *lin, uchar *pos); |
| 60 |
void (*linseekp)(lindef *lin, uchar *pos); |
| 61 |
int (*linreadp)(lindef *lin, uchar *buf, uint siz); |
| 62 |
void (*linpaddp)(lindef *lin, uchar *pos, long delta); |
| 63 |
|
| 64 |
int (*linqtopp)(lindef *lin, uchar *pos); |
| 65 |
int (*lingetsp)(lindef *lin, uchar *buf, uint siz); |
| 66 |
void (*linnamp)(lindef *lin, char *buf); |
| 67 |
void (*linfindp)(lindef *lin, char *buf, objnum *objp, |
| 68 |
uint *ofsp); |
| 69 |
void (*lingotop)(lindef *lin, int where); |
| 70 |
long (*linofsp)(lindef *lin); |
| 71 |
void (*linrenp)(lindef *lin, objnum oldnum, objnum newnum); |
| 72 |
|
| 73 |
void (*lindelp)(lindef *lin, objnum objn); |
| 74 |
|
| 75 |
ulong (*linlnump)(lindef *lin); |
| 76 |
# define LINGOTOP OSFSK_SET |
| 77 |
# define LINGOEND OSFSK_END |
| 78 |
lindef *linpar; |
| 79 |
lindef *linnxt; |
| 80 |
int linid; |
| 81 |
char *linbuf; |
| 82 |
ushort linflg; |
| 83 |
# define LINFEOF 0x01 |
| 84 |
# define LINFMORE 0x02 |
| 85 |
# define LINFDBG 0x04 |
| 86 |
# define LINFNOINC 0x08 |
| 87 |
# define LINFCMODE 0x10 |
| 88 |
ushort linlen; |
| 89 |
ushort linlln; |
| 90 |
}; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
#define LINLLNMAX 20 |
| 98 |
|
| 99 |
|
| 100 |
#define linget(lin) ((*((lindef *)(lin))->lingetp)((lindef *)(lin))) |
| 101 |
#define lincls(lin) ((*((lindef *)(lin))->linclsp)((lindef *)(lin))) |
| 102 |
#define linppos(lin, buf, buflen) \ |
| 103 |
((*((lindef *)(lin))->linppos)((lindef *)(lin), buf, buflen)) |
| 104 |
#define linglop(lin, buf) ((*((lindef *)(lin))->linglop)(lin, buf)) |
| 105 |
#define linwrt(lin, fp) ((*((lindef *)(lin))->linwrtp)(lin, fp)) |
| 106 |
#define lincmpinf(lin, buf) ((*((lindef *)(lin))->lincmpp)(lin, buf)) |
| 107 |
#define linactiv(lin) ((*((lindef *)(lin))->linactp)(lin)) |
| 108 |
#define lindisact(lin) ((*((lindef *)(lin))->lindisp)(lin)) |
| 109 |
#define lintell(lin, pos) ((*((lindef *)(lin))->lintellp)(lin, pos)) |
| 110 |
#define linseek(lin, pos) ((*((lindef *)(lin))->linseekp)(lin, pos)) |
| 111 |
#define linread(lin, buf, siz) ((*((lindef *)(lin))->linreadp)(lin, buf, siz)) |
| 112 |
#define linpadd(lin, pos, delta) \ |
| 113 |
((*((lindef *)(lin))->linpaddp)(lin, pos, delta)) |
| 114 |
#define linqtop(lin, pos) ((*((lindef *)(lin))->linqtopp)(lin, pos)) |
| 115 |
#define lingets(lin, buf, siz) ((*((lindef *)(lin))->lingetsp)(lin, buf, siz)) |
| 116 |
#define linnam(lin, buf) ((*((lindef *)(lin))->linnamp)(lin, buf)) |
| 117 |
#define linlnum(lin) ((*((lindef *)(lin))->linlnump)(lin)) |
| 118 |
#define linfind(lin, buf, objp, ofsp) \ |
| 119 |
((*((lindef *)(lin))->linfindp)(lin, buf, objp, ofsp)) |
| 120 |
#define lingoto(lin, where) ((*((lindef *)(lin))->lingotop)(lin, where)) |
| 121 |
#define linofs(lin) ((*((lindef *)(lin))->linofsp)(lin)) |
| 122 |
#define linrenum(lin, oldnum, newnum) \ |
| 123 |
((*((lindef *)(lin))->linrenp)(lin, oldnum, newnum)) |
| 124 |
#define lindelnum(lin, objn) ((*((lindef *)(lin))->lindelp)(lin, objn)) |
| 125 |
|
| 126 |
|
| 127 |
#ifdef __cplusplus |
| 128 |
} |
| 129 |
#endif |
| 130 |
|
| 131 |
#endif |