aboutsummaryrefslogtreecommitdiffstats
path: root/src/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw.c')
-rw-r--r--src/raw.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/raw.c b/src/raw.c
index 2bfc977..7116c97 100644
--- a/src/raw.c
+++ b/src/raw.c
@@ -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;