mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
This was scattered in a number of modules, xmlParserInputPtr have usually their base, cur and end pointer set from an xmlBuf used as input. * buf.c buf.h: add a new function implementing this setup * parser.c HTMLparser.c catalog.c parserInternals.c xmlreader.c use the new function instead of digging into the buffer in all those modules
66 lines
1.8 KiB
C
66 lines
1.8 KiB
C
/*
|
|
* buf.h: Internal Interfaces for memory buffers in libxml2
|
|
*
|
|
* See Copyright for the status of this software.
|
|
*
|
|
* daniel@veillard.com
|
|
*/
|
|
|
|
#ifndef __XML_BUF_H__
|
|
#define __XML_BUF_H__
|
|
|
|
#include <libxml/tree.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
xmlBufPtr xmlBufCreate(void);
|
|
xmlBufPtr xmlBufCreateSize(size_t size);
|
|
xmlBufPtr xmlBufCreateStatic(void *mem, size_t size);
|
|
|
|
int xmlBufSetAllocationScheme(xmlBufPtr buf,
|
|
xmlBufferAllocationScheme scheme);
|
|
int xmlBufGetAllocationScheme(xmlBufPtr buf);
|
|
|
|
void xmlBufFree(xmlBufPtr buf);
|
|
void xmlBufEmpty(xmlBufPtr buf);
|
|
|
|
size_t xmlBufShrink(xmlBufPtr buf, size_t len);
|
|
int xmlBufGrow(xmlBufPtr buf, int len);
|
|
int xmlBufInflate(xmlBufPtr buf, size_t len);
|
|
int xmlBufResize(xmlBufPtr buf, size_t len);
|
|
|
|
int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
|
|
int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len);
|
|
int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
|
|
int xmlBufCCat(xmlBufPtr buf, const char *str);
|
|
int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string);
|
|
int xmlBufWriteChar(xmlBufPtr buf, const char *string);
|
|
int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
|
|
|
|
size_t xmlBufAvail(xmlBufPtr buf);
|
|
size_t xmlBufLength(xmlBufPtr buf);
|
|
size_t xmlBufUse(xmlBufPtr buf);
|
|
int xmlBufIsEmpty(xmlBufPtr buf);
|
|
int xmlBufAddLen(xmlBufPtr buf, size_t len);
|
|
int xmlBufErase(xmlBufPtr buf, size_t len);
|
|
|
|
xmlChar * xmlBufContent(const xmlBufPtr buf);
|
|
xmlChar * xmlBufEnd(const xmlBufPtr buf);
|
|
|
|
xmlChar * xmlBufDetach(xmlBufPtr buf);
|
|
|
|
size_t xmlBufDump(FILE *file, xmlBufPtr buf);
|
|
|
|
xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
|
|
xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
|
|
int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
|
|
|
|
int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* __XML_BUF_H__ */
|
|
|