4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.1 2008/02/15 15:14:19 james
14 * *** empty log message ***
22 cmd_parse (Cmd * c, Context * ctx, char *buf)
24 if (!strcmp (buf, "quit"))
27 if (!strcmp (buf, "flow"))
28 ctx->k->set_flow (ctx->k, ctx, 1);
29 if (!strcmp (buf, "noflow"))
30 ctx->k->set_flow (ctx->k, ctx, 0);
31 if (!strncmp (buf, "baud", 4))
32 ctx->k->set_baud (ctx->k, ctx, atoi (buf + 4));
33 if (!strncmp (buf, "break", 4))
34 ctx->k->send_break (ctx->k, ctx);
39 cmd_show_status (Cmd * c, Context * ctx)
45 vt102_status_line (ctx->v, c->csl);
47 vt102_status_line (ctx->v, c->buf);
53 cmd_key (Cmd * c, Context * ctx, int key)
58 cmd_parse (c, ctx, c->buf + 1);
60 cmd_show_status (c, ctx);
64 if (((key == 8) || (key == 127)) && (c->ptr > 1))
70 if ((key >= 32) && (key < 127))
79 cmd_show_status (c, ctx);
86 cmd_activate (Cmd * c, Context * ctx)
93 cmd_show_status (c, ctx);
99 cmd_new_status (Cmd * c, Context * ctx, char *msg)
101 strcpy (c->csl, msg);
102 cmd_show_status (c, ctx);
112 ret = (Cmd *) malloc (sizeof (Cmd));