Pristine Ack-5.5
[Ack-5.5.git] / util / ack / grows.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 #ifndef NORCSID
6 #define RCS_GROWS "$Id: grows.h,v 2.3 1994/06/24 10:12:43 ceriel Exp $"
7 #endif
8
9 /* struct used to identify and do bookkeeping for growing strings */
10
11 typedef struct {
12         char            *gr_string ;    /* Points to start of string */
13         unsigned        gr_size ;       /* Current string size */
14         unsigned        gr_max ;        /* Maximum string size */
15 } growstring ;
16
17 #define GR_MORE         50      /* Steps to grow */
18
19 #define gr_start(id)    (id).gr_string  /* The start of the string */
20
21 /* Routines used */
22
23 extern  int     gr_throw() ;    /* To free the core */
24 extern  int     gr_add() ;      /* To add one character */
25 extern  int     gr_cat() ;      /* concatenate the contents and the string */
26 extern  int     gr_init() ;     /* Initialize the bookkeeping */
27 extern  char    *gr_final() ;   /* Transform to a stable storage string */