[31m-- main is main file of main project written with Ada.[m
[31m-- Main is Copyright (C) 2025 Manuel De Girardi ; [m
[31m--[m
[31m--   This program is free software; you can redistribute it and/or modify[m
[31m--   it under the terms of the GNU General Public License as published by[m
[31m--   the Free Software Foundation; either version 2 of the License, or[m
[31m--   (at your option) any later version.[m
[31m--[m
[31m--   This program is distributed in the hope that it will be useful,[m
[31m--   but WITHOUT ANY WARRANTY; without even the implied warranty of[m
[31m--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the[m
[31m--   GNU General Public License for more details.[m
[31m--[m
[31m--   You should have received a copy of the GNU General Public License[m
[31m--   along with this program; if not, write to the Free Software[m
[31m--   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA[m
[31m--[m
[31m-- Date := 2026-10-11 17:08:46 ; [m
[31m-- Version := 0.47.0a ; [m
[01;34mwith[m Ada[31m.[mStrings[31m.[mWide_Unbounded[31m;[m
[01;34mwith[m M[31m.[mStrings[31m;[m
[01;34muse[m M[31m.[mStrings[31m;[m
[01;34mwith[m Ada[31m.[mUnchecked_Deallocation[31m;[m
[01;34mwith[m Gnat[31m.[mos_Lib[31m;[m
[01;34muse[m Gnat[31m.[mOs_Lib[31m;[m
[01;34mwith[m Adam[31m.[mResults[31m;[m
[31m--use Adam.Results;[m
[01;34mwith[m M[31m.[mResults[31m;[m
[31m--use M.Results;[m
[01;34mpackage[m M[31m.[mTools [01;34mis[m
   
   
   [31m--  type Result_Enum is (File, Search, Spawn);[m
   
   [31m--  type Result_Record (Name : Result_Enum) is tagged[m
   [31m--     record[m
   [31m--  	 Wlines : U_Array_Access;[m
   [31m--  	 Count  : Natural := 0;[m
   [31m--  	 Initialized : Boolean := False;[m
   [31m--  	 case Name is[m
   [31m--  	    when File =>[m
   [31m--  	       null;[m
   [31m--  	    when Search =>[m
   [31m--  	       Pattern   : Wide_String_Access := new Wide_String ' ("");[m
   [31m--  	       Address   : String_Access;[m
   [31m--  	       Doc_Name  : Wide_String_Access;[m
   [31m--  	    when Spawn =>[m
   [31m--  	       Process_Id     : Gnat.Os_Lib.Process_Id;[m
   [31m--  	       Program_Name   : U_String;[m
   [31m--  	       Args           : Argument_List_Access;	 [m
   [31m--  	       Output_File    : U_String;[m
   [31m--  	       Success        : Boolean := False;[m
   [31m--  	       Return_Code    : Integer := 0;[m
   [31m--  	       Err_To_Out     : Boolean := False;	 [m
   [31m--  	 end case;[m
	 
   [31m--     end record;   [m
   [01;34mfunction[m [01;30mInteger_Image[m [31m([mValue [31m:[m [01;34min[m [32mInteger[m[31m)[m [01;34mreturn[m [32mString[m[31m;[m
   [01;34mfunction[m [01;30mSpawn[m[31m([mLine [31m:[m [01;34min[m [32mString[m[31m;[m Filename [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m M[31m.[mResults[31m.[mResult_Record[31m;[m
   

   
   
   [01;34mfunction[m [01;30mDelete_Local_Prefix[m[31m([mFilename [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m [32mString[m[31m;[m
   [01;34mfunction[m [01;30mNormalize_Quoted_Argument[m[31m([mArg [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m [32mString[m[31m;[m
   [01;34mfunction[m [01;30mSearch_Regexp[m [31m([mPath [31m:[m [01;34min[m [32mString[m[31m;[m
                           Pattern [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m [32mString[m[31m;[m
   [01;34mfunction[m [01;30mExpand_filename[m [31m([mLine [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m [32mString[m[31m;[m
   [01;34mprocedure[m [01;30mChange_directory[m [31m([mLine [31m:[m [01;34min[m [32mString[m[31m;[mOld_Pwd [31m:[m [01;34min[m [01;34mout[m String_Access[31m);[m
   [01;34mprocedure[m [01;30mFind_At_Path[m [31m([mPath [31m:[m [01;34min[m [32mString[m[31m;[m
			   Pattern [31m:[m [01;34min[m [32mString[m[31m;[m
			   Result [31m:[m [01;34min[m M[31m.[mResults[31m.[mWide_Result_Access[31m);[m
   [01;34mprocedure[m [01;30mCompletion[m [31m([mLine [31m:[m [01;34min[m [32mString[m[31m;[m
			 Full_Command [31m:[m [01;34mout[m Wide_String_Access[31m;[m
			 Result [31m:[m [01;34mout[m M[31m.[mResults[31m.[mWide_Result_Access[31m);[m
   
   [01;34mfunction[m [01;30mShell_Spawn[m[31m([mLine [31m:[m [01;34min[m [32mString[m[31m)[m [01;34mreturn[m Adam[31m.[mResults[31m.[mSpawn_Result_Type[31m;[m

   

   
   
   
   
   Local_Prefix [31m:[m [01;34mconstant[m [32mString[m [31m:=[m [31m"./"[m[31m;[m

[01;34mend[m M[31m.[mTools [31m;[m 
