亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? error.c

?? xml開源解析代碼.版本為libxml2-2.6.29,可支持GB3212.網絡消息發送XML時很有用.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * error.c: module displaying/handling XML parser errors * * See Copyright for the status of this software. * * Daniel Veillard <daniel@veillard.com> */#define IN_LIBXML#include "libxml.h"#include <string.h>#include <stdarg.h>#include <libxml/parser.h>#include <libxml/xmlerror.h>#include <libxml/xmlmemory.h>#include <libxml/globals.h>void XMLCDECL xmlGenericErrorDefaultFunc	(void *ctx ATTRIBUTE_UNUSED,				 const char *msg,				 ...);#define XML_GET_VAR_STR(msg, str) {				\    int       size, prev_size = -1;				\    int       chars;						\    char      *larger;						\    va_list   ap;						\								\    str = (char *) xmlMalloc(150);				\    if (str != NULL) {						\								\    size = 150;							\								\    while (1) {							\	va_start(ap, msg);					\  	chars = vsnprintf(str, size, msg, ap);			\	va_end(ap);						\	if ((chars > -1) && (chars < size)) {			\	    if (prev_size == chars) {				\		break;						\	    } else {						\		prev_size = chars;				\	    }							\	}							\	if (chars > -1)						\	    size += chars + 1;					\	else							\	    size += 100;					\	if ((larger = (char *) xmlRealloc(str, size)) == NULL) {\	    break;						\	}							\	str = larger;						\    }}								\}/************************************************************************ * 									* * 			Handling of out of context errors		* * 									* ************************************************************************//** * xmlGenericErrorDefaultFunc: * @ctx:  an error context * @msg:  the message to display/transmit * @...:  extra parameters for the message display *  * Default handler for out of context error messages. */void XMLCDECLxmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {    va_list args;    if (xmlGenericErrorContext == NULL)	xmlGenericErrorContext = (void *) stderr;    va_start(args, msg);    vfprintf((FILE *)xmlGenericErrorContext, msg, args);    va_end(args);}/** * initGenericErrorDefaultFunc: * @handler:  the handler *  * Set or reset (if NULL) the default handler for generic errors * to the builtin error function. */voidinitGenericErrorDefaultFunc(xmlGenericErrorFunc * handler){    if (handler == NULL)        xmlGenericError = xmlGenericErrorDefaultFunc;    else        xmlGenericError = (*handler);}/** * xmlSetGenericErrorFunc: * @ctx:  the new error handling context * @handler:  the new handler function * * Function to reset the handler and the error context for out of * context error messages. * This simply means that @handler will be called for subsequent * error messages while not parsing nor validating. And @ctx will * be passed as first argument to @handler * One can simply force messages to be emitted to another FILE * than * stderr by setting @ctx to this file handle and @handler to NULL. * For multi-threaded applications, this must be set separately for each thread. */voidxmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {    xmlGenericErrorContext = ctx;    if (handler != NULL)	xmlGenericError = handler;    else	xmlGenericError = xmlGenericErrorDefaultFunc;}/** * xmlSetStructuredErrorFunc: * @ctx:  the new error handling context * @handler:  the new handler function * * Function to reset the handler and the error context for out of * context structured error messages. * This simply means that @handler will be called for subsequent * error messages while not parsing nor validating. And @ctx will * be passed as first argument to @handler * For multi-threaded applications, this must be set separately for each thread. */voidxmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {    xmlGenericErrorContext = ctx;    xmlStructuredError = handler;}/************************************************************************ * 									* * 			Handling of parsing errors			* * 									* ************************************************************************//** * xmlParserPrintFileInfo: * @input:  an xmlParserInputPtr input *  * Displays the associated file and line informations for the current input */voidxmlParserPrintFileInfo(xmlParserInputPtr input) {    if (input != NULL) {	if (input->filename)	    xmlGenericError(xmlGenericErrorContext,		    "%s:%d: ", input->filename,		    input->line);	else	    xmlGenericError(xmlGenericErrorContext,		    "Entity: line %d: ", input->line);    }}/** * xmlParserPrintFileContext: * @input:  an xmlParserInputPtr input *  * Displays current context within the input content for error tracking */static voidxmlParserPrintFileContextInternal(xmlParserInputPtr input , 		xmlGenericErrorFunc channel, void *data ) {    const xmlChar *cur, *base;    unsigned int n, col;	/* GCC warns if signed, because compared with sizeof() */    xmlChar  content[81]; /* space for 80 chars + line terminator */    xmlChar *ctnt;    if (input == NULL) return;    cur = input->cur;    base = input->base;    /* skip backwards over any end-of-lines */    while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) {	cur--;    }    n = 0;    /* search backwards for beginning-of-line (to max buff size) */    while ((n++ < (sizeof(content)-1)) && (cur > base) &&     	   (*(cur) != '\n') && (*(cur) != '\r'))        cur--;    if ((*(cur) == '\n') || (*(cur) == '\r')) cur++;    /* calculate the error position in terms of the current position */    col = input->cur - cur;    /* search forward for end-of-line (to max buff size) */    n = 0;    ctnt = content;    /* copy selected text to our buffer */    while ((*cur != 0) && (*(cur) != '\n') &&     	   (*(cur) != '\r') && (n < sizeof(content)-1)) {		*ctnt++ = *cur++;	n++;    }    *ctnt = 0;    /* print out the selected text */    channel(data ,"%s\n", content);    /* create blank line with problem pointer */    n = 0;    ctnt = content;    /* (leave buffer space for pointer + line terminator) */    while ((n<col) && (n++ < sizeof(content)-2) && (*ctnt != 0)) {	if (*(ctnt) != '\t')	    *(ctnt) = ' ';	ctnt++;    }    *ctnt++ = '^';    *ctnt = 0;    channel(data ,"%s\n", content);}/** * xmlParserPrintFileContext: * @input:  an xmlParserInputPtr input *  * Displays current context within the input content for error tracking */voidxmlParserPrintFileContext(xmlParserInputPtr input) {   xmlParserPrintFileContextInternal(input, xmlGenericError,                                     xmlGenericErrorContext);}/** * xmlReportError: * @err: the error * @ctx: the parser context or NULL * @str: the formatted error message * * Report an erro with its context, replace the 4 old error/warning * routines. */static voidxmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str,               xmlGenericErrorFunc channel, void *data){    char *file = NULL;    int line = 0;    int code = -1;    int domain;    const xmlChar *name = NULL;    xmlNodePtr node;    xmlErrorLevel level;    xmlParserInputPtr input = NULL;    xmlParserInputPtr cur = NULL;    if (err == NULL)        return;    if (channel == NULL) {	channel = xmlGenericError;	data = xmlGenericErrorContext;    }    file = err->file;    line = err->line;    code = err->code;    domain = err->domain;    level = err->level;    node = err->node;    if (code == XML_ERR_OK)        return;    if ((node != NULL) && (node->type == XML_ELEMENT_NODE))        name = node->name;    /*     * Maintain the compatibility with the legacy error handling     */    if (ctxt != NULL) {        input = ctxt->input;        if ((input != NULL) && (input->filename == NULL) &&            (ctxt->inputNr > 1)) {            cur = input;            input = ctxt->inputTab[ctxt->inputNr - 2];        }        if (input != NULL) {            if (input->filename)                channel(data, "%s:%d: ", input->filename, input->line);            else if ((line != 0) && (domain == XML_FROM_PARSER))                channel(data, "Entity: line %d: ", input->line);        }    } else {        if (file != NULL)            channel(data, "%s:%d: ", file, line);        else if ((line != 0) && (domain == XML_FROM_PARSER))            channel(data, "Entity: line %d: ", line);    }    if (name != NULL) {        channel(data, "element %s: ", name);    }    switch (domain) {        case XML_FROM_PARSER:            channel(data, "parser ");            break;        case XML_FROM_NAMESPACE:            channel(data, "namespace ");            break;        case XML_FROM_DTD:        case XML_FROM_VALID:            channel(data, "validity ");            break;        case XML_FROM_HTML:            channel(data, "HTML parser ");            break;        case XML_FROM_MEMORY:            channel(data, "memory ");            break;        case XML_FROM_OUTPUT:            channel(data, "output ");            break;        case XML_FROM_IO:            channel(data, "I/O ");            break;        case XML_FROM_XINCLUDE:            channel(data, "XInclude ");            break;        case XML_FROM_XPATH:            channel(data, "XPath ");            break;        case XML_FROM_XPOINTER:            channel(data, "parser ");            break;        case XML_FROM_REGEXP:            channel(data, "regexp ");            break;        case XML_FROM_MODULE:            channel(data, "module ");            break;        case XML_FROM_SCHEMASV:            channel(data, "Schemas validity ");            break;        case XML_FROM_SCHEMASP:            channel(data, "Schemas parser ");            break;        case XML_FROM_RELAXNGP:            channel(data, "Relax-NG parser ");            break;        case XML_FROM_RELAXNGV:            channel(data, "Relax-NG validity ");            break;        case XML_FROM_CATALOG:            channel(data, "Catalog ");            break;        case XML_FROM_C14N:            channel(data, "C14N ");            break;        case XML_FROM_XSLT:            channel(data, "XSLT ");            break;        case XML_FROM_I18N:            channel(data, "encoding ");            break;        default:            break;    }    switch (level) {        case XML_ERR_NONE:            channel(data, ": ");            break;        case XML_ERR_WARNING:            channel(data, "warning : ");            break;        case XML_ERR_ERROR:            channel(data, "error : ");            break;        case XML_ERR_FATAL:            channel(data, "error : ");            break;    }    if (str != NULL) {        int len;	len = xmlStrlen((const xmlChar *)str);	if ((len > 0) && (str[len - 1] != '\n'))	    channel(data, "%s\n", str);	else	    channel(data, "%s", str);    } else {        channel(data, "%s\n", "out of memory error");    }    if (ctxt != NULL) {        xmlParserPrintFileContextInternal(input, channel, data);        if (cur != NULL) {            if (cur->filename)                channel(data, "%s:%d: \n", cur->filename, cur->line);            else if ((line != 0) && (domain == XML_FROM_PARSER))                channel(data, "Entity: line %d: \n", cur->line);            xmlParserPrintFileContextInternal(cur, channel, data);        }    }    if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) &&        (err->int1 < 100) &&	(err->int1 < xmlStrlen((const xmlChar *)err->str1))) {	xmlChar buf[150];	int i;	channel(data, "%s\n", err->str1);	for (i=0;i < err->int1;i++)	     buf[i] = ' ';	buf[i++] = '^';	buf[i] = 0;	channel(data, "%s\n", buf);    }}/** * __xmlRaiseError: * @schannel: the structured callback channel * @channel: the old callback channel * @data: the callback data * @ctx: the parser context or NULL * @ctx: the parser context or NULL * @domain: the domain for the error * @code: the code for the error * @level: the xmlErrorLevel for the error * @file: the file source of the error (or NULL) * @line: the line of the error or 0 if N/A * @str1: extra string info * @str2: extra string info * @str3: extra string info * @int1: extra int info * @col: column number of the error or 0 if N/A  * @msg:  the message to display/transmit * @...:  extra parameters for the message display * * Update the appropriate global or contextual error structure, * then forward the error message down the parser or generic * error callback handler */void XMLCDECL__xmlRaiseError(xmlStructuredErrorFunc schannel,              xmlGenericErrorFunc channel, void *data, void *ctx,              void *nod, int domain, int code, xmlErrorLevel level,              const char *file, int line, const char *str1,              const char *str2, const char *str3, int int1, int col,	      const char *msg, ...){    xmlParserCtxtPtr ctxt = NULL;    xmlNodePtr node = (xmlNodePtr) nod;    char *str = NULL;    xmlParserInputPtr input = NULL;    xmlErrorPtr to = &xmlLastError;    xmlNodePtr baseptr = NULL;    if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))        return;    if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {	ctxt = (xmlParserCtxtPtr) ctx;	if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&	    (ctxt->sax->initialized == XML_SAX2_MAGIC))	    schannel = ctxt->sax->serror;    }    /*     * Check if structured error handler set     */    if (schannel == NULL) {	schannel = xmlStructuredError;	/*	 * if user has defined handler, change data ptr to user's choice	 */	if (schannel != NULL)	    data = xmlGenericErrorContext;    }    if ((domain == XML_FROM_VALID) &&        ((channel == xmlParserValidityError) ||	 (channel == xmlParserValidityWarning))) {	ctxt = (xmlParserCtxtPtr) ctx;	if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&	    (ctxt->sax->initialized == XML_SAX2_MAGIC))	    schannel = ctxt->sax->serror;    }    if (code == XML_ERR_OK)        return;    /*     * Formatting the message     */    if (msg == NULL) {        str = (char *) xmlStrdup(BAD_CAST "No error message provided");    } else {        XML_GET_VAR_STR(msg, str);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲尤物久久| 91在线你懂得| 欧美三级电影网站| 欧美成人a视频| 国产精品美女久久久久aⅴ国产馆| 国产欧美精品一区二区色综合朱莉| 中文字幕av一区二区三区高| 亚洲精品视频在线观看网站| 粉嫩欧美一区二区三区高清影视| 91电影在线观看| 久久影院午夜论| 亚洲精品一二三| 国产尤物一区二区| 在线观看一区二区视频| 国产精品久久久久久亚洲伦| 午夜精品久久久久久久久久| 激情图片小说一区| 欧美日韩国产123区| 久久一区二区三区国产精品| 久久在线观看免费| 久久99精品一区二区三区| 国产大陆精品国产| 亚洲精品在线免费观看视频| 亚洲午夜免费电影| 国产乱淫av一区二区三区| 91在线国产观看| 久久影音资源网| 国产自产2019最新不卡| 99国产精品久久久久久久久久| 欧美日韩在线播放三区四区| 国产亚洲午夜高清国产拍精品| 亚洲一区二区三区四区在线 | 成人一区在线看| 日韩欧美中文字幕公布| 国产精品美女久久福利网站| 一区二区三区四区不卡视频| 成人在线综合网站| 日韩美女一区二区三区| 日韩成人av影视| 欧美一区二区三区免费在线看| 亚洲一级片在线观看| 在线国产亚洲欧美| 中文字幕一区av| 亚洲国产综合视频在线观看| 99re亚洲国产精品| 国产精品免费视频一区| 国产一区二区三区电影在线观看| 欧美性受xxxx黑人xyx| 亚洲日本在线a| 95精品视频在线| 亚洲精品一区二区三区99| 日韩中文字幕亚洲一区二区va在线| 成人h版在线观看| 亚洲欧美一区二区三区国产精品| 久久99久国产精品黄毛片色诱| 欧美在线看片a免费观看| 最新国产精品久久精品| 99视频热这里只有精品免费| 国产日韩一级二级三级| 精品影院一区二区久久久| 欧美va亚洲va在线观看蝴蝶网| 日韩精品亚洲专区| 91精品国产高清一区二区三区蜜臀 | 欧美国产精品一区| 天天综合天天综合色| 欧美亚洲国产bt| 中文字幕日韩av资源站| 色综合久久久久综合| 亚洲情趣在线观看| av一二三不卡影片| 玉米视频成人免费看| 日本精品视频一区二区| 自拍偷拍亚洲激情| 91成人免费网站| 亚洲美女电影在线| 欧美专区亚洲专区| 国产精品一级在线| 国产精品麻豆视频| 欧美日韩一区二区三区在线看 | 粉嫩欧美一区二区三区高清影视| 精品盗摄一区二区三区| 韩国精品主播一区二区在线观看| 欧美在线综合视频| 韩国精品久久久| 国产欧美日韩精品在线| 久久91精品久久久久久秒播| 久久久久久久久久久黄色| 91黄色免费看| 国产伦精品一区二区三区免费迷| 日韩视频一区二区在线观看| 亚洲一区二区三区精品在线| 精品日韩欧美一区二区| 成人app网站| 一区二区成人在线视频| 在线视频你懂得一区二区三区| 亚洲大片在线观看| 亚洲国产精品精华液ab| aaa欧美日韩| 韩国在线一区二区| 精品国产一区久久| 韩国女主播一区二区三区| 久久国产夜色精品鲁鲁99| 国产亚洲欧美在线| 成人福利电影精品一区二区在线观看| 日韩午夜激情视频| 国产一区二区精品久久| 蜜桃视频在线一区| 亚洲男人天堂一区| 日韩一区二区电影| 精品视频色一区| 丁香另类激情小说| 激情综合网天天干| 亚洲综合男人的天堂| 69堂国产成人免费视频| 美女mm1313爽爽久久久蜜臀| 久久久久久久久久看片| 国产在线播精品第三| 亚洲在线视频免费观看| 日韩一区二区精品葵司在线| 成人激情综合网站| 日本sm残虐另类| 亚洲精品福利视频网站| 欧美一个色资源| 欧美日韩国产精品自在自线| 福利一区福利二区| 一区二区三区中文字幕电影 | 三级一区在线视频先锋| 中文字幕一区二区在线观看 | 日本一不卡视频| 国产精品久久久久天堂| 欧美伦理视频网站| 国产成人av在线影院| 一级日本不卡的影视| 欧美国产一区二区| 在线视频一区二区三| av爱爱亚洲一区| 韩国欧美一区二区| 亚洲国产精品久久人人爱| 欧美成人三级电影在线| 99精品视频在线免费观看| 经典三级一区二区| 亚洲欧美日韩一区二区| 国产精品私人自拍| 欧美一区二区在线免费观看| 国产在线精品一区二区三区不卡| 日韩成人av影视| 亚洲地区一二三色| 亚洲伦理在线精品| 国产精品久久精品日日| 中文字幕国产精品一区二区| 欧美妇女性影城| 欧美性大战久久久久久久| 91在线一区二区| 国产一区二区福利| 久久精品国产在热久久| 看片的网站亚洲| 精品一区二区三区在线播放| 夜夜嗨av一区二区三区| 久久久国产精品麻豆| 一区在线观看免费| 一本大道久久a久久综合| 国产精品进线69影院| 亚洲一区二区三区小说| 国产精品成人免费| 国产精品萝li| 久久99久久精品| 99久久免费国产| 欧美一区二区三区人| 久久久91精品国产一区二区精品| 精品99久久久久久| 久久伊人蜜桃av一区二区| 国产亚洲欧洲一区高清在线观看| 亚洲最大色网站| 麻豆精品一区二区av白丝在线| 国产精品麻豆一区二区| 日韩精品在线网站| 欧美高清视频一二三区 | 亚洲色图欧美激情| 久久精品亚洲精品国产欧美| 日韩欧美国产不卡| 亚洲一区av在线| 精品一区二区三区不卡 | 久久99精品国产.久久久久| 国产精品久久久久影院| 欧美激情一区二区三区不卡| 欧美福利电影网| 日韩av电影天堂| 色菇凉天天综合网| 亚洲欧洲日本在线| 久久国产精品99精品国产| 日本不卡不码高清免费观看| 强制捆绑调教一区二区| 亚洲自拍偷拍综合| 国产成人免费视频| 欧美一区二区三区性视频| 国产女主播一区| 色婷婷激情一区二区三区| 国产网站一区二区三区| 亚洲三级免费观看| 懂色av中文一区二区三区|