system.pp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2007 by contributors of the Free Pascal Compiler
  4. Pascal system unit for the Symbian OS
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit System;
  12. interface
  13. {$ifdef SYSTEMDEBUG}
  14. {$define SYSTEMEXCEPTIONDEBUG}
  15. {$endif SYSTEMDEBUG}
  16. {$ifdef cpui386}
  17. {$define Set_i386_Exception_handler}
  18. {$endif cpui386}
  19. {$define DISABLE_NO_THREAD_MANAGER}
  20. { include system-independent routine headers }
  21. {$I systemh.inc}
  22. const
  23. LineEnding = #13#10;
  24. LFNSupport = true;
  25. DirectorySeparator = '\';
  26. DriveSeparator = ':';
  27. PathSeparator = ';';
  28. { FileNameCaseSensitive is defined separately below }
  29. maxExitCode = 65535;
  30. MaxPathLen = 260;
  31. type
  32. PEXCEPTION_FRAME = ^TEXCEPTION_FRAME;
  33. TEXCEPTION_FRAME = record
  34. next : PEXCEPTION_FRAME;
  35. handler : pointer;
  36. end;
  37. const
  38. { Default filehandles }
  39. UnusedHandle : THandle = -1;
  40. StdInputHandle : THandle = 0;
  41. StdOutputHandle : THandle = 0;
  42. StdErrorHandle : THandle = 0;
  43. FileNameCaseSensitive : boolean = true;
  44. CtrlZMarksEOF: boolean = true; (* #26 not considered as end of file *)
  45. sLineBreak = LineEnding;
  46. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
  47. { Thread count for DLL }
  48. Thread_count : longint = 0;
  49. System_exception_frame : PEXCEPTION_FRAME =nil;
  50. type
  51. TStartupInfo=packed record
  52. cb : longint;
  53. lpReserved : Pointer;
  54. lpDesktop : Pointer;
  55. lpTitle : Pointer;
  56. dwX : longint;
  57. dwY : longint;
  58. dwXSize : longint;
  59. dwYSize : longint;
  60. dwXCountChars : longint;
  61. dwYCountChars : longint;
  62. dwFillAttribute : longint;
  63. dwFlags : longint;
  64. wShowWindow : Word;
  65. cbReserved2 : Word;
  66. lpReserved2 : Pointer;
  67. hStdInput : longint;
  68. hStdOutput : longint;
  69. hStdError : longint;
  70. end;
  71. var
  72. { C compatible arguments }
  73. argc : longint;
  74. argv : ppchar;
  75. { Win32 Info }
  76. startupinfo : tstartupinfo;
  77. hprevinst,
  78. MainInstance,
  79. cmdshow : longint;
  80. DLLreason,DLLparam:longint;
  81. type
  82. TDLL_Process_Entry_Hook = function (dllparam : longint) : longbool;
  83. TDLL_Entry_Hook = procedure (dllparam : longint);
  84. const
  85. Dll_Process_Attach_Hook : TDLL_Process_Entry_Hook = nil;
  86. Dll_Process_Detach_Hook : TDLL_Entry_Hook = nil;
  87. Dll_Thread_Attach_Hook : TDLL_Entry_Hook = nil;
  88. Dll_Thread_Detach_Hook : TDLL_Entry_Hook = nil;
  89. implementation
  90. var
  91. SysInstance: Longint; public name '_FPC_SysInstance';
  92. { include system independent routines }
  93. {$I system.inc}
  94. {*****************************************************************************
  95. Parameter Handling
  96. *****************************************************************************}
  97. var
  98. ModuleName : array[0..255] of char;
  99. function GetCommandFile:pchar;
  100. begin
  101. end;
  102. procedure setup_arguments;
  103. begin
  104. end;
  105. function paramcount : longint;
  106. begin
  107. paramcount := argc - 1;
  108. end;
  109. function paramstr(l : longint) : string;
  110. begin
  111. if (l>=0) and (l<argc) then
  112. paramstr:=strpas(argv[l])
  113. else
  114. paramstr:='';
  115. end;
  116. procedure randomize;
  117. begin
  118. // randseed:=GetTickCount;
  119. end;
  120. {*****************************************************************************
  121. Exit code and Entry Point
  122. *****************************************************************************}
  123. procedure PascalMain; stdcall; external name 'PASCALMAIN';
  124. procedure fpc_do_exit; stdcall; external name 'FPC_DO_EXIT';
  125. procedure SysInitStdIO;
  126. begin
  127. end;
  128. procedure _E32Startup; stdcall; public name '_E32Startup';
  129. begin
  130. IsLibrary:=false;
  131. PascalMain;
  132. { if we pass here there was no error }
  133. fpc_do_exit;
  134. end;
  135. {*****************************************************************************
  136. Process routines
  137. *****************************************************************************}
  138. (* ProcessID cached to avoid repeated calls to GetCurrentProcess. *)
  139. var
  140. ProcessID: SizeUInt;
  141. function GetProcessID: SizeUInt;
  142. begin
  143. GetProcessID := ProcessID;
  144. end;
  145. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  146. begin
  147. result := stklen;
  148. end;
  149. begin
  150. end.