// Copyright 2010 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: jdtang@google.com (Jonathan Tang)
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "attribute.h"
#include "error.h"
#include "gumbo.h"
#include "insertion_mode.h"
#include "parser.h"
#include "tokenizer.h"
#include "tokenizer_states.h"
#include "utf8.h"
#include "util.h"
#include "vector.h"
#define AVOID_UNUSED_VARIABLE_WARNING(i) (void)(i)
#define GUMBO_STRING(literal) { literal, sizeof(literal) - 1 }
#define TERMINATOR { "", 0 }
static void* malloc_wrapper(void* unused, size_t size) {
return malloc(size);
}
static void free_wrapper(void* unused, void* ptr) {
return free(ptr);
}
const GumboOptions kGumboDefaultOptions = {
&malloc_wrapper,
&free_wrapper,
NULL,
8,
false,
-1,
};
static const GumboStringPiece kDoctypeHtml = GUMBO_STRING("html");
static const GumboStringPiece kPublicIdHtml4_0 = GUMBO_STRING(
"-//W3C//DTD HTML 4.0//EN");
static const GumboStringPiece kPublicIdHtml4_01 = GUMBO_STRING(
"-//W3C//DTD HTML 4.01//EN");
static const GumboStringPiece kPublicIdXhtml1_0 = GUMBO_STRING(
"-//W3C//DTD XHTML 1.0 Strict//EN");
static const GumboStringPiece kPublicIdXhtml1_1 = GUMBO_STRING(
"-//W3C//DTD XHTML 1.1//EN");
static const GumboStringPiece kSystemIdRecHtml4_0 = GUMBO_STRING(
"http://www.w3.org/TR/REC-html40/strict.dtd");
static const GumboStringPiece kSystemIdHtml4 = GUMBO_STRING(
"http://www.w3.org/TR/html4/strict.dtd");
static const GumboStringPiece kSystemIdXhtmlStrict1_1 = GUMBO_STRING(
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
static const GumboStringPiece kSystemIdXhtml1_1 = GUMBO_STRING(
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd");
static const GumboStringPiece kSystemIdLegacyCompat = GUMBO_STRING(
"about:legacy-compat");
// The doctype arrays have an explicit terminator because we want to pass them
// to a helper function, and passing them as a pointer discards sizeof
// information. The SVG arrays are used only by one-off functions, and so loops
// over them use sizeof directly instead of a terminator.
static const GumboStringPiece kQuirksModePublicIdPrefixes[] = {
GUMBO_STRING("+//Silmaril//dtd html Pro v0r11 19970101//"),
GUMBO_STRING("-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//"),
GUMBO_STRING("-//AS//DTD HTML 3.0 asWedit + extensions//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0 Level 1//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0 Level 2//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0 Strict Level 1//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0 Strict Level 2//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0 Strict//"),
GUMBO_STRING("-//IETF//DTD HTML 2.0//"),
GUMBO_STRING("-//IETF//DTD HTML 2.1E//"),
GUMBO_STRING("-//IETF//DTD HTML 3.0//"),
GUMBO_STRING("-//IETF//DTD HTML 3.2 Final//"),
GUMBO_STRING("-//IETF//DTD HTML 3.2//"),
GUMBO_STRING("-//IETF//DTD HTML 3//"),
GUMBO_STRING("-//IETF//DTD HTML Level 0//"),
GUMBO_STRING("-//IETF//DTD HTML Level 1//"),
GUMBO_STRING("-//IETF//DTD HTML Level 2//"),
GUMBO_STRING("-//IETF//DTD HTML Level 3//"),
GUMBO_STRING("-//IETF//DTD HTML Strict Level 0//"),
GUMBO_STRING("-//IETF//DTD HTML Strict Level 1//"),
GUMBO_STRING("-//IETF//DTD HTML Strict Level 2//"),
GUMBO_STRING("-//IETF//DTD HTML Strict Level 3//"),
GUMBO_STRING("-//IETF//DTD HTML Strict//"),
GUMBO_STRING("-//IETF//DTD HTML//"),
GUMBO_STRING("-//Metrius//DTD Metrius Presentational//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 2.0 HTML//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 2.0 Tables//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 3.0 HTML//"),
GUMBO_STRING("-//Microsoft//DTD Internet Explorer 3.0 Tables//"),
GUMBO_STRING("-//Netscape Comm. Corp.//DTD HTML//"),
GUMBO_STRING("-//Netscape Comm. Corp.//DTD Strict HTML//"),
GUMBO_STRING("-//O'Reilly and Associates//DTD HTML 2.0//"),
GUMBO_STRING("-//O'Reilly and Associates//DTD HTML Extended 1.0//"),
GUMBO_STRING("-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//"),
GUMBO_STRING("-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::)"
"extensions to HTML 4.0//"),
GUMBO_STRING("-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::"
"extensions to HTML 4.0//"),
GUMBO_STRING("-//Spyglass//DTD HTML 2.0 Extended//"),
GUMBO_STRING("-//SQ//DTD HTML 2.0 HoTMetaL + extensions//"),
GUMBO_STRING("-//Sun Microsystems Corp.//DTD HotJava HTML//"),
GUMBO_STRING("-//Sun Microsystems Corp.//DTD HotJava Strict HTML//"),
GUMBO_STRING("-//W3C//DTD HTML 3 1995-03-24//"),
GUMBO_STRING("-//W3C//DTD HTML 3.2 Draft//"),
GUMBO_STRING("-//W3C//DTD HTML 3.2 Final//"),
GUMBO_STRING("-//W3C//DTD HTML 3.2//"),
GUMBO_STRING("-//W3C//DTD HTML 3.2S Draft//"),
GUMBO_STRING("-//W3C//DTD HTML 4.0 Frameset//"),
GUMBO_STRING("-//W3C//DTD HTML 4.0 Transitional//"),
GUMBO_STRING("-//W3C//DTD HTML Experimental 19960712//"),
GUMBO_STRING("-//W3C//DTD HTML Experimental 970421//"),
GUMBO_STRING("-//W3C//DTD W3 HTML//"),
GUMBO_STRING("-//W3O//DTD W3 HTML 3.0//"),
GUMBO_STRING("-//WebTechs//DTD Mozilla HTML 2.0//"),
GUMBO_STRING("-//WebTechs//DTD Mozilla HTML//"),
TERMINATOR
};
static const GumboStringPiece kQuirksModePublicIdExactMatches[] = {
GUMBO_STRING("-//W3O//DTD W3 HTML Strict 3.0//EN//"),
GUMBO_STRING("-/W3C/DTD HTML 4.0 Transitional/EN"),
GUMBO_STRING("HTML"),
TERMINATOR
};
static const GumboStringPiece kQuirksModeSystemIdExactMatches[] = {
GUMBO_STRING("http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"),
TERMINATOR
};
static const GumboStringPiece kLimitedQuirksPublicIdPrefixes[] = {
GUMBO_STRING("-//W3C//DTD XHTML 1.0 Frameset//"),
GUMBO_STRING("-//W3C//DTD XHTML 1.0 Transitional//"),
TERMINATOR
};
static const GumboStringPiece kLimitedQuirksRequiresSystemIdPublicIdPrefixes[] = {
GUMBO_STRING("-//W3C//DTD HTML 4.01 Frameset//"),
GUMBO_STRING("-//W3C//DTD HTML 4.01 Transitional//"),
TERMINATOR
};
// Indexed by GumboNamespaceEnum; keep in sync with that.
static const char* kLegalXmlns[] = {
"http://www.w3.org/1999/xhtml",
"http://www.w3.org/2000/svg",
"http://www.w3.org/1998/Math/MathML"
};
typedef struct _ReplacementEntry {
const GumboStringPiece from;
const GumboStringPiece to;
} ReplacementEntry;
#define REPLACEMENT_ENTRY(from, to) \
{ GUMBO_STRING(from), GUMBO_STRING(to) }
// Static data for SVG attribute replacements.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adjust-svg-attributes
static const ReplacementEntry kSvgAttributeReplacements[] = {
REPLACEMENT_ENTRY("attributename", "attributeName"),
REPLACEMENT_ENTRY("attributetype", "attributeType"),
REPLACEMENT_ENTRY("basefrequency", "baseFrequency"),
REPLACEMENT_ENTRY("baseprofile", "baseProfile"),
REPLACEMENT_ENTRY("calcmode", "calcMode"),
REPLACEMENT_ENTRY("clippathunits", "clipPathUnits"),
REPLACEMENT_ENTRY("contentscripttype", "contentScriptType"),
REPLACEMENT_ENTRY("contentstyletype", "contentStyleType"),
REPLACEMENT_ENTRY("diffuseconstant", "diffuseConstant"),
REPLACEMENT_ENTRY("edgemode", "edgeMode"),
REPLACEMENT_ENTRY("externalresourcesrequired", "externalResourcesRequired"),
REPLACEMENT_ENTRY("filt
没有合适的资源?快使用搜索试试~ 我知道了~
EasyIOS的Swift版本.zip
共140个文件
swift:58个
h:31个
m:16个
需积分: 5 0 下载量 144 浏览量
2024-02-06
09:52:11
上传
评论
收藏 362KB ZIP 举报
温馨提示
EasyIOS的Swift版本.zip
资源推荐
资源详情
资源评论
收起资源包目录
EasyIOS的Swift版本.zip (140个子文件)
parser.c 160KB
tokenizer.c 114KB
char_ref.c 79KB
error.c 10KB
utf8.c 9KB
tag.c 4KB
vector.c 4KB
string_buffer.c 3KB
util.c 2KB
string_piece.c 2KB
attribute.c 1KB
EncodeLoginScene.crypto 2KB
.gitkeep 0B
.gitkeep 0B
gumbo.h 26KB
Defines.h 9KB
error.h 8KB
NSAttributedString+HTMLStyle.h 6KB
utf8.h 5KB
tokenizer.h 5KB
tokenizer_states.h 4KB
URLNavigation.h 3KB
string_buffer.h 3KB
UIColor+HTMLColors.h 3KB
vector.h 2KB
char_ref.h 2KB
parser.h 2KB
util.h 2KB
URLManager.h 2KB
insertion_mode.h 2KB
SwiftTryCatch.h 1KB
string_piece.h 1KB
token_type.h 1KB
attribute.h 1KB
UIViewController+URLManage.h 959B
OGNode.h 777B
ObjectiveGumbo.h 566B
pinyin.h 553B
OGElement.h 414B
NSData+EasyExtend.h 357B
DesEncrypt.h 356B
OGText.h 352B
OGUtility.h 349B
NSString+OGString.h 311B
OGDocument.h 279B
Contents.json 585B
Podfile.lock 1013B
pinyin.m 24KB
UIColor+HTMLColors.m 21KB
NSAttributedString+HTMLStyle.m 9KB
OGUtility.m 6KB
URLManager.m 6KB
URLNavigation.m 5KB
ObjectiveGumbo.m 5KB
UIViewController+URLManage.m 5KB
DesEncrypt.m 4KB
OGElement.m 3KB
OGNode.m 2KB
SwiftTryCatch.m 2KB
NSData+EasyExtend.m 1KB
OGText.m 1KB
NSString+OGString.m 713B
OGDocument.m 349B
Chinese.md 7KB
Chinese.md 7KB
project.pbxproj 29KB
Info.plist 1KB
Info.plist 746B
url.plist 412B
login-logo@2x.png 74KB
arrow-down@2x.png 51KB
Podfile 104B
EasyIOS-Swift.podspec 2KB
EUIExtend+UIView.swift 23KB
Reachability.swift 13KB
EasyORM.swift 13KB
EZCoreDataManager.swift 11KB
EZExtend+UIView.swift 9KB
EZAction.swift 9KB
EUI+ViewProperty.swift 8KB
EUIProperty.swift 8KB
EZInfiniteScrolling.swift 7KB
Regex.swift 7KB
EUIParse.swift 6KB
PullHeader.swift 6KB
EZPullToRefresh.swift 6KB
EUI.swift 6KB
EZKit.swift 6KB
EZRequest.swift 6KB
EZExtend+Bond.swift 5KB
PullFooter.swift 5KB
EUI+ButtonProperty.swift 4KB
EZSystemInfo.swift 4KB
EZViewModel.swift 4KB
EUI+ScrollViewProperty.swift 4KB
EZExtend+UILabel.swift 3KB
EUI+CollectionViewProperty.swift 3KB
EZExtend+String.swift 3KB
EUI+TableViewProperty.swift 3KB
EZScene.swift 3KB
共 140 条
- 1
- 2
资源评论
YOLO数据集工作室
- 粉丝: 443
- 资源: 1569
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功