make it possible to retrieve buffer position after parsing XML

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-03-23 13:03:52 +01:00
parent f65d07fb14
commit 15a3d7d3ad
2 changed files with 6 additions and 0 deletions

View file

@ -39,6 +39,7 @@ extern "C" {
DDS_EXPORT struct ut_xmlpState *ut_xmlpNewFile (FILE *fp, void *varg, const struct ut_xmlpCallbacks *cb);
DDS_EXPORT struct ut_xmlpState *ut_xmlpNewString (const char *string, void *varg, const struct ut_xmlpCallbacks *cb);
DDS_EXPORT void ut_xmlpSetRequireEOF (struct ut_xmlpState *st, int require_eof);
DDS_EXPORT size_t ut_xmlpGetBufpos (const struct ut_xmlpState *st);
DDS_EXPORT void ut_xmlpFree (struct ut_xmlpState *st);
DDS_EXPORT int ut_xmlpParse (struct ut_xmlpState *st);

View file

@ -153,6 +153,11 @@ void ut_xmlpSetRequireEOF (struct ut_xmlpState *st, int require_eof)
st->require_eof = require_eof;
}
size_t ut_xmlpGetBufpos (const struct ut_xmlpState *st)
{
return st->cbufp;
}
void ut_xmlpFree (struct ut_xmlpState *st)
{
if (st->fp != NULL) {