forked from jrsoftware/issrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompPreprocInt.pas
122 lines (110 loc) · 6.3 KB
/
CompPreprocInt.pas
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
unit CompPreprocInt;
{
Inno Setup
Copyright (C) 1997-2020 Jordan Russell
Portions by Martijn Laan
For conditions of distribution and use, see LICENSE.TXT.
Compiler preprocessor interface
}
interface
uses
Windows;
const
ispeSuccess = 0;
ispeInvalidParam = 1;
ispePreprocessError = 2;
ispeSilentAbort = 3;
type
TPreprocCompilerData = type Pointer;
TPreprocFileHandle = type Integer;
TPreprocLoadFileProc =
function(CompilerData: TPreprocCompilerData; Filename: PChar;
ErrorFilename: PChar; ErrorLine: Integer;
ErrorColumn: Integer): TPreprocFileHandle; stdcall;
TPreprocLineInProc =
function(CompilerData: TPreprocCompilerData; FileHandle: TPreprocFileHandle;
LineIndex: Integer): PChar; stdcall;
TPreprocLineOutProc =
procedure(CompilerData: TPreprocCompilerData; LineFilename: PChar;
LineNumber: Integer; LineText: PChar); stdcall;
TPreprocErrorProc =
procedure(CompilerData: TPreprocCompilerData; ErrorMsg: PChar;
ErrorFilename: PChar; ErrorLine: Integer; ErrorColumn: Integer); stdcall;
TPreprocStatusProc =
procedure(CompilerData: TPreprocCompilerData; StatusMsg: PChar; Warning: BOOL); stdcall;
TPreprocPrependDirNameProc =
function(CompilerData: TPreprocCompilerData; Filename: PChar; Dir: PChar;
ErrorFilename: PChar; ErrorLine: Integer; ErrorColumn: Integer): PChar; stdcall;
TPreprocCleanupProc = function(CleanupProcData: Pointer): Integer; stdcall;
PPreprocessScriptParams = ^TPreprocessScriptParams;
TPreprocessScriptParams = record
Size: Cardinal; { [in] Set to SizeOf(TPreprocessScriptParams).
Preprocessor must return ispeInvalidParam
if value is not recognized. }
InterfaceVersion: Cardinal; { [in] Currently set to 2.
Preprocessor must return ispeInvalidParam
if value is not recognized. }
CompilerBinVersion: Cardinal; { [in] Compiler version as an integer }
Filename: PChar; { [in] The full name of the file being
preprocessed, or an empty string if
preprocessing the main script. }
SourcePath: PChar; { [in] The default source directory, and
directory to look in for #include files.
Normally, this is the directory containing
the script file. }
CompilerPath: PChar; { [in] The "compiler:" directory. This is
the directory which contains the *.e32
files. }
Options: PChar; { [in] The 'ISPP:'-prefixed options that
were passed to the compiler in
TCompileScriptParamsEx.Options. }
CompilerData: TPreprocCompilerData; { [in] Opaque value supplied by the
compiler that the preprocessor must
pass unchanged when calling the
*Proc callback functions. }
LoadFileProc: TPreprocLoadFileProc;
{ [in] Call to load a new file. Returns
a "handle" to the file which can be
passed to LineInProc. On failure,
returns -1 and internally calls
ErrorProc with a description of the
error. }
LineInProc: TPreprocLineInProc; { [in] Call to read a line from the
specified file. LineIndex is
zero-based. The returned pointer is
valid only until the next LineInProc
call is made (or the preprocess
function returns). NULL is returned
if EOF is reached. }
LineOutProc: TPreprocLineOutProc; { [in] Call to send preprocessed
line back to the compiler. }
StatusProc: TPreprocStatusProc; { [in] Call to log a message. }
ErrorProc: TPreprocErrorProc; { [in] Call to report an error. }
PrependDirNameProc: TPreprocPrependDirNameProc;
{ [in] If the specified filename is
relative, prepends the specified
directory name (must include trailing
path separator). If the specified
filename begins with a prefix, such
as "compiler:", expands the prefix.
The returned pointer is valid only
until the next PrependDirNameProc
call is made (or the preprocess
function returns). On failure,
returns NULL and internally calls
ErrorProc with a description of the
error.}
PreprocCleanupProc: TPreprocCleanupProc;
{ [out] Preprocessor-defined function
that, if set, is called after
compilation completes or is aborted.
Note: This function will still be
called if the preprocess function
returns a non-ispeSuccess value. }
PreprocCleanupProcData: Pointer; { [out] Preprocessor-defined value
passed to PreprocCleanupProc. }
end;
TPreprocessScriptProc = function(var Params: TPreprocessScriptParams): Integer;
stdcall;
implementation
end.