-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayer-aux.ads
30 lines (20 loc) · 891 Bytes
/
player-aux.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
29
30
-- Auxiliary things for interfacing with C
with Interfaces.C;
with Interfaces.C.Strings;
package Player.Aux is
pragma Elaborate_Body;
type Void_Ptr is new Interfaces.C.Strings.Chars_Ptr;
Bool_To_CInt : constant array (Boolean) of Interfaces.C.Int :=
(True => 1, False => 0);
procedure Check (I : in Interfaces.C.Int);
-- Will raise the Player_Error exception when I /= 0.
procedure Check_Fail;
-- Will always raise; = Check (-1);
procedure Free_Strings;
-- Release memory used by temporary copies of strings.
function To_C (S : in String) return Interfaces.C.Strings.Chars_Ptr;
-- Returns a pointer to the first element of a copy of the S string.
-- Memory increases until Free_Strings is called.
-- This allows a portable and comfortable way to use Ada strings as
-- parameters to C functions.
end Player.Aux;