langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 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"}}