home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / lib / H / tmp / stringinfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.3 KB  |  55 lines

  1. /*=====================================================================
  2.  *
  3.  * FILE:
  4.  * stringfuncs.h
  5.  *
  6.  * $Header: /private/postgres/src/lib/H/tmp/RCS/stringinfo.h,v 1.1 1991/02/05 15:47:20 sp Exp $
  7.  *
  8.  * Declarations/definitons for "string" functions.
  9.  *=====================================================================
  10.  */
  11.  
  12. #ifndef StringInfoIncluded
  13. #define StringInfoIncluded
  14.  
  15. #include "tmp/c.h"        /* for 'String' */
  16.  
  17. /*-------------------------
  18.  * StringInfoData holds information about a string.
  19.  *     'data' is the string.
  20.  *    'len' is the current string length (as returned by 'strlen')
  21.  *    'maxlen' is the size in bytes of 'data', i.e. the maximum string
  22.  *        size (includeing the terminating '\0' char) that we can
  23.  *        currently store in 'data' without having to reallocate
  24.  *        more space.
  25.  */
  26. typedef struct StringInfoData {
  27.     String data;
  28.     int maxlen;
  29.     int len;
  30. } StringInfoData;
  31.  
  32. typedef StringInfoData *StringInfo;
  33.  
  34. /*------------------------
  35.  * makeStringInfo
  36.  * create a 'StringInfoData' & return a pointer to it.
  37.  */
  38. extern
  39. StringInfo
  40. makeStringInfo ARGS((
  41. ));
  42.  
  43. /*------------------------
  44.  * appendStringInfo
  45.  * similar to 'strcat' but reallocates more space if necessary...
  46.  */
  47. extern
  48. void
  49. appendStringInfo ARGS((
  50.     StringInfo    str,
  51.     char *    buffer
  52. ));
  53.  
  54. #endif StringInfoIncluded
  55.