-- -- -------------------------------------------------------------------------------- -- -- OSI_Utilities -- -- This package exports routines used by other OSI packages. -- -- -- -- -- Gerardo A. Colon -- 28 August 1990 -- -- Science Applications International Corporation --
311 Park Place Boulevard, Suite 360 --
Clearwater, Florida 34619 -- -- Developed for the STARS program under task S40. -- -- -- -- -- Dependencies => -- ( Operating_System => AIX , -- Compiler => None , -- Device => None ) ; -- -- -------------------------------------------------------------------------------- with System ; pragma Page ; -------------------------------------------------------------------------------- -- package OSI_Utilities (body). -------------------------------------------------------------------------------- package body OSI_Utilities is -------------------------------------------------------------------------------- -- Local Subprograms. -------------------------------------------------------------------------------- function Strlen ( S : String_Pointer ) return Interface_Unsigned ; -------------------------------------------------------------------------------- -- -- Strlen -- -- This function returns the length of the string pointed by -- the string pointer given by S. -- -- None. -- -- -------------------------------------------------------------------------------- pragma Interface ( C , Strlen ) ; -------------------------------------------------------------------------------- -- External Subprograms. -------------------------------------------------------------------------------- function Is_Valid ( File_Name : in OSI_String ) return Boolean is -------------------------------------------------------------------------------- -- -- Is_Valid -- -- This function returns True is the file name given by the -- parameter File_Name is valid. The function returns False -- otherwise. -- -- None. -- -- -------------------------------------------------------------------------------- The_Name_String : constant String := To_String ( File_Name ) ; begin -- Is_Valid for The_Index in The_Name_String'Range loop case The_Name_String ( The_Index ) is when 'a' .. 'z' => null ; when 'A' .. 'Z' => null ; when '0' .. '9' => null ; when '.' | '_' | '-' => null ; when others => return False ; end case ; end loop ; -- return True ; end Is_Valid ; function String_Of ( The_Pointer : String_Pointer ) return String is -------------------------------------------------------------------------------- -- -- String_Of -- -- This function returns the string pointed by the pointer given -- by The_Pointer. -- -- None. -- -- -------------------------------------------------------------------------------- The_String : String ( 1 .. Integer ( Strlen ( The_Pointer ) ) ) ; for The_String use at The_Pointer ; begin -- String_Of return The_String ; end String_Of ; end OSI_Utilities ; --