Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
proc Query*(data: var array[1024, char], length: var cint): cint {.exportc.} =
|
||||
const text = "Here am I"
|
||||
if length < text.len:
|
||||
return 0
|
||||
|
||||
for i in 0 .. <text.len:
|
||||
data[i] = text[i]
|
||||
length = text.len
|
||||
return 1
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#include <stdio.h>
|
||||
|
||||
extern int Query (char * Data, size_t * Length);
|
||||
|
||||
int main (int argc, char * argv [])
|
||||
{
|
||||
char Buffer [1024];
|
||||
size_t Size = sizeof (Buffer);
|
||||
|
||||
if (0 == Query (Buffer, &Size))
|
||||
{
|
||||
printf ("failed to call Query\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
char * Ptr = Buffer;
|
||||
while (Size-- > 0) putchar (*Ptr++);
|
||||
putchar ('\n');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
constant Here_am_I = "Here am I"
|
||||
function Query(atom pData, atom pLength)
|
||||
integer len = peekNS(pLength,machine_word(),0)
|
||||
if poke_string(pData,len,Here_am_I) then
|
||||
return 0
|
||||
end if
|
||||
pokeN(pLength,length(Here_am_I)+1,machine_word())
|
||||
return 1
|
||||
end function
|
||||
constant Query_cb = call_back(routine_id("Query"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue