"Cryostat" (Genesis)

cryostat.adb


   1 ------------------------------------------------------------------------------
   2 ------------------------------------------------------------------------------
   3 -- This file is part of 'Cryostat', an Ada library for persistent storage.  --
   4 --                                                                          --
   5 -- (C) 2020 Stanislav Datskovskiy ( www.loper-os.org )                      --
   6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html     --
   7 --                                                                          --
   8 -- You do not have, nor can you ever acquire the right to use, copy or      --
   9 -- distribute this software ; Should you use this software for any purpose, --
  10 -- or copy and distribute it to anyone or in any manner, you are breaking   --
  11 -- the laws of whatever soi-disant jurisdiction, and you promise to         --
  12 -- continue doing so for the indefinite future. In any case, please         --
  13 -- always : read and understand any software ; verify any PGP signatures    --
  14 -- that you use - for any purpose.                                          --
  15 ------------------------------------------------------------------------------
  16 ------------------------------------------------------------------------------
  17 
  18 package body Cryostat is
  19    
  20    -- Test if the Cryostat is usable
  21    function IsReady return Boolean is
  22    begin
  23       return PMaps.IsReady(Map);
  24    end IsReady;
  25    
  26    
  27    -- If the Cryostat is writable, sync to disk immediately.
  28    procedure Sync is
  29    begin
  30       PMaps.Sync(Map);
  31    end Sync;
  32    
  33    
  34    -- Zero the entire mapped space of the Cryostat.
  35    procedure Zap is
  36    begin
  37       PMaps.Zap(Map);
  38    end Zap;
  39    
  40    
  41    -- Close the Cryostat and mark it unusable.
  42    -- Normally, this is unnecessary (Finalize will do it)
  43    procedure Stop is
  44    begin
  45       PMaps.Stop(Map);
  46    end Stop;
  47    
  48 end Cryostat;