[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - FFI - struct passed by value

FFI - struct passed by value

Q&A's, tips, howto's

FFI - struct passed by value

Postby Astrobe » Tue Jan 28, 2014 10:46 pm

I'd like to use this nice little GUI library: http://enchantia.com/software/graphapp/

The widget set is not as full featured as other libraries but it's good enough for simple user interfaces. Plus it fits in a single 700K DLL and is portable.

The problem is that it passes and returns one of its major structures (Rect) as value: http://enchantia.com/software/graphapp/ ... l/rect.htm

Is there, by any chance, some trick to make it work with NewLisp's FFI without writing wrappers?
Astrobe
 
Posts: 39
Joined: Mon Jan 11, 2010 9:41 pm

Re: FFI - struct passed by value

Postby Lutz » Tue Jan 28, 2014 11:34 pm

Yes, it is is possible without writing any wrappers.

See the files newlisp-10.5.x/util/ffitest.c and newlisp-10.5.x/qa-specific-tests/qa-libffi and look for “clock”. There is a “struct clock” defined in ffitest.c. which then is used in qa-libffi.

There are also pointers to structs, an example for those can be found in the manual at:
http://www.newlisp.org/downloads/newlis ... tml#struct
Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: FFI - struct passed by value

Postby Astrobe » Wed Jan 29, 2014 11:28 am

Astrobe
 
Posts: 39
Joined: Mon Jan 11, 2010 9:41 pm


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron