Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,8 +0,0 @@
|
|||
with Interfaces.C; use Interfaces.C;
|
||||
with Interfaces.C.Strings; use Interfaces.C.Strings;
|
||||
|
||||
package Exported is
|
||||
function Query (Data : chars_ptr; Size : access size_t)
|
||||
return int;
|
||||
pragma Export (C, Query, "Query");
|
||||
end Exported;
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
gcc -c main.c
|
||||
gnatmake -c exported.adb
|
||||
gnatbind -n exported.ali
|
||||
gnatlink exported.ali main.o -o main
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
identification division.
|
||||
program-id. Query.
|
||||
|
||||
environment division.
|
||||
configuration section.
|
||||
special-names.
|
||||
call-convention 0 is extern.
|
||||
|
||||
repository.
|
||||
function all intrinsic.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
01 query-result.
|
||||
05 filler value "Here I am".
|
||||
|
||||
linkage section.
|
||||
01 data-reference.
|
||||
05 data-buffer pic x occurs 0 to 8192 times
|
||||
depending on length-reference.
|
||||
01 length-reference usage binary-long.
|
||||
|
||||
procedure division extern using data-reference length-reference.
|
||||
|
||||
if length(query-result) less than or equal to length-reference
|
||||
and length-reference less than 8193 then
|
||||
move query-result to data-reference
|
||||
move length(query-result) to length-reference
|
||||
move 1 to return-code
|
||||
end-if
|
||||
|
||||
goback.
|
||||
end program Query.
|
||||
|
|
@ -1 +0,0 @@
|
|||
untyped __call__("functionName", args);
|
||||
Loading…
Add table
Add a link
Reference in a new issue