blob: e8c77153d1645b3e1d48ed57b974e53d63bbdf95 [file] [log] [blame]
Daniel Veillardbca22f42012-07-11 16:48:47 +08001/*
Daniel Veillard28cc42d2012-08-10 10:00:18 +08002 * 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 Veillardbca22f42012-07-11 16:48:47 +08007 *
Daniel Veillard28cc42d2012-08-10 10:00:18 +08008 * Copy: See Copyright for the status of this software.
Daniel Veillardbca22f42012-07-11 16:48:47 +08009 *
Daniel Veillard28cc42d2012-08-10 10:00:18 +080010 * Author: Daniel Veillard
Daniel Veillardbca22f42012-07-11 16:48:47 +080011 */
12
13#ifndef __XML_BUF_H__
14#define __XML_BUF_H__
15
16#include <libxml/tree.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22xmlBufPtr xmlBufCreate(void);
23xmlBufPtr xmlBufCreateSize(size_t size);
24xmlBufPtr xmlBufCreateStatic(void *mem, size_t size);
25
26int xmlBufSetAllocationScheme(xmlBufPtr buf,
27 xmlBufferAllocationScheme scheme);
28int xmlBufGetAllocationScheme(xmlBufPtr buf);
29
30void xmlBufFree(xmlBufPtr buf);
31void xmlBufEmpty(xmlBufPtr buf);
32
Daniel Veillard82cdfc42012-08-22 11:05:09 +080033/* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */
Daniel Veillardbca22f42012-07-11 16:48:47 +080034int xmlBufGrow(xmlBufPtr buf, int len);
35int xmlBufInflate(xmlBufPtr buf, size_t len);
36int xmlBufResize(xmlBufPtr buf, size_t len);
37
38int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
39int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len);
40int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
41int xmlBufCCat(xmlBufPtr buf, const char *str);
42int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string);
43int xmlBufWriteChar(xmlBufPtr buf, const char *string);
44int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
45
Daniel Veillard18e1f1f2012-08-06 10:16:41 +080046size_t xmlBufAvail(const xmlBufPtr buf);
47size_t xmlBufLength(const xmlBufPtr buf);
48/* size_t xmlBufUse(const xmlBufPtr buf); */
49int xmlBufIsEmpty(const xmlBufPtr buf);
Daniel Veillardbca22f42012-07-11 16:48:47 +080050int xmlBufAddLen(xmlBufPtr buf, size_t len);
51int xmlBufErase(xmlBufPtr buf, size_t len);
52
Daniel Veillard18e1f1f2012-08-06 10:16:41 +080053/* const xmlChar * xmlBufContent(const xmlBufPtr buf); */
54/* const xmlChar * xmlBufEnd(const xmlBufPtr buf); */
Daniel Veillardbca22f42012-07-11 16:48:47 +080055
56xmlChar * xmlBufDetach(xmlBufPtr buf);
57
58size_t xmlBufDump(FILE *file, xmlBufPtr buf);
59
60xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
61xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
62int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
63
Daniel Veillard61551a12012-07-16 16:28:47 +080064int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
Daniel Veillard00ac0d32012-07-16 18:03:01 +080065size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input);
66int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
67 size_t base, size_t cur);
Daniel Veillardbca22f42012-07-11 16:48:47 +080068#ifdef __cplusplus
69}
70#endif
71#endif /* __XML_BUF_H__ */
72