From 8c0d0ee9ed9f4b7814df1b8168be4b8c6e3d5ccb Mon Sep 17 00:00:00 2001 From: gotmor Date: Sun, 10 Jun 2007 17:27:42 +0000 Subject: improved buffer handling: malloc buffer buffer size is multiplier of dzen.slave_win.max_lines git-svn-id: http://dzen.googlecode.com/svn/trunk@77 f2baff5b-bf2c-0410-a398-912abdc3d8b2 --- dzen.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dzen.h') diff --git a/dzen.h b/dzen.h index 34a68da..b4a3f37 100644 --- a/dzen.h +++ b/dzen.h @@ -17,7 +17,8 @@ #define ALIGNLEFT 1 #define ALIGNRIGHT 2 -#define BUF_SIZE 4096 +#define MIN_BUF_SIZE 512 +#define MAX_LINE_LEN 512 /* gui data structures */ enum { ColFG, ColBG, ColLast }; @@ -53,8 +54,12 @@ struct SW { Window *line; Drawable *drawable; - char *tbuf[BUF_SIZE]; + //char *tbuf[BUF_SIZE]; + /* input buffer */ + char **tbuf; + int tsize; int tcnt; + int max_lines; int first_line_vis; int last_line_vis; -- cgit v1.2.3-54-g00ecf