aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames <>2008-02-29 22:50:29 +0000
committerjames <>2008-02-29 22:50:29 +0000
commit453cbff0edfe3e031184abeb730fd3b13008ad6b (patch)
tree17d8051e88be50dda93b4db3a50ee78f36afae9c
parent11818085b36f0bbc6d21fece3fdb0a90df1535aa (diff)
downloadsympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.tar.gz
sympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.tar.bz2
sympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.zip
*** empty log message ***
-rw-r--r--src/ansi.c14
-rw-r--r--src/cmd.c11
-rw-r--r--src/prototypes.h2
3 files changed, 24 insertions, 3 deletions
diff --git a/src/ansi.c b/src/ansi.c
index 970d353..ae89f61 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $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 ***
*
@@ -740,11 +743,16 @@ int ansi_key(ANSI *a,Context *c,int key)
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);
diff --git a/src/cmd.c b/src/cmd.c
index 34dc2f4..c2d5e57 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $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 ***
*
@@ -137,6 +140,14 @@ cmd_key (Cmd * c, Context * ctx,ANSI *a, int key)
int
+cmd_deactivate (Cmd * c, Context * ctx)
+{
+ c->active = 0;
+ cmd_show_status (c, ctx);
+ return 0;
+}
+
+int
cmd_activate (Cmd * c, Context * ctx)
{
c->active = 1;
diff --git a/src/prototypes.h b/src/prototypes.h
index c378764..074f1a9 100644
--- a/src/prototypes.h
+++ b/src/prototypes.h
@@ -146,6 +146,8 @@ extern TTY *serial_open(char *path, int lock_mode);
/* 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);