Hi Henrik,
Worked, thanks!
So I'm now using this line: gcc -o main.so -m64 -std=gnu99 -fPIC
-shared -export-dynamic main.c -lm -lpcre
OK, thanks.
I haven't scrutinized it in detail, just a minor hint:
(while
(let? R (line T)
(link R)) ) ) ) )
The
Worked, thanks!
So I'm now using this line: gcc -o main.so -m64 -std=gnu99 -fPIC
-shared -export-dynamic main.c -lm -lpcre
It seems the version 3 number was not needed after all.
I've attached the C code for reference and this is what I use in PL:
(println
(pipe (native pcre/main.so
I've been looking into using this in conjunction with the pcre library.
However I have problems with both returning results and capturing them in PL.
The result should be an array of strings or if it's more convenient
stored by reference in a variable.
ATM I'm trying with the following:
void
Hi Henrik,
ATM I'm trying with the following:
void tst(char *strs[2]){
strs[0] = foo;
strs[1] = bar;
}
(native pcre/main.so tst NIL '(X (8 . S)))
X contains foo but I can't seem to get at bar.
Right. (8 . S) is a structure of size 8, consisting of a single string
Oops, forgot one answer.
On Fri, May 11, 2012 at 08:48:15PM +0700, Henrik Sarvell wrote:
Maybe it's just easier to print the results and capture that? If so
then maybe it's even easier/more efficient to skip this completely and
simply call an executable or does native have lower overhead?
I
On May 9, 2012 at 3:33 PM Alexander Burger a...@software-lab.de wrote:
Does anybody know of a programming language with an equally powerful --
yet as simple -- C function interface? Except C/C++ of course ;-)
I think D has it. (D is pretty nice, it looks like C++ except the evil.)
best
Alex,
That looks great! I'm very impressed with native and now he doc!
Cheers!
Rand
On May 9, 2012, at 3:33 PM, Alexander Burger a...@software-lab.de wrote:
Hi all,
at last, I have found the time to write an in-detail description of the
'native' function:
Alexander Burger a...@software-lab.de writes:
Hi Alex,
at last, I have found the time to write an in-detail description of
the
'native' function:
http://software-lab.de/doc/native.html
Any comments welcome! It became quite long, not because 'native' is so
complicated, but because
Hi Jakob,
Does anybody know of a programming language with an equally powerful --
yet as simple -- C function interface? Except C/C++ of course ;-)
I think D has it. (D is pretty nice, it looks like C++ except the evil.)
OK, but, well, if I understand it right, D is an extension of C (a