1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

parser: Implement xmlCtxtGetInputPosition

See #762.
This commit is contained in:
Nick Wellnhofer
2025-07-22 22:38:50 +02:00
parent 144ed959a5
commit 8aaa53d712
2 changed files with 84 additions and 4 deletions

View File

@@ -101,7 +101,11 @@ typedef void (* xmlParserInputDeallocate)(xmlChar *str);
struct _xmlParserInput {
/* Input buffer */
xmlParserInputBuffer *buf;
/* The file analyzed, if any */
/**
* @deprecated Use #xmlCtxtGetInputPosition
*
* The filename or URI, if any
*/
const char *filename;
/* unused */
const char *directory XML_DEPRECATED_MEMBER;
@@ -113,11 +117,23 @@ struct _xmlParserInput {
const xmlChar *end;
/* unused */
int length XML_DEPRECATED_MEMBER;
/* Current line */
/**
* @deprecated Use #xmlCtxtGetInputPosition
*
* Current line
*/
int line;
/* Current column */
/**
* @deprecated Use #xmlCtxtGetInputPosition
*
* Current column
*/
int col;
/* How many xmlChars already consumed */
/**
* @deprecated Use #xmlCtxtGetInputPosition
*
* How many xmlChars already consumed
*/
unsigned long consumed;
/* function to deallocate the base */
xmlParserInputDeallocate free XML_DEPRECATED_MEMBER;
@@ -1926,6 +1942,13 @@ XMLPUBFUN int
const xmlChar **name,
const xmlChar **systemId,
const xmlChar **publicId);
XMLPUBFUN int
xmlCtxtGetInputPosition (xmlParserCtxt *ctxt,
int inputIndex,
const char **filname,
int *line,
int *col,
unsigned long *bytePos);
XMLPUBFUN void
xmlCtxtSetErrorHandler (xmlParserCtxt *ctxt,
xmlStructuredErrorFunc handler,