LeapGL/tests/event_injector/emulator-console.c
/* Send a message to the console asynchronously. Any answer will be
 * ignored. */
Send a message to the console asynchronously. Any answer will be
ignored.
Send a message to the console asynchronously . Any answer will be ignored .
void
emulatorConsole_send( EmulatorConsole*  con, const char* command )
{
    int  cmdlen = strlen(command);
    Msg* msg;
    Msg** plast;
    if (cmdlen == 0)
        return;
    msg = msg_alloc(command, cmdlen);
    plast = &con->out_msg;
    while (*plast) {
        plast = &(*plast)->next;
    }
    *plast = msg;
    if (con->out_msg == msg) {
        iolooper_add_write(con->looper, con->fd);
    }
    emulatorConsole_sendOutput(con);
}
void emulatorConsole_send ( EmulatorConsole * con , const char * command ) { int cmdlen = strlen ( command ) ; Msg * msg ; Msg * * plast ; if ( cmdlen == 0 ) return ; msg = msg_alloc ( command , cmdlen ) ; plast = & con -> out_msg ; while ( * plast ) { plast = & ( * plast ) -> next ; } * plast = msg ; if ( con -> out_msg == msg ) { iolooper_add_write ( con -> looper , con -> fd ) ; } emulatorConsole_sendOutput ( con ) ; }
Send a message to the console asynchronously.
Send a message to the console asynchronously .
/* Append new message at end of outgoing list */