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

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

?? testsax.c

?? xml開源解析代碼.版本為libxml2-2.6.29,可支持GB3212.網絡消息發送XML時很有用.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * testSAX.c : a small tester program for parsing using the SAX API. * * See Copyright for the status of this software. * * daniel@veillard.com */#include "libxml.h"#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#endif#ifdef HAVE_SYS_TIMEB_H#include <sys/timeb.h>#endif#ifdef HAVE_TIME_H#include <time.h>#endif#ifdef LIBXML_SAX1_ENABLED#include <string.h>#include <stdarg.h>#ifdef HAVE_SYS_TYPES_H#include <sys/types.h>#endif#ifdef HAVE_SYS_STAT_H#include <sys/stat.h>#endif#ifdef HAVE_FCNTL_H#include <fcntl.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#ifdef HAVE_STRING_H#include <string.h>#endif#include <libxml/globals.h>#include <libxml/xmlerror.h>#include <libxml/parser.h>#include <libxml/parserInternals.h> /* only for xmlNewInputFromFile() */#include <libxml/tree.h>#include <libxml/debugXML.h>#include <libxml/xmlmemory.h>static int debug = 0;static int copy = 0;static int recovery = 0;static int push = 0;static int speed = 0;static int noent = 0;static int quiet = 0;static int nonull = 0;static int sax2 = 0;static int repeat = 0;static int callbacks = 0;static int timing = 0;/* * Timing routines. *//* * Internal timing routines to remove the necessity to have unix-specific * function calls */#ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_SYS_TIMEB_H#ifdef HAVE_SYS_TIME_H#ifdef HAVE_FTIMEstatic intmy_gettimeofday(struct timeval *tvp, void *tzp){	struct timeb timebuffer;	ftime(&timebuffer);	if (tvp) {		tvp->tv_sec = timebuffer.time;		tvp->tv_usec = timebuffer.millitm * 1000L;	}	return (0);}#define HAVE_GETTIMEOFDAY 1#define gettimeofday my_gettimeofday#endif /* HAVE_FTIME */#endif /* HAVE_SYS_TIME_H */#endif /* HAVE_SYS_TIMEB_H */#endif /* !HAVE_GETTIMEOFDAY */#if defined(HAVE_GETTIMEOFDAY)static struct timeval begin, end;/* * startTimer: call where you want to start timing */static voidstartTimer(void){    gettimeofday(&begin, NULL);}/* * endTimer: call where you want to stop timing and to print out a *           message about the timing performed; format is a printf *           type argument */static void XMLCDECLendTimer(const char *fmt, ...){    long msec;    va_list ap;    gettimeofday(&end, NULL);    msec = end.tv_sec - begin.tv_sec;    msec *= 1000;    msec += (end.tv_usec - begin.tv_usec) / 1000;#ifndef HAVE_STDARG_H#error "endTimer required stdarg functions"#endif    va_start(ap, fmt);    vfprintf(stderr, fmt, ap);    va_end(ap);    fprintf(stderr, " took %ld ms\n", msec);}#elif defined(HAVE_TIME_H)/* * No gettimeofday function, so we have to make do with calling clock. * This is obviously less accurate, but there's little we can do about * that. */#ifndef CLOCKS_PER_SEC#define CLOCKS_PER_SEC 100#endifstatic clock_t begin, end;static voidstartTimer(void){    begin = clock();}static void XMLCDECLendTimer(const char *fmt, ...){    long msec;    va_list ap;    end = clock();    msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;#ifndef HAVE_STDARG_H#error "endTimer required stdarg functions"#endif    va_start(ap, fmt);    vfprintf(stderr, fmt, ap);    va_end(ap);    fprintf(stderr, " took %ld ms\n", msec);}#else/* * We don't have a gettimeofday or time.h, so we just don't do timing */static voidstartTimer(void){    /*     * Do nothing     */}static void XMLCDECLendTimer(char *format, ...){    /*     * We cannot do anything because we don't have a timing function     */#ifdef HAVE_STDARG_H    va_start(ap, format);    vfprintf(stderr, format, ap);    va_end(ap);    fprintf(stderr, " was not timed\n", msec);#else    /* We don't have gettimeofday, time or stdarg.h, what crazy world is     * this ?!     */#endif}#endif/* * empty SAX block */static xmlSAXHandler emptySAXHandlerStruct = {    NULL, /* internalSubset */    NULL, /* isStandalone */    NULL, /* hasInternalSubset */    NULL, /* hasExternalSubset */    NULL, /* resolveEntity */    NULL, /* getEntity */    NULL, /* entityDecl */    NULL, /* notationDecl */    NULL, /* attributeDecl */    NULL, /* elementDecl */    NULL, /* unparsedEntityDecl */    NULL, /* setDocumentLocator */    NULL, /* startDocument */    NULL, /* endDocument */    NULL, /* startElement */    NULL, /* endElement */    NULL, /* reference */    NULL, /* characters */    NULL, /* ignorableWhitespace */    NULL, /* processingInstruction */    NULL, /* comment */    NULL, /* xmlParserWarning */    NULL, /* xmlParserError */    NULL, /* xmlParserError */    NULL, /* getParameterEntity */    NULL, /* cdataBlock; */    NULL, /* externalSubset; */    1,    NULL,    NULL, /* startElementNs */    NULL, /* endElementNs */    NULL  /* xmlStructuredErrorFunc */};static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;extern xmlSAXHandlerPtr debugSAXHandler;/************************************************************************ *									* *				Debug Handlers				* *									* ************************************************************************//** * isStandaloneDebug: * @ctxt:  An XML parser context * * Is this document tagged standalone ? * * Returns 1 if true */static intisStandaloneDebug(void *ctx ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return(0);    fprintf(stdout, "SAX.isStandalone()\n");    return(0);}/** * hasInternalSubsetDebug: * @ctxt:  An XML parser context * * Does this document has an internal subset * * Returns 1 if true */static inthasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return(0);    fprintf(stdout, "SAX.hasInternalSubset()\n");    return(0);}/** * hasExternalSubsetDebug: * @ctxt:  An XML parser context * * Does this document has an external subset * * Returns 1 if true */static inthasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return(0);    fprintf(stdout, "SAX.hasExternalSubset()\n");    return(0);}/** * internalSubsetDebug: * @ctxt:  An XML parser context * * Does this document has an internal subset */static voidinternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,	       const xmlChar *ExternalID, const xmlChar *SystemID){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.internalSubset(%s,", name);    if (ExternalID == NULL)	fprintf(stdout, " ,");    else	fprintf(stdout, " %s,", ExternalID);    if (SystemID == NULL)	fprintf(stdout, " )\n");    else	fprintf(stdout, " %s)\n", SystemID);}/** * externalSubsetDebug: * @ctxt:  An XML parser context * * Does this document has an external subset */static voidexternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,	       const xmlChar *ExternalID, const xmlChar *SystemID){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.externalSubset(%s,", name);    if (ExternalID == NULL)	fprintf(stdout, " ,");    else	fprintf(stdout, " %s,", ExternalID);    if (SystemID == NULL)	fprintf(stdout, " )\n");    else	fprintf(stdout, " %s)\n", SystemID);}/** * resolveEntityDebug: * @ctxt:  An XML parser context * @publicId: The public ID of the entity * @systemId: The system ID of the entity * * Special entity resolver, better left to the parser, it has * more context than the application layer. * The default behaviour is to NOT resolve the entities, in that case * the ENTITY_REF nodes are built in the structure (and the parameter * values). * * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. */static xmlParserInputPtrresolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId){    callbacks++;    if (quiet)	return(NULL);    /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */        fprintf(stdout, "SAX.resolveEntity(");    if (publicId != NULL)	fprintf(stdout, "%s", (char *)publicId);    else	fprintf(stdout, " ");    if (systemId != NULL)	fprintf(stdout, ", %s)\n", (char *)systemId);    else	fprintf(stdout, ", )\n");/*********    if (systemId != NULL) {        return(xmlNewInputFromFile(ctxt, (char *) systemId));    } *********/    return(NULL);}/** * getEntityDebug: * @ctxt:  An XML parser context * @name: The entity name * * Get an entity by name * * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. */static xmlEntityPtrgetEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name){    callbacks++;    if (quiet)	return(NULL);    fprintf(stdout, "SAX.getEntity(%s)\n", name);    return(NULL);}/** * getParameterEntityDebug: * @ctxt:  An XML parser context * @name: The entity name * * Get a parameter entity by name * * Returns the xmlParserInputPtr */static xmlEntityPtrgetParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name){    callbacks++;    if (quiet)	return(NULL);    fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);    return(NULL);}/** * entityDeclDebug: * @ctxt:  An XML parser context * @name:  the entity name  * @type:  the entity type  * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @content: the entity value (without processing). * * An entity definition has been parsed */static voidentityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,          const xmlChar *publicId, const xmlChar *systemId, xmlChar *content){const xmlChar *nullstr = BAD_CAST "(null)";    /* not all libraries handle printing null pointers nicely */    if (publicId == NULL)        publicId = nullstr;    if (systemId == NULL)        systemId = nullstr;    if (content == NULL)        content = (xmlChar *)nullstr;    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",            name, type, publicId, systemId, content);}/** * attributeDeclDebug: * @ctxt:  An XML parser context * @name:  the attribute name  * @type:  the attribute type  * * An attribute definition has been parsed */static voidattributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,                   const xmlChar * name, int type, int def,                   const xmlChar * defaultValue, xmlEnumerationPtr tree){    callbacks++;    if (quiet)        return;    if (defaultValue == NULL)        fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",                elem, name, type, def);    else        fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",                elem, name, type, def, defaultValue);    xmlFreeEnumeration(tree);}/** * elementDeclDebug: * @ctxt:  An XML parser context * @name:  the element name  * @type:  the element type  * @content: the element value (without processing). * * An element definition has been parsed */static voidelementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,	    xmlElementContentPtr content ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",            name, type);}/** * notationDeclDebug: * @ctxt:  An XML parser context * @name: The name of the notation * @publicId: The public ID of the entity * @systemId: The system ID of the entity * * What to do when a notation declaration has been parsed. */static voidnotationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,	     const xmlChar *publicId, const xmlChar *systemId){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",            (char *) name, (char *) publicId, (char *) systemId);}/** * unparsedEntityDeclDebug: * @ctxt:  An XML parser context * @name: The name of the entity * @publicId: The public ID of the entity * @systemId: The system ID of the entity * @notationName: the name of the notation * * What to do when an unparsed entity declaration is parsed */static voidunparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,		   const xmlChar *publicId, const xmlChar *systemId,		   const xmlChar *notationName){const xmlChar *nullstr = BAD_CAST "(null)";    if (publicId == NULL)        publicId = nullstr;    if (systemId == NULL)        systemId = nullstr;    if (notationName == NULL)        notationName = nullstr;    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",            (char *) name, (char *) publicId, (char *) systemId,	    (char *) notationName);}/** * setDocumentLocatorDebug: * @ctxt:  An XML parser context * @loc: A SAX Locator * * Receive the document locator at startup, actually xmlDefaultSAXLocator * Everything is available on the context, so this is useless in our case. */static voidsetDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.setDocumentLocator()\n");}/** * startDocumentDebug: * @ctxt:  An XML parser context * * called when the document start being processed. */static voidstartDocumentDebug(void *ctx ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.startDocument()\n");}/** * endDocumentDebug: * @ctxt:  An XML parser context * * called when the document end has been detected. */static voidendDocumentDebug(void *ctx ATTRIBUTE_UNUSED){    callbacks++;    if (quiet)	return;    fprintf(stdout, "SAX.endDocument()\n");}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青青爽久久午夜综合久久午夜| 日韩免费高清电影| 亚洲欧美中日韩| heyzo一本久久综合| 亚洲欧洲日韩在线| 91麻豆文化传媒在线观看| 亚洲色图.com| 欧美三级电影一区| 蜜乳av一区二区三区| 欧美成人艳星乳罩| 国产成人福利片| 亚洲精品成人少妇| 欧美日韩美女一区二区| 美腿丝袜亚洲综合| 日本一区二区免费在线| 一本色道久久综合亚洲91| 一区二区三区中文免费| 欧美一区二区三区视频免费| 国内精品视频一区二区三区八戒| 中文字幕av资源一区| 色噜噜狠狠色综合中国| 男男视频亚洲欧美| 国产女人水真多18毛片18精品视频| 91日韩在线专区| 免费在线看成人av| 中文字幕制服丝袜一区二区三区| 欧美专区亚洲专区| 国产一区二区91| 一区二区三区欧美久久| 日韩欧美一区中文| 91在线播放网址| 裸体歌舞表演一区二区| 国产精品色婷婷久久58| 91精品国产综合久久久久久漫画 | 91久久香蕉国产日韩欧美9色| 亚洲午夜羞羞片| 国产欧美日韩视频一区二区| 欧美日韩精品免费| 成人免费三级在线| 免费视频一区二区| 亚洲精品乱码久久久久久| 久久久久久麻豆| 欧美高清视频一二三区| 99re这里只有精品首页| 经典三级视频一区| 亚洲国产精品一区二区久久恐怖片 | 丁香天五香天堂综合| 亚洲成a人v欧美综合天堂下载 | 91精品国产综合久久福利软件| 成人午夜碰碰视频| 久久99国产乱子伦精品免费| 亚洲精品你懂的| 国产精品美女久久福利网站| 日韩免费高清av| 51午夜精品国产| 欧美性大战久久久久久久蜜臀 | 欧美精品一区男女天堂| 欧美区一区二区三区| 91色九色蝌蚪| av激情综合网| 成人免费毛片嘿嘿连载视频| 经典三级视频一区| 日韩激情一区二区| 亚洲大型综合色站| 亚洲资源在线观看| 一区二区三区成人在线视频| 中文字幕日本乱码精品影院| 久久久国际精品| 久久久国际精品| 久久精品欧美一区二区三区不卡| 欧美电视剧免费全集观看| 777亚洲妇女| 欧美一区二区三区免费观看视频 | 久久狠狠亚洲综合| 亚洲va国产va欧美va观看| 亚洲综合色丁香婷婷六月图片| 99re热这里只有精品免费视频| 国产麻豆精品视频| 久久99国产精品久久99果冻传媒| 欧美aaaaaa午夜精品| 麻豆精品国产91久久久久久| 日本不卡一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩二区三区四区| 麻豆精品视频在线观看| 精品一区二区久久久| 精品一区二区久久| 国产91精品露脸国语对白| 高清不卡在线观看| 97久久精品人人爽人人爽蜜臀| 91亚洲午夜精品久久久久久| 欧美最新大片在线看| 欧美区视频在线观看| 欧美一区三区二区| 久久久综合九色合综国产精品| 久久久三级国产网站| 国产精品国产三级国产普通话99| 亚洲欧美在线高清| 亚洲成av人影院| 久久精工是国产品牌吗| 国产成人免费网站| 色视频成人在线观看免| 欧美日韩卡一卡二| 久久久国产精品午夜一区ai换脸| 国产精品久久午夜夜伦鲁鲁| 一区2区3区在线看| 麻豆成人综合网| 成人av资源站| 在线91免费看| 2017欧美狠狠色| 亚洲精品欧美综合四区| 蜜桃久久久久久| 91网站在线播放| 日韩一区二区在线观看视频 | 91麻豆免费在线观看| 欧美日韩在线精品一区二区三区激情 | 蜜桃一区二区三区在线观看| 国产精品69毛片高清亚洲| 日本精品一级二级| 欧美不卡一区二区| 亚洲欧美成aⅴ人在线观看| 男人的j进女人的j一区| 99vv1com这只有精品| 精品日韩成人av| 一区二区三区美女视频| 激情小说欧美图片| 欧美无砖专区一中文字| 久久精品一区二区三区不卡| 亚洲一线二线三线久久久| 国产一区二区三区四区五区美女| 91豆麻精品91久久久久久| 久久精品一区二区三区不卡 | 亚洲人吸女人奶水| 裸体在线国模精品偷拍| 91九色02白丝porn| 中文字幕第一区综合| 免费在线观看视频一区| 欧美亚洲综合色| 国产精品久久久久永久免费观看| 天堂蜜桃91精品| 色综合天天性综合| 欧美国产视频在线| 久久99久久精品欧美| 欧美日韩你懂的| 亚洲人成小说网站色在线 | 日韩精品最新网址| 亚洲亚洲精品在线观看| 99re在线视频这里只有精品| 久久精品亚洲麻豆av一区二区 | 欧美日韩免费在线视频| 亚洲欧美综合网| 成人激情校园春色| 欧美极品xxx| 国产乱色国产精品免费视频| 精品国产精品网麻豆系列| 亚洲aⅴ怡春院| 欧美亚一区二区| 亚洲日本中文字幕区| 成人激情黄色小说| 欧美高清在线视频| 国产精品自在欧美一区| 久久午夜色播影院免费高清| 蜜臀精品一区二区三区在线观看| 欧美日韩国产系列| 亚洲国产日韩在线一区模特 | 日韩av午夜在线观看| 欧美三级中文字| 香蕉久久夜色精品国产使用方法| 在线亚洲人成电影网站色www| 亚洲色图欧洲色图婷婷| 97se亚洲国产综合自在线| 国产精品丝袜久久久久久app| 国产传媒日韩欧美成人| 国产亲近乱来精品视频| 成人久久18免费网站麻豆 | 亚洲一区在线观看免费| 91极品视觉盛宴| 亚洲一本大道在线| 91麻豆精品国产91| 日韩在线卡一卡二| 日韩三级在线观看| 久久精品久久99精品久久| 久久久久青草大香线综合精品| 激情小说欧美图片| 国产视频一区在线播放| av资源网一区| 亚洲国产日韩综合久久精品| 7777精品伊人久久久大香线蕉经典版下载 | 成人免费看黄yyy456| 国产精品视频一二| 色狠狠桃花综合| 奇米在线7777在线精品| 精品动漫一区二区三区在线观看| 国产盗摄一区二区| 亚洲一区二区在线视频| 日韩一级片网站| 成人精品鲁一区一区二区| 亚洲国产精品一区二区尤物区| 日韩美女视频一区二区在线观看| 国产999精品久久久久久绿帽|