Changes in uspace/srv/net/module.c [aadf01e:21580dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/module.c
raadf01e r21580dd 60 60 * @returns Other error codes as defined for each specific module message function. 61 61 */ 62 extern int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);62 extern int module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count ); 63 63 64 64 /** External function to print the module name. … … 66 66 * The function has to be defined in each module. 67 67 */ 68 extern void module_print_name(void);68 extern void module_print_name( void ); 69 69 70 70 /** External module startup function. … … 73 73 * @param[in] client_connection The client connection function to be registered. 74 74 */ 75 extern int module_start(async_client_conn_t client_connection);75 extern int module_start( async_client_conn_t client_connection ); 76 76 77 77 /*@}*/ … … 81 81 * @param[in] icall The initial message call structure. 82 82 */ 83 void client_connection(ipc_callid_t iid, ipc_call_t * icall);83 void client_connection( ipc_callid_t iid, ipc_call_t * icall ); 84 84 85 85 /** Starts the module. … … 89 89 * @returns Other error codes as defined for each specific module start function. 90 90 */ 91 int main(int argc, char * argv[]);91 int main( int argc, char * argv[] ); 92 92 93 void client_connection( ipc_callid_t iid, ipc_call_t * icall){94 ipc_callid_t 95 ipc_call_t 96 ipc_call_t 97 int 98 int 93 void client_connection( ipc_callid_t iid, ipc_call_t * icall ){ 94 ipc_callid_t callid; 95 ipc_call_t call; 96 ipc_call_t answer; 97 int answer_count; 98 int res; 99 99 100 100 /* … … 102 102 * - Answer the first IPC_M_CONNECT_ME_TO call. 103 103 */ 104 ipc_answer_0( iid, EOK);104 ipc_answer_0( iid, EOK ); 105 105 106 while( true){107 refresh_answer( &answer, &answer_count);106 while( true ){ 107 refresh_answer( & answer, & answer_count ); 108 108 109 callid = async_get_call( &call);110 res = module_message( callid, &call, &answer, &answer_count);109 callid = async_get_call( & call ); 110 res = module_message( callid, & call, & answer, & answer_count ); 111 111 112 if((IPC_GET_METHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP)){ 113 return; 114 } 112 if( IPC_GET_METHOD( call ) == IPC_M_PHONE_HUNGUP ) return; 115 113 116 answer_call( callid, res, &answer, answer_count);114 answer_call( callid, res, & answer, answer_count ); 117 115 } 118 116 } 119 117 120 int main( int argc, char * argv[]){118 int main( int argc, char * argv[] ){ 121 119 ERROR_DECLARE; 122 120 123 121 printf("Task %d - ", task_get_id()); 124 122 module_print_name(); 125 printf( "\n");126 if( ERROR_OCCURRED(module_start(client_connection))){127 printf( " - ERROR %i\n", ERROR_CODE);123 printf( "\n" ); 124 if( ERROR_OCCURRED( module_start( client_connection ))){ 125 printf( " - ERROR %i\n", ERROR_CODE ); 128 126 return ERROR_CODE; 129 127 }
Note:
See TracChangeset
for help on using the changeset viewer.