4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.2 2008/02/15 23:52:12 james
14 * *** empty log message ***
16 * Revision 1.1 2008/02/15 15:14:19 james
17 * *** empty log message ***
25 cmd_parse (Cmd * c, Context * ctx, char *buf)
27 if (!strcmp (buf, "quit"))
30 if (!strcmp (buf, "flow"))
31 ctx->k->set_flow (ctx->k, ctx, 1);
32 if (!strcmp (buf, "noflow"))
33 ctx->k->set_flow (ctx->k, ctx, 0);
34 if (!strncmp (buf, "baud", 4))
35 ctx->k->set_baud (ctx->k, ctx, atoi (buf + 4));
36 if (!strncmp (buf, "break", 4))
37 ctx->k->send_break (ctx->k, ctx);
38 if (!strncmp (buf, "hangup", 4))
39 ctx->k->hangup (ctx->k, ctx);
44 cmd_show_status (Cmd * c, Context * ctx)
50 vt102_status_line (ctx->v, c->csl);
52 vt102_status_line (ctx->v, c->buf);
58 cmd_key (Cmd * c, Context * ctx, int key)
63 cmd_parse (c, ctx, c->buf + 1);
65 cmd_show_status (c, ctx);
69 if (((key == 8) || (key == 127)) && (c->ptr > 1))
75 if ((key >= 32) && (key < 127))
84 cmd_show_status (c, ctx);
91 cmd_activate (Cmd * c, Context * ctx)
98 cmd_show_status (c, ctx);
104 cmd_new_status (Cmd * c, Context * ctx, char *msg)
106 strcpy (c->csl, msg);
107 cmd_show_status (c, ctx);
117 ret = (Cmd *) malloc (sizeof (Cmd));