/*
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is expat.
The Initial Developer of the Original Code is James Clark.
Portions created by James Clark are Copyright (C) 1998
James Clark. All Rights Reserved.
Contributor(s):
*/
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "xmldef.h"
#ifdef XML_UNICODE
#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
#define XmlConvert XmlUtf16Convert
#define XmlGetInternalEncoding XmlGetUtf16InternalEncoding
#define XmlEncode XmlUtf16Encode
#define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1))
typedef unsigned short ICHAR;
#else
#define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX
#define XmlConvert XmlUtf8Convert
#define XmlGetInternalEncoding XmlGetUtf8InternalEncoding
#define XmlEncode XmlUtf8Encode
#define MUST_CONVERT(enc, s) (!(enc)->isUtf8)
typedef char ICHAR;
#endif
#ifdef XML_UNICODE_WCHAR_T
#define XML_T(x) L ## x
#else
#define XML_T(x) x
#endif
/* Round up n to be a multiple of sz, where sz is a power of 2. */
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
#include "xmlparse.h"
#include "xmltok.h"
#include "xmlrole.h"
#include "hashtable.h"
#define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */
#define INIT_DATA_BUF_SIZE 1024
#define INIT_ATTS_SIZE 16
#define INIT_BLOCK_SIZE 1024
#define INIT_BUFFER_SIZE 1024
typedef struct tag {
struct tag *parent;
const char *rawName;
int rawNameLength;
const XML_Char *name;
char *buf;
char *bufEnd;
} TAG;
typedef struct {
const XML_Char *name;
const XML_Char *textPtr;
int textLen;
const XML_Char *systemId;
const XML_Char *base;
const XML_Char *publicId;
const XML_Char *notation;
char open;
} ENTITY;
typedef struct block {
struct block *next;
int size;
XML_Char s[1];
} BLOCK;
typedef struct {
BLOCK *blocks;
BLOCK *freeBlocks;
const XML_Char *end;
XML_Char *ptr;
XML_Char *start;
} STRING_POOL;
/* The XML_Char before the name is used to determine whether
an attribute has been specified. */
typedef struct {
XML_Char *name;
char maybeTokenized;
} ATTRIBUTE_ID;
typedef struct {
const ATTRIBUTE_ID *id;
char isCdata;
const XML_Char *value;
} DEFAULT_ATTRIBUTE;
typedef struct {
const XML_Char *name;
int nDefaultAtts;
int allocDefaultAtts;
DEFAULT_ATTRIBUTE *defaultAtts;
} ELEMENT_TYPE;
typedef struct {
HASH_TABLE generalEntities;
HASH_TABLE elementTypes;
HASH_TABLE attributeIds;
STRING_POOL pool;
int complete;
int standalone;
const XML_Char *base;
} DTD;
typedef enum XML_Error Processor(XML_Parser parser,
const char *start,
const char *end,
const char **endPtr);
static Processor prologProcessor;
static Processor prologInitProcessor;
static Processor contentProcessor;
static Processor cdataSectionProcessor;
static Processor epilogProcessor;
static Processor errorProcessor;
static Processor externalEntityInitProcessor;
static Processor externalEntityInitProcessor2;
static Processor externalEntityInitProcessor3;
static Processor externalEntityContentProcessor;
static enum XML_Error
handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName);
static enum XML_Error
processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *);
static enum XML_Error
initializeEncoding(XML_Parser parser);
static enum XML_Error
doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
const char *start, const char *end, const char **endPtr);
static enum XML_Error
doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr);
static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const XML_Char *tagName, const char *s);
static int
defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, int isCdata, const XML_Char *dfltValue);
static enum XML_Error
storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *,
STRING_POOL *);
static enum XML_Error
appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *,
STRING_POOL *);
static ATTRIBUTE_ID *
getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end);
static enum XML_Error
storeEntityValue(XML_Parser parser, const char *start, const char *end);
static int
reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end);
static void
reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end);
static const XML_Char *getOpenEntityNames(XML_Parser parser);
static int setOpenEntityNames(XML_Parser parser, const XML_Char *openEntityNames);
static void normalizePublicId(XML_Char *s);
static int dtdInit(DTD *);
static void dtdDestroy(DTD *);
static int dtdCopy(DTD *newDtd, const DTD *oldDtd);
static void poolInit(STRING_POOL *);
static void poolClear(STRING_POOL *);
static void poolDestroy(STRING_POOL *);
static XML_Char *poolAppend(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc,
const char *ptr, const char *end);
static int poolGrow(STRING_POOL *pool);
static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s);
static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n);
#define poolStart(pool) ((pool)->start)
#define poolEnd(pool) ((pool)->ptr)
#define poolLength(pool) ((pool)->ptr - (pool)->start)
#define poolChop(pool) ((void)--(pool->ptr))
#define poolLastChar(pool) (((pool)->ptr)[-1])
#define poolDiscard(pool) ((pool)->ptr = (pool)->start)
#define poolFinish(pool) ((pool)->start = (pool)->ptr)
#define poolAppendChar(pool, c) \
(((pool)->ptr == (pool)->end && !poolGrow(pool)) \
? 0 \
: ((*((pool)->ptr)++ = c), 1))
typedef struct {
/* The first member must be userData so that the XML_GetUserData macro works. */
void *userData;
void *handlerArg;
char *buffer;
/* first character to be parsed */
const char *bufferPtr;
/* past last character to be parsed */
char *bufferEnd;
/* allocated end of buffer */
const char *bufferLim;
long parseEndByteIndex;
const char *parseEndPtr;
XML_Char *dataBuf;
XML_Char *dataBufEnd;
XML_StartElementHandler startElementHandler;
XML_EndElementHandler endElementHandler;
XML_CharacterDataHandler characterDataHandler;
XML_ProcessingInstructionHandler processingInstructionHandler;
XML_DefaultHandler defaultHandler;
XML_UnparsedEntityDeclHandler unparsedEntityDeclHandler;
XML_NotationDeclHandler notationDeclHandler;
XML_ExternalEntityRefHandler externalEntityRefHandler;
XML_UnknownEncodingHandler unknownEncodingHandler;
const ENCODING *encoding;
INIT_ENCODING initEncoding;
const XML_Char *protocolEncodingName;
void *unknownEncodingMem;
void *unknownEncodingData;
void *unknownEncodingHandlerData;
void (*unknownEncodingRelease)(void *);
PROLOG_STATE prologState;
Processor *processor;
enum XML_Error errorCode;
const char *eventPtr;
const char *eventEndPtr;
const char *positionPtr;
int tagLevel;
ENTITY *declEntity;
const XML_Char *declNotationName;
const XML_Char *declNotationPublicId;
ELEMENT_TYPE *declElementType;
ATTRIBUTE_ID *declAttributeId;
char declAttributeIsCdata;
DTD dtd;
TAG *tagStack;
TAG *freeTagList;
int attsSize;
ATTRIBUTE *atts;
POSITION position;
STRING_POOL tempPool;
STRING_POOL temp2Pool;
char *groupConnector;
unsigned groupSize;
int hadExternalDoctype;
} Parser;
#define
没有合适的资源?快使用搜索试试~ 我知道了~
w3c-libwww-5.2.6.tar.gz_UNIX_w3c
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 189 浏览量
2022-09-24
12:09:45
上传
评论
收藏 1.84MB GZ 举报
温馨提示
共1191个文件
html:321个
h:215个
c:184个
www工具包
资源推荐
资源详情
资源评论
收起资源包目录
w3c-libwww-5.2.6.tar.gz_UNIX_w3c (1191个子文件)
Makefile.am 4KB
Makefile.am 3KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 749B
Makefile.am 734B
Makefile.am 581B
Makefile.am 548B
Makefile.am 427B
Makefile.am 422B
Makefile.am 345B
Makefile.am 339B
Makefile.am 267B
Makefile.am 258B
Makefile.am 242B
Makefile.am 225B
Makefile.am 221B
Makefile.am 207B
Makefile.am 199B
Makefile.am 195B
Makefile.am 172B
Makefile.am 171B
Makefile.am 162B
Makefile.am 162B
Makefile.am 159B
Makefile.am 151B
Makefile.am 150B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 145B
Makefile.am 139B
Makefile.am 137B
Makefile.am 136B
Makefile.am 127B
Makefile.am 121B
Makefile.am 117B
Makefile.am 117B
Makefile.am 106B
Makefile.am 82B
MakeHelp.bat 1KB
HlpSBar.bmp 7KB
Largeico.bmp 4KB
HlpTBar.bmp 2KB
AppExit.bmp 2KB
ScMenu.bmp 2KB
Toolbar.bmp 1KB
Smallico.bmp 1KB
FileOpen.bmp 566B
CurArw4.bmp 566B
FileNew.bmp 566B
RecFirst.bmp 502B
EditCopy.bmp 502B
CurHelp.bmp 502B
EditPast.bmp 502B
EditCut.bmp 502B
Scmin.bmp 502B
FileSave.bmp 502B
RecLast.bmp 502B
RecPrev.bmp 502B
FilePrnt.bmp 502B
RecNext.bmp 502B
EditUndo.bmp 502B
Scmax.bmp 502B
Stateico.bmp 374B
CurArw2.bmp 310B
Bullet.bmp 142B
xmlparse.c 68KB
HTCache.c 66KB
CSLabel.c 65KB
HTBrowse.c 61KB
HTAccess.c 57KB
HTFTP.c 47KB
HTHost.c 47KB
CSMacRed.c 40KB
HTTP.c 39KB
HTReqMan.c 37KB
xmltok_impl.c 36KB
HTAnchor.c 36KB
HTRobot.c 36KB
HTWAIS.c 36KB
HTNet.c 35KB
HTAABrow.c 32KB
CSUser.c 29KB
xmltok.c 27KB
HTBTree.c 26KB
HTEvtLst.c 26KB
GridText.c 26KB
HTFormat.c 25KB
crypt_util.c 25KB
HTNDir.c 25KB
www.c 23KB
xmlrole.c 23KB
HTGopher.c 23KB
共 1191 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
林当时
- 粉丝: 97
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于matlab实现多车辆车辆路径问题,用遗传算法编程,保证可用.rar
- 基于matlab实现多层极限学习机实现手写体识别,准确率超过99%.rar
- 基于matlab实现电力系统最优潮流程序,可以应用于电力市场下的最优潮流计算 适合电力系统专业的同仁使用.rar
- 串行通信的通信协议串口协议串行通信的通信协议串口协议
- Vue构建交互式的单页面应用程序Vue构建交互式的单页面应用程序
- Spring Boot快速搭建和部署应用程序
- Redis开源的高性键值存储系统广泛应用于缓存、实时消息传递
- Qt跨平台的应用程序开发框架Qt跨平台的应用程序开发框架
- 单片机是集成处理器、存储器和输入输出设备
- 深度学习机器习方法模仿人脑神经网络深度学习机器习方法模仿人脑神经网络
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功