xmlbuff.c 356 B

12345678910111213141516171819
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include "xmlbuff.h"
  4. XMLBuff *XMLBuffNew(void) {
  5. XMLBuff *out = malloc(sizeof(XMLBuff));
  6. if (out == NULL) {
  7. puts("Couldn't allocate memory for XMLBuff!");
  8. return NULL;
  9. }
  10. *out = (XMLBuff){ .data=NULL };
  11. return out;
  12. }
  13. void XMLBuffFree(XMLBuff *in) {
  14. free(in->data);
  15. free(in);
  16. }