-
Notifications
You must be signed in to change notification settings - Fork 1
/
longstr.h
32 lines (26 loc) · 860 Bytes
/
longstr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* $Id$
*
* Long string handler -- Definitions
*
* Shigeya Suzuki, April 1993
*/
#ifndef __LONGSTR_H__
#define __LONGSTR_H__
#ifndef __P
# include "cdefs.h"
#endif
struct longstr {
char *ls_buf; /* pointer to head of buffer */
char *ls_ptr; /* pointer to current tail (points null ch) */
size_t ls_allocsize; /* chunks for allocation */
size_t ls_size; /* size of the *ls_buf */
size_t ls_used; /* bytes used (actually, ls_ptr - ls_buf +1) */
};
#define LONGSTR_CHUNK 10240 /* default allocation chunk */
extern void ls_init __P((struct longstr*));
extern void ls_reset __P((struct longstr*));
extern void ls_grow __P((struct longstr*, size_t));
extern void ls_append __P((struct longstr*, char*, size_t));
extern void ls_appendstr __P((struct longstr*, char*));
extern void ls_appendchar __P((struct longstr*, int));
#endif