Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#include "mozart.h"
#include <string.h>
OZ_BI_define(c_strdup,1,1)
{
OZ_declareVirtualString(0, s1);
char* s2 = strdup(s1);
OZ_Term s3 = OZ_string(s2);
free( s2 );
OZ_RETURN( s3 );
}
OZ_BI_end
OZ_C_proc_interface * oz_init_module(void)
{
static OZ_C_proc_interface table[] = {
{"strdup",1,1,c_strdup},
{0,0,0,0}
};
return table;
}

View file

@ -0,0 +1,6 @@
makefile(
lib : [
'strdup.o' 'strdup.so'
]
rules:o('strdup.so':ld('strdup.o'))
)

View file

@ -0,0 +1,4 @@
declare
[Strdup] = {Module.link ['strdup.so{native}']}
in
{System.showInfo {Strdup.strdup "hello"}}