亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
蜜桃av噜噜一区二区三区小说| 91久久精品一区二区| 欧美三级一区二区| 石原莉奈在线亚洲二区| 在线观看一区不卡| 亚洲国产精品久久不卡毛片 | 日韩精品视频网| 欧美一级片在线| 精品一区二区影视| 一区二区中文字幕在线| 国产精品1024久久| 日韩毛片一二三区| 欧美精品1区2区| 国产老女人精品毛片久久| 中文子幕无线码一区tr| 精品婷婷伊人一区三区三| 秋霞成人午夜伦在线观看| 久久精品一区二区三区不卡牛牛 | 国产成人av资源| 国产精品私人影院| 欧美无砖砖区免费| 国产精品亚洲成人| 亚洲韩国一区二区三区| 国产欧美一区二区三区网站| 国产精品国产三级国产有无不卡| 国产一区二区在线观看免费| 亚洲成人免费电影| 亚洲午夜在线视频| 日韩视频免费观看高清完整版| 久久99精品一区二区三区| 日本一区二区三区久久久久久久久不 | 亚洲成人自拍一区| 精品粉嫩超白一线天av| 菠萝蜜视频在线观看一区| 色婷婷综合久久久中文一区二区 | 日韩女优毛片在线| 在线视频欧美精品| k8久久久一区二区三区| 免播放器亚洲一区| 亚洲香蕉伊在人在线观| 国产精品久久久久久久午夜片| 精品裸体舞一区二区三区| 色偷偷88欧美精品久久久| www.亚洲免费av| aaa亚洲精品| 成人精品高清在线| 蜜臀av性久久久久蜜臀aⅴ四虎| 精品盗摄一区二区三区| 国产婷婷色一区二区三区在线| 一区二区在线观看av| 蜜桃av一区二区| 成人黄色一级视频| 色婷婷av一区二区三区大白胸| 91麻豆蜜桃一区二区三区| 色综合久久久久综合| 欧美成人aa大片| 久久久激情视频| 国产精品人成在线观看免费| 国产精品福利一区二区| 一区二区三区精品在线观看| 日韩主播视频在线| 国产高清不卡二三区| 欧美性感一类影片在线播放| 色88888久久久久久影院野外| 91蜜桃免费观看视频| 欧美人xxxx| 久久久综合激的五月天| 亚洲免费观看高清完整版在线 | 久久99国产精品免费| 豆国产96在线|亚洲| 欧美亚洲免费在线一区| 欧美欧美欧美欧美| 国产精品天天看| 婷婷夜色潮精品综合在线| 成人美女视频在线观看| 日韩一区二区三免费高清| 亚洲欧美区自拍先锋| 国产一区二三区好的| 91精品国产福利在线观看| 亚洲视频在线一区观看| 亚洲成年人影院| 日本精品一区二区三区四区的功能| 日韩亚洲欧美高清| 中文字幕精品在线不卡| 喷白浆一区二区| 在线观看视频91| 精品电影一区二区三区| 亚洲精品视频一区| 在线亚洲高清视频| 中文字幕在线不卡| 国产成人午夜精品5599 | 成人免费av网站| 精品国产乱码久久久久久浪潮 | 韩国一区二区三区| 在线不卡免费av| 亚洲影视资源网| 91黄色免费网站| 亚洲三级免费观看| 在线观看亚洲a| 成人网男人的天堂| 亚洲情趣在线观看| 在线播放国产精品二区一二区四区| 一级中文字幕一区二区| 欧美喷潮久久久xxxxx| 裸体一区二区三区| 亚洲精品一区二区三区蜜桃下载 | 懂色av中文一区二区三区| 国产精品高清亚洲| 国产精品一二三区在线| 日韩一区欧美一区| 欧美剧在线免费观看网站 | 欧美经典一区二区| 91精彩视频在线| 蜜臀av一区二区在线免费观看 | 欧洲亚洲精品在线| 麻豆国产一区二区| 欧美国产日本视频| 在线免费不卡视频| 狠狠色狠狠色综合日日91app| 亚洲自拍与偷拍| 国产日韩视频一区二区三区| 在线日韩一区二区| 日本欧美一区二区三区| 亚洲欧美视频在线观看| 欧美二区乱c少妇| 91福利小视频| 成人av电影在线| 久久97超碰国产精品超碰| 亚洲精品视频免费看| 久久久久国产精品麻豆ai换脸| 色婷婷一区二区三区四区| 狠狠色丁香婷婷综合久久片| 午夜电影网亚洲视频| 亚洲欧美在线另类| 国产精品国产三级国产普通话蜜臀| 欧美二区三区的天堂| 在线观看日韩精品| 色噜噜狠狠成人中文综合| 国产99精品国产| 国产精品一卡二卡| 精品一区二区三区久久| 麻豆高清免费国产一区| 另类小说综合欧美亚洲| 全国精品久久少妇| 精品一区二区三区欧美| 久久疯狂做爰流白浆xx| 日韩av中文字幕一区二区三区| 亚洲午夜久久久久久久久久久| 亚洲免费看黄网站| 亚洲精品国产精品乱码不99| 中文字幕日韩av资源站| 亚洲欧美一区二区不卡| 亚洲综合一区二区三区| 午夜精品爽啪视频| 日本视频一区二区三区| 国产高清精品久久久久| 99国产精品一区| 欧美久久久一区| 久久免费精品国产久精品久久久久 | 午夜精品影院在线观看| 激情久久五月天| 色94色欧美sute亚洲线路一ni| 欧美日韩在线观看一区二区| 欧美tickle裸体挠脚心vk| 国产精品剧情在线亚洲| 日韩高清电影一区| 99久久免费视频.com| 日韩色视频在线观看| 亚洲欧洲国产日本综合| 日韩成人免费看| 99久久99久久精品免费观看| 日韩免费高清电影| 中文字幕亚洲区| 韩国成人福利片在线播放| 色悠悠久久综合| 国产精品久久久久婷婷| 老司机精品视频线观看86| 在线亚洲免费视频| 国产精品青草综合久久久久99| 日韩成人一级大片| 欧美理论片在线| 亚洲成人动漫av| 在线观看中文字幕不卡| 中文字幕一区免费在线观看| 国产成人h网站| 国产女人aaa级久久久级 | 色哟哟亚洲精品| 亚洲欧美成aⅴ人在线观看| 91首页免费视频| 最新国产の精品合集bt伙计| 成人v精品蜜桃久久一区| 国产精品久久三| 91亚洲午夜精品久久久久久| 亚洲欧洲三级电影| 欧美日韩一区精品| 午夜精品久久久久久久久久久 | 性久久久久久久久| 欧美一区二区三区的| 久久99精品久久久久久| 久久久亚洲精品石原莉奈|