/utility/stringbuffer.h

http://github.com/interactive-matter/aJson · C Header · 55 lines · 24 code · 8 blank · 23 comment · 0 complexity · 37e21b50d45f7a663ed61ed60e4cdfbd MD5 · raw file

  1. /*
  2. * aJson
  3. * stringbuffer.h
  4. *
  5. * http://interactive-matter.org/
  6. *
  7. * This file is part of aJson.
  8. *
  9. * aJson is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * aJson is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. * You should have received a copy of the GNU General Public License
  19. * along with aJson. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. * Created on: 14.10.2010
  22. * Author: marcus
  23. */
  24. #ifndef STRINGBUFFER_H_
  25. #define STRINGBUFFER_H_
  26. typedef struct
  27. {
  28. char* string;
  29. unsigned int memory;
  30. unsigned int string_length;
  31. } string_buffer;
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif
  36. string_buffer*
  37. stringBufferCreate(void);
  38. char
  39. stringBufferAdd(char value, string_buffer* buffer);
  40. char*
  41. stringBufferToString(string_buffer* buffer);
  42. void
  43. stringBufferFree(string_buffer* buffer);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif /* STRINGBUFFER_H_ */