From d6990c3ab1095e0637a5113fe062b9eb6e1a2238 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 23 Nov 2007 08:11:42 +0200 Subject: Move stringbuf into librpmio, rename header - rename header to more generic rpmstring.h for collecting misc string helper functions --- rpmio/rpmstring.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 rpmio/rpmstring.h (limited to 'rpmio/rpmstring.h') diff --git a/rpmio/rpmstring.h b/rpmio/rpmstring.h new file mode 100644 index 000000000..ff0bdebbd --- /dev/null +++ b/rpmio/rpmstring.h @@ -0,0 +1,52 @@ +#ifndef _RPMSTRING_H_ +#define _RPMSTRING_H_ + +/** \file rpmio/rpmstring.h + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + */ +typedef struct StringBufRec *StringBuf; + +/** + */ +StringBuf newStringBuf(void); + +/** + */ +StringBuf freeStringBuf( StringBuf sb); + +/** + */ +void truncStringBuf(StringBuf sb); + +/** + */ +char * getStringBuf(StringBuf sb); + +/** + */ +void stripTrailingBlanksStringBuf(StringBuf sb); + +/** + */ +#define appendStringBuf(sb, s) appendStringBufAux(sb, s, 0) + +/** + */ +#define appendLineStringBuf(sb, s) appendStringBufAux(sb, s, 1) + +/** + */ +void appendStringBufAux(StringBuf sb, const char * s, int nl); + +#ifdef __cplusplus +} +#endif + +#endif /* _RPMSTRING_H_ */ -- cgit v1.2.3