I'm currently working on a language binding for the Y Window system. I'm attempting to pass a struct from my C# library to a C library. I'm very new to this but I have considerable experience with C#.
Here is the struct defined in C:
I'm only interested in the oid and cid fields of the object struct... the rest is unimportant to me (at least for the foreseeable future).
Most external functions that I'm calling from C# take the object struct as an argument and one returns an object struct.
The C functions I must use are:
What I need is help providing the struct to the C library and getting the struct from the C library. Has anyone had experience with this? Can anyone point me to a good source of information on this?
--
Casey Winans
Here is the struct defined in C:
Code:
struct object
{
int oid, cid;
struct object *next;
struct eventType *firstET;
}
struct eventType
{
struct eventType *next;
const char *name;
void * (*eventCallBack) (struct object *, void *);
}
I'm only interested in the oid and cid fields of the object struct... the rest is unimportant to me (at least for the foreseeable future).
Most external functions that I'm calling from C# take the object struct as an argument and one returns an object struct.
The C functions I must use are:
Code:
struct object *YObject_CreateFromClassName(char *name);
void YObject_SetProperty(struct object *object, const char *name, const char *value);
char * YObject_GetProperty(struct object *object, const char *name);
int YSignal_Connect(struct object *object,
const char *name, void *(*eventCallBack) (struct object *, void *));
What I need is help providing the struct to the C library and getting the struct from the C library. Has anyone had experience with this? Can anyone point me to a good source of information on this?
--
Casey Winans