[Previous] [Contents] [Index] [Next]

io_net_dll_entry_t

Entry for a shared object to be loaded by io-net

Synopsis:

typedef struct _io_net_dll_entry {
    int nfuncs;
    int (*init) (void *dll_hdl,
                 dispatch_t *dpp,
                 io_net_self_t *ion,
                 char *options );
    int (*shutdown) (void *dll_hdl );
} io_net_dll_entry_t;

Description:

The io_net_dll_entry_t data structure defines a shared-object entry that's loaded by io-net. Your driver must create a public symbol of type io_net_dll_entry_t called io_net_dll_entry.

The nfuncs member specifies the number of functions in the io_net_dll_entry_t structure. In the structure above, this is 2, because there are two functions, init() and shutdown().

init()

A pointer to your driver's initialization function, which is mandatory. This is the first of your driver's functions that io-net calls. The prototype is:

int (*init) (void *dll_hdl,
             dispatch_t *dpp,
             io_net_self_t *ion,
             char *options );

The arguments are:

dll_hdl
An internal handle used by io-net -- you'll need this handle for future calls into the io-net framework.
dpp
A pointer to the dispatch handle.
ion
A pointer to a data structure of the io-net functions that your driver can call. For more information, see io_net_self_t.
options
Command-line suboptions related to your driver.

Your init() function should return 0 on success. If an error occurs, this function should set errno and return -1.

shutdown()

A pointer to your driver's optional "master" shutdown function. This is called just before io-net finally closes your driver shared object.

The prototype is:

int (*shutdown) (void *dll_hdl );

The dll_hdl is the handle that was passed to the driver's initialization function.

A particular shared object can register multiple times as multiple different things (e.g. as an up-producer and as a converter). When a particular registration instance (a "registrant") is shut down, its shutdown1() and shutdown2() functions (from the io_net_registrant_t structure's io_net_registrant_funcs_t function pointer array) are called.

When all of the shared object's registrants are closed, this shutdown() function is called. If you don't wish to supply this function, place a NULL in this member.

Your driver's shutdown() function should return 0.

Classification:

QNX

See also:

io_net_registrant_t, io_net_registrant_funcs_t


[Previous] [Contents] [Index] [Next]