[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #56176] Implementation of loadlibrary function
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #56176] Implementation of loadlibrary function (revisited) |
Date: |
Fri, 12 Jul 2019 19:05:26 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36 |
Follow-up Comment #2, bug #56176 (project octave):
Many years ago, someone made the assertion that this project would depend on
improved classdef support in Octave. I've seen that repeated, but I'm not sure
I fully understand. As far as I can tell, the only parts of loadlibrary in
Matlab that use classes are the 'libpointer' and 'libstruct' functions for
dealing with C pointers and structs. Is that right or did I miss something
else?
As I understand it, this project would add ordinary functions to Octave:
calllib, libfunctions, loadlibrary, and unloadlibrary. When libraries are
loaded with loadlibrary, they are stored internally in the interpreter with a
string name as the lookup key. I don't think there is any kind of handle class
interface to deal with. It's only when more complicated pointer and struct
types are needed that classes come into the picture. For a simple example
loadlibrary ("libc")
calllib ("libc", "printf", "%s, %s\n", "Hello", "world")
It seems to me that one of the harder parts of this project is preprocessing
and parsing C header files to automatically build a table of function
prototypes, and then building all the rules for automatically converting
Octave data types into C equivalents and the reverse. The mechanics of loading
a dynamic library and invoking a function pointer are relatively simple. I've
gone through a lot of similar trouble with automatic argument and return value
conversion in the Pythonic package.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56176>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #56176] Implementation of loadlibrary function (revisited),
Mike Miller <=