/***************************************************************************** * Reader functions *****************************************************************************/ static void ReaderErrorHandler( void *p_arg, const char *p_msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { VLC_UNUSED(severity); xml_reader_t *p_reader = (xml_reader_t *)p_arg; int line = xmlTextReaderLocatorLineNumber( locator ); msg_Err( p_reader->p_xml, "XML parser error (line %d) : %s", line, p_msg ); }
void XMLParser::handleError( void *pArg, const char *pMsg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { XMLParser *pThis = (XMLParser*)pArg; int line = xmlTextReaderLocatorLineNumber( locator ); msg_Err( pThis->getIntf(), "XML parser error (line %d) : %s", line, pMsg ); pThis->m_errors = true; }
static void gstyle_palette_error_cb (void *arg, const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { g_warning ("Parse error at line %i:\n%s\n", xmlTextReaderLocatorLineNumber (locator), msg); }
static void raptor_rss_error_handler(void *arg, const char *message, xmlParserSeverities severity, xmlTextReaderLocatorPtr xml_locator) { raptor_parser* rdf_parser=(raptor_parser*)arg; raptor_locator *locator=&rdf_parser->locator; locator->line= -1; locator->column= -1; if(arg) locator->line= xmlTextReaderLocatorLineNumber(xml_locator); raptor_parser_error(rdf_parser, message); }
static void error_handler(void *arg, const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { if (severity == XML_PARSER_SEVERITY_ERROR) { tmx_err(E_XDATA, "xml parser: error at line %d: %s", xmlTextReaderLocatorLineNumber(locator), msg); } }
//----------------------------------------- void RngValidator::readerErr(void* arg, const char* const msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) //----------------------------------------- { const int line = xmlTextReaderLocatorLineNumber(locator); cerr << "WARN " << "Some kinda error! " << msg << ", severity: " << severity << ", line: " << line << endl; }
static void* tmx_malloc(size_t len) { return tmx_alloc_func(NULL, len); } /* - Parsers - Each function is called when the XML reader is on an element with the same name. Each function return 1 on succes and 0 on failure. This parser is strict, the entry file MUST respect the file format. On failure tmx_errno is set and and an error message is generated. */ static void error_handler(void *arg UNUSED, const char *msg, xmlParserSeverities severity, xmlTextReaderLocatorPtr locator) { if (severity == XML_PARSER_SEVERITY_ERROR) { tmx_err(E_XDATA, "xml parser: error at line %d: %s", xmlTextReaderLocatorLineNumber(locator), msg); } } static xmlTextReaderPtr create_parser(const char *filename) { xmlTextReaderPtr reader = NULL; if ((reader = xmlReaderForFile(filename, NULL, 0))) { xmlTextReaderSetErrorHandler(reader, error_handler, NULL); if (xmlTextReaderRead(reader) != 1) { xmlFreeTextReader(reader); reader = NULL; } } else { tmx_err(E_UNKN, "xml parser: unable to open %s", filename);