MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlTextReaderLocatorLineNumber

Function xmlTextReaderLocatorLineNumber

ThirdParty/libxml2/vtklibxml2/xmlreader.c:4629–4655  ·  view source on GitHub ↗

* xmlTextReaderLocatorLineNumber: * @locator: the xmlTextReaderLocatorPtr used * * Obtain the line number for the given locator. * * Returns the line number or -1 in case of error. */

Source from the content-addressed store, hash-verified

4627 * Returns the line number or -1 in case of error.
4628 */
4629int
4630xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator) {
4631 /* we know that locator is a xmlParserCtxtPtr */
4632 xmlParserCtxtPtr ctx = (xmlParserCtxtPtr)locator;
4633 int ret = -1;
4634
4635 if (locator == NULL)
4636 return(-1);
4637 if (ctx->node != NULL) {
4638 ret = xmlGetLineNo(ctx->node);
4639 }
4640 else {
4641 /* inspired from error.c */
4642 xmlParserInputPtr input;
4643 input = ctx->input;
4644 if ((input->filename == NULL) && (ctx->inputNr > 1))
4645 input = ctx->inputTab[ctx->inputNr - 2];
4646 if (input != NULL) {
4647 ret = input->line;
4648 }
4649 else {
4650 ret = -1;
4651 }
4652 }
4653
4654 return ret;
4655}
4656
4657/**
4658 * xmlTextReaderLocatorBaseURI:

Callers

nothing calls this directly

Calls 1

xmlGetLineNoFunction · 0.85

Tested by

no test coverage detected