strbuf.h 1.4 KB

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