1. -- 
  2. -- Copyright (c) 2012 Kevin Wellwood 
  3. -- All rights reserved. 
  4. -- 
  5. -- This source code is distributed under the Modified BSD License. For terms and 
  6. -- conditions, see license.txt. 
  7. -- 
  8.  
  9. with Ada.Streams;                       use Ada.Streams; 
  10.  
  11. -- This package provides an implementation for Allegro_Files backed by read-only 
  12. -- memory. It differs from the Allegro Memfile addon by optionally managing the 
  13. -- memory backing the file. 
  14. private package Resources.Allegro_Files is 
  15.  
  16.     -- Returns a reference to a read-only Allegro_File backed by 'buffer'. If 
  17.     -- 'consume' is True, the Allegro_File assumes ownership of the buffer, 
  18.     -- freeing it when the file is closed. If 'buffer' is consumed, the caller 
  19.     -- should not reference 'buffer' again after calling this function. 
  20.     function Open_Memfile( buffer  : access Stream_Element_Array; 
  21.                            consume : Boolean := False ) return A_Allegro_File; 
  22.  
  23. end Resources.Allegro_Files;