hcl/bin/slim_stream.ads

56 lines
2.1 KiB
Ada
Raw Permalink Normal View History

with H2.Slim;
with Ada.Text_IO;
package Slim_Stream is
package S renames H2.Slim.Scheme;
------------------------------------------------------------
2014-01-16 16:52:18 +00:00
--type Object_Character_Array_Pointer is access all S.Object_Character_Array;
type Object_Character_Array_Pointer is access constant S.Object_Character_Array;
type String_Input_Stream_Record(Str: Object_Character_Array_Pointer) is new S.Stream_Record with record
Pos: S.Object_Size := 0;
end record;
procedure Open (Stream: in out String_Input_Stream_Record);
procedure Close (Stream: in out String_Input_Stream_Record);
procedure Read (Stream: in out String_Input_Stream_Record;
2014-01-16 16:52:18 +00:00
Data: out S.Object_Character_Array;
Last: out S.Object_Size);
procedure Write (Stream: in out String_Input_Stream_Record;
2014-01-16 16:52:18 +00:00
Data: out S.Object_Character_Array;
Last: out S.Object_Size);
------------------------------------------------------------
type File_Stream_Record is new S.Stream_Record with record
2014-01-16 16:52:18 +00:00
Name: S.Constant_Object_Character_Array_Pointer;
Handle: Ada.Text_IO.File_Type;
end record;
procedure Open (Stream: in out File_Stream_Record);
procedure Close (Stream: in out File_Stream_Record);
procedure Read (Stream: in out File_Stream_Record;
2014-01-16 16:52:18 +00:00
Data: out S.Object_Character_Array;
Last: out S.Object_Size);
procedure Write (Stream: in out File_Stream_Record;
2014-01-16 16:52:18 +00:00
Data: out S.Object_Character_Array;
Last: out S.Object_Size);
2014-01-01 14:07:03 +00:00
------------------------------------------------------------
procedure Allocate_Stream (Interp: in out S.Interpreter_Record;
2014-01-16 16:52:18 +00:00
Name: access S.Object_Character_Array;
2014-01-01 14:07:03 +00:00
Result: out S.Stream_Pointer);
procedure Deallocate_Stream (Interp: in out S.Interpreter_Record;
Source: in out S.Stream_Pointer);
--private
-- type File_Stream_Record is new S.Stream_Record with record
2014-01-16 16:52:18 +00:00
-- Name: S.Constant_Object_Character_Array_Pointer;
-- Handle: Ada.Text_IO.File_Type;
2014-01-01 14:07:03 +00:00
-- end record;
end Slim_Stream;