Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
:- module test_ffi.
|
||||
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
:- implementation.
|
||||
|
||||
% The actual FFI code begins here.
|
||||
:- pragma foreign_decl("C", "#include <string.h>").
|
||||
|
||||
:- func strdup(string::in) = (string::out) is det.
|
||||
:- pragma foreign_proc("C", strdup(S::in) = (SD::out),
|
||||
[will_not_call_mercury, not_thread_safe, promise_pure],
|
||||
"SD = strdup(S);").
|
||||
% The actual FFI code ends here.
|
||||
|
||||
main(!IO) :-
|
||||
io.write_string(strdup("Hello, worlds!\n"), !IO).
|
||||
|
||||
:- end_module test_ffi.
|
||||
|
|
@ -0,0 +1 @@
|
|||
:- func strdup(string) = string.
|
||||
Loading…
Add table
Add a link
Reference in a new issue