/*
* $Log$
+ * Revision 1.6 2008/02/20 19:44:37 james
+ * @@
+ *
* Revision 1.5 2008/02/20 18:31:44 james
* *** empty log message ***
*
}
-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)
{
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:
default:
fprintf (stderr, "Unhandeled message type %d\n", m->hdr.type);
}
+return 0;
}
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);
}
}
/*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);
}
}
/*
* $Log$
+ * Revision 1.10 2008/02/20 19:44:37 james
+ * @@
+ *
* Revision 1.9 2008/02/20 18:49:11 staffcvs
* *** empty log message ***
*
terminal_register_handlers ();
ansi->terminal = terminal_open (0, 1);
- ansi_reset (ansi, NULL);
+ ansi->reset(ansi, NULL);
}
}
if (ansi)
{
- ansi_terminal_reset (ansi);
+ ansi->close(ansi);
terminal_atexit ();
}
/*
* $Log$
+ * Revision 1.25 2008/02/20 19:44:37 james
+ * @@
+ *
* Revision 1.24 2008/02/20 19:36:06 james
* @@
*
if (!a->terminal)
- return;
+ return 0;
red = a->terminal->recv (a->terminal, buf, sizeof (buf));
if (red <= 0)
/*
* $Log$
+ * Revision 1.10 2008/02/20 19:44:37 james
+ * @@
+ *
* Revision 1.9 2008/02/20 19:36:06 james
* @@
*
int history_ptr;
- void (*dispatch)(struct ANSI_struct *,struct Context_struct *);
+ int (*dispatch)(struct ANSI_struct *,struct Context_struct *);
void (*update)(struct ANSI_struct *,struct Context_struct *);
- void (*oneshot)(struct ANSI_struct *,struct CRT_struct *);
+ void (*one_shot)(struct ANSI_struct *,struct CRT_struct *);
void (*reset)(struct ANSI_struct *,struct CRT_struct *);
void (*terminal_reset)(struct ANSI_struct *);
void (*close)(struct ANSI_struct *);