| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef LINF_INCLUDED |
| 23 |
#define LINF_INCLUDED |
| 24 |
|
| 25 |
#include <stdio.h> |
| 26 |
|
| 27 |
#ifndef STD_INCLUDED |
| 28 |
#include "std.h" |
| 29 |
#endif |
| 30 |
#ifndef OS_INCLUDED |
| 31 |
#include "os.h" |
| 32 |
#endif |
| 33 |
#ifndef LIN_INCLUDED |
| 34 |
#include "lin.h" |
| 35 |
#endif |
| 36 |
#ifndef OBJ_INCLUDED |
| 37 |
#include "obj.h" |
| 38 |
#endif |
| 39 |
#ifndef MCM_INCLUDED |
| 40 |
#include "mcm.h" |
| 41 |
#endif |
| 42 |
#ifndef TOK_INCLUDED |
| 43 |
#include "tok.h" |
| 44 |
#endif |
| 45 |
|
| 46 |
#ifdef __cplusplus |
| 47 |
extern "C" { |
| 48 |
#endif |
| 49 |
|
| 50 |
|
| 51 |
#define LINFPGMAX 128 |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
struct linfinfo |
| 59 |
{ |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
ulong fpos; |
| 66 |
|
| 67 |
|
| 68 |
objnum objn; |
| 69 |
|
| 70 |
|
| 71 |
uint ofs; |
| 72 |
}; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
struct linfdef |
| 78 |
{ |
| 79 |
lindef linflin; |
| 80 |
osfildef *linffp; |
| 81 |
char linfbuf[100]; |
| 82 |
int linfbufnxt; |
| 83 |
int linfnxtlen; |
| 84 |
ulong linfnum; |
| 85 |
ulong linfseek; |
| 86 |
mcmcxdef *linfmem; |
| 87 |
mcmon linfpg[LINFPGMAX]; |
| 88 |
ulong linfcrec; |
| 89 |
char linfnam[1]; |
| 90 |
}; |
| 91 |
typedef struct linfdef linfdef; |
| 92 |
|
| 93 |
|
| 94 |
linfdef *linfini(mcmcxdef *mctx, errcxdef *errctx, char *filename, |
| 95 |
int flen, struct tokpdef *path, int must_find_file, |
| 96 |
int new_line_records); |
| 97 |
|
| 98 |
|
| 99 |
void linfini2(mcmcxdef *mctx, linfdef *linf, |
| 100 |
char *filename, int flen, osfildef *fp, int new_line_records); |
| 101 |
|
| 102 |
|
| 103 |
int linfget(lindef *lin); |
| 104 |
|
| 105 |
|
| 106 |
void linfppos(lindef *lin, char *buf, uint bufl); |
| 107 |
|
| 108 |
|
| 109 |
void linfcls(lindef *lin); |
| 110 |
|
| 111 |
|
| 112 |
void linfglop(lindef *lin, uchar *buf); |
| 113 |
|
| 114 |
|
| 115 |
void linfglop2(lindef *lin, uchar *buf); |
| 116 |
|
| 117 |
|
| 118 |
int linfwrt(lindef *lin, osfildef *fp); |
| 119 |
|
| 120 |
|
| 121 |
int linfload(osfildef *fp, struct dbgcxdef *dbgctx, errcxdef *ec, |
| 122 |
struct tokpdef *path); |
| 123 |
|
| 124 |
|
| 125 |
void linfcmp(lindef *lin, uchar *buf); |
| 126 |
|
| 127 |
|
| 128 |
void linffind(lindef *lin, char *buf, objnum *objp, uint *ofsp); |
| 129 |
|
| 130 |
|
| 131 |
void linfact(lindef *lin); |
| 132 |
|
| 133 |
|
| 134 |
void linfdis(lindef *lin); |
| 135 |
|
| 136 |
|
| 137 |
void linftell(lindef *lin, uchar *pos); |
| 138 |
|
| 139 |
|
| 140 |
void linfseek(lindef *lin, uchar *pos); |
| 141 |
|
| 142 |
|
| 143 |
int linfread(lindef *lin, uchar *buf, uint siz); |
| 144 |
|
| 145 |
|
| 146 |
void linfpadd(lindef *lin, uchar *pos, long delta); |
| 147 |
|
| 148 |
|
| 149 |
int linfqtop(lindef *lin, uchar *pos); |
| 150 |
|
| 151 |
|
| 152 |
int linfgets(lindef *lin, uchar *buf, uint bufsiz); |
| 153 |
|
| 154 |
|
| 155 |
void linfnam(lindef *lin, char *buf); |
| 156 |
|
| 157 |
|
| 158 |
ulong linflnum(lindef *lin); |
| 159 |
|
| 160 |
|
| 161 |
void linfgoto(lindef *lin, int where); |
| 162 |
|
| 163 |
|
| 164 |
long linfofs(lindef *lin); |
| 165 |
|
| 166 |
|
| 167 |
void linfren(lindef *lin, objnum oldnum, objnum newnum); |
| 168 |
|
| 169 |
|
| 170 |
void linfdelnum(lindef *lin, objnum objn); |
| 171 |
|
| 172 |
|
| 173 |
void linf_copy_linerecs(linfdef *linf, struct linfinfo *info); |
| 174 |
|
| 175 |
|
| 176 |
#ifdef DEBUG |
| 177 |
# define LINFDEBUG(x) x |
| 178 |
#else |
| 179 |
# define LINFDEBUG(x) |
| 180 |
#endif |
| 181 |
|
| 182 |
#ifdef __cplusplus |
| 183 |
} |
| 184 |
#endif |
| 185 |
|
| 186 |
#endif |