langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
makefile(
|
||||
lib : [
|
||||
'strdup.o' 'strdup.so'
|
||||
]
|
||||
rules:o('strdup.so':ld('strdup.o'))
|
||||
)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
declare
|
||||
[Strdup] = {Module.link ['strdup.so{native}']}
|
||||
in
|
||||
{System.showInfo {Strdup.strdup "hello"}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue