system.pp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. CtrlZMarksEOF: boolean = false; (* #26 not considered as end of file *)
  28. maxExitCode = 255; {$ERROR TODO: CONFIRM THIS}
  29. MaxPathLen = 256;
  30. AllFilesMask = '*';
  31. Type
  32. { type and constant declartions doesn't hurt }
  33. LongInt = $80000000..$7fffffff;
  34. Integer = -32768..32767;
  35. ShortInt = -128..127;
  36. Byte = 0..255;
  37. Word = 0..65535;
  38. { !!!!
  39. DWord = Cardinal;
  40. LongWord = Cardinal;
  41. }
  42. { The Cardinal data type isn't currently implemented for the m68k }
  43. DWord = LongInt;
  44. LongWord = LongInt;
  45. { Zero - terminated strings }
  46. PChar = ^Char;
  47. PPChar = ^PChar;
  48. { procedure type }
  49. TProcedure = Procedure;
  50. const
  51. { max. values for longint and int }
  52. MaxLongint = High(LongInt);
  53. MaxInt = High(Integer);
  54. { Must be determined at startup for both }
  55. Test68000 : byte = 0;
  56. Test68881 : byte = 0;
  57. { Palm specific data types }
  58. type
  59. Ptr = ^Char;
  60. var
  61. ExitCode : DWord;
  62. { this variables are passed to PilotMain by the PalmOS }
  63. cmd : Word;
  64. cmdPBP : Ptr;
  65. launchFlags : Word;
  66. implementation
  67. { mimic the C start code }
  68. function PilotMain(_cmd : Word;_cmdPBP : Ptr;_launchFlags : Word) : DWord;cdecl;public;
  69. begin
  70. cmd:=_cmd;
  71. cmdPBP:=_cmdPBP;
  72. launchFlags:=_launchFlags;
  73. asm
  74. bsr PASCALMAIN
  75. end;
  76. PilotMain:=ExitCode;
  77. end;
  78. {*****************************************************************************
  79. System Dependent Exit code
  80. *****************************************************************************}
  81. Procedure system_exit;
  82. begin
  83. end;
  84. function GetProcessID: SizeUInt;
  85. begin
  86. GetProcessID := 1;
  87. end;
  88. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  89. begin
  90. result := stklen;
  91. end;
  92. begin
  93. StackLength := CheckInitialStkLen (InitialStkLen);
  94. ExitCode:=0;
  95. end.