aboutsummaryrefslogtreecommitdiffstats
path: root/src/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw.c')
-rw-r--r--src/raw.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/raw.c b/src/raw.c
index 5e6b586..df54ced 100644
--- a/src/raw.c
+++ b/src/raw.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.2 2008/03/06 16:49:39 james
+ * *** empty log message ***
+ *
* Revision 1.1 2008/03/06 16:49:05 james
* *** empty log message ***
*
@@ -18,46 +21,51 @@ static char rcsid[] = "$Id$";
#include "project.h"
-typedef struct {
- RX_SIGNATURE;
- int rfd;
- int wfd;
-} RX_Raw;
+typedef struct
+{
+ RX_SIGNATURE;
+ int rfd;
+ int wfd;
+} RX_Raw;
-static int rx_raw_rx(RX *_r,int ch)
+static int
+rx_raw_rx (RX * _r, int ch)
{
-RX_Raw *r=(RX_Raw *) _r;
-uint8_t c=ch;
-return (write(r->wfd,&c,1)==1) ? 0:-1;
+ RX_Raw *r = (RX_Raw *) _r;
+ uint8_t c = ch;
+ return (write (r->wfd, &c, 1) == 1) ? 0 : -1;
}
-static void rx_raw_close(RX *r)
+static void
+rx_raw_close (RX * r)
{
-free(r);
+ free (r);
}
-RX *rx_new_raw(int rfd,int wfd)
+RX *
+rx_new_raw (int rfd, int wfd)
{
RX_Raw *ret;
ret = malloc (sizeof (RX_Raw));
memset (ret, 0, sizeof (RX_Raw));
- ret->rx=rx_raw_rx;
- ret->close=rx_raw_close;
+ ret->rx = rx_raw_rx;
+ ret->close = rx_raw_close;
- ret->rfd=rfd;
- ret->wfd=wfd;
+ ret->rfd = rfd;
+ ret->wfd = wfd;
- return (RX*) ret;
+ return (RX *) ret;
}
-TTY *terminal_new_raw(int rfd,int wfd)
+TTY *
+terminal_new_raw (int rfd, int wfd)
{
//FIXME
-return NULL;
+ return NULL;
}
static void
@@ -73,14 +81,14 @@ ansi_raw_free (ANSI * a)
}
ANSI *
-ansi_new_raw (int rfd,int wfd)
+ansi_new_raw (int rfd, int wfd)
{
ANSI *ret;
ret = malloc (sizeof (ANSI));
memset (ret, 0, sizeof (ANSI));
- ret->terminal = terminal_new_raw(rfd,wfd);
+ ret->terminal = terminal_new_raw (rfd, wfd);
ret->close = ansi_raw_free;
return ret;