diff options
author | james <> | 2008-03-06 21:34:09 +0000 |
---|---|---|
committer | james <> | 2008-03-06 21:34:09 +0000 |
commit | 3aaa25a4e02ff362ef6b057c597630bdbef5227b (patch) | |
tree | cccef46a7ddafa7912d0069c5477847982536fc8 /src/raw.c | |
parent | 63a3f74532632a7e07b71f805eb806b05b3f19e3 (diff) | |
download | sympathy-3aaa25a4e02ff362ef6b057c597630bdbef5227b.tar.gz sympathy-3aaa25a4e02ff362ef6b057c597630bdbef5227b.tar.bz2 sympathy-3aaa25a4e02ff362ef6b057c597630bdbef5227b.zip |
*** empty log message ***
Diffstat (limited to 'src/raw.c')
-rw-r--r-- | src/raw.c | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.5 2008/03/06 21:34:09 james + * *** empty log message *** + * * Revision 1.4 2008/03/06 21:33:02 james * *** empty log message *** * @@ -34,7 +37,7 @@ typedef struct int wfd; } RX_Raw; -typedef struct +typedef struct { TTY_SIGNATURE; } RAW_TERMINAL; @@ -46,8 +49,8 @@ rx_raw_rx (RX * _r, int ch) RX_Raw *r = (RX_Raw *) _r; int ret; uint8_t c = ch; - set_blocking(r->wfd); - ret=(write (r->wfd, &c, 1) == 1) ? 0 : -1; + set_blocking (r->wfd); + ret = (write (r->wfd, &c, 1) == 1) ? 0 : -1; } static void @@ -132,13 +135,14 @@ raw_terminal_write (TTY * _t, void *buf, int len) -static void raw_terminal_close(TTY *_t) +static void +raw_terminal_close (TTY * _t) { -RAW_TERMINAL *t=(RAW_TERMINAL *)_t; + RAW_TERMINAL *t = (RAW_TERMINAL *) _t; set_blocking (t->rfd); set_blocking (t->wfd); -free(t); + free (t); } @@ -148,7 +152,7 @@ terminal_new_raw (int rfd, int wfd) RAW_TERMINAL *t; t = (RAW_TERMINAL *) malloc (sizeof (RAW_TERMINAL)); - memset(t,0,sizeof(t)); + memset (t, 0, sizeof (t)); strcpy (t->name, "raw"); t->rfd = rfd; @@ -170,15 +174,17 @@ ansi_raw_one_shot (ANSI * a, CRT * c) { } -static int ansi_raw_key(ANSI *a,Context *c,int key) +static int +ansi_raw_key (ANSI * a, Context * c, int key) { -return c->k->key (c->k, c, key); + return c->k->key (c->k, c, key); } -static void ansi_raw_parse(ANSI *a,Context *c,uint8_t *buf,int red) +static void +ansi_raw_parse (ANSI * a, Context * c, uint8_t * buf, int red) { -while (red--) -ansi_raw_key(a,c,*(buf++)); + while (red--) + ansi_raw_key (a, c, *(buf++)); } static int @@ -213,7 +219,7 @@ ansi_new_raw (int rfd, int wfd) memset (ret, 0, sizeof (ANSI)); ret->terminal = terminal_new_raw (rfd, wfd); - ret->dispatch=ansi_raw_dispatch; + ret->dispatch = ansi_raw_dispatch; ret->close = ansi_raw_free; return ret; |