strbuf.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* ----------------------------------------------------------------------------
  2. libconfig - A library for processing structured configuration files
  3. Copyright (C) 2005-2010 Mark A Lindner
  4. This file is part of libconfig.
  5. This library is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this library. If not, see <http://www.gnu.org/licenses/>.
  15. ----------------------------------------------------------------------------
  16. */
  17. #ifndef __libconfig_strbuf_h
  18. #define __libconfig_strbuf_h
  19. #include <string.h>
  20. #include <sys/types.h>
  21. typedef struct
  22. {
  23. char *string;
  24. size_t length;
  25. size_t capacity;
  26. } strbuf_t;
  27. char *strbuf_release(strbuf_t *buf);
  28. void strbuf_append(strbuf_t *buf, const char *text);
  29. #endif /* __libconfig_strbuf_h */