comparison buffer.h @ 41:5252fa9b5cb1

Little update for buffer
author David Demelier <markand@malikania.fr>
date Sun, 02 Oct 2011 11:17:36 +0200
parents ae4128d16c92
children fea13579acbe
comparison
equal deleted inserted replaced
40:d741c948de89 41:5252fa9b5cb1
19 #ifndef _BUFFER_H_ 19 #ifndef _BUFFER_H_
20 #define _BUFFER_H_ 20 #define _BUFFER_H_
21 21
22 #define BUFFER_DEFAULT_BSIZE 512 22 #define BUFFER_DEFAULT_BSIZE 512
23 23
24 #define BUFFER_FIXED 0x00
25 #define BUFFER_AUTO 0x01
26
24 #include <stdarg.h> 27 #include <stdarg.h>
25 28
26 struct buffer { 29 struct buffer {
27 char *data; /* string buffer */ 30 char *data; /* string buffer */
28 size_t length; /* string's length */ 31 size_t length; /* string's length */
29 32
30 #define BUFFER_FIXED 0x00000000
31 #define BUFFER_AUTO 0x00000001
32 int flags; /* buffer's flags (default AUTO) */ 33 int flags; /* buffer's flags (default AUTO) */
33 34
34 /* Private should not be modified by user */ 35 /* Private should not be modified by user */
35 size_t size; /* current size */ 36 size_t size; /* current size */
36 size_t bsize; /* block size */ 37 size_t bsize; /* block size */