/*
* $Log$
+ * Revision 1.37 2008/02/29 22:50:29 james
+ * *** empty log message ***
+ *
* Revision 1.36 2008/02/28 22:00:42 james
* *** empty log message ***
*
cmd_show_status (c->d, c);
- if (c->d->active)
- return cmd_key (c->d, c,a, key);
- if (key == CMD_KEY)
+ if (c->d->active) {
+ if (key == CMD_KEY)
+ return cmd_deactivate (c->d, c);
+ }else {
+ return cmd_key (c->d, c,a, key);
+ }
+ } else if (key == CMD_KEY)
return cmd_activate (c->d, c);
+ }
return c->k->key (c->k, c, key);
/*
* $Log$
+ * Revision 1.8 2008/02/29 22:50:29 james
+ * *** empty log message ***
+ *
* Revision 1.7 2008/02/28 22:00:42 james
* *** empty log message ***
*
}
+int
+cmd_deactivate (Cmd * c, Context * ctx)
+{
+ c->active = 0;
+ cmd_show_status (c, ctx);
+ return 0;
+}
+
int
cmd_activate (Cmd * c, Context * ctx)
{
/* cmd.c */
extern int cmd_parse(Cmd *c, Context *ctx, ANSI *a, char *buf);
extern void cmd_show_status(Cmd *c, Context *ctx);
+extern int cmd_key(Cmd *c, Context *ctx, ANSI *a, int key);
+extern int cmd_deactivate(Cmd *c, Context *ctx);
extern int cmd_activate(Cmd *c, Context *ctx);
extern void cmd_new_status(Cmd *c, Context *ctx, char *msg);
extern Cmd *cmd_new(void);