-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgid-buffering.ads
More file actions
27 lines (20 loc) · 887 Bytes
/
Copy pathgid-buffering.ads
File metadata and controls
27 lines (20 loc) · 887 Bytes
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
private package GID.Buffering is
-- Attach a buffer to a stream.
procedure Attach_Stream
(b : in 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;