summaryrefslogtreecommitdiff
path: root/packages/libogcfpc/src/fat.pp
blob: 2a90e7d06ce868baff1c516aef6c36a7e1de47f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
unit fat;
{$mode objfpc} 
{$J+}
{$INLINE ON}
{$MACRO ON}
{$ASSERTIONS ON}

interface

uses
  ctypes, gctypes, gccore;

function fatInit(cacheSize: cuint32; setAsDefaultDevice: cbool): cbool; cdecl; external;
function fatInitDefault: cbool; cdecl; external;

function fatMountSimple(name_: pcchar; interface_: PDISC_INTERFACE): cbool; cdecl; external;

function fatMount(name_: pcchar; interface_: PDISC_INTERFACE; startSector: sec_t; cacheSize, SectorsPerPage: cuint32): cbool; cdecl; external;
procedure fatUnmount(name_: pcchar); cdecl; external;
procedure fatGetVolumeLabel(name_, label_: pcchar); cdecl; external;

// File attributes
const
  ATTR_ARCHIVE = $20;         // Archive
  ATTR_DIRECTORY = $10;       // Directory
  ATTR_VOLUME = $08;          // Volume
  ATTR_SYSTEM = $04;          // System
  ATTR_HIDDEN = $02;          // Hidden
  ATTR_READONLY = $01;        // Read only

(*
Methods to modify DOS File Attributes
*)
function FAT_getAttr(const _file: pcchar): cint; cdecl; external;
function FAT_setAttr(const _file: pcchar; attr: cint): cint; cdecl; external;



implementation

initialization
{$linklib fat}
end.