separate (RPC) function RPC_Protseq_Vector_Element( Protseq_Vector : in RPC_Protseq_Vector_Type; Element_Number : in positive := 1 ) return Protocol_Sequence_Type is -- **************************************************************************** use C_String_Pkg; -- /// Direct visibility to the "/=" operator -- /// C helper to return the index'th element from the vector procedure get_protseq( protseq_vector : in System.Address; index : in integer; protseq : in System.Address); pragma INTERFACE (C, get_protseq); Local_CStr : C_String_Pkg.C_String; Local_Protseq : Protocol_Sequence_Type := (others => Ascii.NUL); Local_Status : DCE_Status.Status_Type; Length : natural := 0; begin if (natural(Element_Number) > natural(Protseq_Vector.Count)) then raise CONSTRAINT_ERROR; end if; -- /// The Element_Number *MUST* be decremented -- /// because arrays in C use a zero-based index get_protseq(Protseq_Vector.Vector'ADDRESS, integer(Element_Number-1), Local_CStr'ADDRESS); if (Local_CStr /= NULL) then C_String_Pkg.C_to_Ada_String(Local_CStr, string(Local_Protseq), TRUE); RPC_String_Free(Local_CStr'ADDRESS, Local_Status); end if; return ( Local_Protseq ); end RPC_Protseq_Vector_Element;