Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Interfaces.C; use Interfaces.C;
|
||||
with Interfaces.C.Strings; use Interfaces.C.Strings;
|
||||
|
||||
procedure Test_C_Interface is
|
||||
function strdup (s1 : Char_Array) return Chars_Ptr;
|
||||
pragma Import (C, strdup, "_strdup");
|
||||
|
||||
S1 : constant String := "Hello World!";
|
||||
S2 : Chars_Ptr;
|
||||
begin
|
||||
S2 := strdup (To_C (S1));
|
||||
Put_Line (Value (S2));
|
||||
Free (S2);
|
||||
end Test_C_Interface;
|
||||
Loading…
Add table
Add a link
Reference in a new issue