Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 1 | /* |
Daniel Veillard | 28cc42d | 2012-08-10 10:00:18 +0800 | [diff] [blame] | 2 | * Summary: Internal Interfaces for memory buffers in libxml2 |
| 3 | * Description: this module describes most of the new xmlBuf buffer |
| 4 | * entry points, those are private routines, with a |
| 5 | * few exceptions exported in tree.h. This was added |
| 6 | * in 2.9.0. |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 7 | * |
Daniel Veillard | 28cc42d | 2012-08-10 10:00:18 +0800 | [diff] [blame] | 8 | * Copy: See Copyright for the status of this software. |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 9 | * |
Daniel Veillard | 28cc42d | 2012-08-10 10:00:18 +0800 | [diff] [blame] | 10 | * Author: Daniel Veillard |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef __XML_BUF_H__ |
| 14 | #define __XML_BUF_H__ |
| 15 | |
| 16 | #include <libxml/tree.h> |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
| 22 | xmlBufPtr xmlBufCreate(void); |
| 23 | xmlBufPtr xmlBufCreateSize(size_t size); |
| 24 | xmlBufPtr xmlBufCreateStatic(void *mem, size_t size); |
| 25 | |
| 26 | int xmlBufSetAllocationScheme(xmlBufPtr buf, |
| 27 | xmlBufferAllocationScheme scheme); |
| 28 | int xmlBufGetAllocationScheme(xmlBufPtr buf); |
| 29 | |
| 30 | void xmlBufFree(xmlBufPtr buf); |
| 31 | void xmlBufEmpty(xmlBufPtr buf); |
| 32 | |
Daniel Veillard | 82cdfc4 | 2012-08-22 11:05:09 +0800 | [diff] [blame] | 33 | /* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */ |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 34 | int xmlBufGrow(xmlBufPtr buf, int len); |
| 35 | int xmlBufInflate(xmlBufPtr buf, size_t len); |
| 36 | int xmlBufResize(xmlBufPtr buf, size_t len); |
| 37 | |
| 38 | int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len); |
| 39 | int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len); |
| 40 | int xmlBufCat(xmlBufPtr buf, const xmlChar *str); |
| 41 | int xmlBufCCat(xmlBufPtr buf, const char *str); |
| 42 | int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string); |
| 43 | int xmlBufWriteChar(xmlBufPtr buf, const char *string); |
| 44 | int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string); |
| 45 | |
Daniel Veillard | 18e1f1f | 2012-08-06 10:16:41 +0800 | [diff] [blame] | 46 | size_t xmlBufAvail(const xmlBufPtr buf); |
| 47 | size_t xmlBufLength(const xmlBufPtr buf); |
| 48 | /* size_t xmlBufUse(const xmlBufPtr buf); */ |
| 49 | int xmlBufIsEmpty(const xmlBufPtr buf); |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 50 | int xmlBufAddLen(xmlBufPtr buf, size_t len); |
| 51 | int xmlBufErase(xmlBufPtr buf, size_t len); |
| 52 | |
Daniel Veillard | 18e1f1f | 2012-08-06 10:16:41 +0800 | [diff] [blame] | 53 | /* const xmlChar * xmlBufContent(const xmlBufPtr buf); */ |
| 54 | /* const xmlChar * xmlBufEnd(const xmlBufPtr buf); */ |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 55 | |
| 56 | xmlChar * xmlBufDetach(xmlBufPtr buf); |
| 57 | |
| 58 | size_t xmlBufDump(FILE *file, xmlBufPtr buf); |
| 59 | |
| 60 | xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer); |
| 61 | xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf); |
| 62 | int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer); |
| 63 | |
Daniel Veillard | 61551a1 | 2012-07-16 16:28:47 +0800 | [diff] [blame] | 64 | int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input); |
Daniel Veillard | 00ac0d3 | 2012-07-16 18:03:01 +0800 | [diff] [blame] | 65 | size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input); |
| 66 | int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input, |
| 67 | size_t base, size_t cur); |
Daniel Veillard | bca22f4 | 2012-07-11 16:48:47 +0800 | [diff] [blame] | 68 | #ifdef __cplusplus |
| 69 | } |
| 70 | #endif |
| 71 | #endif /* __XML_BUF_H__ */ |
| 72 | |