1996-07-09 02:22:35 -04:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
|
|
|
|
* stringinfo.h--
|
1997-09-07 01:04:48 -04:00
|
|
|
* Declarations/definitons for "string" functions.
|
1996-07-09 02:22:35 -04:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
|
*
|
1998-09-01 00:40:42 -04:00
|
|
|
* $Id: stringinfo.h,v 1.7 1998/09/01 04:36:21 momjian Exp $
|
1996-07-09 02:22:35 -04:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#ifndef STRINGINFO_H
|
|
|
|
|
#define STRINGINFO_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------
|
|
|
|
|
* StringInfoData holds information about a string.
|
1997-09-07 01:04:48 -04:00
|
|
|
* 'data' is the string.
|
|
|
|
|
* 'len' is the current string length (as returned by 'strlen')
|
|
|
|
|
* 'maxlen' is the size in bytes of 'data', i.e. the maximum string
|
1998-03-19 23:12:25 -05:00
|
|
|
* size (including the terminating '\0' char) that we can
|
1997-09-07 01:04:48 -04:00
|
|
|
* currently store in 'data' without having to reallocate
|
|
|
|
|
* more space.
|
1996-07-09 02:22:35 -04:00
|
|
|
*/
|
1997-09-07 01:04:48 -04:00
|
|
|
typedef struct StringInfoData
|
|
|
|
|
{
|
1997-09-07 22:41:22 -04:00
|
|
|
char *data;
|
|
|
|
|
int maxlen;
|
|
|
|
|
int len;
|
1997-09-08 17:56:23 -04:00
|
|
|
} StringInfoData;
|
1996-07-09 02:22:35 -04:00
|
|
|
|
|
|
|
|
typedef StringInfoData *StringInfo;
|
|
|
|
|
|
|
|
|
|
/*------------------------
|
|
|
|
|
* makeStringInfo
|
|
|
|
|
* create a 'StringInfoData' & return a pointer to it.
|
|
|
|
|
*/
|
|
|
|
|
extern StringInfo makeStringInfo(void);
|
|
|
|
|
|
|
|
|
|
/*------------------------
|
|
|
|
|
* appendStringInfo
|
|
|
|
|
* similar to 'strcat' but reallocates more space if necessary...
|
|
|
|
|
*/
|
1997-09-07 22:41:22 -04:00
|
|
|
extern void appendStringInfo(StringInfo str, char *buffer);
|
1996-07-09 02:22:35 -04:00
|
|
|
|
1998-09-01 00:40:42 -04:00
|
|
|
#endif /* STRINGINFO_H */
|