grows.h 976 B

123456789101112131415161718192021222324252627
  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$"
  7. #endif
  8. /* struct used to identify and do bookkeeping for growing strings */
  9. typedef struct {
  10. char *gr_string ; /* Points to start of string */
  11. unsigned gr_size ; /* Current string size */
  12. unsigned gr_max ; /* Maximum string size */
  13. } growstring ;
  14. #define GR_MORE 50 /* Steps to grow */
  15. #define gr_start(id) (id).gr_string /* The start of the string */
  16. /* Routines used */
  17. extern int gr_throw() ; /* To free the core */
  18. extern int gr_add() ; /* To add one character */
  19. extern int gr_cat() ; /* concatenate the contents and the string */
  20. extern int gr_init() ; /* Initialize the bookkeeping */
  21. extern char *gr_final() ; /* Transform to a stable storage string */