Mercurial > hg > nnchat
diff libnnchat.h @ 325:c086345d176b
Move some functions to libnnchat and rename nn_find_window to findWindow()
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 11 Jun 2011 10:03:44 +0300 |
parents | b765f15f9895 |
children | a8bda904846c |
line wrap: on
line diff
--- a/libnnchat.h Sat Jun 11 09:49:42 2011 +0300 +++ b/libnnchat.h Sat Jun 11 10:03:44 2011 +0300 @@ -30,6 +30,7 @@ #define NN_CONNBUF_SIZE (64 * 1024) #define NN_NUM_BUCKETS (256) #define NN_DELAY_USEC (15 * 1000) +#define NN_BACKBUF_LEN (512) /* Backbuffer size (in lines) */ typedef struct { ssize_t pos, len, size; @@ -72,6 +73,19 @@ } nn_conn_t; +typedef struct { + qringbuf_t *data; /* "Backbuffer" data for this window */ + int pos; /* Current position in the window, 0 = real time */ + BOOL dirty; + + char *id; /* Chatter ID, NULL = main window */ + int num; /* Window number */ + + char *buf; + size_t len, bufsize; +} nn_window_t; + + const char *nn_get_errstr(int err); BOOL nn_network_init(void); void nn_network_close(void); @@ -119,4 +133,7 @@ char * nn_editbuf_get_string(nn_editbuf_t *buf, ssize_t start, ssize_t end); +nn_window_t *nn_window_new(const char *); +void nn_window_free(nn_window_t *); + #endif