Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/module.c

    raadf01e r21580dd  
    6060 *  @returns Other error codes as defined for each specific module message function.
    6161 */
    62 extern int module_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count);
     62extern int      module_message( ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count );
    6363
    6464/** External function to print the module name.
     
    6666 *  The function has to be defined in each module.
    6767 */
    68 extern void module_print_name(void);
     68extern void     module_print_name( void );
    6969
    7070/** External module startup function.
     
    7373 *  @param[in] client_connection The client connection function to be registered.
    7474 */
    75 extern int module_start(async_client_conn_t client_connection);
     75extern int      module_start( async_client_conn_t client_connection );
    7676
    7777/*@}*/
     
    8181 *  @param[in] icall The initial message call structure.
    8282 */
    83 void client_connection(ipc_callid_t iid, ipc_call_t * icall);
     83void    client_connection( ipc_callid_t iid, ipc_call_t * icall );
    8484
    8585/**     Starts the module.
     
    8989 *  @returns Other error codes as defined for each specific module start function.
    9090 */
    91 int main(int argc, char * argv[]);
     91int     main( int argc, char * argv[] );
    9292
    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;
     93void 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;
    9999
    100100        /*
     
    102102         *  - Answer the first IPC_M_CONNECT_ME_TO call.
    103103         */
    104         ipc_answer_0(iid, EOK);
     104        ipc_answer_0( iid, EOK );
    105105
    106         while(true){
    107                 refresh_answer(&answer, &answer_count);
     106        while( true ){
     107                refresh_answer( & answer, & answer_count );
    108108
    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 );
    111111
    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;
    115113
    116                 answer_call(callid, res, &answer, answer_count);
     114                answer_call( callid, res, & answer, answer_count );
    117115        }
    118116}
    119117
    120 int main(int argc, char * argv[]){
     118int main( int argc, char * argv[] ){
    121119        ERROR_DECLARE;
    122120
    123121        printf("Task %d - ", task_get_id());
    124122        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 );
    128126                return ERROR_CODE;
    129127        }
Note: See TracChangeset for help on using the changeset viewer.