Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

  1. /*===========================================================================
  2. xmlsbuf.h
  3. see parsifal.h for copyright info
  4. ===========================================================================*/
  5. #ifndef XMLSBUF__H
  6. #define XMLSBUF__H
  7. #include <stddef.h>
  8. #include "xmlpool.h"
  9. #ifndef XMLAPI
  10. #define XMLAPI
  11. #endif
  12. #ifndef BYTE
  13. #define BYTE unsigned char
  14. #endif
  15. #ifndef XMLCH_DEFINED
  16. #define XMLCH_DEFINED
  17. typedef unsigned char XMLCH;
  18. #endif
  19. #ifndef COUNTBUFSIZE
  20. #define COUNTBUFSIZE(cBytes, blocksize) \
  21. ((!(cBytes)) ? (blocksize) : (!( (cBytes) % (blocksize) ) ? (int)(cBytes) : (int)( (((cBytes) / (blocksize)) + 1) * (blocksize) )) )
  22. #endif
  23. typedef struct tagXMLSTRINGBUF
  24. {
  25. int capacity;
  26. int blocksize;
  27. int len;
  28. int usePool;
  29. XMLCH *str;
  30. LPXMLPOOL pool;
  31. } XMLSTRINGBUF, *LPXMLSTRINGBUF;
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. XMLCH XMLAPI *XMLStringbuf_Append(LPXMLSTRINGBUF sbuf, XMLCH *str, int len);
  36. XMLCH XMLAPI *XMLStringbuf_AppendCh(LPXMLSTRINGBUF sbuf, XMLCH c);
  37. XMLCH XMLAPI *XMLStringbuf_Init(LPXMLSTRINGBUF sbuf, int blockSize, int initSize);
  38. XMLCH XMLAPI *XMLStringbuf_InitUsePool(LPXMLSTRINGBUF sbuf, int blockSize, int initSize, LPXMLPOOL pool);
  39. XMLCH XMLAPI *XMLStringbuf_ToString(LPXMLSTRINGBUF sbuf);
  40. int XMLAPI XMLStringbuf_SetLength(LPXMLSTRINGBUF sbuf, int len);
  41. void XMLAPI XMLStringbuf_Free(LPXMLSTRINGBUF sbuf);
  42. #ifdef __cplusplus
  43. }
  44. #endif /* __cplusplus */
  45. #endif /* XMLSBUF__H */