diff options
| author | Marc G. Fournier | 1996-08-28 07:27:54 +0000 |
|---|---|---|
| committer | Marc G. Fournier | 1996-08-28 07:27:54 +0000 |
| commit | 870be9fa8e5ead7a9fec1b1cf539c701bba57d2a (patch) | |
| tree | 0980ed1b45ec7974d2ceea9df3d0570c165804b6 /src/include/lib/stringinfo.h | |
| parent | 907c884fe8b88d3df5883c278cacb094a1cfc7ac (diff) | |
Clean up th ecompile process by centralizing the include files
- code compile tested, but due to a yet unresolved problem with
parse.h's creation, compile not completed...
Diffstat (limited to 'src/include/lib/stringinfo.h')
| -rw-r--r-- | src/include/lib/stringinfo.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h new file mode 100644 index 00000000000..524a11414ad --- /dev/null +++ b/src/include/lib/stringinfo.h @@ -0,0 +1,47 @@ +/*------------------------------------------------------------------------- + * + * stringinfo.h-- + * Declarations/definitons for "string" functions. + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: stringinfo.h,v 1.1 1996/08/28 07:22:41 scrappy Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef STRINGINFO_H +#define STRINGINFO_H + +/*#include "c.h" */ /* for 'String' */ + +/*------------------------- + * StringInfoData holds information about a string. + * '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 + * size (includeing the terminating '\0' char) that we can + * currently store in 'data' without having to reallocate + * more space. + */ +typedef struct StringInfoData { + char *data; + int maxlen; + int len; +} StringInfoData; + +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... + */ +extern void appendStringInfo(StringInfo str, char *buffer); + +#endif /* STRINGINFO_H */ |
