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 GNAT.OS_Lib; 
  10.  
  11. -- Allegro 5.0.9 - Path structures 
  12. package Allegro.Paths is 
  13.  
  14.     ALLEGRO_NATIVE_PATH_SEP : constant Character; 
  15.  
  16.     type Allegro_Path is limited private; 
  17.     type A_Allegro_Path is access all Allegro_Path; 
  18.  
  19.     function Al_Create_Path( str : String ) return A_Allegro_Path; 
  20.  
  21.     function Al_Create_Path_For_Directory( str : String ) return A_Allegro_Path; 
  22.  
  23.     procedure Al_Destroy_Path( path : in out A_Allegro_Path ); 
  24.  
  25.     function Al_Clone_Path( path : A_Allegro_Path ) return A_Allegro_Path; 
  26.     pragma Import( C, Al_Clone_Path, "al_clone_path" ); 
  27.  
  28.     function Al_Join_Paths( path : A_Allegro_Path; tail : A_Allegro_Path ) return Boolean; 
  29.  
  30.     function Al_Rebase_Path( head : A_Allegro_Path; tail : A_Allegro_Path ) return Boolean; 
  31.  
  32.     function Al_Get_Path_Drive( path : A_Allegro_Path ) return String; 
  33.  
  34.     function Al_Get_Path_Num_Components( path : A_Allegro_Path ) return Integer; 
  35.     pragma Import( C, Al_Get_Path_Num_Components, "al_get_path_num_components" ); 
  36.  
  37.     function Al_Get_Path_Component( path : A_Allegro_Path; i : Integer ) return String; 
  38.  
  39.     function Al_Get_Path_Tail( path : A_Allegro_Path ) return String; 
  40.  
  41.     function Al_Get_Path_Filename( path : A_Allegro_Path ) return String; 
  42.  
  43.     function Al_Get_Path_Basename( path : A_Allegro_Path ) return String; 
  44.  
  45.     function Al_Get_Path_Extension( path : A_Allegro_Path ) return String; 
  46.  
  47.     procedure Al_Set_Path_Drive( path : A_Allegro_Path; drive : String ); 
  48.  
  49.     procedure Al_Append_Path_Component( path : A_Allegro_Path; s : String ); 
  50.  
  51.     procedure Al_Insert_Path_Component( path : A_Allegro_Path; 
  52.                                         i    : Integer; 
  53.                                         s    : String ); 
  54.  
  55.     procedure Al_Replace_Path_Component( path : A_Allegro_Path; 
  56.                                          i    : Integer; 
  57.                                          s    : String ); 
  58.  
  59.     procedure Al_Remove_Path_Component( path : A_Allegro_Path; i : Integer ); 
  60.     pragma Import( C, Al_Remove_Path_Component, "al_remove_path_component" ); 
  61.  
  62.     procedure Al_Drop_Path_Tail( path : A_Allegro_Path ); 
  63.     pragma Import( C, Al_Drop_Path_Tail, "al_drop_path_tail" ); 
  64.  
  65.     procedure Al_Set_Path_Filename( path : A_Allegro_Path; filename : String ); 
  66.  
  67.     function Al_Set_Path_Extension( path : A_Allegro_Path; extension : String ) return Boolean; 
  68.  
  69.     function Al_Path_CStr( path  : A_Allegro_Path; 
  70.                            delim : Character := ALLEGRO_NATIVE_PATH_SEP ) return String; 
  71.  
  72.     function Al_Make_Path_Canonical( path : A_Allegro_Path ) return Boolean; 
  73.  
  74. private 
  75.  
  76.     ALLEGRO_NATIVE_PATH_SEP : constant Character := GNAT.OS_Lib.Directory_Separator; 
  77.  
  78.     type Allegro_Path is limited null record; 
  79.     pragma Convention( C, Allegro_Path ); 
  80.  
  81. end Allegro.Paths;