Hosted by
|
with System;
with Ada.Streams; use Ada.Streams;
package Pipes is
C_Constant_EOF : Character;
pragma Import(C, C_Constant_EOF);
type Pipe_Stream is
new Root_Stream_Type with private;
type Pipe is access Pipe_Stream;
type Pipe_Mode is (Read_Only, Write_Only);
function Std_In
return Pipe;
function Std_Out
return Pipe;
function Execute
(Command : in String;
Mode : in Pipe_Mode)
return Pipe;
procedure Close
(Stream : in out Pipe);
procedure Read
(Stream : in out Pipe_Stream;
Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
procedure Write
(Stream : in out Pipe_Stream;
Item : in Stream_Element_Array);
private
type C_File is new System.Address;
type Pipe_Stream is
new Ada.Streams.Root_Stream_Type with
record
Mode : Pipe_Mode;
File : C_File;
end record;
end Pipes;
|