RosettaCodeData/Task/Use-another-language-to-call-a-function/Ada/use-another-language-to-call-a-function-2.ada
2023-07-01 13:44:08 -04:00

14 lines
356 B
Ada

package body Exported is
function Query (Data : chars_ptr; Size : access size_t)
return int is
Result : char_array := "Here am I";
begin
if Size.all < Result'Length then
return 0;
else
Update (Data, 0, Result);
Size.all := Result'Length;
return 1;
end if;
end Query;
end Exported;