ISPP.Intf.pas 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {
  2. Inno Setup Preprocessor
  3. Copyright (C) 2001-2002 Alex Yackimoff
  4. Inno Setup
  5. Copyright (C) 1997-2025 Jordan Russell
  6. Portions by Martijn Laan
  7. For conditions of distribution and use, see LICENSE.TXT.
  8. }
  9. unit ISPP.Intf;
  10. interface
  11. type
  12. TOptionID = 0..25;
  13. TOptions = set of TOptionID;
  14. PIsppParserOptions = ^TIsppParserOptions;
  15. TIsppParserOptions = record
  16. Options: TOptions;
  17. end;
  18. TIsppOptions = record
  19. ParserOptions: TIsppParserOptions;
  20. Options: TOptions;
  21. VerboseLevel: Integer;
  22. InlineStart: String;
  23. InlineEnd: String;
  24. SpanSymbol: Char;
  25. end;
  26. TIsppVarType = (evSpecial, evNull, evInt, evStr, evLValue, evCallContext);
  27. IIsppFuncParam = interface
  28. function GetType: TIsppVarType; stdcall;
  29. function GetAsInt64: Int64; stdcall;
  30. function GetAsString(Buf: PChar; BufSize: Cardinal): Integer; stdcall;
  31. end;
  32. IIsppFuncResult = interface
  33. procedure SetAsInt(Value: Int64); stdcall;
  34. procedure SetAsString(Value: PChar); stdcall;
  35. procedure SetAsNull; stdcall;
  36. procedure Error(Message: PChar); stdcall;
  37. end;
  38. IIsppFuncParams = interface
  39. function Get(Index: Integer): IIsppFuncParam; stdcall;
  40. function GetCount: Integer; stdcall;
  41. end;
  42. TIsppFuncResult = record
  43. ErrParam: Integer;
  44. Error: Integer;
  45. end;
  46. TIsppFunction = function (Ext: NativeInt; const Params: IIsppFuncParams;
  47. const FuncResult: IIsppFuncResult): TIsppFuncResult; stdcall;
  48. IPreprocessor = interface
  49. procedure DefineVariable(Name: PChar; Typ: TIsppVarType; Value: Int64);
  50. procedure QueueLine(Line: PChar);
  51. end;
  52. const
  53. { TIsppFuncResult.Error values }
  54. // Function executed successfully
  55. ISPPFUNC_SUCCESS = 0;
  56. // Unexpected failure
  57. ISPPFUNC_FAIL = 1;
  58. // Too many arguments passed, ErrParam contains maximal number of arguments needed
  59. ISPPFUNC_MANYARGS = 2;
  60. // Insufficient required arguments, ErrParam contains minimal number of arguments
  61. ISPPFUNC_INSUFARGS = 3;
  62. // Wrong type of argument passed, ErrParam is the index of the argument
  63. ISPPFUNC_INTWANTED = 4;
  64. // Wrong type of argument passed, ErrParam is the index of the argument
  65. ISPPFUNC_STRWANTED = 5;
  66. const
  67. { Parser options }
  68. optSCBE = TOptionID(Ord('B') - Ord('A'));
  69. optSCME = TOptionID(Ord('M') - Ord('A'));
  70. optPassNulls = TOptionID(Ord('N') - Ord('A'));
  71. optPascalStrings = TOptionID(Ord('P') - Ord('A'));
  72. optAllowUndeclared = TOptionID(Ord('U') - Ord('A'));
  73. { Preprocessor options }
  74. optPassToCompiler = TOptionID(Ord('C') - Ord('A'));
  75. optEmitEmptyLines = TOptionID(Ord('E') - Ord('A'));
  76. optCircMacroCall = TOptionID(Ord('R') - Ord('A'));
  77. optVerbose = TOptionID(Ord('V') - Ord('A'));
  78. implementation
  79. end.