OxFFI
OxFfi is a "foreign function interface" that allows Ox programs to easily call compiled code in dynamic libraries without the need to write and compile wrappers.
To call a C function with oxffi, you just tell OxFFI the name and argument types of the function, and OxFFI returns an object that you can call just like a normal Ox function.
Requirements
You'll need the following to get started:
-
32-bit x86 Linux distribution (tested on Ubuntu 6.06)
-
Ox 4.x
- Patience -- OxFFI is new, so there may be bugs.
Installing OxFFI
-
unzip the archive under your ox/packages directory (so you have "ox/packages/oxffi")
-
test the installation by changing into the "ox/packages/oxffi/samples" directory and running "oxl test_oxffibasic.ox"
Downloads:
- Source code: oxffi_src_010.tar.gz
- Pre-built binary package for x86 Linux: oxffi_010.tar.gz
Documentation:
- The download package contains text and HTML documentation in the "doc" subdirectory
- You can also browse the manual online here.
Author:
John Zedlewski (johnzed at gmail dot com)
FAQ/Problems:
- I'm guessing that most problems will revolve around shared library linking. If you get an error message that some dll can't be loaded, please double-check the path and name for that shared library (".so" file). Libraries in standard locations (/lib, /usr/lib, the current working directory) will be found automatically, while you need to give full paths to others. Also make sure you don't have your LD_LIBRARY_PATH environment variable set to something weird (it should be unset).