diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-11-15 15:29:24 +0100 |
commit | 2cf0d770b66b6c6ce50af2767f575db552cd784c (patch) | |
tree | 56ba70257c94add690ddaa8b0ec961c6964a146e /lib/utils/strbuf.h | |
parent | 2169959c6ba2d77512b8b39366a4d3e476931b4a (diff) | |
download | abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.gz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.tar.xz abrt-2cf0d770b66b6c6ce50af2767f575db552cd784c.zip |
move inc/ and lib/ to src/. No code changes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils/strbuf.h')
-rw-r--r-- | lib/utils/strbuf.h | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/lib/utils/strbuf.h b/lib/utils/strbuf.h deleted file mode 100644 index dc45a199..00000000 --- a/lib/utils/strbuf.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - strbuf.h - string buffer - - Copyright (C) 2009 RedHat inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef STRBUF_H -#define STRBUF_H - -#ifdef __cplusplus -extern "C" { -#endif - -struct strbuf -{ - /* Size of the allocated buffer. Always > 0. */ - int alloc; - /* Length of the string, without the ending \0. */ - int len; - char *buf; -}; - -/** - * Creates and initializes a new string buffer. - * @returns - * It never returns NULL. The returned pointer must be released by - * calling the function strbuf_free(). - */ -struct strbuf *strbuf_new(); - -/** - * Releases the memory held by the string buffer. - * @param strbuf - * If the strbuf is NULL, no operation is performed. - */ -void strbuf_free(struct strbuf *strbuf); - -/** - * Releases the strbuf, but not the internal buffer. The internal - * string buffer is returned. Caller is responsible to release the - * returned memory using free(). - */ -char* strbuf_free_nobuf(struct strbuf *strbuf); - -/** - * The string content is set to an empty string, erasing any previous - * content and leaving its length at 0 characters. - */ -void strbuf_clear(struct strbuf *strbuf); - -/** - * The current content of the string buffer is extended by adding a - * character c at its end. - */ -struct strbuf *strbuf_append_char(struct strbuf *strbuf, char c); - -/** - * The current content of the string buffer is extended by adding a - * string str at its end. - */ -struct strbuf *strbuf_append_str(struct strbuf *strbuf, - const char *str); - -/** - * The current content of the string buffer is extended by inserting a - * string str at its beginning. - */ -struct strbuf *strbuf_prepend_str(struct strbuf *strbuf, - const char *str); - -/** - * The current content of the string buffer is extended by adding a - * sequence of data formatted as the format argument specifies. - */ -struct strbuf *strbuf_append_strf(struct strbuf *strbuf, - const char *format, ...); - -/** - * The current content of the string buffer is extended by inserting a - * sequence of data formatted as the format argument specifies at the - * buffer beginning. - */ -struct strbuf *strbuf_prepend_strf(struct strbuf *strbuf, - const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif |