system.pp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Florian Klaempfl
  4. member of the Free Pascal development team
  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. {$define PALMOS}
  12. {$ASMMODE DIRECT}
  13. unit system;
  14. {$I os.inc}
  15. Interface
  16. {Platform specific information}
  17. const
  18. LineEnding = #10;
  19. LFNSupport = false;
  20. DirectorySeparator = '/';
  21. DriveSeparator = ':';
  22. ExtensionSeparator = '.';
  23. PathSeparator = ';';
  24. AllowDirectorySeparators : set of char = ['\','/'];
  25. AllowDriveSeparators : set of char = [':'];
  26. FileNameCaseSensitive = false;
  27. FileNameCasePreserving = true;
  28. CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
  29. maxExitCode = 255; {$ERROR TODO: CONFIRM THIS}
  30. MaxPathLen = 256;
  31. AllFilesMask = '*';
  32. Type
  33. { type and constant declartions doesn't hurt }
  34. LongInt = $80000000..$7fffffff;
  35. Integer = -32768..32767;
  36. ShortInt = -128..127;
  37. Byte = 0..255;
  38. Word = 0..65535;
  39. { !!!!
  40. DWord = Cardinal;
  41. LongWord = Cardinal;
  42. }
  43. { The Cardinal data type isn't currently implemented for the m68k }
  44. DWord = LongInt;
  45. LongWord = LongInt;
  46. { Zero - terminated strings }
  47. PChar = ^Char;
  48. PPChar = ^PChar;
  49. { procedure type }
  50. TProcedure = Procedure;
  51. const
  52. { max. values for longint and int }
  53. MaxLongint = High(LongInt);
  54. MaxInt = High(Integer);
  55. { Must be determined at startup for both }
  56. Test68000 : byte = 0;
  57. Test68881 : byte = 0;
  58. { Palm specific data types }
  59. type
  60. Ptr = ^Char;
  61. var
  62. ExitCode : DWord;
  63. { this variables are passed to PilotMain by the PalmOS }
  64. cmd : Word;
  65. cmdPBP : Ptr;
  66. launchFlags : Word;
  67. implementation
  68. { mimic the C start code }
  69. function PilotMain(_cmd : Word;_cmdPBP : Ptr;_launchFlags : Word) : DWord;cdecl;public;
  70. begin
  71. cmd:=_cmd;
  72. cmdPBP:=_cmdPBP;
  73. launchFlags:=_launchFlags;
  74. asm
  75. bsr PASCALMAIN
  76. end;
  77. PilotMain:=ExitCode;
  78. end;
  79. {*****************************************************************************
  80. System Dependent Exit code
  81. *****************************************************************************}
  82. Procedure system_exit;
  83. begin
  84. end;
  85. function GetProcessID: SizeUInt;
  86. begin
  87. GetProcessID := 1;
  88. end;
  89. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  90. begin
  91. result := stklen;
  92. end;
  93. begin
  94. StackLength := CheckInitialStkLen (InitialStkLen);
  95. ExitCode:=0;
  96. end.