diff options
| author | james <> | 2008-02-29 22:50:29 +0000 | 
|---|---|---|
| committer | james <> | 2008-02-29 22:50:29 +0000 | 
| commit | 453cbff0edfe3e031184abeb730fd3b13008ad6b (patch) | |
| tree | 17d8051e88be50dda93b4db3a50ee78f36afae9c | |
| parent | 11818085b36f0bbc6d21fece3fdb0a90df1535aa (diff) | |
| download | sympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.tar.gz sympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.tar.bz2 sympathy-453cbff0edfe3e031184abeb730fd3b13008ad6b.zip | |
*** empty log message ***
| -rw-r--r-- | src/ansi.c | 14 | ||||
| -rw-r--r-- | src/cmd.c | 11 | ||||
| -rw-r--r-- | src/prototypes.h | 2 | 
3 files changed, 24 insertions, 3 deletions
| @@ -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); @@ -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); | 
