31,6 → 31,7 |
*/ |
|
/** @file |
* Generic module functions. |
*/ |
|
#ifndef __NET_MODULES_H__ |
48,11 → 49,33 |
*/ |
#define CONVERT_SIZE( type_from, type_to, count ) (( sizeof( type_from ) / sizeof( type_to )) * ( count )) |
|
/** Registers the module service at the name server. |
* @param me The module service. Input parameter. |
* @param phonehash The created phone hash. Output parameter. |
*/ |
#define REGISTER_ME( me, phonehash ) ipc_connect_to_me( PHONE_NS, ( me ), 0, 0, ( phonehash )) |
|
/** Connect to the needed module function type definition. |
* @param need The needed module service. Input parameter. |
* @returns The phone of the needed service. |
*/ |
typedef int connect_module_t( services_t need ); |
|
connect_module_t connect_to_service; |
/** Connects to the needed module. |
* @param need The needed module service. Input parameter. |
* @returns The phone of the needed service. |
*/ |
int connect_to_service( services_t need ); |
|
/** Creates bidirectional connection with the needed module service and registers the message receiver. |
* @param need The needed module service. Input parameter. |
* @param arg1 The first parameter. Input parameter. |
* @param arg2 The second parameter. Input parameter. |
* @param arg3 The third parameter. Input parameter. |
* @param client_receiver The message receiver. Input parameter. |
* @returns The phone of the needed service. |
* @returns Other error codes as defined for the ipc_connect_to_me() function. |
*/ |
int bind_service( services_t need, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, async_client_conn_t client_receiver ); |
|
#endif |