diff --git a/.gitignore b/.gitignore
index a84999ab..d7e65d71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,8 @@
*.user
*.ncb
*.suo
+/build/
+*.ipch
+*.sdf
+*.opensdf
+*.cache
diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
index 00000000..6c5837d8
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,478 @@
+#### 2018-05-25 00:27 修正 skeSetFileSystem 失效问题。
+* 更新 libcurl 为 7.50.1 版本。同时也修正了因 libcurl 原因 wkeSetFileSystem 失效的问题(貌似之前修正过一次。。。)。
+* 修正 wkeLoadHtml(W) 加载页面内容时,wkeSetFileSystem 回调失效的问题。
+* 修改 libcurl 相关的 vsprops。
+
+#### 2016-11-09 10:53 修正更新 libcurl 之后 wkeSetFileSystem 无效的问题。
+* 修正更新 libcurl 之后 wkeSetFileSystem 无效的问题,失效是因为 libcurl 的函数没有替换为 wkeSetFileSystem 设置的。
+* wkexe.exe 增加 --useragent 参数设置 UserAgent。
+
+#### 2016-08-03 12:28 readme.md 中去掉 vs2015 工程相关描述,现在还没有 vs2015 工程。
+* readme.md 中去掉 vs2015,现在还没有 vs2015 工程。
+
+#### 2016-08-03 12:07 readme.md 细节调整。
+* readme.md 细节调整。
+
+#### 2016-08-03 11:59 readme.md 中增加了使用 git 同步更新代码的方法说明。
+* 中增加了使用 git 同步更新代码的方法说明。
+
+#### 2016-08-03 11:03 版本 1.2.1.3 处理 WM_SETCURSOR 消息,修正编辑框当中光标闪烁的问题。
+* 处理 WM_SETCURSOR 消息,修正编辑框当中光标闪烁的问题。
+* 修改版本号为 1.2.1.3。
+
+#### 2016-08-01 13:23 版本 1.2.1.2 使用 libcurl 7.50,修正 HTTPS 问题。
+* 使用最新的 libcurl 7.50 源码,LIB Release - DLL Windows SSPI + MT 生成新的 libcurl_imp.lib,修正了有时 HTTPS 失败的问题(例如 https://wx.qq.com 无法打开的问题)。
+* 修改版本号为 1.2.1.2。
+
+#### 2016-07-29 22:47 在 readme.md 中添加编译指南、一条 FAQ。
+* 在 readme.md 中,将编译指南从 FAQ 中单独提出来。
+* 增加一条 FAQ:`FAQ1. wke 对 HTML5 的支持如何?`。
+
+#### 2016-07-28 01:57 修改 readme.md 一些语法问题。
+* 修改 readme.md 一些语法问题。
+
+#### 2016-07-28 01:48 readme.md 中增加贡献者名单。
+* readme.md 中增加贡献者名单。
+
+#### 2016-07-28 00:23 修正 readme.md 中 FAQ 的链接问题。
+* 修正 readme.md 中 FAQ 的链接问题。
+
+#### 2016-07-28 00:18 修改 readme.md 排版。
+* 修改 readme.md 排版。
+
+#### 2016-07-28 00:04 将 FAQ 直接放到 readme.md 当中。
+* 将 FAQ 直接放到 readme.md 当中。
+
+#### 2016-07-28 23:37 项目根目录增加 FAQ 文档。
+* 项目根目录增加 FAQ 文档,记录一下经常被问到的问题。
+
+#### 2016-06-24 12:05 规范JS接口,增加 wkeJSAddRef、wkeJSReleaseRef 。
+* 所有JS接口上,添加 wkeJSState* 参数。
+* 添加 wkeJSAddRef、wkeJSReleaseRef 函数,显式地引用变量,避免被 GC。
+
+改动如下:
+- wkeWebView -> wkeWebView *
+- wkeString -> wkeString *
+- jsExecState -> wkeJSState *
+- jsValue -> wkeJSValue
+- ....
+- jsCall -> wkeJSCall
+- jsGet -> wkeJSGet
+- ...
+
+* 修改版本号为 1.2.2.0
+
+#### 2016-06-24 12:05 规范命名、类型定义。
+* wke有几个命名,我想调整一下,问一下大家的意见,主要是基于两点原因
+ 1.现在句柄类型(wkeWebView、wkeString等)、指针类型(wkeSettings*、wkeConsoleMessaget*等)都在用,比较混乱。
+ 2.JS函数族,命名上加上wke。
+
+改动如下:
+- wkeWebView -> wkeWebView *
+- wkeString -> wkeString *
+- jsExecState -> wkeJSState *
+- jsValue -> wkeJSValue
+- ....
+- jsCall -> wkeJSCall
+- jsGet -> wkeJSGet
+- ...
+
+* 修改版本号为 1.2.2.0
+
+#### 2016-06-23 17:55 修改版本号为 1.2.1.1。
+* 修改版本号为 1.2.1.1
+
+#### 2016-06-23 17:46 使用群里蚂蚁的方法优化了绘制,妈妈再也不用担心 wke 绘制卡顿了。
+* 使用群里蚂蚁的方法优化了绘制,妈妈再也不用担心 wke 绘制卡顿了。
+* 增加了以下函数:
+ - wkeSetRepaintInterval 设置 wkeRepaintIfNeededAfterInterval 调用 wkeRepaintIfNeed 的时间间隔。
+ - wkeGetRepaintInterfal 获取 wkeRepaintIfNeededAfterInterval 调用 wkeRepaintIfNeed 的时间间隔。
+ - wkeRepaintIfNeededAfterInterval 根据指定的时间间隔调用 wkeRepaintIfNeed。
+ - wkeRepaintAllNeeded 调用所有 wkeWebView 的 wkeRepaintIfNeededAfterInterval。
+ - wkeRunMessageLoop 消息循环 + wkeRepaintAllNeeded 的调用。
+
+优化原理:以前的绘制是使用WM_TIMER定时器来重绘,当消息队列很忙的时候有可能不能及时绘制,造成卡顿,优化方法是在消息循环当中直接绘制,使绘制优先于消息处理。
+
+#### 2016-06-23 12:13 修正调用 WebCore::DatabaseTracker::setDatabaseDirectoryPath 发生断言失败的问题。
+* 修正调用 WebCore::DatabaseTracker::setDatabaseDirectoryPath 发生断言失败的问题,改为在 wkeInitialize 时调用 WebCore::DatabaseTracker::initializeTracker。
+
+#### 2016-06-22 20:15 使用蚂蚁实现的 websocket 。
+* 使用蚂蚁实现的 websocket,当前一个连接一个线程,有待优化。
+
+#### 2016-06-22 17:40 实现默认 window.prompt。
+* 实现默认 window.prompt 函数。
+* 修改版本号为 1.2.1.0。
+* 修改资源中相关网站地址为 www.github.com/cexer/wke。
+* 取消 wke 对 WebCore 项目的依赖,防止每次从 WebCore 编译。
+
+#### 2016-06-22 14:16 修正 CWebWindow::resize、CWebWindow::moveToCenter 的 WS_CHILD 属性判断 BUG。
+* 修正 CWebWindow::resize、CWebWindow::moveToCenter 的 WS_CHILD 属性判断不正确,导致以控件形式创建时位置不正确的问题。
+
+#### 2016-03-10 23:29 优化 wkexe、增加命令行直接加载 HTML 文本支持。
+* 重构 wkexe 中一部分代码。
+* 修改 wkexe 行为,若未在命令行指定参数,使用默认参数启动 about:blank 页面。
+* 修改 wkexe 对于`html`参数的理解,现在可支持直接传递 html 内容,如:
+```html
+wkexe --html=""
+wkexe --html="Hello World!"
+```
+* 增加 wkexe 对于 cookie 文件路径的自定义支持,使用参数`cookie`设置路径。
+* 修改 wkeLoadW、wkeLoad 以支持`about:blank`地址。
+
+#### 2016-03-10 22:14 增加 cookie 操作接口。
+* 增加 wkeSetCookie 设置指定 wkeWebView 的 cookie。
+* 修改 wkeConfigure、wkeInitializeEx 的参数结构体 wkeSettings,增加指定全局 cookie 文件路径的成员。
+
+#### 2016-03-10 21:24 增加查找插件时同时在工作目录的 plugins 目录下查找。
+* 增加查找插件时同时在工作目录的 plugins 目录下查找,之前只在程序所在目录查找。
+
+#### 2016-03-09 09:09 增加 Document/todo.md 记录平时积累的需求、问题。
+* 增加 Document/todo.md 记录平时积累的需求、问题。
+
+#### 2015-12-30 00:23 修正 wkeWebWindow 网页中编辑框输入法不跟随光标的问题。
+* 在 WM_IME_STARTCOMPOSITION 添加 ImmSetCompositionWindow 调用,以修正 wkeWebWindow 网页中编辑框输入法不跟随光标的问题。
+
+#### 2015-12-25 23:44 增加 wkeOnDocumentReady 回调参数,以区分 iframe 的加载成功事件。
+* 增加 FrameLoaderClient::dispatchDidFinishDocumentLoad 参数,使 wkeOnDocumentReady 有回调参数,以区分 iframe 的加载成功事件。
+
+#### 2015-12-25 23:44 实现几个底层回调,使 window.close、window.blur、window.focus 生效。
+* 实现 ChromeClient::unfocus、ChromeClient::focus、ChromeClient::closeWindowSoon,使 window.close、window.blur、window.focus 生效。
+
+#### 2015-12-25 20:59 修正 wkeBrowser 中拦截 _blank 导致无法打开链接的问题。
+* 修正 wkeBrowser 中拦截 _blank 导致无法打开链接的问题。
+
+#### 2015-12-24 20:27 临时解决 wke 的 vs2010 工程 Debug 模式链接失败的问题。
+* 修改 vs2010 工程文件,调度模式时忽略默认库 msvcrt.lib;LIBCMT.lib。这只是临时解决问题,应该工程配置某个地方直接或间接引入了这两个 release 模式下的库。
+
+#### 2015-12-23 12:47 修改插件查找机制支持非 np 开头的插件。
+* 修改 PluginDatabaseWin.cpp::PluginDatabase::getPluginPathsInDirectories,以支持加载 plugins 目录下非 np 开头的插件。
+
+#### 2015-12-20 19:10 修改 wkeOnCreateView 函数。
+* 修改 wkeOnCreateView 函数参数,使用结构体 wkeNewViewInfo 传递,并增加 target 信息。
+* 修改 wkeOnCreateView 函数行为,若返回 NULL,则不继续浏览该地址。、
+* 在 wkeBrowser 当中增加 wkeOnCreateView 测试。
+
+#### 2015-12-20 15:37 去掉 wke 接口定义的平台依赖。
+* 去掉 wke.h 当中对 、HWND、HDC 等的直接引用,接口上去掉平台依赖。
+
+#### 2015-12-20 15:37 明确定义 wke 接口的调用约定为 cdecl。
+* 定义调用约定 WKE_CALL = cdecl。
+* 每个函数声明前明确加上调用约定,以防止当使用不同的调用约定时出现错误。
+
+#### 2015-12-19 23:03 修正 wke 无法正确加载 windowed 插件的问题。
+* 增加 wkeSetHostWindow,若使用 windowed 插件,必须先调用此函数,以免插件找不到容器容器。
+* 增加 wkeSetHostWindow,若使用 windowed 插件,必须先调用此函数,以免插件找不到容器容器。
+* 修改 WebCore::PluginView::platformStart 函数,若找不到插件容器窗口,则使用桌面为容器。
+* 在 wkeBrowser 当中增加 wkeSetHostWindow 调用,以支持 windowed 插件,使用 VLC 插件测试通过。
+* 在 使用 wkeCreateWindow 返回的 webView 增加自动的 wkeSetHostWindow 调用,以支持 windowed 插件。
+
+#### 2015-12-19 17:58 wkeBrowser 中增加使用 jsFunction 绑定函数的示例。
+* wkeBrowser 中增加使用 jsFunction 绑定函数的示例。
+
+#### 2015-12-16 16:38 增加控制台消息回调。
+* 增加控制台消息回调功能,通过 wkeOnConsoleMessage 设置回调函数。
+* wkeBrowser 当中增加控制台消息回调功能测试。
+
+#### 2015-11-27 21:56 提交编译好的二进制文件。
+* 提交编译好的二进制文件。
+
+#### 2015-11-26 20:23 修正 wke 中 wkeSimpleStringT 拷贝宽字符串只拷一半的问题。
+* 之前 wke 中的 wkeSimpleStringT 有拷贝宽字符串只拷一半的问题,导致 wkeToTempStringW 不正常。
+
+#### 2015-11-26 10:26 增加 vs2010.bat 等批处理用于打开工程,避免找不到 nmake 的情况。
+* 在使用 vs2010 或 vs2013 编译时可能会出现找不到 namke 的情况,因此增加 vs2010.bat 等批处理,其会先设置环境变量再打开工程。
+
+#### 2015-11-26 10:07 修正 wkeBrowser 的 _WIN32_WINNT 导致找不到符号的问题。
+* 修正 wkeBrowser 的 _WIN32_WINNT 导致找不到 IDC_HAND 宏的问题,将其设置为最低 0x501(Windows XP)即可。
+
+#### 2015-11-25 22:28 增加基于 vs2008 工程文件 的 vs2005 工程文件。
+* 增加基于 vs2008 工程文件 的 vs2005 工程文件。
+* 修改 wkeBrowser 中 _WIN32_WINNT 定义,以支持 vs2005 编译。
+* 去掉 wkeBrowser 当中对 Direct3D 的引用,以支持 vs2005 编译。
+
+#### 2015-11-25 21:20 增加基于 BrentHuang 完成的 vs2013 工程文件。
+* 增加基于 BrentHuang(群里光 光)完成的 vs2013 工程文件,感谢 BrentHuang 的贡献。
+* 使用 BrentHuang 提供的修改过的几个源代码以支持 vs2013 中编译,我另外修改了几处以兼容 vs2008 和 vs2010。
+
+#### 2015-11-25 13:03 增加 wkeLoad/wkeLoadW 智能加载接口。
+* 增加 wkeLoad/wkeLoadW 智能加载接口,可分析出参数的类型是 URL 、HTML 或 文件路径,判断顺序如下:
+ - 若参数中明确指定了 https://、http://、file:///,则按 URL 加载。
+ - 若参数中包含 “<” 和 “>” 两个 HTML 中的特殊字符(同时这两个字符不可能是路径字符),按照 HTML 加载。
+ - 若参数中不包含 “:” 字符则按照相对路径处理,依次在当前工作目录、EXE所在目录查找将其补全为完整路径。
+ - 若完整路径指向的文件确实存在,则将其按照文件执行加载。
+ - 若以上判断全部失败,则当作 URL 加载。
+* 在 wkeBrowser 中将加载函数改为 wkeLoadW,可通过运行 wkeBrowser [加载参数] 直接进行测试。
+
+#### 2015-11-24 23:51 修改 ChangeLog 更新日志的路径。
+* 去掉 ChangeLog.txt。
+* 将 Document/history.md 移至根目录下 ChangeLog.md。
+
+#### 2015-11-24 23:38 去掉 wke 中对 std::string 的引用。
+* 去掉 wke 中 jsBind.cpp 对 std::string 的引用,自己实现了一个简单的字符串缓存对象。
+
+#### 2015-11-24 23:35 修正 wkeBrowser 无法访问百度的问题。
+* 修正 wkeBrowser 中因在 wkeOnNavigation 中禁用百度,导致无法访问百度的问题。
+
+#### 2015-11-24 23:31 增加 BrentHuang 完成的 vs2010 的工程文件。
+* 增加 BrentHuang(群里光 光)完成的 vs2010 的工程文件,感谢 BrentHuang 的贡献。
+
+#### 2015-10-06 14:18 增加基于 wkeWebView 的带窗口、消息处理、绘制的窗口/控件接口。
+* 增加基于 wkeWebView 的带窗口、消息处理、绘制的窗口/控件,接口:
+ - 使用 wkeCreateWindow 创建窗口或控件,当前支持普通弹出窗口、分层窗口(用于透明)、控件。
+ - 使用 wkeShowWindow 显示、隐藏窗口或控件。
+ - 使用 wkeEnableWindow 禁用、启用窗口或控件。
+ - 使用 wkeMoveWindow/wkeMoveToCenter 移动窗口或控件。
+ - 使用 wkeResizeWindow 设置窗口或控件的大小。
+ - 使用 wkeSetWindowTitle 设置窗口标题。
+
+* 增加了一个新的项目 wkexe,作为三个新项目(wkeClient、wkeSample)中第一个。此项目的功能:
+ - 创建类似于 cmd.exe 之于 cmd、bat 文件的 WebApp 的执行器,加载不同的 html 文件执行任务。
+ - 演示项目,用于演示 wke 接口的作用。
+
+* 为了与 wkeCreateWindow 等一系列针对窗口的操作进行区分,修改新页面回调接口名称:
+ - 更名 wkeOnNewWindow 为 wkeOnCreateView
+ - 更名 wkeNewWindowCallback 为 wkeCreateViewCallback
+
+* 去掉了在 wkeCreateWebView、wkeDestroyWebView 中 s_webViews 相关的东西。
+* 修改 alert、confirm 弹出框的默认标题为 "wke" 。
+
+#### 2015-10-05 01:30 增加地址加载、文档解析状态的回调接口。
+* 增加地址加载、文档解析状态的回调接口:
+ - wkeOnLoadingFinish 设置地址加载成功、失败、取消状态的回调函数。
+ - wkeOnDocumentReady 设置文档解析成功的回调函数。
+
+#### 2015-10-05 00:56 修正 wkeNavigationType 的值。
+* 在 wke 中将 WebCore::NavigationType 转换为 wkeNavigationType 时使用了直接强制转换,因此需要保证两个 enum 定义的值完全一致。
+
+#### 2015-10-04 22:27 实现打开新窗口的控制回调 。
+* 实现打开新窗口的控制回调,使用 wkeOnNewWindow 设置回调函数。
+* 在 demo/bin/file.html 当中增加 wkeOnNewWindow 的测试数据(wkeBrowser中暂未增加)。
+
+#### 2015-10-04 17:11 修改实现代码中所有成员变量以 `m_` 开头 。
+* 修改实现代码中所有成员变量的命令以 `m_` 开头(与 WebKit 内核保持一致)。
+
+#### 2015-10-04 16:11 实现打开链接的控制回调。
+* 实现打开链接的控制回调,使用 wkeOnNavigation 设置回调函数。
+* 在 wkeBrowser 当中增加 wkeOnNavigation 的测试。
+
+#### 2015-09-30 17:21 实现 alert、confirm、prompt 回调。
+* 实现 alert、confirm、prompt 回调,并支持自定义实现,接口:
+ - wkeOnAlertBox
+ - wkeOnConfirmBox
+ - wkeOnPromptBox
+
+* 修正 wkeGetStringW 复制字符串截断的问题。
+* wkeBrowser 中增加 wkeOnTitleChanged 和 wkeOnURLChanged 回调的测试。
+
+#### 2015-09-30 16:36 规范 wke 回调接口。
+* 修改所有回调函数类型名称为 `事件名称 + Callback` 的形式:
+ - 更名 wkeOnTitleChanged 为 wkeTitleChangedCallback
+ - 更名 wkeOnURLChanged 为 wkeURLChangedCallback
+ - 更名 wkeOnPaintUpdated 为 wkePaintUpdatedCallback
+
+* 去掉 wkeSetHandler、wkeGetHandler,所有回调定义单独的 wkeOn + 事件名称 形式的设置函数:
+ - wkeOnTitleChanged
+ - wkeOnURLChanged
+ - wkeOnPaintUpdated
+
+* 修改所有回调函数的回调参数,去掉 wkeClientHandler,增加 void* param。
+* 去掉 wkeClientHandler 结构。
+
+
+#### 2015-09-29 23:07 修正去掉 StringTable 依赖之后的编译问题。
+* 修正去掉 StringTable 依赖之后的编译问题。
+
+#### 2015-09-29 15:32 去掉 wke 项目中的 StringTable 依赖。
+* 去掉 wke 项目中的 StringTable 依赖,因 StringTable 实际上全局字符串池,且只在 wkeFinalize 时才释放,若字符串函数(比如jsToString)调用过多,会导致内存只增不减。
+* 修改 jsToString 和 jsToStringW 的实现,不依赖 StringTable,返回 static 字符串,因此其返回值会被下次调用冲掉,在使用不能保存字符串指针,应该立即保存到字符串数组或 std::string、std::wstring 当中再使用。
+* 更名 jsToString 为 jsToTempString,更名 jsToStringW 为 jsToTempStringW,因其返回值会被下次调用冲掉。
+
+#### 2015-09-29 09:10 增加两个 C 导出函数 wkeRepaintIfNeed 和 wkeGetViewDC 。
+* 增加两个 C 导出函数 wkeRepaintIfNeed 和 wkeGetViewDC 。
+* 修正 wkeSetHandler 和 wkeGetHandler 的 const 问题。
+
+#### 2015-09-29 02:20 去掉 IWebView 接口。
+* 因 IWebView* 纯虚函数的调用方式,与 C 接口没有大的区别,择其一即可。而 C 接口可兼容大多数的开发语言,所以保留 C 接口。不再支持 IWebView* 接口。
+* 在 C++ 模式下导出符号增加 extern "C" 。
+
+#### 2015-09-29 01:58 修改 wkeString 字符串相关接口。
+* 修改 wkeString 的类型定义,使在 C 下更安全,在 C++ 下更方便。
+* 更名 wkeToString 为 wkeGetString,更名 wkeToStringW 为 wkeGetStringW,使其符合 wke 的命令习惯 。
+* 增加 wkeSetString 和 wkeSetStringW 。
+
+#### 2015-09-29 01:39 整理 wke 内部结构。
+* 整理 wke 内部的结构,将所有的 *.inl 文件使用 .h 和 .cpp 进行分离。
+* 在 wke.h 当中包含上 windows.h,因其需要 HDC 的定义。
+
+#### 2015-09-29 22:17 提交 Release 版的目标文件。
+* 上次提交误提交了 Debug 版的 wke.dll,改为提交 Release 版的。
+
+#### 2015-09-29 22:10 修改 wkeBrowser 对 wke 的调用为 C 接口调用。
+* 修改 wkeBrowser 对 wke 的调用为 C 接口调用,因 IWebView* 纯虚函数的调用方式,与 C 接口没有大的区别,择其一即可。而容 C 接口可兼容大多数的开发语言,所以保留 C 接口,为抛弃 C++ 接口做准备。
+* 修正 wkeGetCookie、wkeGetCookieW 函数没有 wkeWebView 参数的 BUG。
+* 更名 wkeGetCaret 为 wkeGetCaretRect 。
+* 修改 wkeBrowser,默认关闭代理(取消定义宏 WKE_BROWSER_USE_LOCAL_PROXY)。
+
+#### 2015-09-29 22:01 修改 wke 实现中用到的 IWebView 为 CWebView。
+* 修改实现中(如 wkeChromeClient、wkeFrameLoaderClient 等)用到的 IWebView 为 CWebView,因为实现需要知道 IWebView 之外的、具体实现相关的信息,用 IWebView 不合适。
+* 此修改为后续的实现作准备。
+
+#### 2015-09-29 21:06 合并 zhanjx1314 实现的设置 UserAgent 的功能。
+* 合并 zhanjx1314(群里(__少) 实现的设置 UserAgent 的功能。
+* 在 webBrowser 当中测试了设置 UserAgent 的功能。
+
+#### 2015-09-23 02:02 修正 JavaScriptCore 当中脚本错误导致后面调用逻辑异常。
+JSValueToXXXXX 和 JSObjectXXXX 函数族中的某些函数在转换/构造变量之后,会判断当前若有JS错误,则返回非法值。但这个错误有可能不是本次转换/构造中发生的,是由前次不相干的操作,比如某次脚本调用中的语法错误,此时返回非法值,则是不正确的。而且返回值不应该在调用完来修正,应该由被调用者来修正。
+
+#### 2015-09-18 20:28 增加代理类型 socks4、socks4a、socks5、socks5h 的支持。
+* 增加代理类型 socks4、socks4a、socks5、socks5 h的支持,接口不用修改。
+
+#### 2015-09-18 20:01 增加全局配置函数,当前只支持代理配置。
+* 增加全局配置函数 wkeConfigure,可在初始化之后执行全局性的配置操作。
+* 修改 wkeBrowser 使用 wkeConfigure 进行全局性配置。
+
+#### 2015-09-17 01:28 增加初始化时的全局配置功能,当前只支持代理配置。
+* 增加初始化函数 wkeInitializeEx,可在初始化时同时进行一些全局性地配置 。
+* 通过 wkeInitializeEx 增加代理配置功能,目前仅支持 HTTP 代理。
+* 修改 wkeBrowser 使用 wkeInitializeEx 进行初始化,并增加代理测试。
+
+#### 2015-09-07 00:23 两处小调整。
+* 修改 readme.md 。
+* 提交 release 版本的 demo/bin/wke.dll 。
+
+#### 2015-09-04 20:40 修改项目 readme 文件。
+* 增加文件 readme.md 描述项目相关信息,并在末尾附原项目 readme.txt 的内容。
+* 删除原项目 readme.txt 。
+
+#### 2015-09-04 19:56 实现 文件选择功能。
+* 实现 ChromeClient::runOpenPanel 函数,打开文件对话框,支持 multipe 属性多选文件。可通过 demo/bin/file.html 和 Document/demo/file.asp 测试。
+
+#### 2015-09-04 19:53 增加从命令行提供的URL进行加载的功能。
+* webBrowser 增加命令行支持,若有命令行参数,则将其作为URL加载。
+
+#### 2015-09-03 10:37 增加项目规范、根据规范调整命名。
+* 编写项目规范,位于 Document/rules.md,合作提交的朋友请按规范编写文档和代码。目前此规范还不完善,后续继续添加。
+* 根据 Document/rules.md 中的命名规范,以及使语法更正确、含义更清晰,作了以下命名调整:
+ - 更名 wkeClientHandler 为 wkeViewHandler(因这里的 "Client" 一词实际上是 WebKit 内部实现相关的东西,在接口中不需要)。
+ - 更名 wkeSetClientHandler 为 wkeSetHandler (去掉 Client)。
+ - 更名 IWebView::setClientHandler 为 IWebView::setHandler (去掉 Client)。
+ - 更名 IWebView::getClientHandler 为 IWebView::handler (去掉 Client、成员函数获取属性不加 get)。
+ - 更名 IWebView::cookieEnabled 为 IWebView::isCookieEnabled (获取是否属性前面加 is)。
+ - 更名 IWebView::getCaret 为 IWebView::caretRect (成员函数获取属性不加 get、使含义更明确)。
+ - 更名 IWebView::getViewDC 为 IWebView::viewDC (成员函数获取属性不加 get)。
+ - 更名 IWebView::transparent 为 IWebView::isTransparent (获取是否属性前面加 is)。
+ - 更名 IWebView::awaken 为 IWebView::wake(执行操作的函数使用动词)。
+ - 更名 IWebView::contentsHeight 为 IWebView::contentHeight(content 即可代表所有内容,无需复数)。
+ - 更名 IWebView::contentsWidth 为 IWebView::contentWidth(content 即可代表所有内容,无需复数)。
+ - 更名 IWebView::contextMenuEvent 为 IWebView::fireContextMenuEvent(使含义更准确)。
+ - 更名 IWebView::copy 为 IWebView::editorCopy (使含义更准确)。
+ - 更名 IWebView::cut 为 IWebView::editorCut (使含义更准确)。
+ - 更名 IWebView::delete_ 为 IWebView::editorDelete (使含义更准确)。
+ - 更名 IWebView::focus 为 IWebView::setFocus (使含义更准确)。
+ - 更名 IWebView::isLoadComplete 为 isLoadingCompleted (语法更准确、统一)。
+ - 更名 IWebView::isLoaded 为 isLoadingSucceeded (语法更准确、统一)。
+ - 更名 IWebView::isLoadFailed 为 isLoadingFailed (语法更准确、统一)。
+ - 更名 IWebView::keyDown 为 IWebView::fireKeyDownEvent(使含义更准确)。
+ - 更名 IWebView::keyPress 为 IWebView::fireKeyPressEvent(使含义更准确)。
+ - 更名 IWebView::keyUp 为 IWebView::fireKeyUpEvent(使含义更准确)。
+ - 更名 IWebView::mouseEvent 为 IWebView::fireMouseEvent(使含义更准确)。
+ - 更名 IWebView::mouseWheel 为 IWebView::fireMouseWheelEvent(使含义更准确)。
+ - 更名 IWebView::paste 为 IWebView::editorPaste (使含义更准确)。
+ - 更名 IWebView::selectAll 为 IWebView::editorSelectAll (使含义更准确)。
+ - 更名 IWebView::tick 为 IWebView::IWebView::repaintIfNeeded(使含义更准确)。
+ - 更名 IWebView::unfocus 为 IWebView::killFocus(使含义更准确) 。
+ - 更名 jsObjectData 为 jsData(Object 函数统一不加 Object)。
+ - 更名 jsObjectGetData 为 jsGetData(Object 函数统一不加 Object)。
+ - 更名 ON_PAINT_UPDATED 为 wkeOnPaintUpdated(类型用大驼峰命名法)。
+ - 更名 ON_TITLE_CHANGED 为 wkeOnTitleChanged(类型用大驼峰命名法)。
+ - 更名 ON_URL_CHANGED 为 wkeOnUrlChanged(类型用大驼峰命名法)。
+ - 更名 wkeInit 为 wkeInitialize (使含义更准确)。
+ - 更名 wkeShutdown 为 wkeFinalize (使含义更准确)。
+ - 更名 wkeVersion 为 wkeGetVersion(非成员函数获取数据加 get)。
+ - 更名 wkeVersionString 为 wkeGetVersionString(非成员函数获取数据加 get)。
+ - 更名 wkeTitle 为 wkeGetTitle,wkeTitleW 为 wkeGetTitleW(非成员函数获取数据加 get)。
+ - 更名 wkeWidth 为 wkdGetWidth(非成员函数获取数据加 get)。
+ - 更名 wkeHeight 为 wkdGetHeight(非成员函数获取数据加 get)。
+ - 更名 wkeWebViewName 为 wkeGetName(非成员函数获取数据加 get、WebView 相关操作函数命名统一不加 WebView)。
+ - 更名 wkeZoomFactor 为 wkeGetZoomFactor(非成员函数获取数据加 get)。
+ - 更名 wkeAwaken 为 wkeWake(wake 动词含义更准确)。
+ - 更名 wkeContentsWidth 为 wkdGetContentWidth(content 即可代表所有内容无需复数、非成员函数获取数据加 get)。
+ - 更名 wkeContentsHeight 为 wkeGetContentHeight(content 即可代表所有内容无需复数、非成员函数获取数据加 get)。
+ - 更名 wkeSelectAll 为 wkeEditorSelectAll (使含义更准确)。
+ - 更名 wkeCopy 为 wkeEditorCopy (使含义更准确)。
+ - 更名 wkeCut 为 wkeEditorCut (使含义更准确)。
+ - 更名 wkePaste 为 wkeEditorPaste (使含义更准确)。
+ - 更名 wkeFocus 为 wkeSetFocus(使含义更准确)。
+ - 更名 wkeUnfocus 为 wkeKillFocus(使含义更准确)。
+ - 更名 wkeGlobalExec 为 wkeGetGlobalExec(非成员函数获取数据加 get)。
+ - 更名 wkeIsLoadComplete 为 wkeIsLoadingCompleted (语法更准确、统一)。
+ - 更名 wkeIsLoaded 为 wkeIsLoadingSucceeded (语法更准确、统一)。
+ - 更名 wkeIsLoadFailed 为 wkeIsLoadingFailed (语法更准确、统一)。
+ - 更名 wkeMediaVolume 为 wkeGetMediaVolume(非成员函数获取数据加 get)。
+ - 更名 wkeSetWebViewName 为 wkeSetName(WebView 相关操作函数命名统一不加 WebView)。
+ - 更名 wkeCookieEnabled 为 wkeIsCookieEnabled(获取是否数据是前面加 is)。
+ - 更名 wkeGetCaret 为 wkeGetCaretRect (使含义更明确)。
+
+#### 2015-09-03 10:17 将回调全部集中到接口 wkeClientHandler 当中。
+* 去掉 wkeBufHandler,将功能合并到 wkeClientHandler 当中。
+* wkeClientHandler 中增加一个回调参数,以传递自定义参数。
+* 去掉 wkeClientHandler 的 const 属性,避免在回调处理中要需要非 const 访问时导致问题。
+
+
+#### 2015-08-31 02:13 修改 Document/history.md 的标题级别。 …
+每条记录的标题修改为四级标题,因三级在浏览器中查看太大。
+
+
+#### 2015-08-31 02:13 修改 Document/history.md 的记录格式。 …
+每条记录不再使用严格的 markdown 格式,改为直接使用提交日志的文本,但增加 markdown 三级标题。
+
+
+#### 2015-08-30 23:24 合并 zhanjx1314 实现的 POST 方式加载页面的功能。 …
+合并 zhanjx1314 实现的 wkePostURL 函数,该函数可以 POST 方式加载页面。
+
+
+#### 2015-08-30 22:59 合并 zhanjx1314 实现的获取 cookie 的功能。 …
+合并 zhanjx1314 实现的获取 cookie 的功能(wchar_t* 版本),并在其基础上增加了一个 utf8* 版本的重载,另外在 webBrowser 中增加一个菜单项测试此功能。
+
+
+#### 2015-08-30 02:00 调整 Document/history.md 标题级别(之前太大)。
+
+
+#### 2015-08-30 01:40 修正 wkeLoadURL 加载中文路径 HTML 文件失败的问题。 …
+wkeLoadURL 调用 `KURL::KURL(const KURL& base, const String& relative, const TextEncoding&)` 构造 KURL ,第二个参数传入的是 const char* 类型的 UTF-8 字符串以构造一个 WTF::String 对象,然而 WTF::String::String(const char*) 是把字符串按照 latin1 处理的,正确应该使用 WTF::String::fromUTF8 显式从 UTF-8 构造。可以用 wkeBrowser 加载 demo/bin/中文.html 测试。
+
+
+#### 2015-08-30 01:36 增加 Document/utility.md 记录一些零碎信息。
+
+
+#### 2015-08-30 01:23 修正 HTML 中图片地址包含中文时无法显示的问题。 …
+WebCore::Document::completeURL 当中构造 KURL 对象时,会调用 encodeRelativeString 将所有 URL(包括本地路径)转换为 UTF-8 编码,导致文件打开失败,显然在 Windows 上路径应该是 GBK。可用 wkeBrowser 加载 demo/bin/english.html 测试。
+
+
+#### 2015-08-30 01:26 调整 Document/history.md 记录日志的顺序,按时间从新到旧。
+
+
+#### 2015-08-30 01:19 增加 webBrowser 拖放加载 HTML 文件的功能。
+
+
+#### 2015-08-29 23:56 修正 jsSet、jsGet 始终访问的是第一次调用时的属性的问题。 …
+JSC::Identifier 内部以 JSC::UString 保存属性名称,而 JSC::UString 内部把 char* 类型字符串的指针值作为其 hash 值,虽然在一个字符串内存上设置了与前次不同的字符串内容,但因为使用了同一内存地址(指针相同), hash 值相同,会认为是同一个字符串。
+
+
+#### 2015-08-29 22:14 修改 Javascript 绑定相关的接口。 …
+* 修改 jsObject、jsArray 函数名为 jsEmptyObject、jsEmptyArray,使其名称更符合实际功能。
+* 去掉 jsFunction 函数。
+* 增加新的 jsObject、jsFunction 函数用于实现对象和函数的绑定,针对单独页面的绑定。
+* 增加 Document 目录,用于存放一些说明性的东西。
+
+
+#### 2015-08-29 21:22 合并从 SOUI 仓库获取的修改。 …
+感谢 SOUI 的作者,其主要增加了两个功能:
+* wkePaint 拷贝页面的内容图像到指定内存。
+* wkeBufHandler 当页面的内容图像更新时回调通知。
+
+
+#### 2015-08-29 21:16:57 忽略 build 目录(中间目录)。
+
+2011-09-07
+ version 1.00 released
\ No newline at end of file
diff --git a/ChangeLog.txt b/ChangeLog.txt
deleted file mode 100644
index 44657e29..00000000
--- a/ChangeLog.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-2011-09-07
- version 1.00 released
\ No newline at end of file
diff --git a/Document/One Day at WebUI Group in year 2018.md b/Document/One Day at WebUI Group in year 2018.md
new file mode 100644
index 00000000..fb93fced
--- /dev/null
+++ b/Document/One Day at WebUI Group in year 2018.md
@@ -0,0 +1,24 @@
+WebUI 群2018年的普通一天
+================
+
+2018年的普普通通的一天的早上,天气不冷不热,空气不好不坏,黄历所载,这一天也没有什么特别的吉凶趋避,日月星辰各安其份。WebUI群里已有不少人,聊着明星八卦,经济股市。
+
+中午时分,夏老师来到群里。夏老师是经过人生跌宕、遍尝过世间甘苦的老司机,其人生阅历极其丰富,而家庭势力十分庞大,遍布了共产主义和资本主义国家的各个阶层。再加上其小到婚姻情感、大到国际政治、闲谈扯谈的明星八卦、学术探讨如物理化学都能侃侃而谈,对百姓民生、国家发展也有深刻的见解,群员们一度怀疑他有可能是个间谍。今天他来到群里也不说话,先发了一张十分暴露的性感美女图片,斜靠在自家产的紫檀红木椅上,左手搭着龙头扶手,右手食指轻轻弹掉烟头的灰烬,看着群里的愣头年轻们对着美女图片发出饥渴地嗷叫,只是呵呵地微笑着。
+
+这时候群主忙过了他的事,也来到群里。群主是一名一事无成的中年人,网传他是70后,可是他身上却缺少那种经历过红尘坎坷的成熟稳重,反而有些不切实际的理想主义、完美主义、浪漫主义,喜欢看书、看电影,甚至喜欢海绵宝宝这样童真的东西。群主进到群里,在攒动的人头中一眼就看到了那张暴露的美女图片,赶紧冲过去一把扯下来,抹一抹脑门上的汗,一边责怪道:“你们又在偷偷害我!”,夏老师叭了一口烟回道:”我就知道群主不喜欢女的“,群里的人发出一阵哄笑。群主也不争辩,面对那些饥渴的愣头年轻们义正严辞地批评道:“还能不能追求点更高的人生价值了?”,说完转身舔了舔口水,小心地把美女图片卷起来揣进怀里,用手轻轻拍拍确定放好了,又转过身说道:“你们呀,一个个的工作不饱和。我去工作了”,然后带着掩饰不住的满足的微笑出去了。
+
+群主出去不久,又有一个人也来了。此人一只脚刚踏进门,群里所有人都觉得哪里不对了。喝茶打牌的、聊天扯谈的,都突然感觉群里的空气中弥漫着一种说不清楚的压力,众人也不知道发生了什么,好似有灭顶之灾将至,都停着手上的动作,僵在那里也不敢作声。有大胆一点的人,额头冒着汗,吞一吞口水,侧着眼睛硬着头皮慢慢地转头往门口看。这人往门口一看,紧绷的神经一下子放松下来,颤抖着声音大声道:”哈哈!没事了没事了!是扫地!“,虽是哈哈地说着,但是表情狰狞,余悸未消,好像刚从噩梦惊醒一般。大家好一会儿才平复了情绪,群里才又恢复了喧闹。扫地进到群里,推一推鼻上的眼镜,照常和大家谈笑风声起来。原来此人江湖人称扫地,是WebUI圈的知名的高手,其年少即以逆向功力扬名看雪,近几年来潜心修炼mb神功,已经隐隐然有开宗立派之象,其mb神功精纯,已经到天人一体的境界,因此他一只脚踏进门,大家就感觉到了他不经意间的气场压迫。
+
+扫地进群的时候,众人都在气场压迫之下如临大敌,角落里却有一个人看书的人始终自顾地执卷轻笑,丝毫不受影响。此人坐在角落里,白衣白裙,脸戴面纱,齐肩秀发,头发上束了条银带,身型婀娜,一看就是位女子,发上银带被窗外照进的阳光一映,更是熠熠生光。从身形和装束上看,这位女子方当妙龄,最多十七八岁,年纪虽轻,却又在举手投足间又透着端丽秀雅,有一种说不清楚的庄重感。她虽是WebUI群的常客,但极少与人说话,每次都在角落里独坐看书,所以也没人和她搭讪,都不敢唐突打扰,更没人见过她的面纱之后的真容,只知道她叫 Pamela。只有扫地和群主偶尔唤她萌弟,与她谈笑。
+
+慢慢地人们都去假装工作了,群里人渐渐少了,显得有点冷静。沉寂了一会儿,突然出现一声惊呼,“那么多公司裁员我才知道,为什么裁员好奇怪的事情”,只见这人整个呈土豆的形状,只有一条眉毛,眼睛很随意地长在额头两边,因吃惊而张大的嘴巴周围有些稀疏的胡渣子,他紧皱着眉头,像是遇到了什么吃惊又难以理解的事情。他左手掐着一支烟,那烟刚被抽过一口,两缕白丝从烟头缓缓上升。等了好一会儿,也没人回应他。此人是群主施展十级甄嬛技能,把他从隔壁群挖过来的,人称Hello帝,是以一己之力撑起一个群的人,无数次拯救Thinking in ReDUI群于冷清将死之境。见无人回应,他继续长大嘴巴吃惊道:“永无止境我觉得很好看为什么不拍了好奇怪的事情”,“银行为什么不用nodejs好奇怪的事情”……,在他的一声声惊呼下,群里终于又热闹起来,那些打瞌睡的、装死的、假装工作很忙的,都又进来高谈阔论起来。
+
+大家胡乱地闲扯哄笑,扯着扯着渐渐地都被吸引到了一个人身边,大家都伸头探脑地围着他听他说着什么。这人叫做兴国软件网,一身黑衣,劲装结扎,身形瘦削,眼以下都蒙着面,但是左脸上有一道粗厉的刀疤,从嘴角直到眼角,即使蒙面也遮掩不住。整个人一副精悍之气,一看就是飞檐走壁,吃江湖饭的好汉。他侧身坐着,右脚踏在旁边的一只凳子上,拎着酒壶仰头畅饮一口,一手指点着面前众人,一边说着自己从前行走江湖见过的奇人异事。Hello帝不时发出“怎么会这样好奇怪的事情”、“感觉很牛B的感叹。
+
+这边大家成群结党地扯谈哄笑,却有一人站在墙边仰头仔细看着墙上的人画,完全不为吵闹所动。只见他约莫二十岁年纪,头戴伦巾,手上拿着一卷书,背在身后,身披一件蓝色长衫,虽然穿着素简,却透出一份俊雅。他正是闻名江湖的 Redrains 少侠,他年纪虽轻但却言行稳重,虽然年少扬名,但却仍然谦虚向学,虽然常在群里,也是极少说话,从不和人谈笑,只偶尔在有人遇到难题的时候出来,帮人指点解惑。
+
+左墙上挂着一列人画,从左至右,一共有七八副。最左边一副人画似乎被人破坏过,画上的人像和文字都模糊不清,但是既然排最左边,想必是来历不凡。第二副画,人物也很模糊,但文字很清晰,Redrains 仔细看那画上文字,“BlzFans。BlzFans 是 wke 项目的奠基者。此位大侠功力深不可测然而为人极低调,将 wke 项目甩给开源界之后,从容离开去实现自己更高的人生价值了,挥一挥衣袖,不带走一声膜拜。感谢他的努力,如今我们除了在他开凿的道路上逶迤前进,也希望有一天他能够再次回到 WebUI 的队伍中来,带我们直接飞往 WebUI 技术的巅峰。”,Redrains 知道 wke 的份量,忍不住点头赞叹。
+
+他又跳到第三副人画,画上却是一只巨大的蚂蚁长着人头。文字写着“蚂蚁大师。蚂蚁大师是曾经 WebUI 群的中坚技术力量,久经杀场,经验丰富,上能架构集群,下能逆向驱动。蚂蚁大师不仅解决了困扰我们已久的 wke 绘制慢的问题,还在 wke 上实现了人民呼声很高的 websocket 功能,还身怀 ewe 神功,其真实功力深不可测。只可惜,2018 年蚂蚁大师已久无音讯。今年国家动荡,数次扫黄打非、打击传销,江湖险恶,蚂蚁大师可能已遭不测”。看到这里,Redrains 只得摇头感叹。
+
+Redrains 少侠看了好一阵墙上的人画了,时而点头赞叹,时而颌首深思,时而又对着人画作揖致敬。
\ No newline at end of file
diff --git a/Document/One Day at WebUI Group in year 2018.txt b/Document/One Day at WebUI Group in year 2018.txt
new file mode 100644
index 00000000..8b440ca8
--- /dev/null
+++ b/Document/One Day at WebUI Group in year 2018.txt
@@ -0,0 +1,16 @@
+2018年的普普通通的一天的早上,天气不冷不热,空气不好不坏,黄历所载,这一天也没有什么特别的吉凶趋避,日月星辰各安其份。WebUI群里已有不少人,聊着明星八卦,经济股市。
+
+中午时分,夏老师来到群里。夏老师是经过人生跌宕、遍尝过世间甘苦的老司机,其人生阅历极其丰富,而家庭势力十分庞大,遍布了共产主义和资本主义国家的各个阶层。再加上其小到婚姻情感、大到国际政治、闲谈扯谈的明星八卦、学术探讨如物理化学都能侃侃而谈,对百姓民生、国家发展也有深刻的见解,群员们一度怀疑他有可能是个间谍。今天他来到群里也不说话,先发了一张十分暴露的性感美女图片,斜靠在自家产的紫檀红木椅上,左手搭着龙头扶手,右手食指轻轻弹掉烟头的灰烬,看着群里的愣头年轻们对着美女图片发出饥渴地嗷叫,只是呵呵地微笑着。
+
+这时候群主忙过了他的事,也来到群里。群主是一名一事无成的中年人,网传他是70后,可是他身上却缺少那种经历过红尘坎坷的成熟稳重,反而有些不切实际的理想主义、完美主义、浪漫主义,喜欢看书、看电影,甚至喜欢海绵宝宝这样童真的东西。群主进到群里,在攒动的人头中一眼就看到了那张暴露的美女图片,赶紧冲过去一把扯下来,抹一抹脑门上的汗,一边责怪道:“你们又在偷偷害我!”,夏老师叭了一口烟回道:”我就知道群主不喜欢女的“,群里的人发出一阵哄笑。群主也不争辩,面对那些饥渴的愣头年轻们义正严辞地批评道:“还能不能追求点更高的人生价值了?”,说完转身舔了舔口水,小心地把美女图片卷起来揣进怀里,用手轻轻拍拍确定放好了,又转过身说道:“你们呀,一个个的工作不饱和。我去工作了”,然后带着掩饰不住的满足的微笑出去了。
+
+群主出去不久,又有一个人也来了。此人一只脚刚踏进门,群里所有人都觉得哪里不对了。喝茶打牌的、聊天扯谈的,都突然感觉群里的空气中弥漫着一种说不清楚的压力,众人也不知道发生了什么,好似有灭顶之灾将至,都停着手上的动作,僵在那里也不敢作声。有大胆一点的人,额头冒着汗,吞一吞口水,侧着眼睛硬着头皮慢慢地转头往门口看。这人往门口一看,紧绷的神经一下子放松下来,颤抖着声音大声道:”哈哈!没事了没事了!是扫地!“,虽是哈哈地说着,但是表情狰狞,余悸未消,好像刚从噩梦惊醒一般。大家好一会儿才平复了情绪,群里才又恢复了喧闹。扫地进到群里,推一推鼻上的眼镜,照常和大家谈笑风声起来。原来此人江湖人称扫地,是WebUI圈的知名的高手,其年少即以逆向功力扬名看雪,近几年来潜心修炼mb神功,已经隐隐然有开宗立派之象,其mb神功精纯,已经到天人一体的境界,因此他一只脚踏进门,大家就感觉到了他不经意间的气场压迫。
+
+扫地进群的时候,众人都在气场压迫之下如临大敌,角落里却有一个人看书的人始终自顾地执卷轻笑,丝毫不受影响。此人坐在角落里,白衣白裙,脸戴面纱,齐肩秀发,头发上束了条银带,身型婀娜,一看就是位女子,发上银带被窗外照进的阳光一映,更是熠熠生光。从身形和装束上看,这位女子方当妙龄,最多十七八岁,年纪虽轻,却又在举手投足间又透着端丽秀雅,有一种说不清楚的庄重感。她虽是WebUI群的常客,但极少与人说话,每次都在角落里独坐看书,所以也没人和她搭讪,都不敢唐突打扰,更没人见过她的面纱之后的真容,只知道她叫 Pamela。只有扫地和群主偶尔唤她萌弟,与她谈笑。
+
+慢慢地人们都去假装工作了,群里人渐渐少了,显得有点冷静。沉寂了一会儿,突然出现一声惊呼,“那么多公司裁员我才知道,为什么裁员好奇怪的事情”,只见这人整个呈土豆的形状,只有一条眉毛,眼睛很随意地长在额头两边,因吃惊而张大的嘴巴周围有些稀疏的胡渣子,他紧皱着眉头,像是遇到了什么吃惊又难以理解的事情。他左手掐着一支烟,那烟刚被抽过一口,两缕白丝从烟头缓缓上升。等了好一会儿,也没人回应他。此人是群主施展十级甄嬛技能,把他从隔壁群挖过来的,人称Hello帝,是以一己之力撑起一个群的人,无数次拯救Thinking in ReDUI群于冷清将死之境。见无人回应,他继续长大嘴巴吃惊道:“永无止境我觉得很好看为什么不拍了好奇怪的事情”,“银行为什么不用nodejs好奇怪的事情”……,在他的一声声惊呼下,群里终于又热闹起来,那些打瞌睡的、装死的、假装工作很忙的,都又进来高谈阔论起来。
+
+大家胡乱地闲扯哄笑,扯着扯着渐渐地都被吸引到了一个人身边,大家都伸头探脑地围着他听他说着什么。这人叫做兴国软件网,一身黑衣,劲装结扎,身形瘦削,眼以下都蒙着面,但是左脸上有一道粗厉的刀疤,从嘴角直到眼角,即使蒙面也遮掩不住。整个人一副精悍之气,一看就是飞檐走壁,吃江湖饭的好汉。他侧身坐着,右脚踏在旁边的一只凳子上,拎着酒壶仰头畅饮一口,一手指点着面前众人,一边说着自己从前行走江湖见过的奇人异事。Hello帝不时发出“怎么会这样好奇怪的事情”、“感觉很牛B的感叹。
+
+
+
diff --git a/Document/rules.md b/Document/rules.md
new file mode 100644
index 00000000..d9447136
--- /dev/null
+++ b/Document/rules.md
@@ -0,0 +1,135 @@
+wke 项目规范
+===========================
+
+目的
+----
+
+wke 对于研究 WebKit 是一个很好的项目,同时也可以作为网页的渲染引擎用于实际工程。目前原作者已经停止维护此项目,我个人 fork 出来自行维护,但希望有更多的人来参与研究、维护。为了此项目的长期良好地发展,有必要编写一份规范文档,以后的所有代码、文档、提交都应该按照此规范进行。
+
+目录
+----
+
+- [文档规范](#document-rules)
+- [代码规范](#coding-rules)
+ - [命名规范](#code-naming)
+ - [总体规范](#code-naming-summary)
+ - [类型(类、结构体等)](#code-naming-type)
+ - [变量(变量、函数等)](#code-naming-variable)
+ - [常量(常量、宏等)](#code-naming-constant)
+ - [排版规范](#code-formating)
+ - [缩进](#code-formating-indent)
+ - [换行](#code-formating-newline)
+ - [空格](#code-formating-whitespace)
+
+----
+
+### 文档规范
+
+中文文档中的描述部分涉及的标点,应该使用中文全角。
+
+### 代码规范:
+
+#### 命名规范
+
+##### 总体规范
+
+代码命名中应该尽量包含被命名实体的的功能性说明,不必包含它的类型信息,因为前者更能帮助阅读者理解整体代码。禁止使用匈牙利命名法。举例:
+正确的命名:
+
+```
+class Student;
+void study(Student* student);
+void doHomeWork(Student* student);
+```
+错误的命名:
+
+```
+class ClassStudent; //不需要包含类型信息。
+void functionStudy(ClassStudent* pClassStudent); //不需要包含类型信息。。
+void functionDoWork(ClassStudent* pClassStudent); //不需要包含类型信息。
+```
+
+代码命名中涉及的单词应该避免缩写,除非名字包含的单词太多、某个单词特别长,或者该缩写是行业或团队通用的、常用的缩写,举例:
+正确的命名:
+
+```
+class Student;
+void study(Student* student);
+void doHomeWork(Student* student);
+double cpuUseage();
+```
+
+错误的命名:
+
+```
+class Stu; //不必要的缩写。
+void study(Stu* s); //参数命名太简单,没有任何说明意义。
+void work(Stu* student); //函数命名意义不明确。
+double centralProcessingUnitUsage(); //应该使用公用的缩写。
+```
+
+
+##### 类型(类、结构体、枚举、函数指针类型等)命名
+
+类型(类类型、结构体类型、枚举类型、函数指针类型等)的命名,使用大驼峰命名法(little camel-case),即:命名中的所有单词(或单词缩写,后面统称单词)第一个字母大写,单词之间紧靠排列(不用间隔符,如下划线)例如:
+
+```
+class SomeClass;
+class SomeLongNameClass;
+enum SomeEnum;
+typedef void (*SomeFuncPointer)();
+```
+
+##### 变量、函数命名
+
+变量、函数的命名,使用小驼峰命名法(little camel-case),即:命名中的第一个单词全部小写,后续单词第一字母大写开始单词中的其余字母小写,单词之间紧靠排列(不用间隔符,如下划线)例如:
+
+
+```
+void someFunction();
+void someLongNameFunction();
+int someVariable;
+int someLongNameVariable;
+```
+
+根据函数的作用,函数命名应该进一步规范:
+
+- 若函数(包括成员函数和非成员函数)是执行操作,则直接以动作、功能的单词命名,如`doHomeWork`、`reportGrade`。
+- 若函数(包括成员函数和非成员函数)的功能是设置数据,则以`set`开头,并紧根要设置数据的名称,如`setNickName`。
+- 若成员函数的功能是获取成员数据,则直接以要获取的实体名称命名,如`Student::nickName`、`Student::grade`。
+- 若非成员函数的功能是获取数据,则使用`get`开头,并紧跟要获取数据的名称,如`getNickName`。
+- 若非成员函数的功能是获取 是/否 数据,则使用`is`开始,并紧跟要获取数据的名称,如`isEnglishPassed`
+
+
+##### 宏、常量、枚等命名
+
+宏、常量 、枚举的命名,使用全大写单词加下划线相连,如:
+
+```
+#define SOME_CONST_VALUE 123
+const int SOME_CONST_VALUE = 123;
+enum SomeEnum
+{
+ SOME_VALUE_1,
+ SOME_VALUE_2
+};
+```
+
+#### 排版规范
+
+##### 缩进规范
+
+缩进应该使用4个空格,以避免使用 TAB 时在不同编辑器中缩进混乱。
+
+##### 换行规范
+
+起始大括号应该换行再写。
+
+##### 空格规范
+
+- `if`、`while`、`for`之类的关键字之后空格再跟括号,如`if (...)`、`for (...)`、`while (...)`。
+- 标点之后加一个空格分隔实体,如`a, b, c`、`for (...; ...; ...)`、`a || b && c`。
+- 括号内第一个字符之前,最后一个字符之后不需要空格,如`(a)`,`(a, b, c)`。
+
+
+**待补充**
\ No newline at end of file
diff --git a/Document/tips.md b/Document/tips.md
new file mode 100644
index 00000000..af08aa00
--- /dev/null
+++ b/Document/tips.md
@@ -0,0 +1,4 @@
+## 测试绑定对象功能
+运行wkeWebBrowser.exe,在地址栏输入`inject`回车,即可注册JS对象`test`,注册后就JS中可访问`test`对象的成员变量`value`和成员函数`msgbox`了。
+在地址栏输入`javascript:test.msgbox('1')`测试调用成员函数。
+在地址栏输入`javascript:document.write(test.value)`测试访问成员变量。
\ No newline at end of file
diff --git a/Document/todo.md b/Document/todo.md
new file mode 100644
index 00000000..05318d7d
--- /dev/null
+++ b/Document/todo.md
@@ -0,0 +1,5 @@
+### HTTP_PROXY 的问题
+牧草(920370262) 提出的问题:wke 默认使用使用 HTTP_PROXY 环境变量设置的代理服务器连接,但现在使用 HTTP_PROXY 指定的 socks5 代理连接有问题。
+
+### Cookie相关问题
+wke 目前 cookie 只能获取手动保存。需要增加自动保存到文件、并自动从文件恢复的功能。
\ No newline at end of file
diff --git a/Document/utility.md b/Document/utility.md
new file mode 100644
index 00000000..b96d088d
--- /dev/null
+++ b/Document/utility.md
@@ -0,0 +1,51 @@
+### URL中文编码转换流程
+ KURL::KURI
+ KURL::init
+ KURL.cpp::encodeRelativeString
+ TextEncoding::encode
+ TextEncodingICU::encode
+
+### 解析HTML、生成tag、处理tag属性、处理URL编码的调用堆栈。
+
+ wke.dll!WebCore::TextCodecUTF8::encode(const wchar_t * characters=0x0028e05c, unsigned int length=6, WebCore::UnencodableHandling __formal=URLEncodedEntitiesForUnencodables) 行309 C++
+ wke.dll!WebCore::TextEncoding::encode(const wchar_t * characters=0x0028e05c, unsigned int length=6, WebCore::UnencodableHandling handling=URLEncodedEntitiesForUnencodables) 行107 + 0x39 字节 C++
+ wke.dll!WebCore::encodeRelativeString(const WTF::String & rel={...}, const WebCore::TextEncoding & encoding={...}, WTF::Vector & output={...}) 行1686 C++
+ wke.dll!WebCore::KURL::init(const WebCore::KURL & base={...}, const WTF::String & relative={...}, const WebCore::TextEncoding & encoding={...}) 行393 + 0x14 字节 C++
+ wke.dll!WebCore::KURL::KURL(const WebCore::KURL & base={...}, const WTF::String & relative={...}, const WebCore::TextEncoding & encoding={...}) 行353 C++
+ wke.dll!WebCore::Document::completeURL(const WTF::String & url={...}) 行3754 + 0x26 字节 C++
+ wke.dll!WebCore::ImageLoader::updateFromElement() 行167 + 0x31 字节 C++
+ wke.dll!WebCore::ImageLoader::updateFromElementIgnoringPreviousError() 行228 C++
+ wke.dll!WebCore::HTMLImageElement::parseMappedAttribute(WebCore::Attribute * attr=0x02328558) 行107 + 0xb 字节 C++
+ wke.dll!WebCore::StyledElement::attributeChanged(WebCore::Attribute * attr=0x02328558, bool preserveDecls=false) 行189 + 0x16 字节 C++
+ wke.dll!WebCore::Element::setAttributeMap(WTF::PassRefPtr list={...}, WebCore::FragmentScriptingPermission scriptingPermission=FragmentScriptingAllowed) 行834 + 0x1d 字节 C++
+ wke.dll!WebCore::HTMLConstructionSite::createHTMLElement(WebCore::AtomicHTMLToken & token={...}) 行384 C++
+ wke.dll!WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement(WebCore::AtomicHTMLToken & token={...}) 行299 + 0x10 字节 C++
+ wke.dll!WebCore::HTMLTreeBuilder::processStartTagForInBody(WebCore::AtomicHTMLToken & token={...}) 行911 C++
+ wke.dll!WebCore::HTMLTreeBuilder::processStartTag(WebCore::AtomicHTMLToken & token={...}) 行1231 C++
+ wke.dll!WebCore::HTMLTreeBuilder::processToken(WebCore::AtomicHTMLToken & token={...}) 行482 C++
+ wke.dll!WebCore::HTMLTreeBuilder::constructTreeFromAtomicToken(WebCore::AtomicHTMLToken & token={...}) 行467 C++
+ wke.dll!WebCore::HTMLTreeBuilder::constructTreeFromToken(WebCore::HTMLToken & rawToken={...}) 行454 C++
+ wke.dll!WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode mode=AllowYield) 行279 C++
+ wke.dll!WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode mode=AllowYield) 行178 C++
+ wke.dll!WebCore::HTMLDocumentParser::append(const WebCore::SegmentedString & source={...}) 行372 C++
+ wke.dll!WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter * writer=0x0231f344, const char * data=0x023b0474, unsigned int length=174) 行50 + 0x1f 字节 C++
+ wke.dll!WebCore::DocumentWriter::addData(const char * bytes=0x023b0474, unsigned int length=174) 行206 + 0x29 字节 C++
+ wke.dll!WebCore::DocumentLoader::commitData(const char * bytes=0x023b0474, unsigned int length=174) 行318 C++
+ wke.dll!wke::FrameLoaderClient::committedLoad(WebCore::DocumentLoader * loader=0x0231f278, const char * data=0x023b0474, int length=174) 行335 C++
+ wke.dll!WebCore::DocumentLoader::commitLoad(const char * data=0x023b0474, int length=174) 行303 + 0x29 字节 C++
+ wke.dll!WebCore::DocumentLoader::receivedData(const char * data=0x023b0474, int length=174) 行330 C++
+ wke.dll!WebCore::MainResourceLoader::addData(const char * data=0x023b0474, int length=174, bool allAtOnce=false) 行169 C++
+ wke.dll!WebCore::ResourceLoader::didReceiveData(const char * data=0x023b0474, int length=174, __int64 encodedDataLength=0, bool allAtOnce=false) 行287 + 0x1c 字节 C++
+ wke.dll!WebCore::MainResourceLoader::didReceiveData(const char * data=0x023b0474, int length=174, __int64 encodedDataLength=0, bool allAtOnce=false) 行468 C++
+ wke.dll!WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle * __formal=0x0236ba78, const char * data=0x023b0474, int length=174, int encodedDataLength=0) 行441 + 0x1f 字节 C++
+ wke.dll!WebCore::writeCallback(void * ptr=0x023b0474, unsigned int size=1, unsigned int nmemb=174, void * data=0x0236ba78) 行212 + 0x28 字节 C++
+ wke.dll!_Curl_client_write() + 0xbb 字节 C
+ wke.dll!_libcurl_set_file_system() + 0x6f4 字节 C
+ wke.dll!_Curl_do() + 0x2f 字节 C
+ wke.dll!_curl_multi_remove_handle() + 0x76a 字节 C
+ wke.dll!_curl_multi_perform() + 0x92 字节 C
+ wke.dll!WebCore::ResourceHandleManager::downloadTimerCallback(WebCore::Timer * timer=0x02368b70) 行371 + 0x13 字节 C++
+ wke.dll!WebCore::Timer::fired() 行100 + 0x23 字节 C++
+ wke.dll!WebCore::ThreadTimers::sharedTimerFiredInternal() 行115 + 0xf 字节 C++
+ wke.dll!WebCore::ThreadTimers::sharedTimerFired() 行94 C++
+ wke.dll!WebCore::TimerWindowWndProc(HWND__ * hWnd=0x003c1ab0, unsigned int message=50733, unsigned int wParam=0, long lParam=0) 行103 + 0x8 字节 C++
diff --git a/Source/JavaScriptCore/API/JSObjectRef.cpp b/Source/JavaScriptCore/API/JSObjectRef.cpp
index 5b97fbf4..39d7ef5f 100644
--- a/Source/JavaScriptCore/API/JSObjectRef.cpp
+++ b/Source/JavaScriptCore/API/JSObjectRef.cpp
@@ -129,7 +129,8 @@ JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned pa
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return toRef(result);
}
@@ -153,7 +154,8 @@ JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSVa
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return toRef(result);
@@ -173,7 +175,8 @@ JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSVal
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return toRef(result);
@@ -192,7 +195,8 @@ JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSVa
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return toRef(result);
@@ -212,7 +216,8 @@ JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSV
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return toRef(result);
@@ -445,7 +450,8 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return result;
}
@@ -477,7 +483,8 @@ JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- result = 0;
+ //cexer ǷֵӦڱɴʱͷأӦɵɡ
+ //result = 0;
}
return result;
}
diff --git a/Source/JavaScriptCore/API/JSValueRef.cpp b/Source/JavaScriptCore/API/JSValueRef.cpp
index 95116d77..6e482648 100644
--- a/Source/JavaScriptCore/API/JSValueRef.cpp
+++ b/Source/JavaScriptCore/API/JSValueRef.cpp
@@ -251,7 +251,8 @@ JSStringRef JSValueCreateJSONString(JSContextRef ctx, JSValueRef apiValue, unsig
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- return 0;
+ //cexer ǷֵӦڱɴʱɣӦɵɡ
+ //return 0;
}
return OpaqueJSString::create(result).leakRef();
}
@@ -277,7 +278,8 @@ double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- number = std::numeric_limits::quiet_NaN();
+ //cexer ǷֵӦڱɴʱɣӦɵɡ
+ //number = std::numeric_limits::quiet_NaN();
}
return number;
}
@@ -294,7 +296,8 @@ JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef*
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- stringRef.clear();
+ //cexer ǷֵӦڱɴʱɣӦɵɡ
+ //stringRef.clear();
}
return stringRef.release().leakRef();
}
@@ -311,7 +314,8 @@ JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exce
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
- objectRef = 0;
+ //cexer ǷֵӦڱɴʱɣӦɵɡ
+ //objectRef = 0;
}
return objectRef;
}
diff --git a/Source/JavaScriptCore/heap/AllocationSpace.h b/Source/JavaScriptCore/heap/AllocationSpace.h
index 052c791c..94332c74 100644
--- a/Source/JavaScriptCore/heap/AllocationSpace.h
+++ b/Source/JavaScriptCore/heap/AllocationSpace.h
@@ -44,7 +44,7 @@ class AllocationSpace {
{
}
- typedef HashSet::iterator BlockIterator;
+ typedef HashSet::const_iterator BlockIterator;
MarkedBlockSet& blocks() { return m_blocks; }
MarkedSpace::SizeClass& sizeClassFor(size_t bytes) { return m_markedSpace.sizeClassFor(bytes); }
diff --git a/Source/JavaScriptCore/parser/JSParser.cpp b/Source/JavaScriptCore/parser/JSParser.cpp
index 59bff314..fa3c0fb0 100644
--- a/Source/JavaScriptCore/parser/JSParser.cpp
+++ b/Source/JavaScriptCore/parser/JSParser.cpp
@@ -739,8 +739,8 @@ class JSParser {
void copyCapturedVariablesToVector(const IdentifierSet& capturedVariables, Vector >& vector)
{
- IdentifierSet::iterator end = capturedVariables.end();
- for (IdentifierSet::iterator it = capturedVariables.begin(); it != end; ++it) {
+ IdentifierSet::const_iterator end = capturedVariables.end();
+ for (IdentifierSet::const_iterator it = capturedVariables.begin(); it != end; ++it) {
if (m_declaredVariables.contains(*it))
continue;
vector.append(*it);
diff --git a/Source/JavaScriptCore/wtf/HashSet.h b/Source/JavaScriptCore/wtf/HashSet.h
index 2b0c88f7..0b06dd7b 100644
--- a/Source/JavaScriptCore/wtf/HashSet.h
+++ b/Source/JavaScriptCore/wtf/HashSet.h
@@ -26,232 +26,259 @@
namespace WTF {
- template class HashSet;
- template
- void deleteAllValues(const HashSet&);
- template
- void fastDeleteAllValues(const HashSet&);
-
- template struct IdentityExtractor;
-
- template::Hash,
- typename TraitsArg = HashTraits > class HashSet {
- WTF_MAKE_FAST_ALLOCATED;
- private:
- typedef HashArg HashFunctions;
- typedef TraitsArg ValueTraits;
-
- public:
- typedef typename ValueTraits::TraitType ValueType;
-
- private:
- typedef HashTable,
- HashFunctions, ValueTraits, ValueTraits> HashTableType;
-
- public:
- typedef HashTableConstIteratorAdapter iterator;
- typedef HashTableConstIteratorAdapter const_iterator;
-
- void swap(HashSet&);
-
- int size() const;
- int capacity() const;
- bool isEmpty() const;
-
- iterator begin() const;
- iterator end() const;
-
- iterator find(const ValueType&) const;
- bool contains(const ValueType&) const;
-
- // An alternate version of find() that finds the object by hashing and comparing
- // with some other type, to avoid the cost of type conversion. HashTranslator
- // must have the following function members:
- // static unsigned hash(const T&);
- // static bool equal(const ValueType&, const T&);
- template iterator find(const T&) const;
- template bool contains(const T&) const;
-
- // The return value is a pair of an interator to the new value's location,
- // and a bool that is true if an new entry was added.
- pair add(const ValueType&);
-
- // An alternate version of add() that finds the object by hashing and comparing
- // with some other type, to avoid the cost of type conversion if the object is already
- // in the table. HashTranslator must have the following function members:
- // static unsigned hash(const T&);
- // static bool equal(const ValueType&, const T&);
- // static translate(ValueType&, const T&, unsigned hashCode);
- template pair add(const T&);
-
- void remove(const ValueType&);
- void remove(iterator);
- void clear();
-
- private:
- friend void deleteAllValues<>(const HashSet&);
- friend void fastDeleteAllValues<>(const HashSet&);
-
- HashTableType m_impl;
- };
-
- template struct IdentityExtractor {
- static const T& extract(const T& t) { return t; }
- };
-
- template
- struct HashSetTranslatorAdapter {
- static unsigned hash(const T& key) { return Translator::hash(key); }
- static bool equal(const ValueType& a, const T& b) { return Translator::equal(a, b); }
- static void translate(ValueType& location, const T& key, const T&, unsigned hashCode)
- {
- Translator::translate(location, key, hashCode);
- }
- };
-
- template
- inline void HashSet::swap(HashSet& other)
- {
- m_impl.swap(other.m_impl);
- }
-
- template
- inline int HashSet::size() const
- {
- return m_impl.size();
- }
-
- template
- inline int HashSet::capacity() const
- {
- return m_impl.capacity();
- }
-
- template
- inline bool HashSet::isEmpty() const
- {
- return m_impl.isEmpty();
- }
-
- template
- inline typename HashSet::iterator HashSet::begin() const
- {
- return m_impl.begin();
- }
-
- template
- inline typename HashSet::iterator HashSet::end() const
- {
- return m_impl.end();
- }
-
- template
- inline typename HashSet::iterator HashSet::find(const ValueType& value) const
- {
- return m_impl.find(value);
- }
-
- template
- inline bool HashSet::contains(const ValueType& value) const
- {
- return m_impl.contains(value);
- }
-
- template
- template
- typename HashSet::iterator
- inline HashSet::find(const T& value) const
- {
- typedef HashSetTranslatorAdapter Adapter;
- return m_impl.template find(value);
- }
-
- template
- template
- inline bool HashSet::contains(const T& value) const
- {
- typedef HashSetTranslatorAdapter Adapter;
- return m_impl.template contains(value);
- }
-
- template
- inline pair::iterator, bool> HashSet::add(const ValueType& value)
- {
- return m_impl.add(value);
- }
-
- template
- template
- inline pair::iterator, bool>
- HashSet::add(const T& value)
- {
- typedef HashSetTranslatorAdapter Adapter;
- return m_impl.template addPassingHashCode(value, value);
- }
-
- template
- inline void HashSet::remove(iterator it)
- {
- if (it.m_impl == m_impl.end())
- return;
- m_impl.internalCheckTableConsistency();
- m_impl.removeWithoutEntryConsistencyCheck(it.m_impl);
- }
-
- template
- inline void HashSet::remove(const ValueType& value)
- {
- remove(find(value));
- }
-
- template
- inline void HashSet::clear()
- {
- m_impl.clear();
- }
-
- template
- void deleteAllValues(HashTableType& collection)
- {
- typedef typename HashTableType::const_iterator iterator;
- iterator end = collection.end();
- for (iterator it = collection.begin(); it != end; ++it)
- delete *it;
- }
-
- template
- inline void deleteAllValues(const HashSet& collection)
- {
- deleteAllValues::ValueType>(collection.m_impl);
- }
-
- template
- void fastDeleteAllValues(HashTableType& collection)
- {
- typedef typename HashTableType::const_iterator iterator;
- iterator end = collection.end();
- for (iterator it = collection.begin(); it != end; ++it)
- fastDelete(*it);
- }
-
- template
- inline void fastDeleteAllValues(const HashSet& collection)
- {
- fastDeleteAllValues::ValueType>(collection.m_impl);
- }
-
- template
- inline void copyToVector(const HashSet& collection, W& vector)
- {
- typedef typename HashSet::const_iterator iterator;
-
- vector.resize(collection.size());
-
- iterator it = collection.begin();
- iterator end = collection.end();
- for (unsigned i = 0; it != end; ++it, ++i)
- vector[i] = *it;
- }
+ template class HashSet;
+ template
+ void deleteAllValues(const HashSet&);
+ template
+ void fastDeleteAllValues(const HashSet&);
+
+ template struct IdentityExtractor;
+
+ template::Hash,
+ typename TraitsArg = HashTraits > class HashSet {
+ WTF_MAKE_FAST_ALLOCATED;
+ private:
+ typedef HashArg HashFunctions;
+ typedef TraitsArg ValueTraits;
+
+ public:
+ typedef typename ValueTraits::TraitType ValueType;
+
+ private:
+ typedef HashTable,
+ HashFunctions, ValueTraits, ValueTraits> HashTableType;
+
+ public:
+ typedef HashTableIteratorAdapter iterator;
+ typedef HashTableConstIteratorAdapter const_iterator;
+
+ void swap(HashSet&);
+
+ int size() const;
+ int capacity() const;
+ bool isEmpty() const;
+
+ iterator begin();
+ iterator end();
+ const_iterator begin() const;
+ const_iterator end() const;
+
+ iterator find(const ValueType&);
+ const_iterator find(const ValueType&) const;
+ bool contains(const ValueType&) const;
+
+ // An alternate version of find() that finds the object by hashing and comparing
+ // with some other type, to avoid the cost of type conversion. HashTranslator
+ // must have the following function members:
+ // static unsigned hash(const T&);
+ // static bool equal(const ValueType&, const T&);
+ template iterator find(const T&);
+ template const_iterator find(const T&) const;
+ template bool contains(const T&) const;
+
+ // The return value is a pair of an interator to the new value's location,
+ // and a bool that is true if an new entry was added.
+ pair add(const ValueType&);
+
+ // An alternate version of add() that finds the object by hashing and comparing
+ // with some other type, to avoid the cost of type conversion if the object is already
+ // in the table. HashTranslator must have the following function members:
+ // static unsigned hash(const T&);
+ // static bool equal(const ValueType&, const T&);
+ // static translate(ValueType&, const T&, unsigned hashCode);
+ template pair add(const T&);
+
+ void remove(const ValueType&);
+ void remove(iterator);
+ void clear();
+
+ private:
+ friend void deleteAllValues<>(const HashSet&);
+ friend void fastDeleteAllValues<>(const HashSet&);
+
+ HashTableType m_impl;
+ };
+
+ template struct IdentityExtractor {
+ static const T& extract(const T& t) { return t; }
+ };
+
+ template
+ struct HashSetTranslatorAdapter {
+ static unsigned hash(const T& key) { return Translator::hash(key); }
+ static bool equal(const ValueType& a, const T& b) { return Translator::equal(a, b); }
+ static void translate(ValueType& location, const T& key, const T&, unsigned hashCode)
+ {
+ Translator::translate(location, key, hashCode);
+ }
+ };
+
+ template
+ inline void HashSet::swap(HashSet& other)
+ {
+ m_impl.swap(other.m_impl);
+ }
+
+ template
+ inline int HashSet::size() const
+ {
+ return m_impl.size();
+ }
+
+ template
+ inline int HashSet::capacity() const
+ {
+ return m_impl.capacity();
+ }
+
+ template
+ inline bool HashSet::isEmpty() const
+ {
+ return m_impl.isEmpty();
+ }
+
+ template
+ inline typename HashSet::iterator HashSet::begin()
+ {
+ return m_impl.begin();
+ }
+
+ template
+ inline typename HashSet::iterator HashSet::end()
+ {
+ return m_impl.end();
+ }
+
+ template
+ inline typename HashSet::const_iterator HashSet::begin() const
+ {
+ return m_impl.begin();
+ }
+ template
+ inline typename HashSet::const_iterator HashSet::end() const
+ {
+ return m_impl.end();
+ }
+ template
+ inline typename HashSet::iterator HashSet::find(const ValueType& value)
+ {
+ return m_impl.find(value);
+ }
+ template
+ inline typename HashSet::const_iterator HashSet::find(const ValueType& value) const
+ {
+ return m_impl.find(value);
+ }
+
+ template
+ inline bool HashSet::contains(const ValueType& value) const
+ {
+ return m_impl.contains(value);
+ }
+
+ template
+ template
+ typename HashSet::iterator
+ inline HashSet::find(const T& value)
+ {
+ typedef HashSetTranslatorAdapter Adapter;
+ return m_impl.template find(value);
+ }
+ template
+ template
+ typename HashSet::const_iterator
+ inline HashSet::find(const T& value) const
+ {
+ typedef HashSetTranslatorAdapter Adapter;
+ return m_impl.template find(value);
+ }
+
+ template
+ template
+ inline bool HashSet::contains(const T& value) const
+ {
+ typedef HashSetTranslatorAdapter Adapter;
+ return m_impl.template contains(value);
+ }
+
+ template
+ pair::iterator, bool> HashSet::add(const ValueType& value)
+ {
+ return m_impl.add(value);
+ }
+
+ template
+ template
+ inline pair::iterator, bool>
+ HashSet::add(const T& value)
+ {
+ typedef HashSetTranslatorAdapter Adapter;
+ return m_impl.template addPassingHashCode(value, value);
+ }
+
+ template
+ inline void HashSet::remove(iterator it)
+ {
+ if (it.m_impl == m_impl.end())
+ return;
+ m_impl.internalCheckTableConsistency();
+ m_impl.removeWithoutEntryConsistencyCheck(it.m_impl);
+ }
+
+ template
+ inline void HashSet::remove(const ValueType& value)
+ {
+ remove(find(value));
+ }
+
+ template
+ inline void HashSet::clear()
+ {
+ m_impl.clear();
+ }
+
+ template
+ void deleteAllValues(HashTableType& collection)
+ {
+ typedef typename HashTableType::const_iterator iterator;
+ iterator end = collection.end();
+ for (iterator it = collection.begin(); it != end; ++it)
+ delete *it;
+ }
+
+ template
+ inline void deleteAllValues(const HashSet& collection)
+ {
+ deleteAllValues::ValueType>(collection.m_impl);
+ }
+
+ template
+ void fastDeleteAllValues(HashTableType& collection)
+ {
+ typedef typename HashTableType::const_iterator iterator;
+ iterator end = collection.end();
+ for (iterator it = collection.begin(); it != end; ++it)
+ fastDelete(*it);
+ }
+
+ template
+ inline void fastDeleteAllValues(const HashSet& collection)
+ {
+ fastDeleteAllValues::ValueType>(collection.m_impl);
+ }
+
+ template
+ inline void copyToVector(const HashSet& collection, W& vector)
+ {
+ typedef typename HashSet::const_iterator iterator;
+
+ vector.resize(collection.size());
+
+ iterator it = collection.begin();
+ iterator end = collection.end();
+ for (unsigned i = 0; it != end; ++it, ++i)
+ vector[i] = *it;
+ }
} // namespace WTF
diff --git a/Source/JavaScriptCore/wtf/MathExtras.h b/Source/JavaScriptCore/wtf/MathExtras.h
index 0b454ce7..5e6b734c 100644
--- a/Source/JavaScriptCore/wtf/MathExtras.h
+++ b/Source/JavaScriptCore/wtf/MathExtras.h
@@ -141,7 +141,11 @@ inline long long abs(long long num) { return _abs64(num); }
inline bool isinf(double num) { return !_finite(num) && !_isnan(num); }
inline bool isnan(double num) { return !!_isnan(num); }
+
+// cexer vs2013ϵmath.hаЩ
+#if defined(_MSC_VER) && (_MSC_VER < 1800) //< VS2013
inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
+#endif
inline double nextafter(double x, double y) { return _nextafter(x, y); }
inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x + FLT_EPSILON; }
diff --git a/Source/WebCore/dom/ShadowInclusionSelector.h b/Source/WebCore/dom/ShadowInclusionSelector.h
index 0310ab55..6aa27f75 100644
--- a/Source/WebCore/dom/ShadowInclusionSelector.h
+++ b/Source/WebCore/dom/ShadowInclusionSelector.h
@@ -119,7 +119,7 @@ class ShadowInclusionSet {
inline ShadowInclusion* ShadowInclusionSet::find(Node* key) const
{
- PointerSet::iterator found = m_set.find(key);
+ PointerSet::const_iterator found = m_set.find(key);
return found != m_set.end() ? *found : 0;
}
diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h
index 77128b73..6f346180 100644
--- a/Source/WebCore/loader/EmptyClients.h
+++ b/Source/WebCore/loader/EmptyClients.h
@@ -285,12 +285,12 @@ class EmptyFrameLoaderClient : public FrameLoaderClient {
virtual void dispatchDidCommitLoad() { }
virtual void dispatchDidFailProvisionalLoad(const ResourceError&) { }
virtual void dispatchDidFailLoad(const ResourceError&) { }
- virtual void dispatchDidFinishDocumentLoad() { }
+ virtual void dispatchDidFinishDocumentLoad(FrameLoader* loader) { }
virtual void dispatchDidFinishLoad() { }
virtual void dispatchDidFirstLayout() { }
virtual void dispatchDidFirstVisuallyNonEmptyLayout() { }
- virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; }
+ virtual Frame* dispatchCreatePage(const NavigationAction& action, const ResourceRequest& request, PassRefPtr formState, const String& frameName) { return 0; }
virtual void dispatchShow() { }
virtual void dispatchDecidePolicyForResponse(FramePolicyFunction, const ResourceResponse&, const ResourceRequest&) { }
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index ea800115..493db48d 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -668,7 +668,7 @@ void FrameLoader::finishedParsing()
// Null-checking the FrameView indicates whether or not we're in the destructor.
RefPtr protector = m_frame->view() ? m_frame : 0;
- m_client->dispatchDidFinishDocumentLoad();
+ m_client->dispatchDidFinishDocumentLoad(this);
checkCompleted();
@@ -2860,7 +2860,7 @@ void FrameLoader::continueLoadAfterNewWindowPolicy(const ResourceRequest& reques
return;
RefPtr frame = m_frame;
- RefPtr mainFrame = m_client->dispatchCreatePage(action);
+ RefPtr mainFrame = m_client->dispatchCreatePage(action, request, formState, frameName);
if (!mainFrame)
return;
diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h
index 0f884ae1..f1bfa3b8 100644
--- a/Source/WebCore/loader/FrameLoaderClient.h
+++ b/Source/WebCore/loader/FrameLoaderClient.h
@@ -152,14 +152,14 @@ namespace WebCore {
virtual void dispatchDidCommitLoad() = 0;
virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0;
virtual void dispatchDidFailLoad(const ResourceError&) = 0;
- virtual void dispatchDidFinishDocumentLoad() = 0;
+ virtual void dispatchDidFinishDocumentLoad(FrameLoader* loader) = 0;
virtual void dispatchDidFinishLoad() = 0;
virtual void dispatchDidFirstLayout() = 0;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;
virtual void dispatchDidLayout() { }
- virtual Frame* dispatchCreatePage(const NavigationAction&) = 0;
+ virtual Frame* dispatchCreatePage(const NavigationAction& action, const ResourceRequest& request, PassRefPtr formState, const String& frameName) = 0;
virtual void dispatchShow() = 0;
virtual void dispatchDecidePolicyForResponse(FramePolicyFunction, const ResourceResponse&, const ResourceRequest&) = 0;
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 5fd3aafa..ac71bf7f 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -866,8 +866,8 @@ static inline void collectFrameViewChildren(FrameView* frameView, Vector >* viewChildren = frameView->children();
ASSERT(viewChildren);
- const HashSet >::iterator end = viewChildren->end();
- for (HashSet >::iterator current = viewChildren->begin(); current != end; ++current) {
+ const HashSet >::const_iterator end = viewChildren->end();
+ for (HashSet >::const_iterator current = viewChildren->begin(); current != end; ++current) {
Widget* widget = (*current).get();
if (widget->isFrameView())
frameViews.append(static_cast(widget));
diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp
index 7cf9d958..f2fa35c1 100644
--- a/Source/WebCore/platform/KURL.cpp
+++ b/Source/WebCore/platform/KURL.cpp
@@ -1673,7 +1673,9 @@ static void encodeRelativeString(const String& rel, const TextEncoding& encoding
UCharBuffer s;
encodeHostnames(rel, s);
- TextEncoding pathEncoding(UTF8Encoding()); // Path is always encoded as UTF-8; other parts may depend on the scheme.
+ //cexer Windows·ӦʹGBK
+ TextEncoding pathEncoding("GBK");
+ //TextEncoding pathEncoding(UTF8Encoding()); // Path is always encoded as UTF-8; other parts may depend on the scheme.
int pathEnd = -1;
if (encoding != pathEncoding && encoding.isValid() && !protocolIs(rel, "mailto") && !protocolIs(rel, "data") && !protocolIsJavaScript(rel)) {
diff --git a/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp b/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
index 1443198c..706a46c7 100644
--- a/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
+++ b/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp
@@ -443,7 +443,7 @@ void ResourceHandleManager::setProxyInfo(const String& host,
if (username.length() || password.length())
userPass = username + ":" + password + "@";
- m_proxy = String("http://") + userPass + host + ":" + String::number(port);
+ m_proxy = userPass + host + ":" + String::number(port);
}
}
diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandle.h b/Source/WebCore/platform/network/curl/SocketStreamHandle.h
index d61404d4..7f5f2a8b 100644
--- a/Source/WebCore/platform/network/curl/SocketStreamHandle.h
+++ b/Source/WebCore/platform/network/curl/SocketStreamHandle.h
@@ -37,6 +37,8 @@
#include
#include
+typedef struct SocketInfo SocketInfo;
+
namespace WebCore {
class AuthenticationChallenge;
@@ -61,6 +63,12 @@ namespace WebCore {
void receivedCredential(const AuthenticationChallenge&, const Credential&);
void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
void receivedCancellation(const AuthenticationChallenge&);
+ public:
+ SocketInfo* info;
+ USHORT HostPort(){ return m_url.port(); }
+ ULONG GetHostIp();
+ void SetState_Opend(){ m_state = Open; }
+ void SetState_Closed(){ m_state = Closed; }
};
} // namespace WebCore
diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp b/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp
index 66576379..f1e68946 100644
--- a/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp
+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp
@@ -30,60 +30,375 @@
*/
#include "config.h"
+
+#include
#include "SocketStreamHandle.h"
+#include "SocketStreamError.h"
#include "KURL.h"
#include "Logging.h"
#include "NotImplemented.h"
#include "SocketStreamHandleClient.h"
+#include "wtf/text/cstring.h"
+#include
+#include
+
+#define SafeDeleteArray(p) {if(p){delete []((char*)p);p=0;}}
+
+#define IpAddrIsOk(ip) ((ip)!=0 && (ip)!=(~0))
+#define IpAddrIsBad(ip) ((ip)==0 || (ip)==(~0))
+#define SocketIsOk(s) ((s)!=0 && (s)!=(~0))
+#define SocketIsBad(s) ((s)==0 || (s)==(~0))
+#define IsSocketConnected( sock, nTimeout ) socket_select( sock, FALSE, nTimeout )
+
+enum{
+ ReasonForOnconnect,
+ ReasonForReceivedData,
+ ReasonForDisconnect,
+};
+
+enum WsConnectState{
+ WsStateConnenting,
+ WsStateConnented,
+ WsStateDisconnected,
+ WsStateDestroying
+};
+
+typedef struct _DList {
+ struct _DList *next,*prev;
+}DList,*LPDList;
+
+__forceinline void DListInit(DList& node){ node.next = &node; node.prev = &node; }
+
+__forceinline void DListRemove( LPDList pList ){ //ɾһڵ
+ if( pList->next ){
+ pList->prev->next = pList->next;
+ pList->next->prev = pList->prev;
+ pList->next = 0;
+ pList->prev = 0;
+ }
+}
+
+class CDList{
+public:
+ __forceinline CDList() { DListInit(node); }
+ __forceinline DList* Ptr() { return &node; }
+ __forceinline BOOL IsEmpty() { return node.next == &node; }
+ __forceinline LPDList FindFirst() { return node.next == &node ? 0 :node.next; }
+ __forceinline LPDList FindLast() { return node.prev == &node ? 0 :node.prev; }
+ __forceinline LPDList FindNext(LPDList pNode) { return pNode->next == &node ? 0 :pNode->next; }
+ __forceinline LPDList FindPrevious(LPDList pNode) { return pNode->prev == &node ? 0 :pNode->prev; }
+ __forceinline void RemoveSelf() { DListRemove( &node ); } // ԼжϿ
+ __forceinline void InsertHead(LPDList pNode){ //λһڵ
+ pNode->prev = &node;
+ pNode->next = node.next;
+ node.next = pNode;
+ pNode->next->prev = pNode;
+ }
+ __forceinline void InsertTail(LPDList pNode){ //βλһڵ
+ pNode->next = &node;
+ pNode->prev = node.prev;
+ pNode->prev->next = pNode;
+ node.prev = pNode;
+ }
+
+ ULONG Count(){ //ýڵ
+ ULONG iCount = 0;
+ LPDList pNode = FindFirst();
+ while( pNode ){
+ iCount ++;
+ pNode = FindNext( pNode );
+ }
+ return iCount;
+ }
+ ULONG GetTopCount(ULONG nTop){ //Сڵ
+ ULONG iCount = 0;
+ LPDList pNode = FindFirst();
+ while( pNode ){
+ iCount ++; if( iCount >= nTop )break;
+ pNode = FindNext( pNode );
+ }
+ return iCount;
+ }
+public:
+ DList node;
+};
+
+class CLockHandle{
+public:
+ CLockHandle( WTF::Mutex* lpCS){
+ __try{ lpCS->lock(); lpcs = lpCS; mIsLocked = TRUE; }
+ __except(1){ lpcs = NULL; mIsLocked = FALSE; }
+ }
+ ~CLockHandle() { if( mIsLocked && lpcs ) { lpcs->unlock(); mIsLocked = FALSE; } }
+ void Unlock() { if( mIsLocked && lpcs ) { lpcs->unlock(); mIsLocked = FALSE; } }
+ void Lock() { if( !mIsLocked && lpcs ){ lpcs->lock(); mIsLocked = TRUE; } }
+ BOOL mIsLocked;
+ WTF::Mutex* lpcs;
+};
+
+
+template
+class CxQueue{
+public:
+ ~CxQueue() { Clear(); }
+ _Type* InsertTail(_Type* pData) { CLockHandle lock(&m_Lock);m_Qs.InsertTail(&pData->node); return pData; }
+ ULONG GetCount() { CLockHandle lock(&m_Lock);return m_Qs.Count(); }
+ ULONG GetTopCount(ULONG nTop) { CLockHandle lock(&m_Lock);return m_Qs.GetTopCount(nTop); }
+ BOOL IsEmpty() { CLockHandle lock(&m_Lock);return m_Qs.FindFirst() == 0; }
+ void Clear(){
+ _Type* q;
+ //CLockHandle lock(&m_Lock);
+ while( (q = GetWithRemoveFromHead()) != NULL){delete q;}
+ }
+ _Type* GetWithRemoveFromHead(){
+ CLockHandle lock(&m_Lock);
+ LPDList q = m_Qs.FindFirst();
+ if( !q )return 0;
+ DListRemove( q );
+ return CONTAINING_RECORD(q,_Type,node);
+ }
+private:
+ Mutex m_Lock;
+ CDList m_Qs;
+};
+
+struct WS_SendInfo{
+ DList node;
+ char* data;
+ int len;
+ WS_SendInfo( const char* buf, int buf_len) { data = new char[buf_len+1]; memcpy( data, buf, buf_len ); len = buf_len; data[buf_len] = 0; }
+ ~WS_SendInfo() { SafeDeleteArray( data ); }
+};
+typedef CxQueue CSendInfo;
+
+struct SocketInfo{
+ WebCore::SocketStreamHandle* ws;
+ int reason;
+ ULONG HostIp;
+ USHORT wPort;
+ WsConnectState wsState;
+ CSendInfo mQueue;
+ char data[1024];
+ int dataLen;
+ SocketInfo( WebCore::SocketStreamHandle* p ){ ws = p; }
+};
namespace WebCore {
-SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient* client)
- : SocketStreamHandleBase(url, client)
-{
- LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
- notImplemented();
+void MainThreadCallForWebSocket( void* invocation ){
+ SocketInfo* info = ((SocketInfo*)invocation);
+ switch( info->reason ){
+ case ReasonForOnconnect:
+ if( info->wsState != WsStateConnenting ){ return; }
+ info->wsState = WsStateConnented;
+ info->ws->SetState_Opend();
+ info->ws->client()->didOpenSocketStream( info->ws );
+ break;
+ case ReasonForReceivedData:
+ if( info->wsState != WsStateConnented ){ return; }
+ info->ws->client()->didReceiveSocketStreamData( info->ws, info->data, info->dataLen );
+ break;
+ case ReasonForDisconnect:
+ if( info->wsState != WsStateConnented ){ return; }
+ info->wsState = WsStateDisconnected;
+ info->ws->SetState_Closed();
+ info->ws->client()->didCloseSocketStream( info->ws );
+ break;
+ }
}
-SocketStreamHandle::~SocketStreamHandle()
-{
- LOG(Network, "SocketStreamHandle %p delete", this);
- setClient(0);
- notImplemented();
+__inline BOOL SetSocketNonBlock(SOCKET s,ULONG isTrue){
+ return 0 == ioctlsocket(s, FIONBIO,&isTrue);
}
-int SocketStreamHandle::platformSend(const char*, int)
-{
- LOG(Network, "SocketStreamHandle %p platformSend", this);
- notImplemented();
- return 0;
+
+void FillSockAddr(void* p_sockaddr_in,ULONG ip,USHORT port,SHORT ifamily){
+ sockaddr_in* remote=(sockaddr_in*)p_sockaddr_in;
+ memset(remote,0,sizeof(sockaddr_in));
+ remote->sin_family = ifamily;
+ remote->sin_port = htons(port);
+ remote->sin_addr.S_un.S_addr = ip;
+ //remote->sin_addr.s_addr = ip;
}
-void SocketStreamHandle::platformClose()
-{
- LOG(Network, "SocketStreamHandle %p platformClose", this);
- notImplemented();
+void s_CloseSocket(SOCKET &s){
+ if(SocketIsBad(s))return;
+ LINGER lingerStruct={1,0};
+ setsockopt(s,SOL_SOCKET, SO_LINGER,(char*)&lingerStruct,sizeof(lingerStruct));
+ closesocket( s );
+ s = INVALID_SOCKET;
+}
+
+BOOL socket_select( SOCKET s, BOOL isRead, LONG nTimeOut ){
+ fd_set fd;
+ timeval timeout;
+ FD_ZERO(&fd);
+ FD_SET((ULONG)s, &fd);
+ timeout.tv_sec = 0; //
+ timeout.tv_usec = nTimeOut * 1000; // 1/1000 Ϊ 1/1000000
+ return ( isRead ) ? 1 == select( 0, &fd, NULL, NULL, &timeout ) : 1 == select( 0, NULL, &fd, NULL, &timeout );
+}
+
+__forceinline ULONG GetSocketRecvBytes( SOCKET sk ){
+ ULONG uCount;
+ return 0 == ioctlsocket( sk , FIONREAD , &uCount ) ? uCount : 0;
+}
+
+SOCKET SocketConnect(DWORD ip,WORD wPort,DWORD ipLocal,LONG iTimeOut){
+ SOCKET sockfd = INVALID_SOCKET;
+ do {
+
+ if (IpAddrIsBad(ip))break;
+ sockfd = socket(AF_INET, SOCK_STREAM, 0);
+ if( sockfd == INVALID_SOCKET)break;
+
+ sockaddr_in addr;
+ FillSockAddr( &addr, ipLocal, htons(0), AF_INET);
+ if (bind(sockfd, (struct sockaddr *)&addr, sizeof(addr)) == INVALID_SOCKET)break;
+
+ addr.sin_port = htons(wPort);
+ addr.sin_addr.s_addr = ip;
+ if(!SetSocketNonBlock(sockfd,true))break;//Ϊģʽ
+
+ //Blockģʽ᷵SOCKET_ERROR,Ҳȴ
+ if(connect(sockfd, (const sockaddr*) &addr, sizeof(addr)) == INVALID_SOCKET){
+ if( !IsSocketConnected( sockfd, iTimeOut ) ){
+ break;// ڹ涨ʱ connect ɹ
+ }
+ }
+ if( !SetSocketNonBlock( sockfd, false ) )break;// ģʽ
+ return sockfd;
+ } while(0);
+ if(sockfd != INVALID_SOCKET)closesocket(sockfd);
+ return INVALID_SOCKET;
}
-void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
+ULONG GetIpaddr(const char *pszHost)
{
+ hostent *lpHostent;
+ __try
+ {
+ lpHostent = gethostbyname(pszHost);
+ if(lpHostent==NULL)return 0;
+ return *(ULONG *)*(lpHostent->h_addr_list);
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {
+ return 0;
+ }
+}
+
+
+unsigned __stdcall WebSocketThread( void* p ){
+ SocketInfo* info = (SocketInfo*)p;
+ //Sleep(100);
+
+ SOCKET sock = SocketConnect( info->HostIp, info->wPort, INADDR_ANY, 5000 );
+
+ // WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "-------->WebSocket BEGIN %d.%d.%d.%d:%d SOCKET=%d", ipfmt(info->HostIp), info->wPort, sock );
+
+ if( SocketIsOk(sock) ){
+ info->reason = ReasonForOnconnect;
+ callOnMainThreadAndWait( MainThreadCallForWebSocket, info );
+
+ while( WsStateConnented == info->wsState && SocketIsOk(sock) ){
+ ULONG bytes = GetSocketRecvBytes( sock );
+ if( bytes ){
+ // ݽվȽ
+ memset( info->data, 0, sizeof(info->data) );
+ if( bytes >= sizeof(info->data) ){
+ bytes = ( sizeof(info->data) - 1 );
+ }
+ info->dataLen = recv( sock, info->data, bytes, 0 );
+ if( info->dataLen > 0 ){
+ info->data[info->dataLen] = 0;
+ info->reason = ReasonForReceivedData;
+ // WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "-------->R %d.%s", info->dataLen, info->data );
+ callOnMainThreadAndWait( MainThreadCallForWebSocket, info );
+ }else{
+ s_CloseSocket( sock );
+ }
+ }else{
+ // ȡҪ͵
+ int iCount = 0;
+ for( ;WsStateConnented == info->wsState; iCount++){
+ WS_SendInfo* si = info->mQueue.GetWithRemoveFromHead();
+ if( !si ){ break; }
+ BOOL isSendOK = si->len == send( sock, si->data, si->len, 0 );
+ // WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "-------->S %d.%s SendOK=%d", si->len, si->data, isSendOK );
+ delete si;
+ if( !isSendOK ){
+ s_CloseSocket( sock );
+ break;
+ }
+ }
+ if( !iCount ){
+ Sleep(10); // ûнպͷ͵ݾSleep
+ }
+ }
+ }
+ }
+
+ s_CloseSocket( sock );
+ info->reason = ReasonForDisconnect;
+ callOnMainThreadAndWait( MainThreadCallForWebSocket, info );
+
+ // WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "-------->Websocket disconnected" );
+
+ while( WsStateDestroying != info->wsState ){ Sleep(10); } // ȴرձ־
+ delete info; // ɾSocket
+ return 0;
+}
+
+ULONG SocketStreamHandle::GetHostIp(){
+ return GetIpaddr( m_url.host().utf8().data() );
+}
+
+SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient* client) : SocketStreamHandleBase(url, client), info(NULL) {
+ info = new SocketInfo( this );
+ info->HostIp = GetHostIp();
+ info->wPort = info->ws->HostPort() ? info->ws->HostPort() : 80;
+ info->wsState = WsStateConnenting;
+ CloseHandle( (HANDLE)_beginthreadex( 0, 0, WebSocketThread, info, 0, 0 ) );
+}
+
+void SocketStreamHandle::platformClose(){
+ if( info ){
+ info->wsState = WsStateDestroying;
+ SetState_Closed();
+ info = NULL;
+ }
+}
+
+SocketStreamHandle::~SocketStreamHandle(){
+ platformClose();
+}
+
+
+int SocketStreamHandle::platformSend(const char* data, int dataLen ){
+ if( info && info->wsState == WsStateConnented ){
+ info->mQueue.InsertTail( new WS_SendInfo(data,dataLen) );
+ return dataLen;
+ }
+ return 0;
+}
+
+
+void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&){
notImplemented();
}
-void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
-{
+void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&){
notImplemented();
}
-void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
-{
+void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&){
notImplemented();
}
-void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
-{
+void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&){
notImplemented();
}
-} // namespace WebCore
+} // namespace WebCore
diff --git a/Source/WebCore/plugins/win/PluginDatabaseWin.cpp b/Source/WebCore/plugins/win/PluginDatabaseWin.cpp
index 3d173852..7fca221c 100644
--- a/Source/WebCore/plugins/win/PluginDatabaseWin.cpp
+++ b/Source/WebCore/plugins/win/PluginDatabaseWin.cpp
@@ -137,8 +137,10 @@ void PluginDatabase::getPluginPathsInDirectories(HashSet& paths) const
continue;
String filename = String(findFileData.cFileName, wcslen(findFileData.cFileName));
- if ((!filename.startsWith("np", false) || !filename.endsWith("dll", false)) &&
- (!equalIgnoringCase(filename, "Plugin.dll") || !it->endsWith("Shockwave 10", false)))
+
+ //cexer npͷIJԶ
+ //if ((!filename.startsWith("np", false) || !filename.endsWith("dll", false)) &&
+ if (!filename.endsWith("dll", false) && (!equalIgnoringCase(filename, "Plugin.dll") || !it->endsWith("Shockwave 10", false)))
continue;
String fullPath = *it + "\\" + filename;
@@ -401,6 +403,26 @@ static inline String safariPluginsDirectory()
return pluginsDirectory;
}
+static inline String safariWorkingPluginDirectory()
+{
+ WCHAR workingDir[_MAX_PATH];
+ static String pluginsDirectory;
+ static bool cachedPluginDirectory = false;
+
+ if (!cachedPluginDirectory) {
+ cachedPluginDirectory = true;
+
+ int workingDirLen = GetCurrentDirectoryW(_MAX_PATH, workingDir);
+
+ if (!workingDirLen || workingDirLen == _MAX_PATH)
+ goto exit;
+
+ pluginsDirectory = String(workingDir) + "\\Plugins";
+ }
+exit:
+ return pluginsDirectory;
+}
+
static inline void addMacromediaPluginDirectories(Vector& directories)
{
#if !OS(WINCE)
@@ -426,6 +448,11 @@ Vector PluginDatabase::defaultPluginDirectories()
if (!ourDirectory.isNull())
directories.append(ourDirectory);
+
+ ourDirectory = safariWorkingPluginDirectory();
+ if (!ourDirectory.isNull())
+ directories.append(ourDirectory);
+
addQuickTimePluginDirectory(directories);
addAdobeAcrobatPluginDirectory(directories);
addMozillaPluginDirectories(directories);
diff --git a/Source/WebCore/plugins/win/PluginViewWin.cpp b/Source/WebCore/plugins/win/PluginViewWin.cpp
index cce09905..66538509 100644
--- a/Source/WebCore/plugins/win/PluginViewWin.cpp
+++ b/Source/WebCore/plugins/win/PluginViewWin.cpp
@@ -999,8 +999,16 @@ bool PluginView::platformStart()
flags |= WS_VISIBLE;
HWND parentWindowHandle = windowHandleForPageClient(m_parentFrame->view()->hostWindow()->platformPageClient());
+ HINSTANCE module = WebCore::instanceHandle();
HWND window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
- 0, 0, 0, 0, parentWindowHandle, 0, WebCore::instanceHandle(), 0);
+ 0, 0, 0, 0, parentWindowHandle, 0, module, 0);
+
+ if (!window)
+ {
+ parentWindowHandle = GetDesktopWindow();
+ window = ::CreateWindowEx(0, kWebPluginViewdowClassName, 0, flags,
+ 0, 0, 0, 0, parentWindowHandle, 0, module, 0);
+ }
#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
m_window = window;
diff --git a/WebKitLibraries/win/include/curl/curl.h b/WebKitLibraries/win/include/curl/curl.h
index cadcdd8c..516ede6a 100644
--- a/WebKitLibraries/win/include/curl/curl.h
+++ b/WebKitLibraries/win/include/curl/curl.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,19 +20,18 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: curl.h,v 1.383 2009-04-28 11:19:10 bagder Exp $
***************************************************************************/
/*
* If you have libcurl problems, all docs and details are found here:
- * http://curl.haxx.se/libcurl/
+ * https://curl.haxx.se/libcurl/
*
* curl-library mailing list subscription and unsubscription web interface:
- * http://cool.haxx.se/mailman/listinfo/curl-library/
+ * https://cool.haxx.se/mailman/listinfo/curl-library/
*/
#include "curlver.h" /* libcurl version defines */
-#include "curl/curlbuild.h" /* libcurl build definitions */
+#include "curlbuild.h" /* libcurl build definitions */
#include "curlrules.h" /* libcurl rules enforcement */
/*
@@ -47,41 +46,42 @@
#include
#include
+#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)
+/* Needed for __FreeBSD_version symbol definition */
+#include
+#endif
+
/* The include stuff here below is mainly for time_t! */
-#ifdef vms
-# include
-# include
-#else
-# include
-# include
-#endif /* defined (vms) */
+#include
+#include
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
- !defined(__CYGWIN__) || defined(__MINGW32__)
-#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
+#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
+#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
+ defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */
#include
#include
#endif
-#else
+#endif
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on system that are known to
+ libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
+ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
+ defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
+ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include
#endif
-#ifndef _WIN32_WCE
+#if !defined(WIN32) && !defined(_WIN32_WCE)
#include
#endif
-#if !defined(WIN32) && !defined(__WATCOMC__)
+
+#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
#include
#endif
-#include
-#endif
#ifdef __BEOS__
#include
@@ -91,37 +91,29 @@
extern "C" {
#endif
-typedef void CURL;
+typedef struct Curl_easy CURL;
/*
- * Decorate exportable functions for Win32 and Symbian OS DLL linking.
- * This avoids using a .def file for building libcurl.dll.
+ * libcurl external API function linkage decorations.
*/
-#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \
- !defined(CURL_STATICLIB)
-#if defined(BUILDING_LIBCURL)
-#define CURL_EXTERN __declspec(dllexport)
-#else
-#define CURL_EXTERN __declspec(dllimport)
-#endif
-#else
-#ifdef CURL_HIDDEN_SYMBOLS
-/*
- * This definition is used to make external definitions visible in the
- * shared library when symbols are hidden by default. It makes no
- * difference when compiling applications whether this is set or not,
- * only when compiling the library.
- */
-#define CURL_EXTERN CURL_EXTERN_SYMBOL
+#ifdef CURL_STATICLIB
+# define CURL_EXTERN
+#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
+# if defined(BUILDING_LIBCURL)
+# define CURL_EXTERN __declspec(dllexport)
+# else
+# define CURL_EXTERN __declspec(dllimport)
+# endif
+#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
+# define CURL_EXTERN CURL_EXTERN_SYMBOL
#else
-#define CURL_EXTERN
-#endif
+# define CURL_EXTERN
#endif
#ifndef curl_socket_typedef
/* socket typedef */
-#ifdef WIN32
+#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@@ -136,7 +128,8 @@ struct curl_httppost {
char *name; /* pointer to allocated name */
long namelength; /* length of name length */
char *contents; /* pointer to allocated data contents */
- long contentslength; /* length of contents field */
+ long contentslength; /* length of contents field, see also
+ CURL_HTTPPOST_LARGE */
char *buffer; /* pointer to allocated buffer contents */
long bufferlength; /* length of buffer field */
char *contenttype; /* Content-Type */
@@ -145,48 +138,169 @@ struct curl_httppost {
file, this link should link to following
files */
long flags; /* as defined below */
-#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
-#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
-#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
- do not free in formfree */
-#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
- do not free in formfree */
-#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
-#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
-#define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the
- regular read callback to get the data
- and pass the given pointer as custom
- pointer */
+
+/* specified content is a file name */
+#define CURL_HTTPPOST_FILENAME (1<<0)
+/* specified content is a file name */
+#define CURL_HTTPPOST_READFILE (1<<1)
+/* name is only stored pointer do not free in formfree */
+#define CURL_HTTPPOST_PTRNAME (1<<2)
+/* contents is only stored pointer do not free in formfree */
+#define CURL_HTTPPOST_PTRCONTENTS (1<<3)
+/* upload file from buffer */
+#define CURL_HTTPPOST_BUFFER (1<<4)
+/* upload file from pointer contents */
+#define CURL_HTTPPOST_PTRBUFFER (1<<5)
+/* upload file contents by using the regular read callback to get the data and
+ pass the given pointer as custom pointer */
+#define CURL_HTTPPOST_CALLBACK (1<<6)
+/* use size in 'contentlen', added in 7.46.0 */
+#define CURL_HTTPPOST_LARGE (1<<7)
char *showfilename; /* The file name to show. If not set, the
actual file name will be used (if this
is a file part) */
void *userp; /* custom pointer used for
HTTPPOST_CALLBACK posts */
+ curl_off_t contentlen; /* alternative length of contents
+ field. Used if CURL_HTTPPOST_LARGE is
+ set. Added in 7.46.0 */
};
+/* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered
+ deprecated but was the only choice up until 7.31.0 */
typedef int (*curl_progress_callback)(void *clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow);
+/* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in
+ 7.32.0, it avoids floating point and provides more detailed information. */
+typedef int (*curl_xferinfo_callback)(void *clientp,
+ curl_off_t dltotal,
+ curl_off_t dlnow,
+ curl_off_t ultotal,
+ curl_off_t ulnow);
+
#ifndef CURL_MAX_WRITE_SIZE
/* Tests have proven that 20K is a very bad buffer size for uploads on
Windows, while 16K for some odd reason performed a lot better.
We do the ifndef check to allow this value to easier be changed at build
- time for those who feel adventurous. */
+ time for those who feel adventurous. The practical minimum is about
+ 400 bytes since libcurl uses a buffer of this size as a scratch area
+ (unrelated to network send operations). */
#define CURL_MAX_WRITE_SIZE 16384
#endif
+
+#ifndef CURL_MAX_HTTP_HEADER
+/* The only reason to have a max limit for this is to avoid the risk of a bad
+ server feeding libcurl with a never-ending header that will cause reallocs
+ infinitely */
+#define CURL_MAX_HTTP_HEADER (100*1024)
+#endif
+
/* This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
+
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
void *outstream);
-/* this is the return codes for the seek callbacks */
+
+
+/* enumeration of file types */
+typedef enum {
+ CURLFILETYPE_FILE = 0,
+ CURLFILETYPE_DIRECTORY,
+ CURLFILETYPE_SYMLINK,
+ CURLFILETYPE_DEVICE_BLOCK,
+ CURLFILETYPE_DEVICE_CHAR,
+ CURLFILETYPE_NAMEDPIPE,
+ CURLFILETYPE_SOCKET,
+ CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
+
+ CURLFILETYPE_UNKNOWN /* should never occur */
+} curlfiletype;
+
+#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
+#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
+#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
+#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
+#define CURLFINFOFLAG_KNOWN_UID (1<<4)
+#define CURLFINFOFLAG_KNOWN_GID (1<<5)
+#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
+#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
+
+/* Content of this structure depends on information which is known and is
+ achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
+ page for callbacks returning this structure -- some fields are mandatory,
+ some others are optional. The FLAG field has special meaning. */
+struct curl_fileinfo {
+ char *filename;
+ curlfiletype filetype;
+ time_t time;
+ unsigned int perm;
+ int uid;
+ int gid;
+ curl_off_t size;
+ long int hardlinks;
+
+ struct {
+ /* If some of these fields is not NULL, it is a pointer to b_data. */
+ char *time;
+ char *perm;
+ char *user;
+ char *group;
+ char *target; /* pointer to the target filename of a symlink */
+ } strings;
+
+ unsigned int flags;
+
+ /* used internally */
+ char * b_data;
+ size_t b_size;
+ size_t b_used;
+};
+
+/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
+#define CURL_CHUNK_BGN_FUNC_OK 0
+#define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */
+#define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */
+
+/* if splitting of data transfer is enabled, this callback is called before
+ download of an individual chunk started. Note that parameter "remains" works
+ only for FTP wildcard downloading (for now), otherwise is not used */
+typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
+ void *ptr,
+ int remains);
+
+/* return codes for CURLOPT_CHUNK_END_FUNCTION */
+#define CURL_CHUNK_END_FUNC_OK 0
+#define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */
+
+/* If splitting of data transfer is enabled this callback is called after
+ download of an individual chunk finished.
+ Note! After this callback was set then it have to be called FOR ALL chunks.
+ Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
+ This is the reason why we don't need "transfer_info" parameter in this
+ callback and we are not interested in "remains" parameter too. */
+typedef long (*curl_chunk_end_callback)(void *ptr);
+
+/* return codes for FNMATCHFUNCTION */
+#define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
+#define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
+#define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
+
+/* callback type for wildcard downloading pattern matching. If the
+ string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
+typedef int (*curl_fnmatch_callback)(void *ptr,
+ const char *pattern,
+ const char *string);
+
+/* These are the return codes for the seek callbacks */
#define CURL_SEEKFUNC_OK 0
#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
@@ -208,10 +322,18 @@ typedef size_t (*curl_read_callback)(char *buffer,
void *instream);
typedef enum {
- CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
- CURLSOCKTYPE_LAST /* never use */
+ CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
+ CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
+ CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
+/* The return code from the sockopt_callback can signal information back
+ to libcurl: */
+#define CURL_SOCKOPT_OK 0
+#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
+ CURLE_ABORTED_BY_CALLBACK */
+#define CURL_SOCKOPT_ALREADY_CONNECTED 2
+
typedef int (*curl_sockopt_callback)(void *clientp,
curl_socket_t curlfd,
curlsocktype purpose);
@@ -231,13 +353,8 @@ typedef curl_socket_t
curlsocktype purpose,
struct curl_sockaddr *address);
-#ifndef CURL_NO_OLDIES
- /* not used since 7.10.8, will be removed in a future release */
-typedef int (*curl_passwd_callback)(void *clientp,
- const char *prompt,
- char *buffer,
- int buflen);
-#endif
+typedef int
+(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
typedef enum {
CURLIOE_OK, /* I/O operation successful */
@@ -256,6 +373,7 @@ typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
int cmd,
void *clientp);
+#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
/*
* The following typedef's are signatures of malloc, free, realloc, strdup and
* calloc respectively. Function pointers of these types can be passed to the
@@ -268,6 +386,9 @@ typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
typedef char *(*curl_strdup_callback)(const char *str);
typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
+#define CURL_DID_MEMORY_FUNC_TYPEDEFS
+#endif
+
/* the kind of data that is passed to information_callback*/
typedef enum {
CURLINFO_TEXT = 0,
@@ -299,7 +420,8 @@ typedef enum {
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
- CURLE_OBSOLETE4, /* 4 - NOT USED */
+ CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
+ 7.17.0, reused in April 2011 for 7.21.5] */
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
CURLE_COULDNT_RESOLVE_HOST, /* 6 */
CURLE_COULDNT_CONNECT, /* 7 */
@@ -307,13 +429,18 @@ typedef enum {
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
- CURLE_OBSOLETE10, /* 10 - NOT USED */
+ CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
+ 7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
- CURLE_OBSOLETE12, /* 12 - NOT USED */
+ CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
+ [was obsoleted in August 2007 for 7.17.0,
+ reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */
- CURLE_OBSOLETE16, /* 16 - NOT USED */
+ CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.
+ [was obsoleted in August 2007 for 7.17.0,
+ reused in July 2014 for 7.38.0] */
CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
CURLE_PARTIAL_FILE, /* 18 */
CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
@@ -348,9 +475,9 @@ typedef enum {
CURLE_OBSOLETE44, /* 44 - NOT USED */
CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
CURLE_OBSOLETE46, /* 46 - NOT USED */
- CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
- CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
+ CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
+ CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
+ CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
wasn't verified fine */
@@ -364,7 +491,7 @@ typedef enum {
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
- CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
+ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
@@ -402,13 +529,36 @@ typedef enum {
wrong format (Added in 7.19.0) */
CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
7.19.0) */
+ CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
+ CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
+ CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
+ CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
+ CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
+ CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
+ session will be queued */
+ CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
+ match */
+ CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */
+ CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer
+ */
CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
-/* Backwards compatibility with older names */
+/* Previously obsolete error code re-used in 7.38.0 */
+#define CURLE_OBSOLETE16 CURLE_HTTP2
+
+/* Previously obsolete error codes re-used in 7.24.0 */
+#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
+#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
+
+/* compatibility with older names */
+#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
+
+/* The following were added in 7.21.5, April 2011 */
+#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
/* The following were added in 7.17.1 */
/* These are scheduled to disappear by 2009 */
@@ -416,7 +566,7 @@ typedef enum {
/* The following were added in 7.17.0 */
/* These are scheduled to disappear by 2009 */
-#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
+#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
@@ -428,7 +578,7 @@ typedef enum {
#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
-#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
+#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
@@ -454,6 +604,16 @@ typedef enum {
make programs break */
#define CURLE_ALREADY_COMPLETE 99999
+/* Provide defines for really old option names */
+#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
+#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
+#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
+
+/* Since long deprecated options with no code in the lib that does anything
+ with them. */
+#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
+#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
+
#endif /*!CURL_NO_OLDIES*/
/* This prototype applies to all conversion callbacks */
@@ -478,14 +638,35 @@ typedef enum {
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
-#define CURLAUTH_NONE 0 /* nothing */
-#define CURLAUTH_BASIC (1<<0) /* Basic (default) */
-#define CURLAUTH_DIGEST (1<<1) /* Digest */
-#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
-#define CURLAUTH_NTLM (1<<3) /* NTLM */
-#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
-#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
-#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
+/*
+ * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
+ *
+ * CURLAUTH_NONE - No HTTP authentication
+ * CURLAUTH_BASIC - HTTP Basic authentication (default)
+ * CURLAUTH_DIGEST - HTTP Digest authentication
+ * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
+ * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
+ * CURLAUTH_NTLM - HTTP NTLM authentication
+ * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
+ * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
+ * CURLAUTH_ONLY - Use together with a single other type to force no
+ * authentication or just that single type
+ * CURLAUTH_ANY - All fine types set
+ * CURLAUTH_ANYSAFE - All fine types except Basic
+ */
+
+#define CURLAUTH_NONE ((unsigned long)0)
+#define CURLAUTH_BASIC (((unsigned long)1)<<0)
+#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
+#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
+/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
+#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
+#define CURLAUTH_NTLM (((unsigned long)1)<<3)
+#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
+#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
+#define CURLAUTH_ONLY (((unsigned long)1)<<31)
+#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
+#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
@@ -493,10 +674,56 @@ typedef enum {
#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
+#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
+#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
+#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
+#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
+
#define CURL_ERROR_SIZE 256
+enum curl_khtype {
+ CURLKHTYPE_UNKNOWN,
+ CURLKHTYPE_RSA1,
+ CURLKHTYPE_RSA,
+ CURLKHTYPE_DSS
+};
+
+struct curl_khkey {
+ const char *key; /* points to a zero-terminated string encoded with base64
+ if len is zero, otherwise to the "raw" data */
+ size_t len;
+ enum curl_khtype keytype;
+};
+
+/* this is the set of return values expected from the curl_sshkeycallback
+ callback */
+enum curl_khstat {
+ CURLKHSTAT_FINE_ADD_TO_FILE,
+ CURLKHSTAT_FINE,
+ CURLKHSTAT_REJECT, /* reject the connection, return an error */
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
+ this causes a CURLE_DEFER error but otherwise the
+ connection will be left intact etc */
+ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
+};
+
+/* this is the set of status codes pass in to the callback */
+enum curl_khmatch {
+ CURLKHMATCH_OK, /* match */
+ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
+ CURLKHMATCH_MISSING, /* no matching host/key found */
+ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
+};
+
+typedef int
+ (*curl_sshkeycallback) (CURL *easy, /* easy handle */
+ const struct curl_khkey *knownkey, /* known */
+ const struct curl_khkey *foundkey, /* found */
+ enum curl_khmatch, /* libcurl's view on the keys */
+ void *clientp); /* custom pointer passed from app */
+
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
CURLUSESSL_NONE, /* do not attempt to use SSL */
@@ -506,6 +733,19 @@ typedef enum {
CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
+/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
+
+/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
+ name of improving interoperability with older servers. Some SSL libraries
+ have introduced work-arounds for this flaw but those work-arounds sometimes
+ make the SSL communication fail. To regain functionality with those broken
+ servers, a user can this way allow the vulnerability back. */
+#define CURLSSLOPT_ALLOW_BEAST (1<<0)
+
+/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
+ SSL backends where such behavior is present. */
+#define CURLSSLOPT_NO_REVOKE (1<<1)
+
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
@@ -556,6 +796,10 @@ typedef enum {
CURLFTPMETHOD_LAST /* not an option, never use */
} curl_ftpmethod;
+/* bitmask defines for CURLOPT_HEADEROPT */
+#define CURLHEADER_UNIFIED 0
+#define CURLHEADER_SEPARATE (1<<0)
+
/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
#define CURLPROTO_HTTP (1<<0)
#define CURLPROTO_HTTPS (1<<1)
@@ -569,15 +813,35 @@ typedef enum {
#define CURLPROTO_DICT (1<<9)
#define CURLPROTO_FILE (1<<10)
#define CURLPROTO_TFTP (1<<11)
+#define CURLPROTO_IMAP (1<<12)
+#define CURLPROTO_IMAPS (1<<13)
+#define CURLPROTO_POP3 (1<<14)
+#define CURLPROTO_POP3S (1<<15)
+#define CURLPROTO_SMTP (1<<16)
+#define CURLPROTO_SMTPS (1<<17)
+#define CURLPROTO_RTSP (1<<18)
+#define CURLPROTO_RTMP (1<<19)
+#define CURLPROTO_RTMPT (1<<20)
+#define CURLPROTO_RTMPE (1<<21)
+#define CURLPROTO_RTMPTE (1<<22)
+#define CURLPROTO_RTMPS (1<<23)
+#define CURLPROTO_RTMPTS (1<<24)
+#define CURLPROTO_GOPHER (1<<25)
+#define CURLPROTO_SMB (1<<26)
+#define CURLPROTO_SMBS (1<<27)
#define CURLPROTO_ALL (~0) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
but 32 */
#define CURLOPTTYPE_LONG 0
#define CURLOPTTYPE_OBJECTPOINT 10000
+#define CURLOPTTYPE_STRINGPOINT 10000
#define CURLOPTTYPE_FUNCTIONPOINT 20000
#define CURLOPTTYPE_OFF_T 30000
+/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
+ string options from the header file */
+
/* name is uppercase CURLOPT_,
type is one of the defined CURLOPTTYPE_
number is unique identifier */
@@ -586,11 +850,12 @@ typedef enum {
#endif
#ifdef CURL_ISOCPP
-#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
+#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
+#define STRINGPOINT CURLOPTTYPE_OBJECTPOINT
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
#define OFF_T CURLOPTTYPE_OFF_T
#define CINIT(name,type,number) CURLOPT_/**/name = type + number
@@ -604,30 +869,30 @@ typedef enum {
typedef enum {
/* This is the FILE * or void * the regular output should be written to. */
- CINIT(FILE, OBJECTPOINT, 1),
+ CINIT(WRITEDATA, OBJECTPOINT, 1),
/* The full URL to get/put */
- CINIT(URL, OBJECTPOINT, 2),
+ CINIT(URL, STRINGPOINT, 2),
/* Port number to connect to, if other than default. */
CINIT(PORT, LONG, 3),
/* Name of proxy to use. */
- CINIT(PROXY, OBJECTPOINT, 4),
+ CINIT(PROXY, STRINGPOINT, 4),
- /* "name:password" to use when fetching. */
- CINIT(USERPWD, OBJECTPOINT, 5),
+ /* "user:password;options" to use when fetching. */
+ CINIT(USERPWD, STRINGPOINT, 5),
- /* "name:password" to use with proxy. */
- CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
+ /* "user:password" to use with proxy. */
+ CINIT(PROXYUSERPWD, STRINGPOINT, 6),
/* Range to get, specified as an ASCII string. */
- CINIT(RANGE, OBJECTPOINT, 7),
+ CINIT(RANGE, STRINGPOINT, 7),
/* not used */
/* Specified file stream to upload from (use as input): */
- CINIT(INFILE, OBJECTPOINT, 9),
+ CINIT(READDATA, OBJECTPOINT, 9),
/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
* bytes big. If this is not used, error messages go to stderr instead: */
@@ -659,14 +924,14 @@ typedef enum {
CINIT(POSTFIELDS, OBJECTPOINT, 15),
/* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, OBJECTPOINT, 16),
+ CINIT(REFERER, STRINGPOINT, 16),
/* Set the FTP PORT string (interface name, named or numerical IP address)
Use i.e '-' to use default address. */
- CINIT(FTPPORT, OBJECTPOINT, 17),
+ CINIT(FTPPORT, STRINGPOINT, 17),
/* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, OBJECTPOINT, 18),
+ CINIT(USERAGENT, STRINGPOINT, 18),
/* If the download receives less than "low speed limit" bytes/second
* during "low speed time" seconds, the operations is aborted.
@@ -689,19 +954,20 @@ typedef enum {
CINIT(RESUME_FROM, LONG, 21),
/* Set cookie in request: */
- CINIT(COOKIE, OBJECTPOINT, 22),
+ CINIT(COOKIE, STRINGPOINT, 22),
- /* This points to a linked list of headers, struct curl_slist kind */
+ /* This points to a linked list of headers, struct curl_slist kind. This
+ list is also used for RTSP (in spite of its name) */
CINIT(HTTPHEADER, OBJECTPOINT, 23),
/* This points to a linked list of post entries, struct curl_httppost */
CINIT(HTTPPOST, OBJECTPOINT, 24),
/* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, OBJECTPOINT, 25),
+ CINIT(SSLCERT, STRINGPOINT, 25),
/* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, OBJECTPOINT, 26),
+ CINIT(KEYPASSWD, STRINGPOINT, 26),
/* send TYPE parameter? */
CINIT(CRLF, LONG, 27),
@@ -711,11 +977,11 @@ typedef enum {
/* send FILE * or void * to store headers to, if you use a callback it
is simply passed to the callback unmodified */
- CINIT(WRITEHEADER, OBJECTPOINT, 29),
+ CINIT(HEADERDATA, OBJECTPOINT, 29),
/* point to a file to read the initial cookies from, also enables
"cookie awareness" */
- CINIT(COOKIEFILE, OBJECTPOINT, 31),
+ CINIT(COOKIEFILE, STRINGPOINT, 31),
/* What version to specifically try to use.
See CURL_SSLVERSION defines below. */
@@ -734,9 +1000,9 @@ typedef enum {
HTTP: DELETE, TRACE and others
FTP: to use a different list command
*/
- CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
+ CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
- /* HTTP request, for odd commands like DELETE, TRACE and others */
+ /* FILE handle to use instead of stderr */
CINIT(STDERR, OBJECTPOINT, 37),
/* 38 is not used */
@@ -744,18 +1010,16 @@ typedef enum {
/* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39),
- /* Pass a pointer to string of the output using full variable-replacement
- as described elsewhere. */
- CINIT(WRITEINFO, OBJECTPOINT, 40),
+ CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
CINIT(VERBOSE, LONG, 41), /* talk a lot */
CINIT(HEADER, LONG, 42), /* throw the header out too */
CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
+ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */
CINIT(UPLOAD, LONG, 46), /* this is an upload */
CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
+ CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
@@ -770,13 +1034,16 @@ typedef enum {
/* 55 = OBSOLETE */
- /* Function that will be called instead of the internal progress display
+ /* DEPRECATED
+ * Function that will be called instead of the internal progress display
* function. This function should be defined as the curl_progress_callback
* prototype defines. */
CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
- /* Data passed to the progress callback */
+ /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
+ callbacks */
CINIT(PROGRESSDATA, OBJECTPOINT, 57),
+#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA
/* We want the referrer field set automatically when following locations */
CINIT(AUTOREFERER, LONG, 58),
@@ -792,19 +1059,19 @@ typedef enum {
CINIT(HTTPPROXYTUNNEL, LONG, 61),
/* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, OBJECTPOINT, 62),
+ CINIT(INTERFACE, STRINGPOINT, 62),
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
* is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, OBJECTPOINT, 63),
+ CINIT(KRBLEVEL, STRINGPOINT, 63),
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
CINIT(SSL_VERIFYPEER, LONG, 64),
/* The CApath or CAfile used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, OBJECTPOINT, 65),
+ CINIT(CAINFO, STRINGPOINT, 65),
/* 66 = OBSOLETE */
/* 67 = OBSOLETE */
@@ -822,9 +1089,7 @@ typedef enum {
/* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71),
- /* What policy to use when closing connections when the cache is filled
- up */
- CINIT(CLOSEPOLICY, LONG, 72),
+ CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */
/* 73 = OBSOLETE */
@@ -840,14 +1105,13 @@ typedef enum {
/* Set to a file name that contains random data for libcurl to use to
seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, OBJECTPOINT, 76),
+ CINIT(RANDOM_FILE, STRINGPOINT, 76),
/* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, OBJECTPOINT, 77),
+ CINIT(EGDSOCKET, STRINGPOINT, 77),
- /* Time-out connect operations after this amount of seconds, if connects
- are OK within this time, then fine... This only aborts the connect
- phase. [Only works on unix-style/SIGALRM operating systems] */
+ /* Time-out connect operations after this amount of seconds, if connects are
+ OK within this time, then fine... This only aborts the connect phase. */
CINIT(CONNECTTIMEOUT, LONG, 78),
/* Function that will be called to store headers (instead of fwrite). The
@@ -866,10 +1130,10 @@ typedef enum {
/* Specify which file name to write all known cookies in after completed
operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, OBJECTPOINT, 82),
+ CINIT(COOKIEJAR, STRINGPOINT, 82),
/* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
+ CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
/* Specify which HTTP version to use! This must be set to one of the
CURL_HTTP_VERSION* enums set below. */
@@ -881,16 +1145,16 @@ typedef enum {
CINIT(FTP_USE_EPSV, LONG, 85),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
+ CINIT(SSLCERTTYPE, STRINGPOINT, 86),
/* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, OBJECTPOINT, 87),
+ CINIT(SSLKEY, STRINGPOINT, 87),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
+ CINIT(SSLKEYTYPE, STRINGPOINT, 88),
/* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, OBJECTPOINT, 89),
+ CINIT(SSLENGINE, STRINGPOINT, 89),
/* set the crypto engine for the SSL-sub system as default
the param has no meaning...
@@ -898,7 +1162,7 @@ typedef enum {
CINIT(SSLENGINE_DEFAULT, LONG, 90),
/* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
+ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
/* DNS cache timeout */
CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
@@ -917,7 +1181,7 @@ typedef enum {
/* The CApath directory used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, OBJECTPOINT, 97),
+ CINIT(CAPATH, STRINGPOINT, 97),
/* Instruct libcurl to use a smaller receive buffer */
CINIT(BUFFERSIZE, LONG, 98),
@@ -935,8 +1199,9 @@ typedef enum {
CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
- the response to be compressed. */
- CINIT(ENCODING, OBJECTPOINT, 102),
+ the response to be compressed. Before 7.21.6, this was known as
+ CURLOPT_ENCODING */
+ CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
/* Set pointer to private data */
CINIT(PRIVATE, OBJECTPOINT, 103),
@@ -949,8 +1214,8 @@ typedef enum {
and password to whatever host the server decides. */
CINIT(UNRESTRICTED_AUTH, LONG, 105),
- /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
- also disables the LPRT attempt). By default, those ones will always be
+ /* Specifically switch on or off the FTP engine's use of the EPRT command (
+ it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */
CINIT(FTP_USE_EPRT, LONG, 106),
@@ -984,6 +1249,7 @@ typedef enum {
essentially places a demand on the FTP server to acknowledge commands
in a timely manner. */
CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
+#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
tell libcurl to resolve names to those IP versions only. This only has
@@ -1016,12 +1282,12 @@ typedef enum {
to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
a poor attempt to find the user's home directory and check for a .netrc
file in there. */
- CINIT(NETRC_FILE, OBJECTPOINT, 118),
+ CINIT(NETRC_FILE, STRINGPOINT, 118),
/* Enable SSL/TLS for FTP, pick one of:
- CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
- CURLFTPSSL_CONTROL - SSL for the control connection or fail
- CURLFTPSSL_ALL - SSL for all communication or fail
+ CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
+ CURLUSESSL_CONTROL - SSL for the control connection or fail
+ CURLUSESSL_ALL - SSL for all communication or fail
*/
CINIT(USE_SSL, LONG, 119),
@@ -1059,10 +1325,10 @@ typedef enum {
/* zero terminated string for pass on to the FTP server when asked for
"account" info */
- CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
+ CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
- /* feed cookies into cookie engine */
- CINIT(COOKIELIST, OBJECTPOINT, 135),
+ /* feed cookie into cookie engine */
+ CINIT(COOKIELIST, STRINGPOINT, 135),
/* ignore Content-Length */
CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
@@ -1108,7 +1374,7 @@ typedef enum {
CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
/* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
+ CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
/* callback function for setting socket options */
CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
@@ -1122,8 +1388,8 @@ typedef enum {
CINIT(SSH_AUTH_TYPES, LONG, 151),
/* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
+ CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
+ CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
/* Send CCC (Clear Command Channel) after authentication */
CINIT(FTP_SSL_CCC, LONG, 154),
@@ -1147,7 +1413,7 @@ typedef enum {
CINIT(POSTREDIR, LONG, 161),
/* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
+ CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
/* Callback function for opening socket (instead of socket(2)). Optionally,
callback is able change the address or refuse to connect returning
@@ -1167,26 +1433,25 @@ typedef enum {
CINIT(SEEKDATA, OBJECTPOINT, 168),
/* CRL file */
- CINIT(CRLFILE, OBJECTPOINT, 169),
+ CINIT(CRLFILE, STRINGPOINT, 169),
/* Issuer certificate */
- CINIT(ISSUERCERT, OBJECTPOINT, 170),
+ CINIT(ISSUERCERT, STRINGPOINT, 170),
/* (IPv6) Address scope */
CINIT(ADDRESS_SCOPE, LONG, 171),
/* Collect certificate chain info and allow it to get retrievable with
- CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
- working with OpenSSL-powered builds. */
+ CURLINFO_CERTINFO after the transfer is complete. */
CINIT(CERTINFO, LONG, 172),
/* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, OBJECTPOINT, 173),
- CINIT(PASSWORD, OBJECTPOINT, 174),
+ CINIT(USERNAME, STRINGPOINT, 173),
+ CINIT(PASSWORD, STRINGPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
- CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
+ CINIT(PROXYUSERNAME, STRINGPOINT, 175),
+ CINIT(PROXYPASSWORD, STRINGPOINT, 176),
/* Comma separated list of hostnames defining no-proxy zones. These should
match both hostnames directly, and hostnames within a domain. For
@@ -1195,13 +1460,13 @@ typedef enum {
implementations of this, .local.com will be considered to be the same as
local.com. A single * is the only valid wildcard, and effectively
disables the use of proxy. */
- CINIT(NOPROXY, OBJECTPOINT, 177),
+ CINIT(NOPROXY, STRINGPOINT, 177),
/* block size for TFTP transfers */
CINIT(TFTP_BLKSIZE, LONG, 178),
/* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, LONG, 179),
+ CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
/* Socks Service */
CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
@@ -1218,6 +1483,212 @@ typedef enum {
to all protocols except FILE and SCP. */
CINIT(REDIR_PROTOCOLS, LONG, 182),
+ /* set the SSH knownhost file name to use */
+ CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+
+ /* set the SSH host key callback custom pointer */
+ CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+
+ /* set the SMTP mail originator */
+ CINIT(MAIL_FROM, STRINGPOINT, 186),
+
+ /* set the list of SMTP mail receiver(s) */
+ CINIT(MAIL_RCPT, OBJECTPOINT, 187),
+
+ /* FTP: send PRET before PASV */
+ CINIT(FTP_USE_PRET, LONG, 188),
+
+ /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
+ CINIT(RTSP_REQUEST, LONG, 189),
+
+ /* The RTSP session identifier */
+ CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
+
+ /* The RTSP stream URI */
+ CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
+
+ /* The Transport: header to use in RTSP requests */
+ CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
+
+ /* Manually initialize the client RTSP CSeq for this handle */
+ CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
+
+ /* Manually initialize the server RTSP CSeq for this handle */
+ CINIT(RTSP_SERVER_CSEQ, LONG, 194),
+
+ /* The stream to pass to INTERLEAVEFUNCTION. */
+ CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
+
+ /* Let the application define a custom write method for RTP data */
+ CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
+
+ /* Turn on wildcard matching */
+ CINIT(WILDCARDMATCH, LONG, 197),
+
+ /* Directory matching callback called before downloading of an
+ individual file (chunk) started */
+ CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
+
+ /* Directory matching callback called after the file (chunk)
+ was downloaded, or skipped */
+ CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
+
+ /* Change match (fnmatch-like) callback for wildcard matching */
+ CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
+
+ /* Let the application define custom chunk data pointer */
+ CINIT(CHUNK_DATA, OBJECTPOINT, 201),
+
+ /* FNMATCH_FUNCTION user pointer */
+ CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
+
+ /* send linked-list of name:port:address sets */
+ CINIT(RESOLVE, OBJECTPOINT, 203),
+
+ /* Set a username for authenticated TLS */
+ CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
+
+ /* Set a password for authenticated TLS */
+ CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
+
+ /* Set authentication type for authenticated TLS */
+ CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
+
+ /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
+ compressed transfer-encoded responses. Set to 0 to disable the use of TE:
+ in outgoing requests. The current default is 0, but it might change in a
+ future libcurl release.
+
+ libcurl will ask for the compressed methods it knows of, and if that
+ isn't any, it will not ask for transfer-encoding at all even if this
+ option is set to 1.
+
+ */
+ CINIT(TRANSFER_ENCODING, LONG, 207),
+
+ /* Callback function for closing socket (instead of close(2)). The callback
+ should have type curl_closesocket_callback */
+ CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
+ CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
+
+ /* allow GSSAPI credential delegation */
+ CINIT(GSSAPI_DELEGATION, LONG, 210),
+
+ /* Set the name servers to use for DNS resolution */
+ CINIT(DNS_SERVERS, STRINGPOINT, 211),
+
+ /* Time-out accept operations (currently for FTP only) after this amount
+ of miliseconds. */
+ CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
+
+ /* Set TCP keepalive */
+ CINIT(TCP_KEEPALIVE, LONG, 213),
+
+ /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
+ CINIT(TCP_KEEPIDLE, LONG, 214),
+ CINIT(TCP_KEEPINTVL, LONG, 215),
+
+ /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
+ CINIT(SSL_OPTIONS, LONG, 216),
+
+ /* Set the SMTP auth originator */
+ CINIT(MAIL_AUTH, STRINGPOINT, 217),
+
+ /* Enable/disable SASL initial response */
+ CINIT(SASL_IR, LONG, 218),
+
+ /* Function that will be called instead of the internal progress display
+ * function. This function should be defined as the curl_xferinfo_callback
+ * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
+ CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
+
+ /* The XOAUTH2 bearer token */
+ CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
+
+ /* Set the interface string to use as outgoing network
+ * interface for DNS requests.
+ * Only supported by the c-ares DNS backend */
+ CINIT(DNS_INTERFACE, STRINGPOINT, 221),
+
+ /* Set the local IPv4 address to use for outgoing DNS requests.
+ * Only supported by the c-ares DNS backend */
+ CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
+
+ /* Set the local IPv4 address to use for outgoing DNS requests.
+ * Only supported by the c-ares DNS backend */
+ CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
+
+ /* Set authentication options directly */
+ CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
+
+ /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
+ CINIT(SSL_ENABLE_NPN, LONG, 225),
+
+ /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
+ CINIT(SSL_ENABLE_ALPN, LONG, 226),
+
+ /* Time to wait for a response to a HTTP request containing an
+ * Expect: 100-continue header before sending the data anyway. */
+ CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227),
+
+ /* This points to a linked list of headers used for proxy requests only,
+ struct curl_slist kind */
+ CINIT(PROXYHEADER, OBJECTPOINT, 228),
+
+ /* Pass in a bitmask of "header options" */
+ CINIT(HEADEROPT, LONG, 229),
+
+ /* The public key in DER form used to validate the peer public key
+ this option is used only if SSL_VERIFYPEER is true */
+ CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
+
+ /* Path to Unix domain socket */
+ CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
+
+ /* Set if we should verify the certificate status. */
+ CINIT(SSL_VERIFYSTATUS, LONG, 232),
+
+ /* Set if we should enable TLS false start. */
+ CINIT(SSL_FALSESTART, LONG, 233),
+
+ /* Do not squash dot-dot sequences */
+ CINIT(PATH_AS_IS, LONG, 234),
+
+ /* Proxy Service Name */
+ CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
+
+ /* Service Name */
+ CINIT(SERVICE_NAME, STRINGPOINT, 236),
+
+ /* Wait/don't wait for pipe/mutex to clarify */
+ CINIT(PIPEWAIT, LONG, 237),
+
+ /* Set the protocol used when curl is given a URL without a protocol */
+ CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
+
+ /* Set stream weight, 1 - 256 (default is 16) */
+ CINIT(STREAM_WEIGHT, LONG, 239),
+
+ /* Set stream dependency on another CURL handle */
+ CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
+
+ /* Set E-xclusive stream dependency on another CURL handle */
+ CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
+
+ /* Do not send any tftp option requests to the server */
+ CINIT(TFTP_NO_OPTIONS, LONG, 242),
+
+ /* Linked-list of host:port:connect-to-host:connect-to-port,
+ overrides the URL's host:port (only for the network layer) */
+ CINIT(CONNECT_TO, OBJECTPOINT, 243),
+
+ /* Set TCP Fast Open */
+ CINIT(TCP_FASTOPEN, LONG, 244),
+
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@@ -1254,13 +1725,11 @@ typedef enum {
option might be handy to force libcurl to use a specific IP version. */
#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
versions that your system allows */
-#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
-#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
+#define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */
+#define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */
/* three convenient "aliases" that follow the name scheme better */
-#define CURLOPT_WRITEDATA CURLOPT_FILE
-#define CURLOPT_READDATA CURLOPT_INFILE
-#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
+#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
enum {
@@ -1269,10 +1738,38 @@ enum {
for us! */
CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
+ CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
+ CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
+ CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
+ Upgrade */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
+/* Convenience definition simple because the name of the version is HTTP/2 and
+ not 2.0. The 2_0 version of the enum name was set while the version was
+ still planned to be 2.0 and we stick to it for compatibility. */
+#define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
+
+/*
+ * Public API enums for RTSP requests
+ */
+enum {
+ CURL_RTSPREQ_NONE, /* first in list */
+ CURL_RTSPREQ_OPTIONS,
+ CURL_RTSPREQ_DESCRIBE,
+ CURL_RTSPREQ_ANNOUNCE,
+ CURL_RTSPREQ_SETUP,
+ CURL_RTSPREQ_PLAY,
+ CURL_RTSPREQ_PAUSE,
+ CURL_RTSPREQ_TEARDOWN,
+ CURL_RTSPREQ_GET_PARAMETER,
+ CURL_RTSPREQ_SET_PARAMETER,
+ CURL_RTSPREQ_RECORD,
+ CURL_RTSPREQ_RECEIVE,
+ CURL_RTSPREQ_LAST /* last in list */
+};
+
/* These enums are for use with the CURLOPT_NETRC option. */
enum CURL_NETRC_OPTION {
CURL_NETRC_IGNORED, /* The .netrc will never be read.
@@ -1287,21 +1784,33 @@ enum CURL_NETRC_OPTION {
enum {
CURL_SSLVERSION_DEFAULT,
- CURL_SSLVERSION_TLSv1,
+ CURL_SSLVERSION_TLSv1, /* TLS 1.x */
CURL_SSLVERSION_SSLv2,
CURL_SSLVERSION_SSLv3,
+ CURL_SSLVERSION_TLSv1_0,
+ CURL_SSLVERSION_TLSv1_1,
+ CURL_SSLVERSION_TLSv1_2,
CURL_SSLVERSION_LAST /* never use, keep last */
};
+enum CURL_TLSAUTH {
+ CURL_TLSAUTH_NONE,
+ CURL_TLSAUTH_SRP,
+ CURL_TLSAUTH_LAST /* never use, keep last */
+};
+
/* symbols to use with CURLOPT_POSTREDIR.
- CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
- CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
+ CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
+ can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
+ | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
-#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
+#define CURL_REDIR_POST_303 4
+#define CURL_REDIR_POST_ALL \
+ (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
typedef enum {
CURL_TIMECOND_NONE,
@@ -1357,6 +1866,7 @@ typedef enum {
CFINIT(OBSOLETE2),
CFINIT(STREAM),
+ CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
@@ -1420,7 +1930,8 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
* Should return the buffer length passed to it as the argument "len" on
* success.
*/
-typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
+typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
+ size_t len);
/*
* NAME curl_formget()
@@ -1516,7 +2027,7 @@ CURL_EXTERN void curl_free(void *p);
* DESCRIPTION
*
* curl_global_init() should be invoked exactly once for each application that
- * uses libcurl and before any call of other libcurl function.
+ * uses libcurl and before any call of other libcurl functions.
*
* This function is not thread-safe!
*/
@@ -1598,10 +2109,40 @@ struct curl_certinfo {
format "name: value" */
};
+/* enum for the different supported SSL backends */
+typedef enum {
+ CURLSSLBACKEND_NONE = 0,
+ CURLSSLBACKEND_OPENSSL = 1,
+ CURLSSLBACKEND_GNUTLS = 2,
+ CURLSSLBACKEND_NSS = 3,
+ CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
+ CURLSSLBACKEND_GSKIT = 5,
+ CURLSSLBACKEND_POLARSSL = 6,
+ CURLSSLBACKEND_CYASSL = 7,
+ CURLSSLBACKEND_SCHANNEL = 8,
+ CURLSSLBACKEND_DARWINSSL = 9,
+ CURLSSLBACKEND_AXTLS = 10,
+ CURLSSLBACKEND_MBEDTLS = 11
+} curl_sslbackend;
+
+/* aliases for library clones and renames */
+#define CURLSSLBACKEND_LIBRESSL 1
+#define CURLSSLBACKEND_BORINGSSL 1
+#define CURLSSLBACKEND_WOLFSSL 6
+
+/* Information about the SSL library used and the respective internal SSL
+ handle, which can be used to obtain further information regarding the
+ connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
+struct curl_tlssessioninfo {
+ curl_sslbackend backend;
+ void *internals;
+};
+
#define CURLINFO_STRING 0x100000
#define CURLINFO_LONG 0x200000
#define CURLINFO_DOUBLE 0x300000
#define CURLINFO_SLIST 0x400000
+#define CURLINFO_SOCKET 0x500000
#define CURLINFO_MASK 0x0fffff
#define CURLINFO_TYPEMASK 0xf00000
@@ -1642,9 +2183,20 @@ typedef enum {
CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
+ CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
+ CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
+ CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
+ CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
+ CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
+ CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
+ CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
+ CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43,
+ CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
+ CURLINFO_TLS_SSL_PTR = CURLINFO_SLIST + 45,
+ CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
/* Fill in new entries below here! */
- CURLINFO_LASTONE = 35
+ CURLINFO_LASTONE = 46
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -1668,6 +2220,7 @@ typedef enum {
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
+#define CURL_GLOBAL_ACK_EINTR (1<<2)
/*****************************************************************************
@@ -1705,15 +2258,16 @@ typedef void (*curl_unlock_function)(CURL *handle,
curl_lock_data data,
void *userptr);
-typedef void CURLSH;
+typedef struct Curl_share CURLSH;
typedef enum {
CURLSHE_OK, /* all is fine */
CURLSHE_BAD_OPTION, /* 1 */
CURLSHE_IN_USE, /* 2 */
CURLSHE_INVALID, /* 3 */
- CURLSHE_NOMEM, /* out of memory */
- CURLSHE_LAST /* never use */
+ CURLSHE_NOMEM, /* 4 out of memory */
+ CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
+ CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
@@ -1778,22 +2332,34 @@ typedef struct {
} curl_version_info_data;
-#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
-#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */
-#define CURL_VERSION_SSL (1<<2) /* SSL options are present */
-#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
-#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
-#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
-#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */
-#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */
-#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */
-#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
-#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
-#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
-#define CURL_VERSION_CONV (1<<12) /* character conversions are
- supported */
-
-/*
+#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
+#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
+ (deprecated) */
+#define CURL_VERSION_SSL (1<<2) /* SSL options are present */
+#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
+#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
+#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported
+ (deprecated) */
+#define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */
+#define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */
+#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */
+#define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */
+#define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are
+ supported */
+#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */
+#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */
+#define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */
+#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
+#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper
+ is suported */
+#define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */
+#define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */
+#define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */
+#define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
+#define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used
+ for cookie domain verification */
+
+ /*
* NAME curl_version_info()
*
* DESCRIPTION
diff --git a/WebKitLibraries/win/include/curl/curlbuild.h b/WebKitLibraries/win/include/curl/curlbuild.h
index 9cb34732..ae95095f 100644
--- a/WebKitLibraries/win/include/curl/curlbuild.h
+++ b/WebKitLibraries/win/include/curl/curlbuild.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,7 +20,6 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: curlbuild.h.dist,v 1.28 2009-05-12 01:57:54 yangtse Exp $
***************************************************************************/
/* ================================================================ */
@@ -50,7 +49,7 @@
*
* If you think that something actually needs to be changed, adjusted
* or fixed in this file, then, report it on the libcurl development
- * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
+ * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
*
* Try to keep one section per platform, compiler and architecture,
* otherwise, if an existing section is reused for a different one and
@@ -68,7 +67,7 @@
*
* For any given platform/compiler curl_off_t must be typedef'ed to a
* 64-bit wide signed integral data type. The width of this data type
- * must remain constant and independant of any possible large file
+ * must remain constant and independent of any possible large file
* support settings.
*
* As an exception to the above, curl_off_t shall be typedef'ed to a
@@ -76,7 +75,7 @@
*
* As a general rule, curl_off_t shall not be mapped to off_t. This
* rule shall only be violated if off_t is the only 64-bit data type
- * available and the size of off_t is independant of large file support
+ * available and the size of off_t is independent of large file support
* settings. Keep your build on the safe side avoiding an off_t gating.
* If you have a 64-bit off_t then take for sure that another 64-bit
* data type exists, dig deeper and you will find it.
@@ -90,7 +89,7 @@
* when the libcurl source code distribution archive file is created.
*
* File include/curl/curlbuild.h.dist is not included in the distribution
- * archive. File include/curl/curlbuild.h is not present in the CVS tree.
+ * archive. File include/curl/curlbuild.h is not present in the git tree.
*
* The distributed include/curl/curlbuild.h file is only intended to be used
* on systems which can not run the also distributed configure script.
@@ -100,7 +99,7 @@
* is suitable and specific to the library being configured and built, which
* is generated from the include/curl/curlbuild.h.in template file.
*
- * If you check out from CVS on a non-configure platform, you must run the
+ * If you check out from git on a non-configure platform, you must run the
* appropriate buildconf* script to set up curlbuild.h and other local files.
*
*/
@@ -370,16 +369,7 @@
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
#elif defined(__VMS)
-# if defined(__alpha) || defined(__ia64)
-# define CURL_SIZEOF_LONG 4
-# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_FORMAT_OFF_T "%lld"
-# define CURL_SIZEOF_CURL_OFF_T 8
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
-# else
+# if defined(__VAX)
# define CURL_SIZEOF_LONG 4
# define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld"
@@ -388,6 +378,15 @@
# define CURL_SIZEOF_CURL_OFF_T 4
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
+# else
+# define CURL_SIZEOF_LONG 4
+# define CURL_TYPEOF_CURL_OFF_T long long
+# define CURL_FORMAT_CURL_OFF_T "lld"
+# define CURL_FORMAT_CURL_OFF_TU "llu"
+# define CURL_FORMAT_OFF_T "%lld"
+# define CURL_SIZEOF_CURL_OFF_T 8
+# define CURL_SUFFIX_CURL_OFF_T LL
+# define CURL_SUFFIX_CURL_OFF_TU ULL
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
# define CURL_SIZEOF_CURL_SOCKLEN_T 4
@@ -528,7 +527,9 @@
/* ===================================== */
#elif defined(__GNUC__)
-# if defined(__i386__) || defined(__ppc__)
+# if !defined(__LP64__) && (defined(__ILP32__) || \
+ defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
+ defined(__sparc__) || defined(__mips__) || defined(__sh__))
# define CURL_SIZEOF_LONG 4
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
@@ -537,7 +538,8 @@
# define CURL_SIZEOF_CURL_OFF_T 8
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
-# elif defined(__x86_64__) || defined(__ppc64__)
+# elif defined(__LP64__) || \
+ defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
# define CURL_SIZEOF_LONG 8
# define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld"
diff --git a/WebKitLibraries/win/include/curl/curlrules.h b/WebKitLibraries/win/include/curl/curlrules.h
index 44018737..55d21f68 100644
--- a/WebKitLibraries/win/include/curl/curlrules.h
+++ b/WebKitLibraries/win/include/curl/curlrules.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,7 +20,6 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: curlrules.h,v 1.6 2009-04-29 15:15:38 yangtse Exp $
***************************************************************************/
/* ================================================================ */
@@ -48,7 +47,7 @@
* library is properly built and used.
*
* You can find further help on the libcurl development mailing list:
- * http://cool.haxx.se/mailman/listinfo/curl-library/
+ * https://cool.haxx.se/mailman/listinfo/curl-library/
*
* NOTE 2
* ------
@@ -57,7 +56,7 @@
* that the dimension of a constant array can not be a negative one.
* In this way if the compile time verification fails, the compilation
* will fail issuing an error. The error description wording is compiler
- * dependant but it will be quite similar to one of the following:
+ * dependent but it will be quite similar to one of the following:
*
* "negative subscript or subscript is too large"
* "array must have at least one element"
@@ -187,11 +186,11 @@ typedef char
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
/* ================================================================ */
-/*
+/*
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
* these to be visible and exported by the external libcurl interface API,
* while also making them visible to the library internals, simply including
- * setup.h, without actually needing to include curl.h internally.
+ * curl_setup.h, without actually needing to include curl.h internally.
* If some day this section would grow big enough, all this should be moved
* to its own header file.
*/
@@ -217,14 +216,23 @@ typedef char
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
*/
-#ifdef CURL_ISOCPP
-# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix
+#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
+# define __CURL_OFF_T_C_HLPR2(x) x
+# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
+# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
+ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
+ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
#else
-# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix
+# ifdef CURL_ISOCPP
+# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
+# else
+# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
+# endif
+# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
+# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
#endif
-#define __CURL_OFF_T_C_HELPER1(Val,Suffix) __CURL_OFF_T_C_HELPER2(Val,Suffix)
-#define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_T)
-#define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_TU)
/*
* Get rid of macros private to this header file.
@@ -240,10 +248,15 @@ typedef char
#undef CURL_PULL_WS2TCPIP_H
#undef CURL_PULL_SYS_TYPES_H
#undef CURL_PULL_SYS_SOCKET_H
+#undef CURL_PULL_SYS_POLL_H
#undef CURL_PULL_STDINT_H
#undef CURL_PULL_INTTYPES_H
#undef CURL_TYPEOF_CURL_SOCKLEN_T
#undef CURL_TYPEOF_CURL_OFF_T
+#ifdef CURL_NO_OLDIES
+#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
+#endif
+
#endif /* __CURL_CURLRULES_H */
diff --git a/WebKitLibraries/win/include/curl/curlver.h b/WebKitLibraries/win/include/curl/curlver.h
index 66314a91..cebcf422 100644
--- a/WebKitLibraries/win/include/curl/curlver.h
+++ b/WebKitLibraries/win/include/curl/curlver.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,24 +20,23 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: curlver.h,v 1.46 2009-03-02 23:44:43 bagder Exp $
***************************************************************************/
/* This header file contains nothing but libcurl version info, generated by
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
-#define LIBCURL_COPYRIGHT "1996 - 2009 Daniel Stenberg, ."
+#define LIBCURL_COPYRIGHT "1996 - 2016 Daniel Stenberg, ."
/* This is the version number of the libcurl package from which this header
file origins: */
-#define LIBCURL_VERSION "7.19.5"
+#define LIBCURL_VERSION "7.50.0"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 19
-#define LIBCURL_VERSION_PATCH 5
+#define LIBCURL_VERSION_MINOR 50
+#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@@ -53,18 +52,26 @@
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
+
+ Note: This define is the full hex number and _does not_ use the
+ CURL_VERSION_BITS() macro since curl's own configure script greps for it
+ and needs it to contain the full number.
*/
-#define LIBCURL_VERSION_NUM 0x071305
+#define LIBCURL_VERSION_NUM 0x073200
/*
* This is the date and time when the full source package was created. The
- * timestamp is not stored in CVS, as the timestamp is properly set in the
+ * timestamp is not stored in git, as the timestamp is properly set in the
* tarballs by the maketgz script.
*
* The format of the date should follow this template:
*
* "Mon Feb 12 11:35:33 UTC 2007"
*/
-#define LIBCURL_TIMESTAMP "Mon May 18 07:07:11 UTC 2009"
+#define LIBCURL_TIMESTAMP "Thu Jul 21 08:55:43 UTC 2016"
+
+#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
+#define CURL_AT_LEAST_VERSION(x,y,z) \
+ (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
#endif /* __CURL_CURLVER_H */
diff --git a/WebKitLibraries/win/include/curl/easy.h b/WebKitLibraries/win/include/curl/easy.h
index 40449c3e..afc766cd 100644
--- a/WebKitLibraries/win/include/curl/easy.h
+++ b/WebKitLibraries/win/include/curl/easy.h
@@ -11,7 +11,7 @@
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,7 +20,6 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: easy.h,v 1.14 2008-05-12 21:43:28 bagder Exp $
***************************************************************************/
#ifdef __cplusplus
extern "C" {
@@ -54,8 +53,8 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
*
* Creates a new curl session handle with the same options set for the handle
* passed in. Duplicating a handle could only be a matter of cloning data and
- * options, internal state info and things like persistant connections cannot
- * be transfered. It is useful in multithreaded applications when you can run
+ * options, internal state info and things like persistent connections cannot
+ * be transferred. It is useful in multithreaded applications when you can run
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/
diff --git a/WebKitLibraries/win/include/curl/mprintf.h b/WebKitLibraries/win/include/curl/mprintf.h
index d7202de1..e20f546e 100644
--- a/WebKitLibraries/win/include/curl/mprintf.h
+++ b/WebKitLibraries/win/include/curl/mprintf.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,13 +20,11 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: mprintf.h,v 1.16 2008-05-20 10:21:50 patrickm Exp $
***************************************************************************/
#include
#include /* needed for FILE */
-
-#include "curl.h"
+#include "curl.h" /* for CURL_EXTERN */
#ifdef __cplusplus
extern "C" {
@@ -45,36 +43,6 @@ CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
-#ifdef _MPRINTF_REPLACE
-# undef printf
-# undef fprintf
-# undef sprintf
-# undef vsprintf
-# undef snprintf
-# undef vprintf
-# undef vfprintf
-# undef vsnprintf
-# undef aprintf
-# undef vaprintf
-# define printf curl_mprintf
-# define fprintf curl_mfprintf
-#ifdef CURLDEBUG
-/* When built with CURLDEBUG we define away the sprintf() functions since we
- don't want internal code to be using them */
-# define sprintf sprintf_was_used
-# define vsprintf vsprintf_was_used
-#else
-# define sprintf curl_msprintf
-# define vsprintf curl_mvsprintf
-#endif
-# define snprintf curl_msnprintf
-# define vprintf curl_mvprintf
-# define vfprintf curl_mvfprintf
-# define vsnprintf curl_mvsnprintf
-# define aprintf curl_maprintf
-# define vaprintf curl_mvaprintf
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/WebKitLibraries/win/include/curl/multi.h b/WebKitLibraries/win/include/curl/multi.h
index 153f7721..7a1040f4 100644
--- a/WebKitLibraries/win/include/curl/multi.h
+++ b/WebKitLibraries/win/include/curl/multi.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,7 +20,6 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: multi.h,v 1.45 2008-05-20 10:21:50 patrickm Exp $
***************************************************************************/
/*
This is an "external" header file. Don't give away any internals here!
@@ -53,7 +52,7 @@
extern "C" {
#endif
-typedef void CURLM;
+typedef struct Curl_multi CURLM;
typedef enum {
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
@@ -65,6 +64,8 @@ typedef enum {
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
+ CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
+ attempted to get added - again */
CURLM_LAST
} CURLMcode;
@@ -73,6 +74,11 @@ typedef enum {
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
+/* bitmask bits for CURLMOPT_PIPELINING */
+#define CURLPIPE_NOTHING 0L
+#define CURLPIPE_HTTP1 1L
+#define CURLPIPE_MULTIPLEX 2L
+
typedef enum {
CURLMSG_NONE, /* first, not used */
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
@@ -90,6 +96,19 @@ struct CURLMsg {
};
typedef struct CURLMsg CURLMsg;
+/* Based on poll(2) structure and values.
+ * We don't use pollfd and POLL* constants explicitly
+ * to cover platforms without poll(). */
+#define CURL_WAIT_POLLIN 0x0001
+#define CURL_WAIT_POLLPRI 0x0002
+#define CURL_WAIT_POLLOUT 0x0004
+
+struct curl_waitfd {
+ curl_socket_t fd;
+ short events;
+ short revents; /* not supported yet */
+};
+
/*
* Name: curl_multi_init()
*
@@ -134,6 +153,20 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *exc_fd_set,
int *max_fd);
+/*
+ * Name: curl_multi_wait()
+ *
+ * Desc: Poll on all fds within a CURLM set as well as any
+ * additional fds passed to the function.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
+ struct curl_waitfd extra_fds[],
+ unsigned int extra_nfds,
+ int timeout_ms,
+ int *ret);
+
/*
* Name: curl_multi_perform()
*
@@ -312,6 +345,37 @@ typedef enum {
/* maximum number of entries in the connection cache */
CINIT(MAXCONNECTS, LONG, 6),
+ /* maximum number of (pipelining) connections to one host */
+ CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
+
+ /* maximum number of requests in a pipeline */
+ CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
+
+ /* a connection with a content-length longer than this
+ will not be considered for pipelining */
+ CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
+
+ /* a connection with a chunk length longer than this
+ will not be considered for pipelining */
+ CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
+
+ /* a list of site names(+port) that are blacklisted from
+ pipelining */
+ CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
+
+ /* a list of server types that are blacklisted from
+ pipelining */
+ CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
+
+ /* maximum number of open connections in total */
+ CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
+
+ /* This is the server push callback function pointer */
+ CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
+
+ /* This is the argument passed to the server push callback */
+ CINIT(PUSHDATA, OBJECTPOINT, 15),
+
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
@@ -339,6 +403,31 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
curl_socket_t sockfd, void *sockp);
+
+/*
+ * Name: curl_push_callback
+ *
+ * Desc: This callback gets called when a new stream is being pushed by the
+ * server. It approves or denies the new stream.
+ *
+ * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
+ */
+#define CURL_PUSH_OK 0
+#define CURL_PUSH_DENY 1
+
+struct curl_pushheaders; /* forward declaration only */
+
+CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
+ size_t num);
+CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
+ const char *name);
+
+typedef int (*curl_push_callback)(CURL *parent,
+ CURL *easy,
+ size_t num_headers,
+ struct curl_pushheaders *headers,
+ void *userp);
+
#ifdef __cplusplus
} /* end of extern "C" */
#endif
diff --git a/WebKitLibraries/win/include/curl/stdcheaders.h b/WebKitLibraries/win/include/curl/stdcheaders.h
index 024413ac..6f0f7f34 100644
--- a/WebKitLibraries/win/include/curl/stdcheaders.h
+++ b/WebKitLibraries/win/include/curl/stdcheaders.h
@@ -1,18 +1,18 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
@@ -20,7 +20,6 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: stdcheaders.h,v 1.8 2004/01/07 09:19:34 bagder Exp $
***************************************************************************/
#include
@@ -31,4 +30,4 @@ size_t fwrite (const void *, size_t, size_t, FILE *);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
-#endif
+#endif /* __STDC_HEADERS_H */
diff --git a/WebKitLibraries/win/include/curl/typecheck-gcc.h b/WebKitLibraries/win/include/curl/typecheck-gcc.h
index 97883058..6ec8bcfd 100644
--- a/WebKitLibraries/win/include/curl/typecheck-gcc.h
+++ b/WebKitLibraries/win/include/curl/typecheck-gcc.h
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
@@ -20,69 +20,88 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
- * $Id: typecheck-gcc.h,v 1.9 2009-01-25 23:26:31 bagder Exp $
***************************************************************************/
/* wraps curl_easy_setopt() with typechecking */
/* To add a new kind of warning, add an
- * if(_curl_is_sometype_option(_curl_opt) && ! _curl_is_sometype(value))
- * _curl_easy_setopt_err_sometype();
+ * if(_curl_is_sometype_option(_curl_opt))
+ * if(!_curl_is_sometype(value))
+ * _curl_easy_setopt_err_sometype();
* block and define _curl_is_sometype_option, _curl_is_sometype and
* _curl_easy_setopt_err_sometype below
*
+ * NOTE: We use two nested 'if' statements here instead of the && operator, in
+ * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
+ * when compiling with -Wlogical-op.
+ *
* To add an option that uses the same type as an existing option, you'll just
* need to extend the appropriate _curl_*_option macro
*/
#define curl_easy_setopt(handle, option, value) \
__extension__ ({ \
__typeof__ (option) _curl_opt = option; \
- if (__builtin_constant_p(_curl_opt)) { \
- if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value)) \
- _curl_easy_setopt_err_long(); \
- if (_curl_is_off_t_option(_curl_opt) && !_curl_is_off_t(value)) \
- _curl_easy_setopt_err_curl_off_t(); \
- if (_curl_is_string_option(_curl_opt) && !_curl_is_string(value)) \
- _curl_easy_setopt_err_string(); \
- if (_curl_is_write_cb_option(_curl_opt) && !_curl_is_write_cb(value)) \
- _curl_easy_setopt_err_write_callback(); \
- if ((_curl_opt) == CURLOPT_READFUNCTION && !_curl_is_read_cb(value)) \
- _curl_easy_setopt_err_read_cb(); \
- if ((_curl_opt) == CURLOPT_IOCTLFUNCTION && !_curl_is_ioctl_cb(value)) \
- _curl_easy_setopt_err_ioctl_cb(); \
- if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION && !_curl_is_sockopt_cb(value))\
- _curl_easy_setopt_err_sockopt_cb(); \
- if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION && \
- !_curl_is_opensocket_cb(value)) \
- _curl_easy_setopt_err_opensocket_cb(); \
- if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION && \
- !_curl_is_progress_cb(value)) \
- _curl_easy_setopt_err_progress_cb(); \
- if ((_curl_opt) == CURLOPT_DEBUGFUNCTION && !_curl_is_debug_cb(value)) \
- _curl_easy_setopt_err_debug_cb(); \
- if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION && \
- !_curl_is_ssl_ctx_cb(value)) \
- _curl_easy_setopt_err_ssl_ctx_cb(); \
- if (_curl_is_conv_cb_option(_curl_opt) && !_curl_is_conv_cb(value)) \
- _curl_easy_setopt_err_conv_cb(); \
- if ((_curl_opt) == CURLOPT_SEEKFUNCTION && !_curl_is_seek_cb(value)) \
- _curl_easy_setopt_err_seek_cb(); \
- if (_curl_is_cb_data_option(_curl_opt) && !_curl_is_cb_data(value)) \
- _curl_easy_setopt_err_cb_data(); \
- if ((_curl_opt) == CURLOPT_ERRORBUFFER && !_curl_is_error_buffer(value)) \
- _curl_easy_setopt_err_error_buffer(); \
- if ((_curl_opt) == CURLOPT_STDERR && !_curl_is_FILE(value)) \
- _curl_easy_setopt_err_FILE(); \
- if (_curl_is_postfields_option(_curl_opt) && !_curl_is_postfields(value)) \
- _curl_easy_setopt_err_postfields(); \
- if ((_curl_opt) == CURLOPT_HTTPPOST && \
- !_curl_is_arr((value), struct curl_httppost)) \
- _curl_easy_setopt_err_curl_httpost(); \
- if (_curl_is_slist_option(_curl_opt) && \
- !_curl_is_arr((value), struct curl_slist)) \
- _curl_easy_setopt_err_curl_slist(); \
- if ((_curl_opt) == CURLOPT_SHARE && !_curl_is_ptr((value), CURLSH)) \
- _curl_easy_setopt_err_CURLSH(); \
+ if(__builtin_constant_p(_curl_opt)) { \
+ if(_curl_is_long_option(_curl_opt)) \
+ if(!_curl_is_long(value)) \
+ _curl_easy_setopt_err_long(); \
+ if(_curl_is_off_t_option(_curl_opt)) \
+ if(!_curl_is_off_t(value)) \
+ _curl_easy_setopt_err_curl_off_t(); \
+ if(_curl_is_string_option(_curl_opt)) \
+ if(!_curl_is_string(value)) \
+ _curl_easy_setopt_err_string(); \
+ if(_curl_is_write_cb_option(_curl_opt)) \
+ if(!_curl_is_write_cb(value)) \
+ _curl_easy_setopt_err_write_callback(); \
+ if((_curl_opt) == CURLOPT_READFUNCTION) \
+ if(!_curl_is_read_cb(value)) \
+ _curl_easy_setopt_err_read_cb(); \
+ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
+ if(!_curl_is_ioctl_cb(value)) \
+ _curl_easy_setopt_err_ioctl_cb(); \
+ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
+ if(!_curl_is_sockopt_cb(value)) \
+ _curl_easy_setopt_err_sockopt_cb(); \
+ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
+ if(!_curl_is_opensocket_cb(value)) \
+ _curl_easy_setopt_err_opensocket_cb(); \
+ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
+ if(!_curl_is_progress_cb(value)) \
+ _curl_easy_setopt_err_progress_cb(); \
+ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
+ if(!_curl_is_debug_cb(value)) \
+ _curl_easy_setopt_err_debug_cb(); \
+ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
+ if(!_curl_is_ssl_ctx_cb(value)) \
+ _curl_easy_setopt_err_ssl_ctx_cb(); \
+ if(_curl_is_conv_cb_option(_curl_opt)) \
+ if(!_curl_is_conv_cb(value)) \
+ _curl_easy_setopt_err_conv_cb(); \
+ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
+ if(!_curl_is_seek_cb(value)) \
+ _curl_easy_setopt_err_seek_cb(); \
+ if(_curl_is_cb_data_option(_curl_opt)) \
+ if(!_curl_is_cb_data(value)) \
+ _curl_easy_setopt_err_cb_data(); \
+ if((_curl_opt) == CURLOPT_ERRORBUFFER) \
+ if(!_curl_is_error_buffer(value)) \
+ _curl_easy_setopt_err_error_buffer(); \
+ if((_curl_opt) == CURLOPT_STDERR) \
+ if(!_curl_is_FILE(value)) \
+ _curl_easy_setopt_err_FILE(); \
+ if(_curl_is_postfields_option(_curl_opt)) \
+ if(!_curl_is_postfields(value)) \
+ _curl_easy_setopt_err_postfields(); \
+ if((_curl_opt) == CURLOPT_HTTPPOST) \
+ if(!_curl_is_arr((value), struct curl_httppost)) \
+ _curl_easy_setopt_err_curl_httpost(); \
+ if(_curl_is_slist_option(_curl_opt)) \
+ if(!_curl_is_arr((value), struct curl_slist)) \
+ _curl_easy_setopt_err_curl_slist(); \
+ if((_curl_opt) == CURLOPT_SHARE) \
+ if(!_curl_is_ptr((value), CURLSH)) \
+ _curl_easy_setopt_err_CURLSH(); \
} \
curl_easy_setopt(handle, _curl_opt, value); \
})
@@ -92,16 +111,19 @@ __extension__ ({ \
#define curl_easy_getinfo(handle, info, arg) \
__extension__ ({ \
__typeof__ (info) _curl_info = info; \
- if (__builtin_constant_p(_curl_info)) { \
- if (_curl_is_string_info(_curl_info) && !_curl_is_arr((arg), char *)) \
- _curl_easy_getinfo_err_string(); \
- if (_curl_is_long_info(_curl_info) && !_curl_is_arr((arg), long)) \
- _curl_easy_getinfo_err_long(); \
- if (_curl_is_double_info(_curl_info) && !_curl_is_arr((arg), double)) \
- _curl_easy_getinfo_err_double(); \
- if (_curl_is_slist_info(_curl_info) && \
- !_curl_is_arr((arg), struct curl_slist *)) \
- _curl_easy_getinfo_err_curl_slist(); \
+ if(__builtin_constant_p(_curl_info)) { \
+ if(_curl_is_string_info(_curl_info)) \
+ if(!_curl_is_arr((arg), char *)) \
+ _curl_easy_getinfo_err_string(); \
+ if(_curl_is_long_info(_curl_info)) \
+ if(!_curl_is_arr((arg), long)) \
+ _curl_easy_getinfo_err_long(); \
+ if(_curl_is_double_info(_curl_info)) \
+ if(!_curl_is_arr((arg), double)) \
+ _curl_easy_getinfo_err_double(); \
+ if(_curl_is_slist_info(_curl_info)) \
+ if(!_curl_is_arr((arg), struct curl_slist *)) \
+ _curl_easy_getinfo_err_curl_slist(); \
} \
curl_easy_getinfo(handle, _curl_info, arg); \
})
@@ -119,15 +141,17 @@ __extension__ ({ \
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
#define _CURL_WARNING(id, message) \
- static void __attribute__((warning(message))) __attribute__((unused)) \
- __attribute__((noinline)) id(void) { __asm__(""); }
+ static void __attribute__((__warning__(message))) \
+ __attribute__((__unused__)) __attribute__((__noinline__)) \
+ id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
- "curl_easy_setopt expects a string (char* or char[]) argument for this option"
+ "curl_easy_setopt expects a "
+ "string (char* or char[]) argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option")
@@ -138,7 +162,8 @@ _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
- "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
+ "curl_easy_setopt expects a "
+ "curl_opensocket_callback argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option")
@@ -151,9 +176,11 @@ _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
- "curl_easy_setopt expects a private data pointer as argument for this option")
+ "curl_easy_setopt expects a "
+ "private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
- "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
+ "curl_easy_setopt expects a "
+ "char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
@@ -191,46 +218,67 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if option takes a char* argument */
#define _curl_is_string_option(option) \
- ((option) == CURLOPT_URL || \
- (option) == CURLOPT_PROXY || \
- (option) == CURLOPT_INTERFACE || \
- (option) == CURLOPT_NETRC_FILE || \
- (option) == CURLOPT_USERPWD || \
- (option) == CURLOPT_USERNAME || \
- (option) == CURLOPT_PASSWORD || \
- (option) == CURLOPT_PROXYUSERPWD || \
- (option) == CURLOPT_PROXYUSERNAME || \
- (option) == CURLOPT_PROXYPASSWORD || \
- (option) == CURLOPT_NOPROXY || \
- (option) == CURLOPT_ENCODING || \
- (option) == CURLOPT_REFERER || \
- (option) == CURLOPT_USERAGENT || \
+ ((option) == CURLOPT_ACCEPT_ENCODING || \
+ (option) == CURLOPT_CAINFO || \
+ (option) == CURLOPT_CAPATH || \
(option) == CURLOPT_COOKIE || \
(option) == CURLOPT_COOKIEFILE || \
(option) == CURLOPT_COOKIEJAR || \
(option) == CURLOPT_COOKIELIST || \
+ (option) == CURLOPT_CRLFILE || \
+ (option) == CURLOPT_CUSTOMREQUEST || \
+ (option) == CURLOPT_DEFAULT_PROTOCOL || \
+ (option) == CURLOPT_DNS_INTERFACE || \
+ (option) == CURLOPT_DNS_LOCAL_IP4 || \
+ (option) == CURLOPT_DNS_LOCAL_IP6 || \
+ (option) == CURLOPT_DNS_SERVERS || \
+ (option) == CURLOPT_EGDSOCKET || \
(option) == CURLOPT_FTPPORT || \
- (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
(option) == CURLOPT_FTP_ACCOUNT || \
+ (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
+ (option) == CURLOPT_INTERFACE || \
+ (option) == CURLOPT_ISSUERCERT || \
+ (option) == CURLOPT_KEYPASSWD || \
+ (option) == CURLOPT_KRBLEVEL || \
+ (option) == CURLOPT_LOGIN_OPTIONS || \
+ (option) == CURLOPT_MAIL_AUTH || \
+ (option) == CURLOPT_MAIL_FROM || \
+ (option) == CURLOPT_NETRC_FILE || \
+ (option) == CURLOPT_NOPROXY || \
+ (option) == CURLOPT_PASSWORD || \
+ (option) == CURLOPT_PINNEDPUBLICKEY || \
+ (option) == CURLOPT_PROXY || \
+ (option) == CURLOPT_PROXYPASSWORD || \
+ (option) == CURLOPT_PROXYUSERNAME || \
+ (option) == CURLOPT_PROXYUSERPWD || \
+ (option) == CURLOPT_PROXY_SERVICE_NAME || \
+ (option) == CURLOPT_RANDOM_FILE || \
(option) == CURLOPT_RANGE || \
- (option) == CURLOPT_CUSTOMREQUEST || \
+ (option) == CURLOPT_REFERER || \
+ (option) == CURLOPT_RTSP_SESSION_ID || \
+ (option) == CURLOPT_RTSP_STREAM_URI || \
+ (option) == CURLOPT_RTSP_TRANSPORT || \
+ (option) == CURLOPT_SERVICE_NAME || \
+ (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
+ (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
+ (option) == CURLOPT_SSH_KNOWNHOSTS || \
+ (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
+ (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
(option) == CURLOPT_SSLCERT || \
(option) == CURLOPT_SSLCERTTYPE || \
+ (option) == CURLOPT_SSLENGINE || \
(option) == CURLOPT_SSLKEY || \
(option) == CURLOPT_SSLKEYTYPE || \
- (option) == CURLOPT_KEYPASSWD || \
- (option) == CURLOPT_SSLENGINE || \
- (option) == CURLOPT_CAINFO || \
- (option) == CURLOPT_CAPATH || \
- (option) == CURLOPT_RANDOM_FILE || \
- (option) == CURLOPT_EGDSOCKET || \
(option) == CURLOPT_SSL_CIPHER_LIST || \
- (option) == CURLOPT_KRBLEVEL || \
- (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
- (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
- (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
- (option) == CURLOPT_CRLFILE || \
- (option) == CURLOPT_ISSUERCERT || \
+ (option) == CURLOPT_TLSAUTH_PASSWORD || \
+ (option) == CURLOPT_TLSAUTH_TYPE || \
+ (option) == CURLOPT_TLSAUTH_USERNAME || \
+ (option) == CURLOPT_UNIX_SOCKET_PATH || \
+ (option) == CURLOPT_URL || \
+ (option) == CURLOPT_USERAGENT || \
+ (option) == CURLOPT_USERNAME || \
+ (option) == CURLOPT_USERPWD || \
+ (option) == CURLOPT_XOAUTH2_BEARER || \
0)
/* evaluates to true if option takes a curl_write_callback argument */
@@ -246,17 +294,22 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if option takes a data argument to pass to a callback */
#define _curl_is_cb_data_option(option) \
- ((option) == CURLOPT_WRITEDATA || \
- (option) == CURLOPT_READDATA || \
+ ((option) == CURLOPT_CHUNK_DATA || \
+ (option) == CURLOPT_CLOSESOCKETDATA || \
+ (option) == CURLOPT_DEBUGDATA || \
+ (option) == CURLOPT_FNMATCH_DATA || \
+ (option) == CURLOPT_HEADERDATA || \
+ (option) == CURLOPT_INTERLEAVEDATA || \
(option) == CURLOPT_IOCTLDATA || \
- (option) == CURLOPT_SOCKOPTDATA || \
(option) == CURLOPT_OPENSOCKETDATA || \
+ (option) == CURLOPT_PRIVATE || \
(option) == CURLOPT_PROGRESSDATA || \
- (option) == CURLOPT_WRITEHEADER || \
- (option) == CURLOPT_DEBUGDATA || \
- (option) == CURLOPT_SSL_CTX_DATA || \
+ (option) == CURLOPT_READDATA || \
(option) == CURLOPT_SEEKDATA || \
- (option) == CURLOPT_PRIVATE || \
+ (option) == CURLOPT_SOCKOPTDATA || \
+ (option) == CURLOPT_SSH_KEYDATA || \
+ (option) == CURLOPT_SSL_CTX_DATA || \
+ (option) == CURLOPT_WRITEDATA || \
0)
/* evaluates to true if option takes a POST data argument (void* or char*) */
@@ -267,11 +320,14 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if option takes a struct curl_slist * argument */
#define _curl_is_slist_option(option) \
- ((option) == CURLOPT_HTTPHEADER || \
- (option) == CURLOPT_HTTP200ALIASES || \
- (option) == CURLOPT_QUOTE || \
+ ((option) == CURLOPT_HTTP200ALIASES || \
+ (option) == CURLOPT_HTTPHEADER || \
+ (option) == CURLOPT_MAIL_RCPT || \
(option) == CURLOPT_POSTQUOTE || \
(option) == CURLOPT_PREQUOTE || \
+ (option) == CURLOPT_PROXYHEADER || \
+ (option) == CURLOPT_QUOTE || \
+ (option) == CURLOPT_RESOLVE || \
(option) == CURLOPT_TELNETOPTIONS || \
0)
@@ -355,7 +411,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
#define _curl_is_error_buffer(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), char *) || \
+ (_curl_is_NULL(expr) || \
+ __builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
@@ -448,7 +505,8 @@ typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
-/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */
+/* evaluates to true if expr is of type curl_opensocket_callback or
+ "similar" */
#define _curl_is_opensocket_cb(expr) \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
@@ -483,7 +541,11 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback1) || \
_curl_callback_compatible((expr), _curl_debug_callback2) || \
_curl_callback_compatible((expr), _curl_debug_callback3) || \
- _curl_callback_compatible((expr), _curl_debug_callback4))
+ _curl_callback_compatible((expr), _curl_debug_callback4) || \
+ _curl_callback_compatible((expr), _curl_debug_callback5) || \
+ _curl_callback_compatible((expr), _curl_debug_callback6) || \
+ _curl_callback_compatible((expr), _curl_debug_callback7) || \
+ _curl_callback_compatible((expr), _curl_debug_callback8))
typedef int (_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
@@ -492,6 +554,14 @@ typedef int (_curl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *);
+typedef int (_curl_debug_callback5) (CURL *,
+ curl_infotype, unsigned char *, size_t, void *);
+typedef int (_curl_debug_callback6) (CURL *,
+ curl_infotype, unsigned char *, size_t, const void *);
+typedef int (_curl_debug_callback7) (CURL *,
+ curl_infotype, const unsigned char *, size_t, void *);
+typedef int (_curl_debug_callback8) (CURL *,
+ curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
@@ -517,7 +587,8 @@ typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
-typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *);
+typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
+ const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
diff --git a/WebKitLibraries/win/include/curl/types.h b/WebKitLibraries/win/include/curl/types.h
deleted file mode 100644
index d37d6ae9..00000000
--- a/WebKitLibraries/win/include/curl/types.h
+++ /dev/null
@@ -1 +0,0 @@
-/* not used */
diff --git a/WebKitLibraries/win/lib/libcrypto.lib b/WebKitLibraries/win/lib/libcrypto.lib
new file mode 100644
index 00000000..7cf606c1
Binary files /dev/null and b/WebKitLibraries/win/lib/libcrypto.lib differ
diff --git a/WebKitLibraries/win/lib/libcurl.lib b/WebKitLibraries/win/lib/libcurl.lib
new file mode 100644
index 00000000..328f58fc
Binary files /dev/null and b/WebKitLibraries/win/lib/libcurl.lib differ
diff --git a/WebKitLibraries/win/lib/libcurl_imp.lib b/WebKitLibraries/win/lib/libcurl_imp.lib
deleted file mode 100644
index 85886c44..00000000
Binary files a/WebKitLibraries/win/lib/libcurl_imp.lib and /dev/null differ
diff --git a/WebKitLibraries/win/lib/libeay32.lib b/WebKitLibraries/win/lib/libeay32.lib
deleted file mode 100644
index ae070c70..00000000
Binary files a/WebKitLibraries/win/lib/libeay32.lib and /dev/null differ
diff --git a/WebKitLibraries/win/lib/libssl.lib b/WebKitLibraries/win/lib/libssl.lib
new file mode 100644
index 00000000..8c07a6ea
Binary files /dev/null and b/WebKitLibraries/win/lib/libssl.lib differ
diff --git a/WebKitLibraries/win/lib/ossl_static.pdb b/WebKitLibraries/win/lib/ossl_static.pdb
new file mode 100644
index 00000000..4243cc09
Binary files /dev/null and b/WebKitLibraries/win/lib/ossl_static.pdb differ
diff --git a/WebKitLibraries/win/lib/ssleay32.lib b/WebKitLibraries/win/lib/ssleay32.lib
deleted file mode 100644
index 710e6f0f..00000000
Binary files a/WebKitLibraries/win/lib/ssleay32.lib and /dev/null differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props
new file mode 100644
index 00000000..7ba40ae5
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props
@@ -0,0 +1,287 @@
+
+
+
+
+
+
+
+ ENABLE_CHANNEL_MESSAGING
+ ENABLE_CLIENT_BASED_GEOLOCATION
+
+
+
+ ENABLE_SQL_DATABASE
+
+ ENABLE_DATALIST
+
+ ENABLE_DETAILS
+
+
+ ENABLE_FILTERS
+
+
+
+
+ ENABLE_GEOLOCATION
+ ENABLE_ICONDATABASE
+
+
+
+
+
+
+
+
+
+ ENABLE_JAVASCRIPT_DEBUGGER
+
+ ENABLE_MATHML
+ ENABLE_METER_TAG
+
+
+
+
+
+
+
+ ENABLE_SHARED_WORKERS
+ ENABLE_SVG
+
+ ENABLE_SVG_FONTS
+
+
+
+
+ ENABLE_WEB_SOCKETS
+
+ ENABLE_WORKERS
+ ENABLE_XSLT
+
+
+
+ $(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_BLOB);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_CSS_FILTERS);$(ENABLE_CSS_REGIONS);$(ENABLE_CSS_EXCLUSIONS);$(ENABLE_SQL_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DATA_TRANSFER_ITEMS);$(ENABLE_DETAILS);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_FILTERS);$(ENABLE_FILE_SYSTEM);$(ENABLE_CSS3_FLEXBOX);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_LINK_PREFETCH);$(ENABLE_MATHML);$(ENABLE_METER_TAG);$(ENABLE_MICRODATA);$(ENABLE_MUTATION_OBSERVERS);$(ENABLE_NOTIFICATIONS);$(ENABLE_PAGE_VISIBILITY_API);$(ENABLE_PROGRESS_TAG);$(ENABLE_QUOTA);$(ENABLE_REGISTER_PROTOCOL_HANDLER);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_WEB_SOCKETS);$(ENABLE_WEB_TIMING);$(ENABLE_WORKERS);$(ENABLE_XSLT);%(PreprocessorDefinitions)
+
+
+
+
+ $(ENABLE_3D_CANVAS)
+ true
+
+
+ $(ENABLE_3D_RENDERING)
+ true
+
+
+ $(ENABLE_ACCELERATED_2D_CANVAS)
+ true
+
+
+ $(ENABLE_BLOB)
+ true
+
+
+ $(ENABLE_CHANNEL_MESSAGING)
+ true
+
+
+ $(ENABLE_CLIENT_BASED_GEOLOCATION)
+ true
+
+
+ $(ENABLE_CSS_FILTERS)
+ true
+
+
+ $(ENABLE_CSS_REGIONS)
+ true
+
+
+ $(ENABLE_CSS_EXCLUSIONS)
+ true
+
+
+ $(ENABLE_SQL_DATABASE)
+ true
+
+
+ $(ENABLE_DATAGRID)
+ true
+
+
+ $(ENABLE_DATALIST)
+ true
+
+
+ $(ENABLE_DATA_TRANSFER_ITEMS)
+ true
+
+
+ $(ENABLE_DETAILS)
+ true
+
+
+ $(ENABLE_DEVICE_ORIENTATION)
+ true
+
+
+ $(ENABLE_DIRECTORY_UPLOAD)
+ true
+
+
+ $(ENABLE_FILTERS)
+ true
+
+
+ $(ENABLE_FILE_SYSTEM)
+ true
+
+
+ $(ENABLE_CSS3_FLEXBOX)
+ true
+
+
+ $(ENABLE_FULLSCREEN_API)
+ true
+
+
+ $(ENABLE_GAMEPAD)
+ true
+
+
+ $(ENABLE_GEOLOCATION)
+ true
+
+
+ $(ENABLE_ICONDATABASE)
+ true
+
+
+ $(ENABLE_INDEXED_DATABASE)
+ true
+
+
+ $(ENABLE_INPUT_COLOR)
+ true
+
+
+ $(ENABLE_INPUT_SPEECH)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_DATE)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_DATETIME)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_DATETIMELOCAL)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_MONTH)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_TIME)
+ true
+
+
+ $(ENABLE_INPUT_TYPE_WEEK)
+ true
+
+
+ $(ENABLE_JAVASCRIPT_DEBUGGER)
+ true
+
+
+ $(ENABLE_LINK_PREFETCH)
+ true
+
+
+ $(ENABLE_MATHML)
+ true
+
+
+ $(ENABLE_METER_TAG)
+ true
+
+
+ $(ENABLE_MICRODATA)
+ true
+
+
+ $(ENABLE_MUTATION_OBSERVERS)
+ true
+
+
+ $(ENABLE_NOTIFICATIONS)
+ true
+
+
+ $(ENABLE_PAGE_VISIBILITY_API)
+ true
+
+
+ $(ENABLE_PROGRESS_TAG)
+ true
+
+
+ $(ENABLE_QUOTA)
+ true
+
+
+ $(ENABLE_REGISTER_PROTOCOL_HANDLER)
+ true
+
+
+ $(ENABLE_SHARED_WORKERS)
+ true
+
+
+ $(ENABLE_SVG)
+ true
+
+
+ $(ENABLE_SVG_DOM_OBJC_BINDINGS)
+ true
+
+
+ $(ENABLE_SVG_FONTS)
+ true
+
+
+ $(ENABLE_VIDEO)
+ true
+
+
+ $(ENABLE_MEDIA_SOURCE)
+ true
+
+
+ $(ENABLE_MEDIA_STATISTICS)
+ true
+
+
+ $(ENABLE_WEB_AUDIO)
+ true
+
+
+ $(ENABLE_WEB_SOCKETS)
+ true
+
+
+ $(ENABLE_WEB_TIMING)
+ true
+
+
+ $(ENABLE_WORKERS)
+ true
+
+
+ $(ENABLE_XSLT)
+ true
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/WinCairo.props b/WebKitLibraries/win/tools/vsprops/WinCairo.props
new file mode 100644
index 00000000..d3decac5
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/WinCairo.props
@@ -0,0 +1,18 @@
+
+
+
+
+
+ $(WebKitLibrariesDir)\include\cairo;$(SolutionDir)\..\..\..\JavaScriptCore\os-win32;%(AdditionalIncludeDirectories)
+ WTF_PLATFORM_WIN_CAIRO=1;CAIRO_WIN32_STATIC_BUILD;%(PreprocessorDefinitions)
+
+
+ cairo.lib;libjpeg.lib;zlib.lib;libpng.lib
+ %(AdditionalLibraryDirectories)
+
+
+ true
+
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/cURL.props b/WebKitLibraries/win/tools/vsprops/cURL.props
new file mode 100644
index 00000000..fb17e7f2
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/cURL.props
@@ -0,0 +1,12 @@
+
+
+
+
+ ws2_32.lib;wininet.lib;Wldap32.lib;libssl.lib;libcurl.lib;libcrypto.lib
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/cURL.vsprops b/WebKitLibraries/win/tools/vsprops/cURL.vsprops
index 3f06aa6b..cbf424e8 100644
--- a/WebKitLibraries/win/tools/vsprops/cURL.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/cURL.vsprops
@@ -6,7 +6,7 @@
>
diff --git a/WebKitLibraries/win/tools/vsprops/debug.props b/WebKitLibraries/win/tools/vsprops/debug.props
new file mode 100644
index 00000000..c963f9aa
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/debug.props
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+ Disabled
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+ %(PreprocessorDefinitions)
+
+
+
+
+ $(WebKitConfigSuffix)
+ true
+
+
+ $(LibraryConfigSuffix)
+ true
+
+
+ $(WebKitDLLConfigSuffix)
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/debug_wincairo.props b/WebKitLibraries/win/tools/vsprops/debug_wincairo.props
new file mode 100644
index 00000000..0712de4f
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/debug_wincairo.props
@@ -0,0 +1,37 @@
+
+
+
+ _debug
+
+ _debug
+
+
+
+ $(WebKitLibrariesDir)\include\cairo;%(AdditionalIncludeDirectories)
+ Disabled
+ DEBUG_ALL;%(PreprocessorDefinitions)
+ true
+ EnableFastChecks
+ MultiThreadedDebug
+
+
+ "$(WebKitLibrariesDir)\lib"
+
+
+ false
+
+
+
+
+ $(WebKitConfigSuffix)
+ true
+
+
+ $(LibraryConfigSuffix)
+ true
+
+
+ $(WebKitDLLConfigSuffix)
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/release.props b/WebKitLibraries/win/tools/vsprops/release.props
new file mode 100644
index 00000000..70856dbe
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/release.props
@@ -0,0 +1,9 @@
+
+
+
+
+ MultiThreaded
+ %(PreprocessorDefinitions)
+
+
+
\ No newline at end of file
diff --git a/WebKitLibraries/win/tools/vsprops/releaseproduction.props b/WebKitLibraries/win/tools/vsprops/releaseproduction.props
new file mode 100644
index 00000000..e3d4c042
--- /dev/null
+++ b/WebKitLibraries/win/tools/vsprops/releaseproduction.props
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+ NDEBUG;%(PreprocessorDefinitions)
+
+
+
+
+ $(WebKitConfigSuffix)
+ true
+
+
+ $(LibraryConfigSuffix)
+ true
+
+
+ $(WebKitDLLConfigSuffix)
+
+
+
\ No newline at end of file
diff --git a/demo/bin/english.html b/demo/bin/english.html
new file mode 100644
index 00000000..ca084f7c
--- /dev/null
+++ b/demo/bin/english.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+中文
+
+
+english
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/bin/english.png b/demo/bin/english.png
new file mode 100644
index 00000000..a54018f6
Binary files /dev/null and b/demo/bin/english.png differ
diff --git a/demo/bin/file.asp b/demo/bin/file.asp
new file mode 100644
index 00000000..c91e9a89
--- /dev/null
+++ b/demo/bin/file.asp
@@ -0,0 +1,5 @@
+<%
+ filesize=Request.TotalBytes 'ϴļĴС
+ filedata=Request.BinaryRead(filesize) 'ϴļĶ
+ Response.Write filesize 'ʾ
+%>
\ No newline at end of file
diff --git a/demo/bin/file.html b/demo/bin/file.html
new file mode 100644
index 00000000..6573fba4
--- /dev/null
+++ b/demo/bin/file.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a target="_blank">
+
<a target="_parent">
+
<a target="_self">
+
<a target="_top">
+
<a target="testTarget">
+
<a target="wontOpen">
+
+
calc.exe
+
www.baidu.com
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/bin/plugins.html b/demo/bin/plugins.html
new file mode 100644
index 00000000..9eb7fd32
--- /dev/null
+++ b/demo/bin/plugins.html
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/bin/vlc.html b/demo/bin/vlc.html
new file mode 100644
index 00000000..cd3cff79
--- /dev/null
+++ b/demo/bin/vlc.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/bin/vlc.reg b/demo/bin/vlc.reg
new file mode 100644
index 00000000..72615de3
--- /dev/null
+++ b/demo/bin/vlc.reg
@@ -0,0 +1,8 @@
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MozillaPlugins\@videolan.org/vlc,version=2.0.3]
+"Description"="VLC Multimedia Plugin"
+"Path"="D:\\program\\VLCPortable2.0.3\\App\\vlc\\npvlc.dll"
+"Product"="VLC media player"
+"Vendor"="VideoLAN"
+"Version"="2.0.3"
\ No newline at end of file
diff --git a/demo/bin/wke.dll b/demo/bin/wke.dll
index 27895a15..a9b2a93b 100644
Binary files a/demo/bin/wke.dll and b/demo/bin/wke.dll differ
diff --git a/demo/bin/wkeBrowser.exe b/demo/bin/wkeBrowser.exe
index 7b13b65e..84787a2a 100644
Binary files a/demo/bin/wkeBrowser.exe and b/demo/bin/wkeBrowser.exe differ
diff --git a/demo/bin/wkexe.exe b/demo/bin/wkexe.exe
new file mode 100644
index 00000000..aa3458ed
Binary files /dev/null and b/demo/bin/wkexe.exe differ
diff --git a/demo/bin/wkexe.html b/demo/bin/wkexe.html
new file mode 100644
index 00000000..e8ec8c79
--- /dev/null
+++ b/demo/bin/wkexe.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a target="_blank">
+
<a target="_parent">
+
<a target="_self">
+
<a target="_top">
+
<a target="testTarget">
+
蝌蚪聊天室(websocket)
+
Websocket聊天室
+
优酷
+
土豆
+
爱奇艺
+
鲁大师游戏库
+
传奇盛世|双线1区
+
+
calc.exe
+
www.baidu.com
+
prompt
+
+
+
+
+
+
\ No newline at end of file
diff --git "a/demo/bin/\344\270\255\346\226\207.html" "b/demo/bin/\344\270\255\346\226\207.html"
new file mode 100644
index 00000000..ca084f7c
--- /dev/null
+++ "b/demo/bin/\344\270\255\346\226\207.html"
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+中文
+
+
+english
+
+
+
+
+
+
\ No newline at end of file
diff --git "a/demo/bin/\344\270\255\346\226\207.png" "b/demo/bin/\344\270\255\346\226\207.png"
new file mode 100644
index 00000000..a54018f6
Binary files /dev/null and "b/demo/bin/\344\270\255\346\226\207.png" differ
diff --git a/demo/libwke/wke.dll b/demo/libwke/wke.dll
new file mode 100644
index 00000000..a9b2a93b
Binary files /dev/null and b/demo/libwke/wke.dll differ
diff --git a/demo/libwke/wke.h b/demo/libwke/wke.h
index 8a2f6c0f..b96edbe0 100644
--- a/demo/libwke/wke.h
+++ b/demo/libwke/wke.h
@@ -11,37 +11,59 @@
#define WKE_H
-#ifdef BUILDING_wke
-# define WKE_API __declspec(dllexport)
+//////////////////////////////////////////////////////////////////////////
+
+
+#if defined(__cplusplus)
+ #define WKE_EXTERN_C extern "C"
#else
-# define WKE_API __declspec(dllimport)
+ #define WKE_EXTERN_C
+#endif
+
+
+#if defined(BUILDING_wke)
+# define WKE_SYMBOL __declspec(dllexport)
+#else
+# define WKE_SYMBOL __declspec(dllimport)
#endif
-typedef char utf8;
-typedef struct {
+#define WKE_CALL _cdecl
+#define WKE_API WKE_EXTERN_C WKE_SYMBOL
+
+
+
+
+typedef struct
+{
int x;
int y;
int w;
int h;
+
} wkeRect;
-enum wkeMouseFlags
+
+typedef enum
{
WKE_LBUTTON = 0x01,
WKE_RBUTTON = 0x02,
WKE_SHIFT = 0x04,
WKE_CONTROL = 0x08,
WKE_MBUTTON = 0x10,
-};
-enum wkeKeyFlags
+} wkeMouseFlags;
+
+
+typedef enum
{
WKE_EXTENDED = 0x0100,
WKE_REPEAT = 0x4000,
-};
-enum wkeMouseMsg
+} wkeKeyFlags;
+
+
+typedef enum
{
WKE_MSG_MOUSEMOVE = 0x0200,
WKE_MSG_LBUTTONDOWN = 0x0201,
@@ -54,260 +76,388 @@ enum wkeMouseMsg
WKE_MSG_MBUTTONUP = 0x0208,
WKE_MSG_MBUTTONDBLCLK = 0x0209,
WKE_MSG_MOUSEWHEEL = 0x020A,
+
+} wkeMouseMsg;
+
+
+
+#if !defined(__cplusplus)
+ #ifndef HAVE_WCHAR_T
+ typedef unsigned short wchar_t;
+ #endif
+
+ #ifndef HAVE_BOOL
+ typedef unsigned char bool;
+ #define true 1
+ #define false 0
+ #endif
+#endif
+
+
+typedef char utf8;
+typedef struct __wkeJSState wkeJSState;
+typedef __int64 wkeJSValue;
+
+
+#if defined(__cplusplus)
+ namespace wke{ class CWebView; };
+ typedef wke::CWebView wkeWebView;
+
+ namespace wke{ class CString; };
+ typedef wke::CString wkeString;
+
+#else
+ typedef struct __wkeWebView wkeWebView;
+ typedef struct __wkeString wkeString;
+#endif
+
+
+
+typedef enum
+{
+ WKE_PROXY_NONE,
+ WKE_PROXY_HTTP,
+ WKE_PROXY_SOCKS4,
+ WKE_PROXY_SOCKS4A,
+ WKE_PROXY_SOCKS5,
+ WKE_PROXY_SOCKS5HOSTNAME
+
+} wkeProxyType;
+
+typedef struct
+{
+ wkeProxyType type;
+ char hostname[100];
+ unsigned short port;
+ char username[50];
+ char password[50];
+
+} wkeProxy;
+
+enum wkeSettingMask
+{
+ WKE_SETTING_PROXY = 1,
+ WKE_SETTING_COOKIE_FILE_PATH = 1<<1
};
-typedef void* jsExecState;
-typedef __int64 jsValue;
+typedef struct
+{
+ wkeProxy proxy;
+ char cookieFilePath[1024];
+ unsigned int mask;
-typedef void* wkeString;
-typedef void (*ON_TITLE_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString title);
-typedef void (*ON_URL_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString url);
+} wkeSettings;
-typedef struct _wkeClientHandler {
- ON_TITLE_CHANGED onTitleChanged;
- ON_URL_CHANGED onURLChanged;
-} wkeClientHandler;
/*
- *c++ interface
- *-----------------------------------------------------------------------------------------------------------
+ *c interface
+ *----------------------------------------------------------------------------------------------------------
*
*/
-#ifdef __cplusplus
-
-namespace wke
+#if defined(__cplusplus)
+extern "C"
{
- class IWebView
- {
- public:
- virtual void destroy() = 0;
+#endif
- virtual const char* name() const = 0;
- virtual void setName(const char* name) = 0;
+WKE_API void WKE_CALL wkeInitialize();
+WKE_API void WKE_CALL wkeInitializeEx(const wkeSettings* settings);
+WKE_API void WKE_CALL wkeConfigure(const wkeSettings* settings);
+
+WKE_API void WKE_CALL wkeFinalize();
+WKE_API void WKE_CALL wkeUpdate();
+WKE_API unsigned int WKE_CALL wkeGetVersion();
+WKE_API const utf8* WKE_CALL wkeGetVersionString();
+
+typedef void* (WKE_CALL *FILE_OPEN) (const char* path);
+typedef void (WKE_CALL *FILE_CLOSE) (void* handle);
+typedef size_t (WKE_CALL *FILE_SIZE) (void* handle);
+typedef int (WKE_CALL *FILE_READ) (void* handle, void* buffer, size_t size);
+typedef int (WKE_CALL *FILE_SEEK) (void* handle, int offset, int origin);
+WKE_API void WKE_CALL wkeSetFileSystem(FILE_OPEN pfn_open, FILE_CLOSE pfn_close, FILE_SIZE pfn_size, FILE_READ pfn_read, FILE_SEEK pfn_seek);
+
+
+WKE_API wkeWebView* WKE_CALL wkeCreateWebView();
+WKE_API wkeWebView* WKE_CALL wkeGetWebView(const char* name);
+WKE_API void WKE_CALL wkeDestroyWebView(wkeWebView* webView);
- virtual bool transparent() const = 0;
- virtual void setTransparent(bool transparent) = 0;
+WKE_API const char* WKE_CALL wkeGetName(wkeWebView* webView);
+WKE_API void WKE_CALL wkeSetName(wkeWebView* webView, const char* name);
- virtual void loadURL(const utf8* url) = 0;
- virtual void loadURL(const wchar_t* url) = 0;
+WKE_API bool WKE_CALL wkeIsTransparent(wkeWebView* webView);
+WKE_API void WKE_CALL wkeSetTransparent(wkeWebView* webView, bool transparent);
- virtual void loadHTML(const utf8* html) = 0;
- virtual void loadHTML(const wchar_t* html) = 0;
+WKE_API void WKE_CALL wkeSetUserAgent(wkeWebView* webView, const utf8* userAgent);
+WKE_API void WKE_CALL wkeSetUserAgentW(wkeWebView* webView, const wchar_t* userAgent);
- virtual void loadFile(const utf8* filename) = 0;
- virtual void loadFile(const wchar_t* filename) = 0;
+WKE_API void WKE_CALL wkeLoadURL(wkeWebView* webView, const utf8* url);
+WKE_API void WKE_CALL wkeLoadURLW(wkeWebView* webView, const wchar_t* url);
+WKE_API void WKE_CALL wkePostURL(wkeWebView* wkeView,const utf8* url, const char* postData,int postLen);
+WKE_API void WKE_CALL wkePostURLW(wkeWebView* wkeView,const wchar_t* url, const char* postData, int postLen);
- virtual bool isLoaded() const = 0; /*document load sucessed*/
- virtual bool isLoadFailed() const = 0; /*document load failed*/
- virtual bool isLoadComplete() const = 0; /*document load complete*/
- virtual bool isDocumentReady() const = 0; /*document ready*/
- virtual void stopLoading() = 0;
- virtual void reload() = 0;
+WKE_API void WKE_CALL wkeLoadHTML(wkeWebView* webView, const utf8* html);
+WKE_API void WKE_CALL wkeLoadHTMLW(wkeWebView* webView, const wchar_t* html);
- virtual const utf8* title() = 0;
- virtual const wchar_t* titleW() = 0;
+WKE_API void WKE_CALL wkeLoadFile(wkeWebView* webView, const utf8* filename);
+WKE_API void WKE_CALL wkeLoadFileW(wkeWebView* webView, const wchar_t* filename);
- virtual void resize(int w, int h) = 0;
- virtual int width() const = 0; /*viewport width*/
- virtual int height() const = 0; /*viewport height*/
+WKE_API void WKE_CALL wkeLoad(wkeWebView* webView, const utf8* str);
+WKE_API void WKE_CALL wkeLoadW(wkeWebView* webView, const wchar_t* str);
- virtual int contentsWidth() const = 0; /*contents width*/
- virtual int contentsHeight() const = 0; /*contents height*/
+WKE_API bool WKE_CALL wkeIsLoading(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeIsLoadingSucceeded(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeIsLoadingFailed(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeIsLoadingCompleted(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeIsDocumentReady(wkeWebView* webView);
+WKE_API void WKE_CALL wkeStopLoading(wkeWebView* webView);
+WKE_API void WKE_CALL wkeReload(wkeWebView* webView);
- virtual void setDirty(bool dirty) = 0;
- virtual bool isDirty() const = 0;
- virtual void addDirtyArea(int x, int y, int w, int h) = 0;
+WKE_API const utf8* WKE_CALL wkeGetTitle(wkeWebView* webView);
+WKE_API const wchar_t* WKE_CALL wkeGetTitleW(wkeWebView* webView);
- virtual void layoutIfNeeded() = 0;
- virtual void paint(void* bits, int pitch) = 0;
+WKE_API void WKE_CALL wkeResize(wkeWebView* webView, int w, int h);
+WKE_API int WKE_CALL wkeGetWidth(wkeWebView* webView);
+WKE_API int WKE_CALL wkeGetHeight(wkeWebView* webView);
+WKE_API int WKE_CALL wkeGetContentWidth(wkeWebView* webView);
+WKE_API int WKE_CALL wkeGetContentHeight(wkeWebView* webView);
- virtual bool canGoBack() const = 0;
- virtual bool goBack() = 0;
- virtual bool canGoForward() const = 0;
- virtual bool goForward() = 0;
+WKE_API void WKE_CALL wkeSetDirty(wkeWebView* webView, bool dirty);
+WKE_API bool WKE_CALL wkeIsDirty(wkeWebView* webView);
+WKE_API void WKE_CALL wkeAddDirtyArea(wkeWebView* webView, int x, int y, int w, int h);
+WKE_API void WKE_CALL wkeLayoutIfNeeded(wkeWebView* webView);
+WKE_API void WKE_CALL wkePaint(wkeWebView* webView, void* bits,int bufWid, int bufHei, int xDst, int yDst, int w, int h, int xSrc, int ySrc, bool bCopyAlpha);
+WKE_API void WKE_CALL wkePaint2(wkeWebView* webView, void* bits,int pitch);
+WKE_API bool WKE_CALL wkeRepaintIfNeeded(wkeWebView* webView);
+WKE_API void* WKE_CALL wkeGetViewDC(wkeWebView* webView);
- virtual void selectAll() = 0;
- virtual void copy() = 0;
- virtual void cut() = 0;
- virtual void paste() = 0;
- virtual void delete_() = 0;
+WKE_API void WKE_CALL wkeSetRepaintInterval(wkeWebView* webView, int ms);
+WKE_API int WKE_CALL wkeGetRepaintInterval(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeRepaintIfNeededAfterInterval(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeRepaintAllNeeded();
+WKE_API int WKE_CALL wkeRunMessageLoop(const bool *quit);
- virtual void setCookieEnabled(bool enable) = 0;
- virtual bool cookieEnabled() const = 0;
+WKE_API bool WKE_CALL wkeCanGoBack(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeGoBack(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeCanGoForward(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeGoForward(wkeWebView* webView);
- virtual void setMediaVolume(float volume) = 0;
- virtual float mediaVolume() const = 0;
+WKE_API void WKE_CALL wkeEditorSelectAll(wkeWebView* webView);
+WKE_API void WKE_CALL wkeEditorCopy(wkeWebView* webView);
+WKE_API void WKE_CALL wkeEditorCut(wkeWebView* webView);
+WKE_API void WKE_CALL wkeEditorPaste(wkeWebView* webView);
+WKE_API void WKE_CALL wkeEditorDelete(wkeWebView* webView);
- virtual bool mouseEvent(unsigned int message, int x, int y, unsigned int flags) = 0;
- virtual bool contextMenuEvent(int x, int y, unsigned int flags) = 0;
- virtual bool mouseWheel(int x, int y, int delta, unsigned int flags) = 0;
- virtual bool keyUp(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
- virtual bool keyDown(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
- virtual bool keyPress(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
+WKE_API const wchar_t* WKE_CALL wkeGetCookieW(wkeWebView* webView);
+WKE_API const utf8* WKE_CALL wkeGetCookie(wkeWebView* webView);
+WKE_API void WKE_CALL wkeSetCookieEnabled(wkeWebView* webView, bool enable);
+WKE_API bool WKE_CALL wkeIsCookieEnabled(wkeWebView* webView);
- virtual void focus() = 0;
- virtual void unfocus() = 0;
+WKE_API void WKE_CALL wkeSetMediaVolume(wkeWebView* webView, float volume);
+WKE_API float WKE_CALL wkeGetMediaVolume(wkeWebView* webView);
- virtual wkeRect getCaret() = 0;
+WKE_API bool WKE_CALL wkeFireMouseEvent(wkeWebView* webView, unsigned int message, int x, int y, unsigned int flags);
+WKE_API bool WKE_CALL wkeFireContextMenuEvent(wkeWebView* webView, int x, int y, unsigned int flags);
+WKE_API bool WKE_CALL wkeFireMouseWheelEvent(wkeWebView* webView, int x, int y, int delta, unsigned int flags);
+WKE_API bool WKE_CALL wkeFireKeyUpEvent(wkeWebView* webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey);
+WKE_API bool WKE_CALL wkeFireKeyDownEvent(wkeWebView* webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey);
+WKE_API bool WKE_CALL wkeFireKeyPressEvent(wkeWebView* webView, unsigned int charCode, unsigned int flags, bool systemKey);
- virtual jsValue runJS(const utf8* script) = 0;
- virtual jsValue runJS(const wchar_t* script) = 0;
- virtual jsExecState globalExec() = 0;
+WKE_API void WKE_CALL wkeSetFocus(wkeWebView* webView);
+WKE_API void WKE_CALL wkeKillFocus(wkeWebView* webView);
- virtual void sleep() = 0; //moveOffscreen
- virtual void awaken() = 0; //moveOnscreen
- virtual bool isAwake() const = 0;
+WKE_API wkeRect WKE_CALL wkeGetCaretRect(wkeWebView* webView);
- virtual void setZoomFactor(float factor) = 0;
- virtual float zoomFactor() const = 0;
+WKE_API wkeJSValue WKE_CALL wkeRunJS(wkeWebView* webView, const utf8* script);
+WKE_API wkeJSValue WKE_CALL wkeRunJSW(wkeWebView* webView, const wchar_t* script);
- virtual void setEditable(bool editable) = 0;
+WKE_API wkeJSState* WKE_CALL wkeGlobalExec(wkeWebView* webView);
- virtual void setClientHandler(const wkeClientHandler* handler) = 0;
- virtual const wkeClientHandler* getClientHandler() const = 0;
- };
-}
+WKE_API void WKE_CALL wkeSleep(wkeWebView* webView);
+WKE_API void WKE_CALL wkeWake(wkeWebView* webView);
+WKE_API bool WKE_CALL wkeIsAwake(wkeWebView* webView);
-typedef wke::IWebView* wkeWebView;
+WKE_API void WKE_CALL wkeSetZoomFactor(wkeWebView* webView, float factor);
+WKE_API float WKE_CALL wkeGetZoomFactor(wkeWebView* webView);
-#else
+WKE_API void WKE_CALL wkeSetEditable(wkeWebView* webView, bool editable);
-typedef void* wkeWebView;
+WKE_API void WKE_CALL wkeSetHostWindow(wkeWebView* webWindow, void* hostWindow);
+WKE_API void* WKE_CALL wkeGetHostWindow(wkeWebView* webWindow);
-#ifndef HAVE_WCHAR_T
-typedef unsigned short wchar_t;
-#endif
-#ifndef HAVE_BOOL
-typedef unsigned char bool;
-#define true 1
-#define false 0
-#endif
+WKE_API const utf8* WKE_CALL wkeGetString(const wkeString* string);
+WKE_API const wchar_t* WKE_CALL wkeGetStringW(const wkeString* string);
-#endif /*__cplusplus*/
+WKE_API void WKE_CALL wkeSetString(wkeString* string, const utf8* str, size_t len);
+WKE_API void WKE_CALL wkeSetStringW(wkeString* string, const wchar_t* str, size_t len);
-/*
- *c interface
- *----------------------------------------------------------------------------------------------------------
- *
- */
+typedef void (WKE_CALL *wkeTitleChangedCallback)(wkeWebView* webView, void* param, const wkeString* title);
+WKE_API void WKE_CALL wkeOnTitleChanged(wkeWebView* webView, wkeTitleChangedCallback callback, void* callbackParam);
-#ifdef __cplusplus
-extern "C"
+typedef void (WKE_CALL *wkeURLChangedCallback)(wkeWebView* webView, void* param, const wkeString* url);
+WKE_API void WKE_CALL wkeOnURLChanged(wkeWebView* webView, wkeURLChangedCallback callback, void* callbackParam);
+
+typedef void (WKE_CALL *wkePaintUpdatedCallback)(wkeWebView* webView, void* param, const void* hdc, int x, int y, int cx, int cy);
+WKE_API void WKE_CALL wkeOnPaintUpdated(wkeWebView* webView, wkePaintUpdatedCallback callback, void* callbackParam);
+
+typedef void (WKE_CALL *wkeAlertBoxCallback)(wkeWebView* webView, void* param, const wkeString* msg);
+WKE_API void WKE_CALL wkeOnAlertBox(wkeWebView* webView, wkeAlertBoxCallback callback, void* callbackParam);
+
+typedef bool (WKE_CALL *wkeConfirmBoxCallback)(wkeWebView* webView, void* param, const wkeString* msg);
+WKE_API void WKE_CALL wkeOnConfirmBox(wkeWebView* webView, wkeConfirmBoxCallback callback, void* callbackParam);
+
+typedef bool (WKE_CALL *wkePromptBoxCallback)(wkeWebView* webView, void* param, const wkeString* msg, const wkeString* defaultResult, wkeString* result);
+WKE_API void WKE_CALL wkeOnPromptBox(wkeWebView* webView, wkePromptBoxCallback callback, void* callbackParam);
+
+
+typedef enum
{
-#endif
+ WKE_MESSAGE_SOURCE_HTML,
+ WKE_MESSAGE_SOURCE_XML,
+ WKE_MESSAGE_SOURCE_JS,
+ WKE_MESSAGE_SOURCE_NETWORK,
+ WKE_MESSAGE_SOURCE_CONSOLE_API,
+ WKE_MESSAGE_SOURCE_OTHER
-WKE_API void wkeInit();
-WKE_API void wkeShutdown();
-WKE_API void wkeUpdate();
-WKE_API unsigned int wkeVersion();
-WKE_API const utf8* wkeVersionString();
+} wkeMessageSource;
-typedef void* (*FILE_OPEN) (const char* path);
-typedef void (*FILE_CLOSE) (void* handle);
-typedef size_t (*FILE_SIZE) (void* handle);
-typedef int (*FILE_READ) (void* handle, void* buffer, size_t size);
-typedef int (*FILE_SEEK) (void* handle, int offset, int origin);
+typedef enum
+{
+ WKE_MESSAGE_TYPE_LOG,
+ WKE_MESSAGE_TYPE_DIR,
+ WKE_MESSAGE_TYPE_DIR_XML,
+ WKE_MESSAGE_TYPE_TRACE,
+ WKE_MESSAGE_TYPE_START_GROUP,
+ WKE_MESSAGE_TYPE_START_GROUP_COLLAPSED,
+ WKE_MESSAGE_TYPE_END_GROUP,
+ WKE_MESSAGE_TYPE_ASSERT
+
+} wkeMessageType;
+
+typedef enum
+{
+ WKE_MESSAGE_LEVEL_TIP,
+ WKE_MESSAGE_LEVEL_LOG,
+ WKE_MESSAGE_LEVEL_WARNING,
+ WKE_MESSAGE_LEVEL_ERROR,
+ WKE_MESSAGE_LEVEL_DEBUG
+
+} wkeMessageLevel;
+
+typedef struct
+{
+ wkeMessageSource source;
+ wkeMessageType type;
+ wkeMessageLevel level;
+ wkeString* message;
+ wkeString* url;
+ unsigned int lineNumber;
+
+} wkeConsoleMessage;
+
+typedef void (WKE_CALL *wkeConsoleMessageCallback)(wkeWebView* webView, void* param, const wkeConsoleMessage* message);
+WKE_API void WKE_CALL wkeOnConsoleMessage(wkeWebView* webView, wkeConsoleMessageCallback callback, void* callbackParam);
+
+
+
+typedef enum
+{
+ WKE_NAVIGATION_TYPE_LINKCLICK,
+ WKE_NAVIGATION_TYPE_FORMSUBMITTE,
+ WKE_NAVIGATION_TYPE_BACKFORWARD,
+ WKE_NAVIGATION_TYPE_RELOAD,
+ WKE_NAVIGATION_TYPE_FORMRESUBMITT,
+ WKE_NAVIGATION_TYPE_OTHER
-WKE_API void wkeSetFileSystem(FILE_OPEN pfn_open, FILE_CLOSE pfn_close, FILE_SIZE pfn_size, FILE_READ pfn_read, FILE_SEEK pfn_seek);
+} wkeNavigationType;
+typedef bool (WKE_CALL *wkeNavigationCallback)(wkeWebView* webView, void* param, wkeNavigationType navigationType, const wkeString* url);
+WKE_API void WKE_CALL wkeOnNavigation(wkeWebView* webView, wkeNavigationCallback callback, void* param);
-WKE_API wkeWebView wkeCreateWebView();
-WKE_API wkeWebView wkeGetWebView(const char* name);
-WKE_API void wkeDestroyWebView(wkeWebView webView);
-WKE_API const char* wkeWebViewName(wkeWebView webView);
-WKE_API void wkeSetWebViewName(wkeWebView webView, const char* name);
+typedef struct
+{
+ wkeNavigationType navigationType;
+ wkeString* url;
+ wkeString* target;
+
+ int x;
+ int y;
+ int width;
+ int height;
-WKE_API bool wkeIsTransparent(wkeWebView webView);
-WKE_API void wkeSetTransparent(wkeWebView webView, bool transparent);
+ bool menuBarVisible;
+ bool statusBarVisible;
+ bool toolBarVisible;
+ bool locationBarVisible;
+ bool scrollbarsVisible;
+ bool resizable;
+ bool fullscreen;
-WKE_API void wkeLoadURL(wkeWebView webView, const utf8* url);
-WKE_API void wkeLoadURLW(wkeWebView webView, const wchar_t* url);
+} wkeNewViewInfo;
-WKE_API void wkeLoadHTML(wkeWebView webView, const utf8* html);
-WKE_API void wkeLoadHTMLW(wkeWebView webView, const wchar_t* html);
-WKE_API void wkeLoadFile(wkeWebView webView, const utf8* filename);
-WKE_API void wkeLoadFileW(wkeWebView webView, const wchar_t* filename);
+typedef wkeWebView* (WKE_CALL *wkeCreateViewCallback)(wkeWebView* webView, void* param, const wkeNewViewInfo* info);
+WKE_API void WKE_CALL wkeOnCreateView(wkeWebView* webView, wkeCreateViewCallback callback, void* param);
-WKE_API bool wkeIsLoaded(wkeWebView webView);
-WKE_API bool wkeIsLoadFailed(wkeWebView webView);
-WKE_API bool wkeIsLoadComplete(wkeWebView webView);
-WKE_API bool wkeIsDocumentReady(wkeWebView webView);
-WKE_API bool wkeIsLoading(wkeWebView webView);
-WKE_API void wkeStopLoading(wkeWebView webView);
-WKE_API void wkeReload(wkeWebView webView);
-WKE_API const utf8* wkeTitle(wkeWebView webView);
-WKE_API const wchar_t* wkeTitleW(wkeWebView webView);
+typedef struct
+{
+ wkeString* url;
+ wkeJSState* frameJSState;
+ wkeJSState* mainFrameJSState;
-WKE_API void wkeResize(wkeWebView webView, int w, int h);
-WKE_API int wkeWidth(wkeWebView webView);
-WKE_API int wkeHeight(wkeWebView webView);
+} wkeDocumentReadyInfo;
-WKE_API int wkeContentsWidth(wkeWebView webView);
-WKE_API int wkeContentsHeight(wkeWebView webView);
+typedef void (WKE_CALL *wkeDocumentReadyCallback)(wkeWebView* webView, void* param, const wkeDocumentReadyInfo* info);
+WKE_API void WKE_CALL wkeOnDocumentReady(wkeWebView* webView, wkeDocumentReadyCallback callback, void* param);
-WKE_API void wkeSetDirty(wkeWebView webView, bool dirty);
-WKE_API bool wkeIsDirty(wkeWebView webView);
-WKE_API void wkeAddDirtyArea(wkeWebView webView, int x, int y, int w, int h);
-WKE_API void wkeLayoutIfNeeded(wkeWebView webView);
-WKE_API void wkePaint(wkeWebView webView, void* bits, int pitch);
-WKE_API bool wkeCanGoBack(wkeWebView webView);
-WKE_API bool wkeGoBack(wkeWebView webView);
-WKE_API bool wkeCanGoForward(wkeWebView webView);
-WKE_API bool wkeGoForward(wkeWebView webView);
+typedef enum
+{
+ WKE_LOADING_SUCCEEDED,
+ WKE_LOADING_FAILED,
+ WKE_LOADING_CANCELED
-WKE_API void wkeSelectAll(wkeWebView webView);
-WKE_API void wkeCopy(wkeWebView webView);
-WKE_API void wkeCut(wkeWebView webView);
-WKE_API void wkePaste(wkeWebView webView);
-WKE_API void wkeDelete(wkeWebView webView);
+} wkeLoadingResult;
-WKE_API void wkeSetCookieEnabled(wkeWebView webView, bool enable);
-WKE_API bool wkeCookieEnabled(wkeWebView webView);
+typedef void (WKE_CALL *wkeLoadingFinishCallback)(wkeWebView* webView, void* param, const wkeString* url, wkeLoadingResult result, const wkeString* failedReason);
+WKE_API void WKE_CALL wkeOnLoadingFinish(wkeWebView* webView, wkeLoadingFinishCallback callback, void* param);
-WKE_API void wkeSetMediaVolume(wkeWebView webView, float volume);
-WKE_API float wkeMediaVolume(wkeWebView webView);
-WKE_API bool wkeMouseEvent(wkeWebView webView, unsigned int message, int x, int y, unsigned int flags);
-WKE_API bool wkeContextMenuEvent(wkeWebView webView, int x, int y, unsigned int flags);
-WKE_API bool wkeMouseWheel(wkeWebView webView, int x, int y, int delta, unsigned int flags);
-WKE_API bool wkeKeyUp(wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey);
-WKE_API bool wkeKeyDown(wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey);
-WKE_API bool wkeKeyPress(wkeWebView webView, unsigned int charCode, unsigned int flags, bool systemKey);
+typedef enum
+{
+ WKE_WINDOW_TYPE_POPUP,
+ WKE_WINDOW_TYPE_TRANSPARENT,
+ WKE_WINDOW_TYPE_CONTROL
-WKE_API void wkeFocus(wkeWebView webView);
-WKE_API void wkeUnfocus(wkeWebView webView);
+} wkeWindowType;
-WKE_API wkeRect wkeGetCaret(wkeWebView webView);
+WKE_API wkeWebView* WKE_CALL wkeCreateWebWindow(wkeWindowType type, void* parent, int x, int y, int width, int height);
+WKE_API void WKE_CALL wkeDestroyWebWindow(wkeWebView* webWindow);
+WKE_API void* WKE_CALL wkeGetWindowHandle(wkeWebView* webWindow);
-WKE_API jsValue wkeRunJS(wkeWebView webView, const utf8* script);
-WKE_API jsValue wkeRunJSW(wkeWebView webView, const wchar_t* script);
+typedef bool (WKE_CALL *wkeWindowClosingCallback)(wkeWebView* webWindow, void* param);
+WKE_API void WKE_CALL wkeOnWindowClosing(wkeWebView* webWindow, wkeWindowClosingCallback callback, void* param);
-WKE_API jsExecState wkeGlobalExec(wkeWebView webView);
+typedef void (WKE_CALL *wkeWindowDestroyCallback)(wkeWebView* webWindow, void* param);
+WKE_API void WKE_CALL wkeOnWindowDestroy(wkeWebView* webWindow, wkeWindowDestroyCallback callback, void* param);
-WKE_API void wkeSleep(wkeWebView webView);
-WKE_API void wkeAwaken(wkeWebView webView);
-WKE_API bool wkeIsAwake(wkeWebView webView);
-WKE_API void wkeSetZoomFactor(wkeWebView webView, float factor);
-WKE_API float wkeZoomFactor(wkeWebView webView);
+WKE_API void WKE_CALL wkeShowWindow(wkeWebView* webWindow, bool show);
+WKE_API void WKE_CALL wkeEnableWindow(wkeWebView* webWindow, bool enable);
-WKE_API void wkeSetEditable(wkeWebView webView, bool editable);
+WKE_API void WKE_CALL wkeMoveWindow(wkeWebView* webWindow, int x, int y, int width, int height);
+WKE_API void WKE_CALL wkeMoveToCenter(wkeWebView* webWindow);
+WKE_API void WKE_CALL wkeResizeWindow(wkeWebView* webWindow, int width, int height);
-WKE_API void wkeSetClientHandler(wkeWebView webView, const wkeClientHandler* handler);
-WKE_API const wkeClientHandler* wkeGetClientHandler(wkeWebView webView);
+WKE_API void WKE_CALL wkeSetWindowTitle(wkeWebView* webWindow, const utf8* title);
+WKE_API void WKE_CALL wkeSetWindowTitleW(wkeWebView* webWindow, const wchar_t* title);
-WKE_API const utf8* wkeToString(const wkeString string);
-WKE_API const wchar_t* wkeToStringW(const wkeString string);
/***JavaScript Bind***/
#define JS_CALL __fastcall
-typedef jsValue (JS_CALL *jsNativeFunction) (jsExecState es);
+typedef wkeJSValue (JS_CALL *wkeJSNativeFunction) (wkeJSState* es);
typedef enum
{
@@ -317,80 +467,107 @@ typedef enum
JSTYPE_OBJECT,
JSTYPE_FUNCTION,
JSTYPE_UNDEFINED,
-} jsType;
-
-WKE_API void jsBindFunction(const char* name, jsNativeFunction fn, unsigned int argCount);
-WKE_API void jsBindGetter(const char* name, jsNativeFunction fn); /*get property*/
-WKE_API void jsBindSetter(const char* name, jsNativeFunction fn); /*set property*/
-
-WKE_API int jsArgCount(jsExecState es);
-WKE_API jsType jsArgType(jsExecState es, int argIdx);
-WKE_API jsValue jsArg(jsExecState es, int argIdx);
+} wkeJSType;
+
+
+WKE_API void WKE_CALL wkeJSBindFunction(const char* name, wkeJSNativeFunction fn, unsigned int argCount);
+WKE_API void WKE_CALL wkeJSBindGetter(const char* name, wkeJSNativeFunction fn); /*get property*/
+WKE_API void WKE_CALL wkeJSBindSetter(const char* name, wkeJSNativeFunction fn); /*set property*/
+
+WKE_API int WKE_CALL wkeJSParamCount(wkeJSState* es);
+WKE_API wkeJSType WKE_CALL wkeJSParamType(wkeJSState* es, int index);
+WKE_API wkeJSValue WKE_CALL wkeJSParam(wkeJSState* es, int index);
+
+WKE_API wkeJSType WKE_CALL wkeJSTypeOf(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsNumber(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsString(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsBool(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsObject(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsFunction(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsUndefined(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsNull(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsArray(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsTrue(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSIsFalse(wkeJSState* es, wkeJSValue v);
+
+WKE_API int WKE_CALL wkeJSToInt(wkeJSState* es, wkeJSValue v);
+WKE_API float WKE_CALL wkeJSToFloat(wkeJSState* es, wkeJSValue v);
+WKE_API double WKE_CALL wkeJSToDouble(wkeJSState* es, wkeJSValue v);
+WKE_API bool WKE_CALL wkeJSToBool(wkeJSState* es, wkeJSValue v);
+WKE_API const utf8* WKE_CALL wkeJSToTempString(wkeJSState* es, wkeJSValue v);
+WKE_API const wchar_t* WKE_CALL wkeJSToTempStringW(wkeJSState* es, wkeJSValue v);
+
+WKE_API wkeJSValue WKE_CALL wkeJSInt(wkeJSState* es, int n);
+WKE_API wkeJSValue WKE_CALL wkeJSFloat(wkeJSState* es, float f);
+WKE_API wkeJSValue WKE_CALL wkeJSDouble(wkeJSState* es, double d);
+WKE_API wkeJSValue WKE_CALL wkeJSBool(wkeJSState* es, bool b);
+
+WKE_API wkeJSValue WKE_CALL wkeJSUndefined(wkeJSState* es);
+WKE_API wkeJSValue WKE_CALL wkeJSNull(wkeJSState* es);
+WKE_API wkeJSValue WKE_CALL wkeJSTrue(wkeJSState* es);
+WKE_API wkeJSValue WKE_CALL wkeJSFalse(wkeJSState* es);
+
+WKE_API wkeJSValue WKE_CALL wkeJSString(wkeJSState* es, const utf8* str);
+WKE_API wkeJSValue WKE_CALL wkeJSStringW(wkeJSState* es, const wchar_t* str);
+WKE_API wkeJSValue WKE_CALL wkeJSEmptyObject(wkeJSState* es);
+WKE_API wkeJSValue WKE_CALL wkeJSEmptyArray(wkeJSState* es);
+
+
+
+//cexer JS֧
+typedef struct __wkeJSData wkeJSData;
+typedef wkeJSValue (WKE_CALL *wkeJSGetPropertyCallback)(wkeJSState* es, wkeJSValue object, const char* propertyName);
+typedef bool (WKE_CALL *wkeJSSetPropertyCallback)(wkeJSState* es, wkeJSValue object, const char* propertyName, wkeJSValue value);
+typedef wkeJSValue (WKE_CALL *wkeJSCallAsFunctionCallback)(wkeJSState* es, wkeJSValue object, wkeJSValue* args, int argCount);
+typedef void (WKE_CALL *wkeJSFinalizeCallback)(wkeJSData* data);
+
+typedef struct __wkeJSData
+{
+ char typeName[100];
+ wkeJSGetPropertyCallback propertyGet;
+ wkeJSSetPropertyCallback propertySet;
+ wkeJSFinalizeCallback finalize;
+ wkeJSCallAsFunctionCallback callAsFunction;
-WKE_API jsType jsTypeOf(jsValue v);
-WKE_API bool jsIsNumber(jsValue v);
-WKE_API bool jsIsString(jsValue v);
-WKE_API bool jsIsBoolean(jsValue v);
-WKE_API bool jsIsObject(jsValue v);
-WKE_API bool jsIsFunction(jsValue v);
-WKE_API bool jsIsUndefined(jsValue v);
-WKE_API bool jsIsNull(jsValue v);
-WKE_API bool jsIsArray(jsValue v);
-WKE_API bool jsIsTrue(jsValue v);
-WKE_API bool jsIsFalse(jsValue v);
+} wkeJSData;
-WKE_API int jsToInt(jsExecState es, jsValue v);
-WKE_API float jsToFloat(jsExecState es, jsValue v);
-WKE_API double jsToDouble(jsExecState es, jsValue v);
-WKE_API bool jsToBoolean(jsExecState es, jsValue v);
-WKE_API const utf8* jsToString(jsExecState es, jsValue v);
-WKE_API const wchar_t* jsToStringW(jsExecState es, jsValue v);
+WKE_API wkeJSValue WKE_CALL wkeJSObject(wkeJSState* es, wkeJSData* obj);
+WKE_API wkeJSValue WKE_CALL wkeJSFunction(wkeJSState* es, wkeJSData* obj);
+WKE_API wkeJSData* WKE_CALL wkeJSGetData(wkeJSState* es, wkeJSValue object);
-WKE_API jsValue jsInt(int n);
-WKE_API jsValue jsFloat(float f);
-WKE_API jsValue jsDouble(double d);
-WKE_API jsValue jsBoolean(bool b);
+WKE_API wkeJSValue WKE_CALL wkeJSGet(wkeJSState* es, wkeJSValue object, const char* prop);
+WKE_API void WKE_CALL wkeJSSet(wkeJSState* es, wkeJSValue object, const char* prop, wkeJSValue v);
-WKE_API jsValue jsUndefined();
-WKE_API jsValue jsNull();
-WKE_API jsValue jsTrue();
-WKE_API jsValue jsFalse();
+WKE_API wkeJSValue WKE_CALL wkeJSGetAt(wkeJSState* es, wkeJSValue object, int index);
+WKE_API void WKE_CALL wkeJSSetAt(wkeJSState* es, wkeJSValue object, int index, wkeJSValue v);
-WKE_API jsValue jsString(jsExecState es, const utf8* str);
-WKE_API jsValue jsStringW(jsExecState es, const wchar_t* str);
-WKE_API jsValue jsObject(jsExecState es);
-WKE_API jsValue jsArray(jsExecState es);
+WKE_API int WKE_CALL wkeJSGetLength(wkeJSState* es, wkeJSValue object);
+WKE_API void WKE_CALL wkeJSSetLength(wkeJSState* es, wkeJSValue object, int length);
-WKE_API jsValue jsFunction(jsExecState es, jsNativeFunction fn, unsigned int argCount);
-//return the window object
-WKE_API jsValue jsGlobalObject(jsExecState es);
+WKE_API wkeJSValue WKE_CALL wkeJSGlobalObject(wkeJSState* es);
+WKE_API wkeWebView* WKE_CALL wkeJSGetWebView(wkeJSState* es);
-WKE_API jsValue jsEval(jsExecState es, const utf8* str);
-WKE_API jsValue jsEvalW(jsExecState es, const wchar_t* str);
+WKE_API wkeJSValue WKE_CALL wkeJSEval(wkeJSState* es, const utf8* str);
+WKE_API wkeJSValue WKE_CALL wkeJSEvalW(wkeJSState* es, const wchar_t* str);
-WKE_API jsValue jsCall(jsExecState es, jsValue func, jsValue thisObject, jsValue* args, int argCount);
-WKE_API jsValue jsCallGlobal(jsExecState es, jsValue func, jsValue* args, int argCount);
+WKE_API wkeJSValue WKE_CALL wkeJSCall(wkeJSState* es, wkeJSValue func, wkeJSValue thisObject, wkeJSValue* args, int argCount);
+WKE_API wkeJSValue WKE_CALL wkeJSCallGlobal(wkeJSState* es, wkeJSValue func, wkeJSValue* args, int argCount);
-WKE_API jsValue jsGet(jsExecState es, jsValue object, const char* prop);
-WKE_API void jsSet(jsExecState es, jsValue object, const char* prop, jsValue v);
+WKE_API wkeJSValue WKE_CALL wkeJSGetGlobal(wkeJSState* es, const char* prop);
+WKE_API void WKE_CALL wkeJSSetGlobal(wkeJSState* es, const char* prop, wkeJSValue v);
-WKE_API jsValue jsGetGlobal(jsExecState es, const char* prop);
-WKE_API void jsSetGlobal(jsExecState es, const char* prop, jsValue v);
-WKE_API jsValue jsGetAt(jsExecState es, jsValue object, int index);
-WKE_API void jsSetAt(jsExecState es, jsValue object, int index, jsValue v);
+WKE_API void WKE_CALL wkeJSAddRef(wkeJSState* es, wkeJSValue v);
+WKE_API void WKE_CALL wkeJSReleaseRef(wkeJSState* es, wkeJSValue v);
+WKE_API void WKE_CALL wkeJSCollectGarbge();
-WKE_API int jsGetLength(jsExecState es, jsValue object);
-WKE_API void jsSetLength(jsExecState es, jsValue object, int length);
-WKE_API wkeWebView jsGetWebView(jsExecState es);
-WKE_API void jsGC(); //garbage collect
#ifdef __cplusplus
}
#endif
-#endif
\ No newline at end of file
+#endif//#ifndef WKE_H
diff --git a/demo/libwke/wke.lib b/demo/libwke/wke.lib
index d9512fab..ca823375 100644
Binary files a/demo/libwke/wke.lib and b/demo/libwke/wke.lib differ
diff --git a/readme.md b/readme.md
new file mode 100644
index 00000000..94c7f986
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,121 @@
+wke Ŀĵ
+===========================
+
+Ŀ¼
+---------
+
+- [Ŀ](#introduce)
+- [ָ](#build)
+ - [棺ܱԴͬ](#build-flathead-way)
+ - [棺ɱԴͬ](#build-hotshot-way)
+- [FAQ](#FAQ)
+ - [FAQ1. wke HTML5 ֧Σ](#FAQ1)
+ - [FAQ2. Ϊʲô](#FAQ2)
+ - [FAQ3. Ϊʲô wke ĿûΪ WebCore Ŀ](#FAQ3)
+- [](#contributors)
+ - [BlzFans](#blzfans)
+ - [Vincent.Lin](#vincent-lin)
+ - [__](#shao)
+ - [ ](#guang-guang)
+ - [](#ma-yi)
+ - [SOUI](#flyhigh)
+ - [](#others)
+
+ Ŀ
+---------
+
+wke һ WebKit 棬ԭĿַ ԭֹͣ£˳ڼоĿ fork ҵʱάѧϰ WebKit ؼҲʵ齫 web UIԱĿȤӭעʱıҲһ WebKit оߡߣҲӭͨĿ㱦ľ顣
+
+һ±Ŀʷ[ύ־](https://github.com/cexer/wke/commits/master)ҲԲ鿴[ļ¼](https://github.com/cexer/wke/blob/master/Document/history.md)˽ġκĿص飬ӭQQȺ **178168957** [WebUI:wke/cef/mshtml/miniblink](http://shang.qq.com/wpa/qunwpa?idkey=ebe64628d19349ed41e2e77b6dfdb4bdd11fc1cb46f6721f24de1a674bd3bf9b) д
+
+
+ ָ
+---------
+
+ **棺ܱԴͬ**
+
+˷˳ı취ȱص ZIP ԴֿϢֺ git ֿͬ
+
+1. [Ŀhttps://www.github.com/cexer/wke](https://www.github.com/cexer/wke) Դ **ZIP **ѹĿĿ¼
+2. ҪѡִĿĿ¼ vs2008.batvs2010.batvs2013.batú VS
+3. ڽУȱ WebCore Ŀɹ֮ٱ wkeBrowserwkexe Ŀ
+
+ϸɱ99%ĵIJȿӷ˽Ϊʲô룬 [FAQ2. Ϊʲô](#FAQ2)
+
+ **棺ɱԴͬ**
+
+һˣ뱣 git ֿͬɼ˷
+
+1. ϸĶ[GitHub һӣзԶת](http://blog.jobbole.com/46200/)Ȼ˵ú git ͻˡ
+2. ҪѡִĿĿ¼ vs2008.batvs2010.batvs2013.batú VS
+3. ڽУȱ WebCore Ŀɹ֮ٱ wkeBrowserwkexe Ŀ
+
+ zip ҪĿǹ git ͻ clone ʱһӣ[GitHub һӣзԶת](http://blog.jobbole.com/46200/)ֻҪеķú git ͻˣͿ clonepullpush ֿˡ
+
+
+ FAQ
+---------
+
+### FAQ1. wke HTML5 ֧Σ
+
+wke WebKit 2011 İ汾֮һֱûͬ WebKit ¹ wke HTML5 ֧ͣ 2011 ꣬һֱδĽһֱ۵ġȻǺȷĸ wke HTML5 ִ֧Լ IE9 ֮ϣ IE10 ֮£ ܷΪ 222 ֣Զ CEF 530 ֮¡Ƕ HTML5 ҪϸߵĻʹ wke뿼 CEF ڿе miniblink ںˡ
+
+
+### FAQ2. Ϊʲô
+
+99%Ŀԭ
+
+**1. Բе git ͻ autocrlf ܵ⣺**
+
+JavaScriptCoreWebCore ĿʱҪ perlpython ȽűģԴļIDLɽӿļȣΪwke ĿԴһ cygwin ĿѾԤ perlpython cygwin 汾 perlpython linux 汾һֶֻ֧ȡ linux з`\n`ļûʲô⣬Ϊ wke ĿеģļIDLļ linux ʽĻз**Ȼ** git ͻĬϻῪһԲеĹ `autocrlf`֮ܿʹ git ͻȡʱὫԴļģļIDLļĻзǿΪǰϵͳĻз windows ϼ `\r\n` perlpython ȡļһԴļӿļ ZIP ƹ git ͻ˵Բйܡ
+
+ϸ˽⣬鿴 [GitHub һӣзԶת](http://blog.jobbole.com/46200/)
+
+**2. ϵ VS2010 - VS2013 ҲԼ nmake ⣺**
+
+ JavaScriptCoreWebCore ĿʱҪ perlpython Ƚűһļ perlpython VSͨԼҵ nmake ġȻ˷֢մ VS2010 - VS2013ĬҲ Լҵ nmakeVS֮ǰһ vsvars32.bat ûĿĿ¼ vs2010.batvs2013.bat ļʵVS2008 û⣬ΪͳһҲڸĿ¼·һ vs2008.bat
+
+ִϲδ⣬QQȺ **178168957** [WebUI:wke/cef/mshtml/miniblink](http://shang.qq.com/wpa/qunwpa?idkey=ebe64628d19349ed41e2e77b6dfdb4bdd11fc1cb46f6721f24de1a674bd3bf9b)
+
+### FAQ3. Ϊʲô wke ĿûΪ WebCore Ŀ
+
+ [FAQ2. Ϊʲô](#FAQ2) еԭģ JavaScriptCoreWebCore ĿǰкܶĽűãĿǷѾɹЩÿζִһ飬ܷʱ䣬ʵ WebCoreJavaScriptCore ĿڿУǼٻҪ±ġ wke Ϊ WebCoreôÿ wke 붼ᵼ WebCoreJavaScriptCore ĿнűãѲҪʱ䣬Դ wke WebCoreĿʼ WebCore ʱʱֶһ WebCoreȻʱ붼ûѲҪĽűʱˡ
+
+
+
+---------
+
+### BlzFans
+
+`BlzFans` λɲȻΪ˼͵ wke Ŀ˦Դ֮뿪ȥʵԼߵֵˣһ䣬һĤݡлŬdzĵ·ǰҲϣһܹٴλص WebUI Ķֱӷ WebUI ۷塣
+
+### Vincent.Lin
+
+`Vincent.Lin` ǴٳɽQQȺ github Ŀԭϡwke ֮ǰһֱûQQȺͳάĿԴĿֱijż `Vincent.Lin` һ˼ wke BUGҪһQQȺ½ԴĿ뷨ӴBUG֮һͻ۵IJֿ⣬wke ûһij
+
+
+### __
+
+`__` ҲȺԭ֮һΪ wke ˲ٴ룬 cookie Ľӿڡ POST ʽҳĽӿڵȡΪȺԱ𱣩֮һԹXXһÿղۼ⡢ij̸Ϊ˴ɽ
+
+
+###
+
+` ` ˾ҲӰȥٵĴwke ֮ǰֻ vs2005vs2008 VSĿļ vs2010vs2013 Ȱ汾֪ÿ` ` ʱΪ wke vs2010vs2013 Ĺ̡ȻҲʧˡȻҲ vs2017vs2018 УΪ⽹ͷöʱֻ̤ɫƲʳ
+
+
+###
+
+`` ʦ wke ȺмἼþɱḻܼܹȺ`` ʦѾõ wke ⣨ijЩ»ᵼ codemirror ٣,ʵܸߵ websocket ܣ wke ҲˣĪɡ
+
+
+### SOUI
+
+`SOUI` һ DirectUI ⣬ҵļ罫 wke ӿԴվõʵʵ SOUI СΪ wke ǿ˲ٹܡһЩ BUGƻصURLıصȡҲǴ SOUI Ⱥ wke ԽԽ֪ǵĿֿĹףȤĿԼ SOUI QQȺ **229313785**
+
+
+###
+
+ʵкܶˣҲΪ wke ĿǴϵĻDZķĵĹףڴһл
+
+ÿߵһһʹ wke ԽԽǿ
\ No newline at end of file
diff --git a/readme.txt b/readme.txt
deleted file mode 100644
index 5b539b12..00000000
--- a/readme.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-
-Web and Flash Embedded in 3D games, based on WebKit
-
-
-
-
-Building wke
-
-VS2005:
-1 Install Visual Studio 2005 SP1
-2 Install the Windows SDK 6.0
-3 Open the vs2005/wke.sln solution file in Visual Studio and build the solution.
- This can take from 30 minutes to 1 hours. More likely 40 minutes.
-
-VS2008:
-1 Install Visual Studio 2008 SP1
-2 Install the Windows SDK 6.0 or newer
-3 Open the vs2008/wke.sln solution file in Visual Studio and build the solution.
- This can take from 30 minutes to 1 hours. More likely 40 minutes.
-
-Run wke
-The wkeBrowser.exe executable can be found at demo/bin/wkeBrowser.exe
-
-
-Common Build Errors:
-
-1. Cygwin exception::handle: Exception: STATUS_ACCESS_VIOLATION
-
- Close the Visual Studio, then relaunch and rebuild. This usually fixes the problem.
\ No newline at end of file
diff --git a/vs2005.bat b/vs2005.bat
new file mode 100644
index 00000000..41b592f9
--- /dev/null
+++ b/vs2005.bat
@@ -0,0 +1,5 @@
+@ECHO off
+CALL "%VS80COMNTOOLS%vsvars32.bat"
+CD "%~dp0vs2005"
+wke.sln
+EXIT
\ No newline at end of file
diff --git a/vs2005/targetver.h b/vs2005/targetver.h
new file mode 100644
index 00000000..e69de29b
diff --git a/vs2005/vsprops/WTFCommon.vsprops b/vs2005/vsprops/WTFCommon.vsprops
index 84401328..03bc572f 100644
--- a/vs2005/vsprops/WTFCommon.vsprops
+++ b/vs2005/vsprops/WTFCommon.vsprops
@@ -10,7 +10,7 @@
AdditionalIncludeDirectories=""$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\";../Source/JavaScriptCore/;"../Source/JavaScriptCore/os-win32/";../Source/JavaScriptCore/wtf/;../Source/JavaScriptCore/wtf/threads/;../Source/JavaScriptCore/wtf/unicode/;"$(ConfigurationBuildDir)\include\private";"$(WebKitLibrariesDir)\include";"$(ConfigurationBuildDir)\include\JavaScriptCore";"$(WebKitLibrariesDir)\include\pthreads""
PreprocessorDefinitions="__STD_C"
ForcedIncludeFiles="ICUVersion.h"
- ProgramDataBaseFileName="$(OutDir)\$(TargetName).vc80.pdb"
+ ProgramDataBaseFileName="$(OutDir)\$(TargetName).vc90.pdb"
/>
diff --git a/vs2005/vsprops/wkeCommon.vsprops b/vs2005/vsprops/wkeCommon.vsprops
index 5b2cc82a..f975224d 100644
--- a/vs2005/vsprops/wkeCommon.vsprops
+++ b/vs2005/vsprops/wkeCommon.vsprops
@@ -12,7 +12,7 @@
/>
diff --git a/vs2005/wke.sln b/vs2005/wke.sln
index 29656253..0235246a 100644
--- a/vs2005/wke.sln
+++ b/vs2005/wke.sln
@@ -37,6 +37,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkeBrowser", "wkeBrowser.vc
{011D10F1-B656-4A1B-A0C3-3842F02122C6} = {011D10F1-B656-4A1B-A0C3-3842F02122C6}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkexe", "wkexe.vcproj", "{5C21D8AD-3930-4AC3-9E32-21FCA603DB76}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Cairo_CFLite|Win32 = Debug_Cairo_CFLite|Win32
@@ -71,6 +73,10 @@ Global
{5C21D8AD-3930-4AC3-9E32-21FCA602DB76}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
{5C21D8AD-3930-4AC3-9E32-21FCA602DB76}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
{5C21D8AD-3930-4AC3-9E32-21FCA602DB76}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
+ {5C21D8AD-3930-4AC3-9E32-21FCA603DB76}.Debug_Cairo_CFLite|Win32.ActiveCfg = Debug_Cairo_CFLite|Win32
+ {5C21D8AD-3930-4AC3-9E32-21FCA603DB76}.Debug_Cairo_CFLite|Win32.Build.0 = Debug_Cairo_CFLite|Win32
+ {5C21D8AD-3930-4AC3-9E32-21FCA603DB76}.Release_Cairo_CFLite|Win32.ActiveCfg = Release_Cairo_CFLite|Win32
+ {5C21D8AD-3930-4AC3-9E32-21FCA603DB76}.Release_Cairo_CFLite|Win32.Build.0 = Release_Cairo_CFLite|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -83,3 +89,4 @@ Global
{1C16337B-ACF3-4D03-AA90-851C5B5EADA6} = {0E50E567-2DE0-49A9-A34F-7984F3809FE3}
EndGlobalSection
EndGlobal
+
diff --git a/vs2005/wke.vcproj b/vs2005/wke.vcproj
index b0dfdb42..45f9a199 100644
--- a/vs2005/wke.vcproj
+++ b/vs2005/wke.vcproj
@@ -22,6 +22,58 @@
InheritedPropertySheets=".\vsprops\wkeDebug.vsprops"
CharacterSet="1"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,75 +151,111 @@
>
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vs2005/wkeBrowser.vcproj b/vs2005/wkeBrowser.vcproj
index 1a1018dd..fde6b3ca 100644
--- a/vs2005/wkeBrowser.vcproj
+++ b/vs2005/wkeBrowser.vcproj
@@ -59,7 +59,7 @@
/>
@@ -182,31 +182,27 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
-
-
NUL ..\demo\libwke
xcopy /D /F /R /Y "%TARGETPATH%" ..\demo\bin\
xcopy /D /F /R /Y "%CONFIGURATIONBUILDDIR%\lib\wke.lib" ..\demo\libwke\
-xcopy /D /F /R /Y "..\wke\wke.h" ..\demo\libwke\
\ No newline at end of file
+xcopy /D /F /R /Y "..\wke\wke.h" ..\demo\libwke\
+xcopy /D /F /R /Y "%TARGETPATH%" ..\demo\libwke\
\ No newline at end of file
diff --git a/vs2005/wkexe.vcproj b/vs2005/wkexe.vcproj
new file mode 100644
index 00000000..a5c13b02
--- /dev/null
+++ b/vs2005/wkexe.vcproj
@@ -0,0 +1,213 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vs2005/wkexePostBuild.cmd b/vs2005/wkexePostBuild.cmd
new file mode 100644
index 00000000..4a09195d
--- /dev/null
+++ b/vs2005/wkexePostBuild.cmd
@@ -0,0 +1,3 @@
+mkdir 2>NUL ..\demo\bin
+
+xcopy /D /F /R /Y "%TARGETPATH%" ..\demo\bin\
\ No newline at end of file
diff --git a/vs2008.bat b/vs2008.bat
new file mode 100644
index 00000000..e595388a
--- /dev/null
+++ b/vs2008.bat
@@ -0,0 +1,5 @@
+@ECHO off
+CALL "%VS90COMNTOOLS%vsvars32.bat"
+CD "%~dp0vs2008"
+wke.sln
+EXIT
\ No newline at end of file
diff --git a/vs2008/WebCore.vcproj b/vs2008/WebCore.vcproj
index 431c3f45..fb31215e 100644
--- a/vs2008/WebCore.vcproj
+++ b/vs2008/WebCore.vcproj
@@ -6,6 +6,7 @@
ProjectGUID="{1C16337B-ACF3-4D03-AA90-851C5B5EADA6}"
RootNamespace="WebCore"
Keyword="Win32Proj"
+ TargetFrameworkVersion="0"
>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,6 +189,18 @@
/>
+
+
+
+
+
+
@@ -122,18 +225,6 @@
/>
-
-
-
-
-
-
@@ -290,7 +381,7 @@
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSCanvasGradient.cpp"
>