Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reference external C struct as a return value

user10569070Nov 7 2010 — edited Nov 9 2010
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2010
Added on Nov 7 2010
2 comments
171 views