wiih.inc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. This file is part of the Free Component Library (FCL)
  3. Copyright (c) 1999-2002 by the Free Pascal development team
  4. BIOS functions unit for Nintendo Wii
  5. Copyright (c) 2011 by Francesco Lombardi
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. *****************************************************************************}
  12. type
  13. TDoOpen = procedure (var f; p: pchar; flags: longint);
  14. TDoClose = procedure (handle: THandle);
  15. TDoWrite = function (h: THandle; addr: pointer; len: longint): longint;
  16. TDoRead = function (h: THandle; addr: pointer; len: longint): longint;
  17. TDoSeek = procedure (handle: THandle; pos: longint);
  18. TDoSeekend = function (handle: THandle): longint;
  19. TDoErase = procedure (p: pchar);
  20. TDoRename = procedure (p1, p2: pchar);
  21. TDoFilepos = function (handle: THandle): longint;
  22. TDoFilesize = function (handle: THandle): longint;
  23. TDoTruncate = procedure (handle: THandle; pos: longint);
  24. TDoIsdevice = function (handle: THandle): boolean;
  25. TFileIO = packed record
  26. DoOpen : TDoOpen;
  27. DoClose : TDoClose;
  28. DoWrite : TDoWrite;
  29. DoRead : TDoRead;
  30. DoSeek : TDoSeek;
  31. DoSeekend : TDoSeekend;
  32. DoErase : TDoErase;
  33. DoRename : TDoRename;
  34. DoFilepos : TDoFilepos;
  35. DoFilesize: TDoFilesize;
  36. DoTruncate: TDoTruncate;
  37. DoIsdevice: TDoIsdevice;
  38. end;
  39. PFileIO = ^TFileIO;
  40. TDoMkdir = procedure (const s: string);
  41. TDoRmdir = procedure (const s: string);
  42. TDoChdir = procedure (const s: string);
  43. TDoGetdir = procedure (DriveNr: byte; var Dir: ShortString);
  44. TDirIO = packed record
  45. DoMkdir : TDoMkdir;
  46. DoRmdir : TDoRmdir;
  47. DoChdir : TDoChdir;
  48. DoGetdir: TDoGetdir;
  49. end;
  50. PDirIO = ^TDirIO;
  51. TFileIODevice = packed record
  52. FileIO: TFileIO;
  53. DirIO: TDirIO;
  54. end;
  55. PFileIODevice = ^TFileIODevice;
  56. procedure AssignDevice(const FIOD: TFileIODevice);
  57. var
  58. FileIODevice: TFileIODevice = (
  59. FileIO: (
  60. DoOpen: nil;
  61. DoClose: nil;
  62. DoWrite: nil;
  63. DoRead: nil;
  64. DoSeek: nil;
  65. DoSeekend: nil;
  66. DoErase: nil;
  67. DoRename: nil;
  68. DoFilepos: nil;
  69. DoFilesize: nil;
  70. DoTruncate: nil;
  71. DoIsdevice: nil;
  72. );
  73. DirIO: (
  74. DoMkdir: nil;
  75. DoRmdir: nil;
  76. DoChdir: nil;
  77. DoGetdir: nil;
  78. );
  79. );