-------------------------------------------------------- ------------------------ -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . P N . U T I L S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2006, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ with Types; use Types; package Ocarina.PN.Utils is -------------------------- -- Directory Operations -- -------------------------- procedure Create_Directory (Dir_Full_Name : name_id); -- Trys to create a directory and handle some creation errors procedure Enter_Directory (Dirname : name_id); -- Change the current directory to Dirname, and saves the -- old current_directory value procedure Leave_Directory; -- Leave the latest entered directory and change to la latest -- left directory function Add_Directory_Separator (Path : name_id) return name_id; -- If there is no directory separator at the end of the path, -- then add it and return the result. Else, return the same -- string. function Remove_Directory_Separator (Path : name_id) return name_id; -- If there is a directory separator at the end of the path, then -- remove it and retirn the result. Else, return the same string. ---------------------- -- Names Operations -- ---------------------- function Get_String_Name (The_String : String) return Types.name_id; -- Enters 'The_String' in the name table and returns the -- corresponding name id -- FIXME : To be moved to Namet function Add_Prefix_To_Name (Prefix : String; Name : name_id) return name_id; function Add_Suffix_To_Name (Suffix : String; Name : name_id) return name_id; function Remove_Suffix_From_Name (Suffix : String; Name : name_id) return name_id; -- This function returns a new name without the suffix. If the suffix does -- not exist, the returned name is equal to the given name. ---------- -- Misc -- ---------- procedure Call_Program (Prog_Name : String; Success : out Boolean; Argument_1 : String := ""; Argument_2 : String := ""; Argument_3 : String := ""); -- Performs a synchronous call to a program end Ocarina.PN.Utils;