4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
9 static char rcsid[] = "$Id$";
13 * Revision 1.3 2008/02/22 17:07:00 james
14 * *** empty log message ***
16 * Revision 1.2 2008/02/15 23:52:12 james
17 * *** empty log message ***
19 * Revision 1.1 2008/02/15 15:14:19 james
20 * *** empty log message ***
28 cmd_parse (Cmd * c, Context * ctx, char *buf)
30 if (!strcmp (buf, "quit"))
33 if (!strcmp (buf, "flow"))
34 ctx->k->set_flow (ctx->k, ctx, 1);
35 if (!strcmp (buf, "noflow"))
36 ctx->k->set_flow (ctx->k, ctx, 0);
37 if (!strcmp (buf, "ansi"))
38 ctx->k->set_ansi (ctx->k, ctx, 0);
39 if (!strcmp (buf, "noansi"))
40 ctx->k->set_ansi (ctx->k, ctx, 1);
41 if (!strncmp (buf, "baud", 4))
42 ctx->k->set_baud (ctx->k, ctx, atoi (buf + 4));
43 if (!strncmp (buf, "break", 4))
44 ctx->k->send_break (ctx->k, ctx);
45 if (!strncmp (buf, "hangup", 4))
46 ctx->k->hangup (ctx->k, ctx);
51 cmd_show_status (Cmd * c, Context * ctx)
57 vt102_status_line (ctx->v, c->csl);
59 vt102_status_line (ctx->v, c->buf);
65 cmd_key (Cmd * c, Context * ctx, int key)
70 cmd_parse (c, ctx, c->buf + 1);
72 cmd_show_status (c, ctx);
76 if (((key == 8) || (key == 127)) && (c->ptr > 1))
82 if ((key >= 32) && (key < 127))
91 cmd_show_status (c, ctx);
98 cmd_activate (Cmd * c, Context * ctx)
105 cmd_show_status (c, ctx);
111 cmd_new_status (Cmd * c, Context * ctx, char *msg)
113 strcpy (c->csl, msg);
114 cmd_show_status (c, ctx);
124 ret = (Cmd *) malloc (sizeof (Cmd));