1. -- 
  2. -- Copyright (c) 2013 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 Allegro.File_IO;                   use Allegro.File_IO; 
  10.  
  11. -- Allegro 5.0.9 - Configuration routines 
  12. package Allegro.Configuration is 
  13.  
  14.     type Allegro_Config is limited private; 
  15.     type A_Allegro_Config is access all Allegro_Config; 
  16.  
  17.     type Allegro_Config_Section is limited private; 
  18.     type A_Allegro_Config_Section is access all Allegro_Config_Section; 
  19.  
  20.     type Allegro_Config_Entry is limited private; 
  21.     type A_Allegro_Config_Entry is access all Allegro_Config_Entry; 
  22.  
  23.     function Al_Create_Config return A_Allegro_Config; 
  24.     pragma Import( C, Al_Create_Config, "al_create_config" ); 
  25.  
  26.     procedure Al_Destroy_Config( config : in out A_Allegro_Config ); 
  27.  
  28.     function Al_Load_Config_File( filename : String ) return A_Allegro_Config; 
  29.  
  30.     function Al_Load_Config_File_f( file : A_Allegro_File ) return A_Allegro_Config; 
  31.     pragma Import( C, Al_Load_Config_File_f, "al_load_config_file_f" ); 
  32.  
  33.     function Al_Save_Config_File( filename : String; config : A_Allegro_Config ) return Boolean; 
  34.  
  35.     function Al_Save_Config_File_f( file   : A_Allegro_File; 
  36.                                     config : A_Allegro_Config ) return Boolean; 
  37.  
  38.     procedure Al_Add_Config_Section( config : A_Allegro_Config; 
  39.                                      name   : String ); 
  40.  
  41.     procedure Al_Add_Config_Comment( config  : A_Allegro_Config; 
  42.                                      section : String; 
  43.                                      comment : String ); 
  44.  
  45.     function Al_Get_Config_Value( config  : A_Allegro_Config; 
  46.                                   section : String; 
  47.                                   key     : String ) return String; 
  48.  
  49.     procedure Al_Set_Config_Value( config  : A_Allegro_Config; 
  50.                                    section : String; 
  51.                                    key     : String; 
  52.                                    value   : String ); 
  53.  
  54.     function Al_Get_First_Config_Section( config   : A_Allegro_Config; 
  55.                                           iterator : access A_Allegro_Config_Section 
  56.                                         ) return String; 
  57.  
  58.     function Al_Get_Next_Config_Section( iterator : access A_Allegro_Config_Section ) return String; 
  59.  
  60.     function Al_Get_First_Config_Entry( config   : A_Allegro_Config; 
  61.                                           section  : String; 
  62.                                           iterator : access A_Allegro_Config_Entry 
  63.                                         ) return String; 
  64.  
  65.     function Al_Get_Next_Config_Entry( iterator : access A_Allegro_Config_Entry ) return String; 
  66.  
  67.     function Al_Merge_Config( cfg1, cfg2 : A_Allegro_Config ) return A_Allegro_Config; 
  68.     pragma Import( C, Al_Merge_Config, "al_merge_config" ); 
  69.  
  70.     procedure Al_Merge_Config_Into( master : A_Allegro_Config; add : A_Allegro_Config ); 
  71.     pragma Import( C, Al_Merge_Config_Into, "al_merge_config_into" ); 
  72.  
  73. private 
  74.  
  75.     type Allegro_Config is limited null record; 
  76.     pragma Convention( C, Allegro_Config ); 
  77.  
  78.     type Allegro_Config_Section is limited null record; 
  79.     pragma Convention( C, Allegro_Config_Section ); 
  80.  
  81.     type Allegro_Config_Entry is limited null record; 
  82.     pragma Convention( C, Allegro_Config_Entry ); 
  83.  
  84. end Allegro.Configuration;