Marshalling a C structure to C#

Posted by Hilbert on Stack Overflow See other posts from Stack Overflow or by Hilbert
Published on 2010-06-09T13:28:29Z Indexed on 2010/06/09 13:32 UTC
Read the original article Hit count: 219

Filed under:
|
|
|
|

Hi, I don't know how to marshall this structure in Mono.

typedef struct rib_struct {
    rib_used_t used;
    rib_status_t status;
    rib_role_t role;
    uint8_t conf;
    rib_dc_t *pending;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
    rib_f_t *props;
} rib_t;

And for example, rib_dc_t is like:

typedef struct rib_dc_struct {
    uint16_t id;
    uint8_t min_id;
    uint8_t conf;
    struct rib_dc_struct *next;
} rib_dc_t;

I don't know how to marshall the pthread structures. And the pointers... should I use IntPtr or a managed structures? How to mashall the pointer in the last struct to the struct itself?

Thanks in adanvaced

© Stack Overflow or respective owner

Related posts about c#

Related posts about marshalling