home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume26 / unproto / part01 / vstring.h < prev   
Encoding:
C/C++ Source or Header  |  1991-12-07  |  410 b   |  15 lines

  1. /* @(#) vstring.h 1.1 91/09/01 23:08:42 */
  2.  
  3. struct vstring {
  4.     char   *str;            /* string value */
  5.     char   *last;            /* last position */
  6. };
  7.  
  8. extern struct vstring *vs_alloc();    /* initial allocation */
  9. extern char *vs_realloc();        /* string extension */
  10.  
  11. /* macro to add one character to auto-resized string */
  12.  
  13. #define    VS_ADDCH(vs,wp,c) \
  14.     ((wp < (vs)->last || (wp = vs_realloc(vs,wp))) ? (*wp++ = c) : 0)
  15.