forked from Macroassembler-AS/asl-releases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asmmac.h
124 lines (102 loc) · 3.59 KB
/
asmmac.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef _ASMMAC_H
#define _ASMMAC_H
/* asmmac.h */
/*****************************************************************************/
/* AS-Portierung */
/* */
/* Unterroutinen des Makroprozessors */
/* */
/* Historie: 16. 5.1996 Grundsteinlegung */
/* 2001-12-31 added DoIntLabel flag */
/* 2002-03-03 added FromFile flag, LineRun pointer to input tag */
/* */
/*****************************************************************************/
#include "errmsg.h"
#include "strcomp.h"
typedef struct _MacroRec
{
char *Name; /* Name des Makros */
Byte ParamCount; /* Anzahl Parameter */
StringList FirstLine; /* Zeiger auf erste Zeile */
StringList ParamNames; /* parameter names, needed for named parameters */
StringList ParamDefVals; /* default values */
LongInt UseCounter; /* to limit recursive calls */
tLstMacroExpMod LstMacroExpMod; /* modify macro expansion list subset */
Boolean LocIntLabel; /* Label used internally instead at beginning */
Boolean GlobalSymbols; /* labels not local to macro */
Boolean UsesNumArgs, /* NUMARGS referenced in macro body */
UsesAllArgs; /* ALLARGS referenced in macro body */
} MacroRec, *PMacroRec;
#define BufferArraySize 1024
typedef struct _TInputTag
{
struct _TInputTag *Next;
Boolean IsMacro;
Integer IfLevel;
Boolean First;
Boolean GlobalSymbols;
tLstMacroExp OrigDoLst;
LongInt StartLine;
Boolean (*Processor)(
#ifdef __PROTOS__
struct _TInputTag *P, char *erg
#endif
);
LongInt ParCnt,ParZ;
StringList Params;
LongInt LineCnt, LineZ;
StringRecPtr Lines, LineRun;
String SpecNameStr, SaveAttr, SaveLabel, AllArgs;
tStrComp SpecName;
ShortString NumArgs;
Boolean IsEmpty, FromFile, UsesAllArgs, UsesNumArgs;
FILE *Datei;
void *Buffer;
void (*Cleanup)(
#ifdef __PROTOS__
struct _TInputTag *P
#endif
);
void (*Restorer)(
#ifdef __PROTOS__
struct _TInputTag *P
#endif
);
Boolean (*GetPos)(
#ifdef __PROTOS__
struct _TInputTag *P, char *Dest
#endif
);
PMacroRec Macro;
} TInputTag, *PInputTag;
typedef struct _TOutputTag
{
struct _TOutputTag *Next;
void (*Processor)(
#ifdef __PROTOS__
void
#endif
);
Integer NestLevel;
PInputTag Tag;
PMacroRec Mac;
StringList ParamNames, ParamDefVals;
LongInt PubSect,GlobSect;
Boolean DoExport, DoGlobCopy, UsesNumArgs, UsesAllArgs;
String GName;
tErrorNum OpenErrMsg;
} TOutputTag, *POutputTag;
extern PInputTag FirstInputTag;
extern POutputTag FirstOutputTag;
extern void Preprocess(void);
extern void AddMacro(PMacroRec Neu, LongInt DefSect, Boolean Protest);
extern Boolean FoundMacro(PMacroRec *Erg);
extern void ClearMacroList(void);
extern void ResetMacroDefines(void);
extern void ClearMacroRec(PMacroRec *Alt, Boolean Complete);
extern void PrintMacroList(void);
extern void PrintDefineList(void);
extern void ClearDefineList(void);
extern void ExpandDefines(char *Line);
extern void asmmac_init(void);
#endif /* _ASMMAC_H */