Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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.high:
|
||||
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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue