-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
gid-buffering.ads
28 lines (21 loc) · 890 Bytes
/
gid-buffering.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
private package GID.Buffering is
-- Attach a buffer to a stream.
procedure Attach_Stream (
b : out Input_Buffer;
stm : in Stream_Access
);
function Is_stream_attached (b : Input_Buffer) return Boolean;
-- From the first call to Get_Byte, subsequent bytes must be read
-- through Get_Byte as well since the stream is partly read in advance
procedure Get_Byte (b : in out Input_Buffer; byte : out U8);
pragma Inline (Get_Byte);
private
subtype Size_test_a is Byte_Array (1 .. 19);
subtype Size_test_b is Ada.Streams.Stream_Element_Array (1 .. 19);
-- is_mapping_possible: Compile-time test for checking if
-- a Byte_Array is equivalemnt to a Ada.Streams.Stream_Element_Array.
--
is_mapping_possible : constant Boolean :=
Size_test_a'Size = Size_test_b'Size and
Size_test_a'Alignment = Size_test_b'Alignment;
end GID.Buffering;