Reference external C struct as a return value
Hello,
I am attemping to create a plsql wapper for a c library. I have added the .so to the listener.ora, but need help on how to reference a struct.
In the .h file the structure is defined as:
typedef struct {
int initialized;
char *name;
int intepin;
int intepout;
int interface;
int fd;
} FPHandle;
The api uses the struct is:
FPHandle *fp_init(void)
The point to all this is how to I refernce a structure in PLSQL? Do I create an plsql object FPHandle?
CREATE OR REPLACE TYPE FPHANDLE AS OBJECT (
initialized integer,
name char *,
intepin integer,
intepout integer,
interface integer,
fd integer);
Then would I create a plsql procedure like:
CREATE OR REPLACE FUNCTION fp_init_func
return FPHANDLE
AS EXTERNAL
NAME "fp_init"
LANGUAGE C
LIBRARY libcvb;
/
Any help on how to reference a C struct and pass it in PLSQL is appreciated.