Thomas Heijligen | 5182037 | 2023-12-11 15:29:17 +0000 | [diff] [blame^] | 1 | with Interfaces.C; |
| 2 | with Interfaces.C.Strings; |
| 3 | with System; |
| 4 | |
| 5 | package FILO.FS.NullFS is |
| 6 | type NullFS_Type is private; |
| 7 | |
| 8 | |
| 9 | procedure Mount |
| 10 | (Item : in out NullFS_Type; |
| 11 | Success : out Boolean); |
| 12 | |
| 13 | procedure Open |
| 14 | (Item : in out NullFS_Type; |
| 15 | Path : in String; |
| 16 | Success : out Boolean); |
| 17 | |
| 18 | procedure Read |
| 19 | (Item : in out NullFS_Type; |
| 20 | Buffer : in out Buffer_Type; |
| 21 | Offset : in Natural; |
| 22 | Success : out Boolean); |
| 23 | |
| 24 | procedure Close |
| 25 | (Item : in out NullFS_Type; |
| 26 | Success : out Boolean); |
| 27 | |
| 28 | --------------------------------------------------------------------- |
| 29 | |
| 30 | function C_Mount return Interfaces.C.int |
| 31 | with |
| 32 | Export, |
| 33 | Convention => C, |
| 34 | External_Name => "nullfs_mount"; |
| 35 | |
| 36 | function C_Read |
| 37 | (buf : System.Address; |
| 38 | len : Interfaces.C.int) |
| 39 | return Interfaces.C.int |
| 40 | with |
| 41 | Export, |
| 42 | Convention => C, |
| 43 | External_Name => "nullfs_read"; |
| 44 | |
| 45 | function C_Dir |
| 46 | (Path : Interfaces.C.Strings.chars_ptr) |
| 47 | return Interfaces.C.int |
| 48 | with |
| 49 | Export, |
| 50 | Convention => C, |
| 51 | External_Name => "nullfs_dir"; |
| 52 | |
| 53 | function C_Close return Interfaces.C.int |
| 54 | with |
| 55 | Export, |
| 56 | Convention => C, |
| 57 | External_Name => "nullfs_close"; |
| 58 | |
| 59 | private |
| 60 | type State_Type is (Unmounted, Mounted, File_Open); |
| 61 | |
| 62 | type NullFS_Type is record |
| 63 | State : State_Type; |
| 64 | end record; |
| 65 | |
| 66 | end FILO.FS.NullFS; |