version 1.16, 2003/06/03 02:56:11 |
version 1.17, 2007/09/17 09:28:36 |
|
|
* Doesn't include the null-terminating char. */ |
* Doesn't include the null-terminating char. */ |
#define Buf_Size(bp) ((size_t)((bp)->inPtr - (bp)->buffer)) |
#define Buf_Size(bp) ((size_t)((bp)->inPtr - (bp)->buffer)) |
/* Buf_Init(buf, init); |
/* Buf_Init(buf, init); |
* Initializes a buffer, to hold approximately init chars. |
* Initializes a buffer, to hold approximately init chars. |
* Set init to 0 if you have no idea. */ |
* Set init to 0 if you have no idea. */ |
extern void Buf_Init(Buffer, size_t); |
extern void Buf_Init(Buffer, size_t); |
/* Buf_Destroy(buf); |
/* Buf_Destroy(buf); |
|
|
/* str = Buf_Retrieve(buf); |
/* str = Buf_Retrieve(buf); |
* Retrieves data from a buffer, as a NULL terminated string. */ |
* Retrieves data from a buffer, as a NULL terminated string. */ |
#define Buf_Retrieve(bp) (*(bp)->inPtr = '\0', (bp)->buffer) |
#define Buf_Retrieve(bp) (*(bp)->inPtr = '\0', (bp)->buffer) |
/* Buf_AddChar(buf, c); |
/* Buf_AddChar(buf, c); |
* Adds a single char to buffer. */ |
* Adds a single char to buffer. */ |
#define Buf_AddChar(bp, byte) \ |
#define Buf_AddChar(bp, byte) \ |
do { \ |
do { \ |