X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=sympathy.git;a=blobdiff_plain;f=apps%2Fmainloop.c;h=3c7d01da7d8088372f8d5014355447a323d77c59;hp=fd2947f8af97729d5fa382f988cb4eba0e69d43c;hb=ece1299582523fd5a339398bdddb77f525e2a2fc;hpb=ab4d1b2e4c884114ecd4cba652ebcc97ef4c1a0d diff --git a/apps/mainloop.c b/apps/mainloop.c index fd2947f..3c7d01d 100644 --- a/apps/mainloop.c +++ b/apps/mainloop.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.6 2008/02/20 19:44:37 james + * @@ + * * Revision 1.5 2008/02/20 18:31:44 james * *** empty log message *** * @@ -301,8 +304,8 @@ check_status (Context * c, Clients * cs) } -static void -msg_from_server (IPC_Msg * m, Context * c) +static int +msg_from_server (ANSI *a,IPC_Msg * m, Context * c) { switch (m->hdr.type) { @@ -320,6 +323,11 @@ msg_from_server (IPC_Msg * m, Context * c) abort (); *(c->v) = m->vt102.vt102; + + if (a->one_shot) { + a->one_shot(a,&c->v->crt); + return 1; + } //FIXME HTML hook break; case IPC_MSG_TYPE_TERM: @@ -331,6 +339,7 @@ msg_from_server (IPC_Msg * m, Context * c) default: fprintf (stderr, "Unhandeled message type %d\n", m->hdr.type); } +return 0; } @@ -466,7 +475,8 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, while (client_socket->msg) { - msg_from_server (client_socket->msg, &c); + if (msg_from_server (ansi,client_socket->msg, &c)) + break; socket_consume_msg (client_socket); } } @@ -475,10 +485,11 @@ mainloop (TTY * tty, Socket * server_socket, Socket * client_socket, /*update our local screen */ if (ansi) { - if (ansi_dispatch (ansi, &c)) - break; + if (ansi->dispatch) + ansi->dispatch (ansi, &c); - ansi_update (ansi, &c); + if (ansi->update) + ansi->update (ansi, &c); } }