raw
cryostat_genesis.kv     1 ------------------------------------------------------------------------------
cryostat_genesis.kv 2 ------------------------------------------------------------------------------
cryostat_genesis.kv 3 -- This file is part of 'Cryostat', an Ada library for persistent storage. --
cryostat_genesis.kv 4 -- --
cryostat_genesis.kv 5 -- (C) 2020 Stanislav Datskovskiy ( www.loper-os.org ) --
cryostat_genesis.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
cryostat_genesis.kv 7 -- --
cryostat_genesis.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
cryostat_genesis.kv 9 -- distribute this software ; Should you use this software for any purpose, --
cryostat_genesis.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
cryostat_genesis.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
cryostat_genesis.kv 12 -- continue doing so for the indefinite future. In any case, please --
cryostat_genesis.kv 13 -- always : read and understand any software ; verify any PGP signatures --
cryostat_genesis.kv 14 -- that you use - for any purpose. --
cryostat_genesis.kv 15 ------------------------------------------------------------------------------
cryostat_genesis.kv 16 ------------------------------------------------------------------------------
cryostat_genesis.kv 17
cryostat_genesis.kv 18 with System;
cryostat_genesis.kv 19 with Unix; use Unix;
cryostat_genesis.kv 20 with PMaps; use PMaps;
cryostat_genesis.kv 21
cryostat_genesis.kv 22
cryostat_genesis.kv 23 generic
cryostat_genesis.kv 24
cryostat_genesis.kv 25 -- The type of the item that will live in the Cryostat :
cryostat_genesis.kv 26 type Form is limited private;
cryostat_genesis.kv 27
cryostat_genesis.kv 28 -- The path of the backing file :
cryostat_genesis.kv 29 Path : in String;
cryostat_genesis.kv 30
cryostat_genesis.kv 31 -- Whether the contents of the Cryostat will be writable :
cryostat_genesis.kv 32 Writable : in Boolean;
cryostat_genesis.kv 33
cryostat_genesis.kv 34 -- Whether the backing file is to be created if it does not already exist :
cryostat_genesis.kv 35 Create : in Boolean;
cryostat_genesis.kv 36
cryostat_genesis.kv 37 package Cryostat is
cryostat_genesis.kv 38
cryostat_genesis.kv 39 pragma Preelaborate;
cryostat_genesis.kv 40
cryostat_genesis.kv 41 -- The concrete datum of type Form that will live in the Cryostat :
cryostat_genesis.kv 42 Item : Form;
cryostat_genesis.kv 43
cryostat_genesis.kv 44 -- Test if the Cryostat is usable
cryostat_genesis.kv 45 function IsReady return Boolean;
cryostat_genesis.kv 46
cryostat_genesis.kv 47 -- If the Cryostat is writable, sync it to disk immediately
cryostat_genesis.kv 48 procedure Sync;
cryostat_genesis.kv 49
cryostat_genesis.kv 50 -- Zero the entire mapped space of the Cryostat
cryostat_genesis.kv 51 procedure Zap;
cryostat_genesis.kv 52
cryostat_genesis.kv 53 -- Close the Cryostat and mark it unusable.
cryostat_genesis.kv 54 -- Normally, this is unnecessary (Finalize will do it)
cryostat_genesis.kv 55 procedure Stop;
cryostat_genesis.kv 56
cryostat_genesis.kv 57 private
cryostat_genesis.kv 58
cryostat_genesis.kv 59 -- The actual number of bytes occupied by an instance of the Form type :
cryostat_genesis.kv 60 Footprint : constant Word := Form'Size / System.Storage_Unit;
cryostat_genesis.kv 61
cryostat_genesis.kv 62 -- Instantiate a memory map using the given params :
cryostat_genesis.kv 63 Map : PMap(Handle => OpenMapFile(Path => Path,
cryostat_genesis.kv 64 Writable => Writable,
cryostat_genesis.kv 65 Create => Create),
cryostat_genesis.kv 66 Length => Footprint,
cryostat_genesis.kv 67 Offset => 0, -- Offsetted maps not supported yet!
cryostat_genesis.kv 68 Create => Create,
cryostat_genesis.kv 69 Writable => Writable);
cryostat_genesis.kv 70
cryostat_genesis.kv 71 -- Force Item to reside at the obtained address :
cryostat_genesis.kv 72 for Item'Address use GetAddress(Map);
cryostat_genesis.kv 73
cryostat_genesis.kv 74 end Cryostat;