diff --git a/.code.yaml b/.code.yaml new file mode 100644 index 000000000..50d30c9cf --- /dev/null +++ b/.code.yaml @@ -0,0 +1,17 @@ +source: + # 文件或目录使用绝对路径,绝对路径按代码库根目录计算,以/开头。 + # 提供产品代码库中编写的测试代码存放目录或文件名格式,以便后续代码统计环节进行排除等特殊处理 + # 不要使用.*/等正则表达式屏蔽掉所有代码,会导致部门代码量骤减从而影响部门代码得分,还会导致Coverity扫不到任何代码而失败 + # 请勿使用Tab键,将会导致yaml解析出错 + # test_source: + # #用于匹配文件; 匹配方式为正则表达式。 + # filepath_regex: [".*/java/test/.*", ".*/test.java"] + # 提供产品代码库中工具或框架自动生成的且在代码库中的代码,没有可为空。以便后续代码统计环节进行排除等特殊处理。 + # auto_generate_source: + # # 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 + # filepath_regex: + # 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。 + # 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空 + third_party_source: + #第三方代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 + filepath_regex:[".*/mars/zstd/.*", ".*/mars/googletest/.*", ".*/mars/googlemock/.*", ".*/mars/boost/.*"] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8fa7d3a4c..2e1821d84 100644 --- a/.gitignore +++ b/.gitignore @@ -6,13 +6,12 @@ build/ /mars/captures obj/ - +.vscode/ *.swp *.pyc xcuserdata xcshareddata -/mars/comm/verinfo.h /mars/libraries/*/ /mars/*/libs/ !/mars/boost/libs/ @@ -56,7 +55,7 @@ xcshareddata /mars/log/win32proj/Debug/*.pdb /mars/log/win32proj/Debug/log.tlog/*.tlog /mars/log/win32proj/Debug/log.tlog/*.lastbuildstate -/mars/log/win32proj/Debug/log.tlog/* +/mars/xlog/win32proj/Debug/log.tlog/* /samples/win32test/Debug/*.obj /samples/win32test/Debug/*.idb /samples/win32test/Debug/*.pdb @@ -89,3 +88,31 @@ xcshareddata .autotools .cproject .project +*.lib +*.pdb +mars/win32proj/Debug/mars.lastbuildstate +mars/win32proj/Debug/mars.unsuccessfulbuild +mars/comm/verinfo.h + +# cmake +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +.vs +mars/*/Win32/Debug +mars/Win32/Debug +*.dir +*.out +Debug-iphonesimulator +*.xcodeproj +*.build +cmake_build +*.settings +mars/cmake-build-debug +mars/openssl/include/openssl/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15d446552..9f5d98004 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,21 +19,21 @@ There are three main branches here: 1. `master` branch. 1. It is the latest (pre-)release branch. We use `master` for tags, with version number `1.1.0`, `1.2.0`, `1.3.0`... 2. **Don't submit any PR on `master` branch.** -2. `dev` branch. - 1. It is our stable developing branch. After full testing, `dev` will be merged to `master` branch for the next release. - 2. **You are recommended to submit bugfix or feature PR on `dev` branch.** +2. `develop` branch. + 1. It is our stable developing branch. After full testing, `develop` will be merged to `master` branch for the next release. + 2. **You are recommended to submit bugfix or feature PR on `develop` branch.** 3. `hotfix` branch. 1. It is the latest tag version for hot fix. If we accept your pull request, we may just tag with version number `1.1.1`, `1.2.3`. 2. **Only submit urgent PR on `hotfix` branch for next specific release.** -Normal bugfix or feature request should be submitted to `dev` branch. After full testing, we will merge them to `master` branch for the next release. +Normal bugfix or feature request should be submitted to `develop` branch. After full testing, we will merge them to `master` branch for the next release. -If you have some urgent bugfixes on a published version, but the `master` branch have already far away with the latest tag version, you can submit a PR on hotfix. And it will be cherry picked to `dev` branch if it is possible. +If you have some urgent bugfixes on a published version, but the `master` branch have already far away with the latest tag version, you can submit a PR on hotfix. And it will be cherry picked to `develop` branch if it is possible. ``` master ↑ -dev <--- hotfix PR +develop <--- hotfix PR ↑ feature/bugfix PR ``` @@ -48,7 +48,7 @@ Before submitting a pull request, please make sure the followings are done: 3. Add the copyright notice to the top of any new files you've added. 4. Check your code lints and checkstyles. 5. Test and test again your code. -6. Now, you can submit your pull request on `dev` or `hotfix` branch. +6. Now, you can submit your pull request on `develop` or `hotfix` branch. ## Code Style Guide Use [Code Style for C/C++](http://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/). diff --git a/LICENSE b/LICENSE index 2109939ac..9fcda23d1 100644 --- a/LICENSE +++ b/LICENSE @@ -31,6 +31,9 @@ All rights reserved. Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches All right reserved +5. google protobuf +Copyright 2014, Google Inc. All rights reserved. + Terms of the BSD 3-Clause License: -------------------------------------------------------------------- @@ -262,3 +265,22 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +BSD 2-clause "Simplified" License +-------------------------------------------------------------------- +micro-ecc + +Copyright (c) 2014, Kenneth MacKay +All rights reserved. + + +Terms of the BSD 2-clause "Simplified" License: +-------------------------------------------------------------------- +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 85b8db59a..53ff68ceb --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ ## Mars [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/Tencent/mars/blob/master/LICENSE) -[![Release Version](https://img.shields.io/badge/release-1.1.3-red.svg)](https://github.com/Tencent/mars/releases) +[![Release Version](https://img.shields.io/badge/release-1.2.3-red.svg)](https://github.com/Tencent/mars/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/mars/pulls) -[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.1.3-red.svg)](https://github.com/Tencent/mars/wiki) -[![WeChat Approved](https://img.shields.io/badge/Platform-iOS | OS X | Android -brightgreen.svg)](https://github.com/Tencent/mars/wiki) +[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.2.3-red.svg)](https://github.com/Tencent/mars/wiki) +[![WeChat Approved](https://img.shields.io/badge/Platform(cmake)-%20iOS%20%7C%20OS%20X%20%7C%20Android(ndkr20)%20%7C%20Windows(vs2015)%20-brightgreen.svg)](https://github.com/Tencent/mars/wiki) (中文版本请参看[这里](#mars_cn)) Mars is a cross-platform infrastructure component developed by WeChat Mobile Team. -It is proved to be effective by billions of WeChat users. +It has been proved to be effective by billions of WeChat users. 1. Cross platform, easy to deploy if you are developing multi-platform or multi-business application. 2. Suitable for small amount data transmission @@ -29,11 +29,13 @@ Start with sample usage [here](https://github.com/Tencent/mars/wiki/Mars-sample- ## Getting started -Choose [Android](#android) or [iOS/OS X](#apple). +python scripts only support python3.10 or higher + +Choose [Android](#android) or [iOS/OS X](#apple) or [Windows](#windows). ### [Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) -You can use either [mars-wrapper](#wrapper) or [mars-core](#core). We recommend you to use mars-wrapper when you just wanna build a sample or demo, while mars-core is preferred to be used in your APP. +You can use either [mars-wrapper](#wrapper) or [mars-core](#core). We recommend you to use mars-wrapper when you just want to build a sample or demo, while mars-core is preferred to be used in your APP. #### mars-wrapper @@ -41,7 +43,7 @@ Add dependencies by adding the following lines to your app/build.gradle. ```xml dependencies { - compile 'com.tencent.mars:mars-wrapper:1.1.3' + compile 'com.tencent.mars:mars-wrapper:1.2.5' } ``` @@ -53,11 +55,21 @@ Add dependencies by adding the following lines to your app/build.gradle. ```xml dependencies { - compile 'com.tencent.mars:mars-core:1.1.3' + compile 'com.tencent.mars:mars-core:1.2.5' } ``` +**OR** +#### mars-xlog +If you just want to user xlog, add dependencies by adding the following lines to your app/build.gradle. +note: xlog is included in mars-core and mars-wrapper. -If you read here, make sure you have added dependencies of mars-wrapper or mars-core. +```xml +dependencies { + compile 'com.tencent.mars:mars-xlog:1.2.5' +} +``` + +If you read here, make sure you have added dependencies of mars-wrapper, mars-core or mars-xlog. #### Xlog Init @@ -66,23 +78,27 @@ Initialize Xlog when your APP starts. Remember to use an exclusive folder to sav When multiple processes is used in your app, make sure that each process owns its exclusive log file. ```java -System.loadLibrary("stlport_shared"); +System.loadLibrary("c++_shared"); System.loadLibrary("marsxlog"); final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath(); final String logPath = SDCARD + "/marssample/log"; +// this is necessary, or may crash for SIGBUS +final String cachePath = this.getFilesDir() + "/xlog" + //init xlog -if (BuildConfig.DEBUG) { - Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); - Xlog.setConsoleLogOpen(true); +Xlog xlog = new Xlog(); +Log.setLogImp(xlog); +if (BuildConfig.DEBUG) { + Log.setConsoleLogOpen(true); + Log.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, logFileName, 0); } else { - Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); - Xlog.setConsoleLogOpen(false); + Log.setConsoleLogOpen(false); + Log.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, logFileName, 0); } -Log.setLogImp(new Xlog()); ``` Uninitialized Xlog when your app exits @@ -94,7 +110,7 @@ Log.appenderClose(); #### STN Init -If you add dependencies of mars-core to your project, you need to initialize and release STN. +If you add dependencies of mars-core to your project, you need to initialize and release STN. Initialize STN before you use it ```java @@ -156,13 +172,18 @@ If you want to modify the encryption algorithm of Xlog, the packer/unpacker of l ### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) Compile +```python +python build_ios.py ``` -python build_apple.py + +or +```python +python build_osx.py ``` 1. Add mars.framework as a dependency of your project. -2. Rename files with .rewriteme extension to .cc extension. -3. Add header files and source files into your project. +2. Rename files in mars/libraries/mars_android_sdk/jni with .rewriteme extension to .cc extension. +3. Add header files in mars/libraries/mars_android_sdk/jni and source files from step 2 into your project. #### Xlog Init @@ -184,17 +205,26 @@ appender_set_console_log(true); xlogger_SetLevel(kLevelInfo); appender_set_console_log(false); #endif -appender_open(kAppednerAsync, [logPath UTF8String], "Test"); +XLogConfig config; +config.mode_ = kAppenderAsync; +config.logdir_ = [logPath UTF8String]; +config.nameprefix_ = "Test"; +config.pub_key_ = ""; +config.compress_mode_ = kZlib; +config.compress_level_ = 0; +config.cachedir_ = ""; +config.cache_days_ = 0; +appender_open(config); ``` -Uninitialized xlog in function "applicationWillTerminate" +Close xlog in function "applicationWillTerminate" ```cpp appender_close(); ``` -####STN Init +#### STN Init Initialize STN before you use it: @@ -237,7 +267,7 @@ Initialize STN before you use it: } - (void)reportEvent_OnForeground:(BOOL)isForeground { - mars::baseevent::OnForeground(isForground); + mars::baseevent::OnForeground(isForeground); } - (void)makesureLongLinkConnect { @@ -245,7 +275,7 @@ Initialize STN before you use it: } ``` -Firstly, you should call the setCalBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called. +Firstly, you should call the setCallBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called. If you want to destroy STN or exit App: @@ -261,7 +291,7 @@ When the App's state of background or foreground is changed: ```objc - (void)reportEvent_OnForeground:(BOOL)isForeground { - mars::baseevent::OnForeground(isForground); + mars::baseevent::OnForeground(isForeground); } ``` @@ -273,6 +303,88 @@ Network change: } ``` +### [Windows](https://github.com/Tencent/mars/wiki/Mars-Windows-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) +Install Visual Studio 2015. + +Compile +```python +python build_windows.py +``` + +1. Add mars.lib as a dependency of your project. +2. Rename files in mars/libraries/mars_android_sdk/jni with .rewriteme extension to .cc extension. +3. Add header files in mars/libraries/mars_android_sdk/jni and source files from step 2 into your project. + +#### Xlog Init + +Initialize Xlog when your app starts. Remember to use an exclusive folder to save the log files, no other files are acceptable in the folder since they would be removed by the cleansing function in Xlog automatically. + +```cpp +std::string logPath = ""; //use your log path +std::string pubKey = ""; //use you pubkey for log encrypt + +// init xlog +#if DEBUG +xlogger_SetLevel(kLevelDebug); +appender_set_console_log(true); +#else +xlogger_SetLevel(kLevelInfo); +appender_set_console_log(false); +#endif +appender_open(kAppenderAsync, logPath.c_str(), "Test", 0, pubKey.c_str()); +``` + +Uninitialized xlog before your app exits + + +```cpp +appender_close(); +``` + +#### STN Init + +Initialize STN before you use it: + +```cpp +void setShortLinkDebugIP(const std::string& _ip, unsigned short _port) +{ + mars::stn::SetShortlinkSvrAddr(_port, _ip); +} +void setShortLinkPort(unsigned short _port) +{ + mars::stn::SetShortlinkSvrAddr(_port, ""); +} +void setLongLinkAddress(const std::string& _ip, unsigned short _port, const std::string& _debug_ip) +{ + vector ports; + ports.push_back(_port); + mars::stn::SetLonglinkSvrAddr(_ip, ports, _debug_ip); +} + +void Init() +{ + mars::stn::SetCallback(mars::stn::StnCallBack::Instance()); + mars::app::SetCallback(mars::app::AppCallBack::Instance()); + mars::baseevent::OnCreate(); + + //todo + //mars::stn::SetClientVersion(version); + //setShortLinkDebugIP(...) + //setLongLinkAddress(...) + + mars::baseevent::OnForeground(true); + mars::stn::MakesureLonglinkConnected(); +} +``` + +Firstly, you should call the setCalBack interface, and secondly, the Mars.init. Then, to initialize the Mars, there is to need to strictly follow the orders of the four commands. Finally, after Mars are initialized, onForeground and makesureLongLinkConnect can be called. + +If you want to destroy STN or exit App: + +```cpp +mars::baseevent::OnDestroy(); +``` + ## Support Any problem? @@ -290,15 +402,14 @@ For more information about contributing issues or pull requests, see our [Mars C Mars is under the MIT license. See the [LICENSE](https://github.com/Tencent/mars/blob/master/LICENSE) file for details. - ------------------------------ ## Mars [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/Tencent/mars/blob/master/LICENSE) -[![Release Version](https://img.shields.io/badge/release-1.1.3-red.svg)](https://github.com/Tencent/mars/releases) +[![Release Version](https://img.shields.io/badge/release-1.2.3-red.svg)](https://github.com/Tencent/mars/releases) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/mars/pulls) -[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.1.3-red.svg)](https://github.com/Tencent/mars/wiki) -[![WeChat Approved](https://img.shields.io/badge/Platform-iOS | OS X | Android -brightgreen.svg)](https://github.com/Tencent/mars/wiki) +[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.2.3-red.svg)](https://github.com/Tencent/mars/wiki) +[![WeChat Approved](https://img.shields.io/badge/Platform-%20iOS%20%7C%20OS%20X%20%7C%20Android%20-brightgreen.svg)](https://github.com/Tencent/mars/wiki) Mars 是微信官方的跨平台跨业务的终端基础组件。 @@ -310,15 +421,16 @@ Mars 是微信官方的跨平台跨业务的终端基础组件。 * SDT: 网络诊断组件; * STN: 信令分发网络模块,也是 Mars 最主要的部分。 -##Samples +## Samples sample 的使用请参考[这里](https://github.com/Tencent/mars/wiki/Mars-sample-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E)。 -##Getting started +## Getting started -接入 [Android](#android) 或者 [iOS/OS X](#apple)。 +python >= 3,10 +接入 [Android](#android_cn) 或者 [iOS/OS X](#apple_cn) 或者 [Windows](#windows_cn) 。 -###[Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) +### [Android](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) gradle 接入我们提供了两种接入方式:[mars-wrapper](#wrapper) 或者 [mars-core](#core)。如果你只是想做个 sample 推荐使用 mars-wrapper,可以快速开发;但是如果你想把 mars 用到你的 app 中的话,推荐使用 mars-core,可定制性更高。 @@ -329,7 +441,7 @@ gradle 接入我们提供了两种接入方式:[mars-wrapper](#wrapper) 或者 ```xml dependencies { - compile 'com.tencent.mars:mars-wrapper:1.1.3' + compile 'com.tencent.mars:mars-wrapper:1.2.5' } ``` @@ -342,10 +454,18 @@ dependencies { ```xml dependencies { - compile 'com.tencent.mars:mars-core:1.1.3' + compile 'com.tencent.mars:mars-core:1.2.5' } ``` -接着往下操作之前,请先确保你已经添加了 mars-wrapper 或者 mars-core 的依赖 +**或者** +#### mars-xlog +如果只想使用 xlog,可以只加 xlog 的依赖(mars-core,mars-wrapper 中都已经包括 xlog): +```xml +dependencies { + compile 'com.tencent.mars:mars-xlog:1.2.5' +} +``` +接着往下操作之前,请先确保你已经添加了 mars-wrapper 或者 mars-core 或者 mars-xlog 的依赖 #### Xlog Init @@ -353,19 +473,30 @@ dependencies { ```java -System.loadLibrary("stlport_shared"); +System.loadLibrary("c++_shared"); System.loadLibrary("marsxlog"); final String SDCARD = Environment.getExternalStorageDirectory().getAbsolutePath(); final String logPath = SDCARD + "/marssample/log"; +// this is necessary, or may crash for SIGBUS +final String cachePath = this.getFilesDir() + "/xlog" + //init xlog +Xlog.XLogConfig logConfig = new Xlog.XLogConfig(); +logConfig.mode = Xlog.AppednerModeAsync; +logConfig.logdir = logPath; +logConfig.nameprefix = logFileName; +logConfig.pubkey = ""; +logConfig.compressmode = Xlog.ZLIB_MODE; +logConfig.compresslevel = 0; +logConfig.cachedir = ""; +logConfig.cachedays = 0; if (BuildConfig.DEBUG) { - Xlog.appenderOpen(Xlog.LEVEL_DEBUG, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + logConfig.level = Xlog.LEVEL_VERBOSE; Xlog.setConsoleLogOpen(true); - } else { - Xlog.appenderOpen(Xlog.LEVEL_INFO, Xlog.AppednerModeAsync, "", logPath, "MarsSample"); + logConfig.level = Xlog.LEVEL_INFO; Xlog.setConsoleLogOpen(false); } @@ -441,17 +572,21 @@ BaseEvent.onForeground(boolean); StnLogic.reset(); ``` -如果你想修改 Xlog 的加密算法或者长短连的加解包部分甚至更改组件的其他部分,可以参考[这里] -(https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) +如果你想修改 Xlog 的加密算法或者长短连的加解包部分甚至更改组件的其他部分,可以参考[这里](https://github.com/Tencent/mars/wiki/Mars-Android-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) -### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) +### [iOS/OS X](https://github.com/Tencent/mars/wiki/Mars-iOS%EF%BC%8FOS-X-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) 编译 ``` -python build_apple.py +python build_ios.py +``` + +or +```python +python build_osx.py ``` -把 mars.framework 作为依赖加入到你的项目中,把和 mars.framework 同目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。 +把 mars.framework 作为依赖加入到你的项目中,把mars/libraries/mars_android_sdk/jni 目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。 #### Xlog Init @@ -474,7 +609,17 @@ appender_set_console_log(true); xlogger_SetLevel(kLevelInfo); appender_set_console_log(false); #endif -appender_open(kAppednerAsync, [logPath UTF8String], "Test"); + +XLogConfig config; +config.mode_ = kAppenderAsync; +config.logdir_ = [logPath UTF8String]; +config.nameprefix_ = "Test"; +config.pub_key_ = ""; +config.compress_mode_ = kZlib; +config.compress_level_ = 0; +config.cachedir_ = ""; +config.cache_days_ = 0; +appender_open(config); ``` 在函数 "applicationWillTerminate" 中反初始化 Xlog @@ -562,6 +707,86 @@ appender_close(); mars::baseevent::OnNetworkChange(); } ``` +### [Windows](https://github.com/Tencent/mars/wiki/Mars-Windows-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97) +安装Visual Studio 2015 + +编译 + +```python +python build_windows.py +``` + +把 mars.lib作为依赖加入到你的项目中,把mars/libraries/mars_android_sdk/jni 目录的后缀名为 rewriteme 的文件名删掉".rewriteme"和头文件一起加入到你的项目中。 + +#### Xlog Init + +在程序启动加载 Xlog 后紧接着初始化 Xlog。但要注意保存 log 的目录请使用单独的目录,不要存放任何其他文件防止被 xlog 自动清理功能误删。 + +```cpp +std::string logPath = ""; //use your log path +std::string pubKey = ""; //use you pubkey for log encrypt + +// init xlog +#if DEBUG +xlogger_SetLevel(kLevelDebug); +appender_set_console_log(true); +#else +xlogger_SetLevel(kLevelInfo); +appender_set_console_log(false); +#endif +appender_open(kAppenderAsync, logPath.c_str(), "Test", 0, pubKey.c_str()); +``` + +在程序退出前反初始化 Xlog + +```cpp +appender_close(); +``` + +#### STN Init + +在你用 STN 之前初始化: + +```cpp +void setShortLinkDebugIP(const std::string& _ip, unsigned short _port) +{ + mars::stn::SetShortlinkSvrAddr(_port, _ip); +} +void setShortLinkPort(unsigned short _port) +{ + mars::stn::SetShortlinkSvrAddr(_port, ""); +} +void setLongLinkAddress(const std::string& _ip, unsigned short _port, const std::string& _debug_ip) +{ + vector ports; + ports.push_back(_port); + mars::stn::SetLonglinkSvrAddr(_ip, ports, _debug_ip); +} + +void Init() +{ + mars::stn::SetCallback(mars::stn::StnCallBack::Instance()); + mars::app::SetCallback(mars::app::AppCallBack::Instance()); + mars::baseevent::OnCreate(); + + //todo + //mars::stn::SetClientVersion(version); + //setShortLinkDebugIP(...) + //setLongLinkAddress(...) + + mars::baseevent::OnForeground(true); + mars::stn::MakesureLonglinkConnected(); +} +``` + +初始化顺序不一定要严格遵守上述代码的顺序,但在初始化时首先要调用 setCallBack 接口 (callback 文件的编写可以参考 demo),再调用 Mars.init,最后再调用 onForeground 和 makesureLongLinkConnect,中间顺序可以随意更改。**注意:STN 默认是后台,所以初始化 STN 后需要主动调用一次**```BaseEvent.onForeground(true)``` + + +需要释放 STN 或者退出程序时: + +```cpp +mars::baseevent::OnDestroy(); +``` ## Support @@ -577,3 +802,11 @@ appender_close(); ## License Mars 使用的 MIT 协议,详细请参考 [LICENSE](https://github.com/Tencent/mars/blob/master/LICENSE)。 + +## 信息公示 +* SDK名称:Mars +* 版本号:0.2.0 +* 开发者:深圳市腾讯计算机系统有限公司 +* 主要功能:Mars 是微信官方的跨平台跨业务的终端基础组件。支持iOS、macOS 和Android。Mars 针对移动网络的特点进行了优化,最终提供了高性能的网络功能。 +* [Mars 使用说明](https://github.com/Tencent/mars) +* [Mars 个人信息保护规则](https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/L60iIjTc9G2A383f) \ No newline at end of file diff --git a/clang_format_ignore.txt b/clang_format_ignore.txt new file mode 100644 index 000000000..95a69c95c --- /dev/null +++ b/clang_format_ignore.txt @@ -0,0 +1,34 @@ +mars/mars/boost +mars/mars/googletest +mars/mars/googlemock +mars/mars/rapidjson +mars/mars/log/crypt/micro-ecc-master +mars/mars/comm/UWP/zlib +mars/mars/openssl +mars/mars/zstd/tests +mars/samples + +mars-private/mars/mmjpeg +mars-private/mars/protobuf +mars-private/mars/cdn/src/proto +mars-private/mars/cdn/src/protocol +mars-private/mars/openssl +mars-private/mars/vfs +mars-private/mars/smc/src/protobuf + +mars-private/mars/andromeda/andromeda.h +mars-private/mars/andromeda/cronet_android_jni_callback.h +mars-private/mars/andromeda/cronet_file_task_runer_wrapper.h +mars-private/mars/andromeda/http_cronet_context_builder.h +mars-private/mars/andromeda/http_network_estimate_callback.h +mars-private/mars/andromeda/http_result_callback.h +mars-private/mars/andromeda/http_with_cronet.h + +mars-wechat/mars/webp +mars-wechat/mars/accessory + +build +cmake_build +tools +mmnet +openssl-build-tools diff --git a/codecc.sh b/codecc.sh new file mode 100755 index 000000000..fc0f5d096 --- /dev/null +++ b/codecc.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# build libraries for android +export ANDROID_NDK_HOME=/usr/local/android-ndks/android-ndk-r16b +export NDK_ROOT=/usr/local/android-ndks/android-ndk-r16b +python mars/build_android.py 1 armeabi diff --git a/mars/CMakeLists.txt b/mars/CMakeLists.txt new file mode 100644 index 000000000..1107a05b7 --- /dev/null +++ b/mars/CMakeLists.txt @@ -0,0 +1,87 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +include_directories(openssl/include) + +add_subdirectory(comm comm) +add_subdirectory(boot boot) +add_subdirectory(boost boost) +add_subdirectory(app app) +add_subdirectory(baseevent baseevent) +add_subdirectory(xlog xlog) +add_subdirectory(sdt sdt) +add_subdirectory(stn stn) + +# for zstd +option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) +option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF) +set(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zstd") +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib) +include(GNUInstallDirs) +add_subdirectory(zstd/build/cmake/lib zstd) + +project (mars) + +include(comm/utils.cmake) + +include_directories(.) +include_directories(..) + +set(SELF_LIBS_OUT ${CMAKE_SYSTEM_NAME}.out) + +if(ANDROID) + + if(NATIVE_CALLBACK) + message("common native callback") + add_definitions(-DNATIVE_CALLBACK) + endif() + + find_library(log-lib log) + find_library(z-lib z) + + link_directories(app baseevent xlog sdt stn comm boost zstd) + + # marsxlog + set(SELF_LIB_NAME marsxlog) + file(GLOB SELF_SRC_FILES libraries/mars_android_sdk/jni/JNI_OnLoad.cc + libraries/mars_xlog_sdk/jni/import.cc) + add_library(${SELF_LIB_NAME} SHARED ${SELF_SRC_FILES}) + install(TARGETS ${SELF_LIB_NAME} LIBRARY DESTINATION ${SELF_LIBS_OUT} ARCHIVE DESTINATION ${SELF_LIBS_OUT}) + get_filename_component(EXPORT_XLOG_EXP_FILE libraries/mars_android_sdk/jni/export.exp ABSOLUTE) + set(SELF_XLOG_LINKER_FLAG "-Wl,--gc-sections -Wl,--version-script='${EXPORT_XLOG_EXP_FILE}'") + if(ANDROID_ABI STREQUAL "x86_64" OR ANDROID_ABI STREQUAL "x86") + set(SELF_XLOG_LINKER_FLAG "-Wl,--gc-sections -Wl,--version-script='${EXPORT_XLOG_EXP_FILE}' -Wl,--no-warn-shared-textrel") + endif() + target_link_libraries(${SELF_LIB_NAME} "${SELF_XLOG_LINKER_FLAG}" + xlog + mars-boost + comm + libzstd_static + ${log-lib} + ${z-lib} + ) + + # marsstn + set(SELF_LIB_NAME marsstn) + file(GLOB SELF_SRC_FILES libraries/mars_android_sdk/jni/*.cc) + add_library(${SELF_LIB_NAME} SHARED ${SELF_SRC_FILES}) + install(TARGETS ${SELF_LIB_NAME} LIBRARY DESTINATION ${SELF_LIBS_OUT} ARCHIVE DESTINATION ${SELF_LIBS_OUT}) + link_directories(${SELF_LIBS_OUT}) + find_library(CRYPT_LIB crypto PATHS openssl/openssl_lib_android/${ANDROID_ABI} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(SSL_LIB ssl PATHS openssl/openssl_lib_android/${ANDROID_ABI} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + target_link_libraries(${SELF_LIB_NAME} "-Wl,--gc-sections" + ${log-lib} + stn + sdt + app + baseevent + comm + boot + mars-boost + marsxlog + libzstd_static + ${SSL_LIB} + ${CRYPT_LIB}) +endif() diff --git a/mars/app/.cproject b/mars/app/.cproject deleted file mode 100644 index e73ca549e..000000000 --- a/mars/app/.cproject +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mars/app/.project b/mars/app/.project deleted file mode 100644 index 448cccbf7..000000000 --- a/mars/app/.project +++ /dev/null @@ -1,77 +0,0 @@ - - - appcomm_mars - - - comm_mars - log_mars - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - ndk-build - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - V=1 NDK_DEBUG=0 -j2 LIBPREFIX=wechat - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/mars/app/CMakeLists.txt b/mars/app/CMakeLists.txt new file mode 100644 index 000000000..75a47ef38 --- /dev/null +++ b/mars/app/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +project (app) + +include(../comm/utils.cmake) +include(../comm/CMakeExtraFlags.txt) + +include_directories(.) +include_directories(src) +include_directories(..) +include_directories(../..) +include_directories(../comm) +include_directories(../../..) +include_directories(../boot) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) +source_group(src FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + +if(MSVC) + add_definitions(/FI"../../comm/projdef.h") + include_directories(../comm/windows) +elseif(ANDROID) + if(NOT CPP_CALL_BACK) + file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) + endif() + if(NATIVE_CALLBACK) + message("applogic native callback") + add_definitions(-DNATIVE_CALLBACK) + endif() + + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) +endif() + +BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") diff --git a/mars/app/app-mac.xcodeproj/project.pbxproj b/mars/app/app-mac.xcodeproj/project.pbxproj deleted file mode 100644 index 48b1aa01c..000000000 --- a/mars/app/app-mac.xcodeproj/project.pbxproj +++ /dev/null @@ -1,511 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1F25BF0F1CD3647300AC1003 /* app_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF0C1CD3647300AC1003 /* app_logic.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1F25BF0C1CD3647300AC1003 /* app_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = app_logic.cc; sourceTree = ""; }; - 1F25BF0D1CD3647300AC1003 /* app_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app_logic.h; sourceTree = ""; }; - 1F25BF0E1CD3647300AC1003 /* app.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app.h; sourceTree = ""; }; - 55D9C0821CC7B1C90076CBD9 /* libapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libapp.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 1F25BF0C1CD3647300AC1003 /* app_logic.cc */, - 1F25BF0D1CD3647300AC1003 /* app_logic.h */, - 1F25BF0E1CD3647300AC1003 /* app.h */, - 55D9C0821CC7B1C90076CBD9 /* libapp.a */, - ); - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* app */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = app; - productName = PublicComponent; - productReference = 55D9C0821CC7B1C90076CBD9 /* libapp.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = felixzhou; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app-mac" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A01E177887B0004F5DDA; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* app */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1F25BF0F1CD3647300AC1003 /* app_logic.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.10; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - SDKROOT = macosx10.10; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "DEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "NDEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app-mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/app/app.h b/mars/app/app.h index cb1a6929e..1d3948658 100644 --- a/mars/app/app.h +++ b/mars/app/app.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -20,29 +20,80 @@ #ifndef APPCOMM_INTERFACE_APPCOMM_H_ #define APPCOMM_INTERFACE_APPCOMM_H_ -#include #include +#include +#include + +#include "mars/comm/comm_data.h" + namespace mars { namespace app { struct AccountInfo { - AccountInfo():uin(0){} - int64_t uin; - std::string username; + AccountInfo() : uin(0), is_logoned(false) { + } + int64_t uin; + std::string username; + bool is_logoned; }; struct DeviceInfo { - std::string devicename; - std::string devicetype; + std::string devicename; + std::string devicetype; }; - + +/* mars2 +extern mars::comm::ProxyInfo GetProxyInfo(const std::string& _host); extern std::string GetAppFilePath(); extern AccountInfo GetAccountInfo(); -extern std::string GetUserName(); +extern std::string GetAppUserName(); extern std::string GetRecentUserName(); extern unsigned int GetClientVersion(); extern DeviceInfo GetDeviceInfo(); -}} +extern double GetOsVersion(); +*/ + +// mars2 +class Callback { + public: + virtual ~Callback(){}; + + virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) { + return false; + } + + virtual std::string GetAppFilePath() = 0; + + virtual AccountInfo GetAccountInfo() = 0; + + virtual unsigned int GetClientVersion() = 0; + + virtual DeviceInfo GetDeviceInfo() = 0; +}; + +/* mars2 +#ifdef NATIVE_CALLBACK + + class AppLogicNativeCallback { + public: + AppLogicNativeCallback() = default; + virtual ~AppLogicNativeCallback() = default; + + virtual mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) {return mars::comm::ProxyInfo();} + virtual std::string GetAppFilePath() {return "";} + virtual AccountInfo GetAccountInfo() {return AccountInfo();} + virtual std::string GetAppUserName() {return "";} + virtual std::string GetRecentUserName() {return "";} + virtual unsigned int GetClientVersion() {return 0;} + virtual DeviceInfo GetDeviceInfo() {return DeviceInfo();} + }; + extern void SetAppLogicNativeCallback(std::shared_ptr _cb); + +#endif //NATIVE_CALLBACK +*/ + +} // namespace app +} // namespace mars #endif /* APPCOMM_INTERFACE_APPCOMM_H_ */ diff --git a/mars/app/app.xcodeproj/project.pbxproj b/mars/app/app.xcodeproj/project.pbxproj deleted file mode 100644 index d33a3ba41..000000000 --- a/mars/app/app.xcodeproj/project.pbxproj +++ /dev/null @@ -1,312 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1F25B30E1CD335FD00AC1003 /* app_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F25B30B1CD335FD00AC1003 /* app_logic.cc */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1F25B30B1CD335FD00AC1003 /* app_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = app_logic.cc; sourceTree = ""; }; - 1F25B30C1CD335FD00AC1003 /* app_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app_logic.h; sourceTree = ""; }; - 1F25B30D1CD335FD00AC1003 /* app.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = app.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libapp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libapp.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 136359EA1981F37600EED49B /* src */ = { - isa = PBXGroup; - children = ( - ); - path = src; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 1F25B30B1CD335FD00AC1003 /* app_logic.cc */, - 1F25B30C1CD335FD00AC1003 /* app_logic.h */, - 1F25B30D1CD335FD00AC1003 /* app.h */, - 136359EA1981F37600EED49B /* src */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libapp.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* app */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = app; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libapp.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* app */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1F25B30E1CD335FD00AC1003 /* app_logic.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_BITCODE = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_BITCODE = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = default; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/net_comm.dst; - ENABLE_BITCODE = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = app; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = "line-tables-only"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/net_comm.dst; - ENABLE_BITCODE = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = app; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "app" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "app" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/app/app_logic.cc b/mars/app/app_logic.cc index 5dfca205e..5b6588554 100644 --- a/mars/app/app_logic.cc +++ b/mars/app/app_logic.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -13,7 +13,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -30,55 +30,260 @@ */ #include "mars/app/app_logic.h" + +#ifdef __APPLE__ +#include + +#include "mars/comm/objc/data_protect_attr.h" +#endif + +#include "app_manager.h" +#include "mars/baseevent/baseprjevent.h" +#include "mars/boot/context.h" +#include "mars/comm/anr.h" +#include "mars/comm/bootrun.h" +#include "mars/comm/dns/dns.h" +#include "mars/comm/macro.h" +#include "mars/comm/time_utils.h" #include "mars/comm/xlogger/xlogger.h" +using namespace mars::boot; +using namespace mars::comm; namespace mars { namespace app { -static Callback* sg_callback = NULL; +// mars2 +// static Callback* sg_callback = NULL; void SetCallback(Callback* const callback) { - sg_callback = callback; + /* mars2 + sg_callback = callback; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + app_manager->SetCallback(callback); + } } -#ifndef ANDROID +#if !defined(ANDROID) || defined(CPP_CALL_BACK) - std::string GetAppFilePath() { - xassert2(sg_callback != NULL); - return sg_callback->GetAppFilePath(); +/* mars2 +NO_DESTROY static mars::comm::ProxyInfo sg_proxyInfo; + static bool sg_gotProxy = false; +NO_DESTROY static Mutex sg_slproxymutex; +NO_DESTROY static Thread sg_slproxyThread; + static uint64_t sg_slporxytimetick = gettickcount(); + static int sg_slproxycount = 0; +*/ + +static void __GetProxyInfo(const std::string& _host, uint64_t _timetick) { + /* mars2 + xinfo_function(TSF"timetick:%_, host:%_", _timetick, _host); + + mars::comm::ProxyInfo proxy_info; + if (!sg_callback->GetProxyInfo(_host, proxy_info)) { + ScopedLock lock(sg_slproxymutex); + if (_timetick != sg_slporxytimetick) { + return; + } + ++ sg_slproxycount; + return; + } + + ScopedLock lock(sg_slproxymutex); + if (_timetick != sg_slporxytimetick) { + return; + } + + ++ sg_slproxycount; + + sg_proxyInfo = proxy_info; + + if (mars::comm::kProxyNone == sg_proxyInfo.type || !sg_proxyInfo.ip.empty() || sg_proxyInfo.host.empty()) { + sg_gotProxy = true; + return; + } + + std::string host = sg_proxyInfo.host; + lock.unlock(); + + static DNS s_dns; + std::vector ips; + s_dns.GetHostByName(host, ips); + + if (ips.empty()) { + return; } - - AccountInfo GetAccountInfo() { - xassert2(sg_callback != NULL); - return sg_callback->GetAccountInfo(); - } - std::string GetUserName() { - xassert2(sg_callback != NULL); - AccountInfo info = sg_callback->GetAccountInfo(); - return info.username; - } + lock.lock(); + sg_proxyInfo.ip = ips.front(); + sg_gotProxy = true; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + app_manager->GetProxyInfo(_host, _timetick); + } +} - std::string GetRecentUserName() { - xassert2(sg_callback != NULL); - return GetUserName(); - } +#if TARGET_OS_IPHONE +static void __ClearProxyInfo() { + /*mars2 + ScopedLock lock(sg_slproxymutex); + sg_slporxytimetick = gettickcount(); + sg_slproxycount = 0; + sg_gotProxy = false; + sg_proxyInfo.type = mars::comm::kProxyNone; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + app_manager->ClearProxyInfo(); + } +} - unsigned int GetClientVersion() { - xassert2(sg_callback != NULL); - return sg_callback->GetClientVersion(); - } +static void onCreate() { + startup_anr(); +} +static void __InitbindBaseprjevent() { + GetSignalOnCreate().connect(&onCreate); + GetSignalOnNetworkChange().connect(&__ClearProxyInfo); +} + +BOOT_RUN_STARTUP(__InitbindBaseprjevent); - DeviceInfo GetDeviceInfo() { - xassert2(sg_callback != NULL); - return sg_callback->GetDeviceInfo(); - } +#endif +mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) { + /* mars2 + xassert2(sg_callback != NULL); +#if !TARGET_OS_IPHONE + mars::comm::ProxyInfo proxy_info; + sg_callback->GetProxyInfo(_host, proxy_info); + return proxy_info; #endif + if (sg_gotProxy) { + return sg_proxyInfo; + } + + ScopedLock lock(sg_slproxymutex, false); + if (!lock.timedlock(500)) return mars::comm::ProxyInfo(); + + if (sg_slproxycount < 3 || 5 * 1000 > gettickspan(sg_slporxytimetick)) { + sg_slproxyThread.start(boost::bind(&__GetProxyInfo, _host, sg_slporxytimetick)); + } + + if (sg_gotProxy) { + return sg_proxyInfo; + } + + return mars::comm::ProxyInfo(); + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetProxyInfo(_host); + } + return mars::comm::ProxyInfo(); } + +std::string GetAppFilePath() { + /* mars2 + xassert2(sg_callback != NULL); + + std::string path = sg_callback->GetAppFilePath(); +#ifdef __APPLE__ + setAttrProtectionNone(path.c_str()); +#endif + + return path; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetAppFilePath(); + } + return ""; } +AccountInfo GetAccountInfo() { + /* mars2 + xassert2(sg_callback != NULL); + return sg_callback->GetAccountInfo(); + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetAccountInfo(); + } + return AccountInfo(); +} + +std::string GetAppUserName() { + /*mars2 + xassert2(sg_callback != NULL); + AccountInfo info = sg_callback->GetAccountInfo(); + return info.username; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetAppUserName(); + } + return ""; +} + +std::string GetRecentUserName() { + /* mars2 + xassert2(sg_callback != NULL); + return GetAppUserName(); + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetRecentUserName(); + } + return ""; +} + +unsigned int GetClientVersion() { + /* mars2 + xassert2(sg_callback != NULL); + return sg_callback->GetClientVersion(); + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetClientVersion(); + } + return 0; +} + +DeviceInfo GetDeviceInfo() { + /*mars2 + xassert2(sg_callback != NULL); + +static DeviceInfo device_info; +if (!device_info.devicename.empty() || !device_info.devicetype.empty()) { +return device_info; +} + +device_info = sg_callback->GetDeviceInfo(); +return device_info; + */ + AppManager* app_manager = Context::CreateContext("default")->GetManager(); + xassert2(NULL != app_manager, "mars2 app_manager is empty."); + if (app_manager) { + return app_manager->GetDeviceInfo(); + } + return DeviceInfo(); +} + +#endif +} // namespace app +} // namespace mars \ No newline at end of file diff --git a/mars/app/app_logic.h b/mars/app/app_logic.h index 55c93435d..e71f68816 100644 --- a/mars/app/app_logic.h +++ b/mars/app/app_logic.h @@ -1,7 +1,7 @@ -// Tencent is pleased to support the open source community by making Mars available. +// Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -23,28 +23,48 @@ #include #include "mars/app/app.h" +#include "mars/comm/comm_data.h" class AutoBuffer; namespace mars { namespace app { - class Callback { - public: - virtual ~Callback() {}; +/* mars2 +class Callback { +public: + virtual ~Callback() {}; - virtual std::string GetAppFilePath() = 0; - - virtual AccountInfo GetAccountInfo() = 0; + virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) { return false; } - virtual unsigned int GetClientVersion() = 0; + virtual std::string GetAppFilePath() = 0; - virtual DeviceInfo GetDeviceInfo() = 0; + virtual AccountInfo GetAccountInfo() = 0; - }; + virtual unsigned int GetClientVersion() = 0; - void SetCallback(Callback* const callback); -}} + virtual DeviceInfo GetDeviceInfo() = 0; +}; +*/ +void SetCallback(Callback* const callback); + +// start app.h +mars::comm::ProxyInfo GetProxyInfo(const std::string& _host); +std::string GetAppFilePath(); +AccountInfo GetAccountInfo(); +std::string GetAppUserName(); // WinBase.h里面定义了GetUserName这个宏 +std::string GetRecentUserName(); +unsigned int GetClientVersion(); +DeviceInfo GetDeviceInfo(); +double GetOsVersion(); + +#ifdef NATIVE_CALLBACK +void SetAppLogicNativeCallback(std::shared_ptr _cb); +#endif +// end app.h + +} // namespace app +} // namespace mars #endif /* APPCOMM_INTERFACE_APPCOMM_LOGIC_H_ */ diff --git a/mars/app/app_manager.cc b/mars/app/app_manager.cc new file mode 100644 index 000000000..c7d01cdb6 --- /dev/null +++ b/mars/app/app_manager.cc @@ -0,0 +1,207 @@ +// +// Created by Changpeng Pan on 2022/8/29. +// + +#include "mars/app/app_manager.h" + +#ifdef __APPLE__ +#include + +#include "mars/comm/objc/data_protect_attr.h" +#endif + +#include "mars/comm/dns/dns.h" +#include "mars/comm/xlogger/xlogger.h" +#ifdef ANDROID +#include "mars/comm/alarm.h" +#endif + +using namespace mars::comm; +using namespace mars::boot; + +namespace mars { +namespace app { + +AppManager::AppManager(Context* context) : context_(context) { + xinfo_function(TSF "mars2 context id %_", context_->GetContextId()); +} + +AppManager::~AppManager() { + xinfo_function(); +} + +std::string AppManager::GetName() { + return typeid(AppManager).name(); +} + +void AppManager::SetCallback(Callback* _callback) { + xinfo_function(); + callback_ = _callback; +} + +mars::comm::ProxyInfo AppManager::GetProxyInfo(const std::string& _host) { + xassert2(callback_ != NULL); + +#if !TARGET_OS_IPHONE + mars::comm::ProxyInfo proxy_info; + callback_->GetProxyInfo(_host, proxy_info); + return proxy_info; +#endif + + if (got_proxy_) { + return proxy_info_; + } + + if (!slproxymutex_.try_lock_for(std::chrono::milliseconds(500))) { + return {}; + } + + if (slproxycount_ < 3 || 5 * 1000 > gettickspan(slproxytimetick_)) { + std::thread([=]() { + AppManager::GetProxyInfo(_host, slproxytimetick_); + }).detach(); + } + + slproxymutex_.unlock(); + if (got_proxy_) { + return proxy_info_; + } + + return {}; +} + +std::string AppManager::GetAppFilePath() { + xassert2(callback_ != NULL); + + std::string path = callback_->GetAppFilePath(); + +#ifdef __APPLE__ + setAttrProtectionNone(path.c_str()); +#endif + + return path; +} + +AccountInfo AppManager::GetAccountInfo() { + xassert2(callback_ != NULL); + return callback_->GetAccountInfo(); +} + +std::string AppManager::GetAppUserName() { + xassert2(callback_ != NULL); + AccountInfo info = callback_->GetAccountInfo(); + return info.username; +} + +std::string AppManager::GetRecentUserName() { + xassert2(callback_ != NULL); + if (callback_ == NULL) { + return ""; + } + return GetAppUserName(); +} + +unsigned int AppManager::GetClientVersion() { + xassert2(callback_ != NULL); + if (callback_ == NULL) { + return 0; + } + return callback_->GetClientVersion(); +} + +DeviceInfo AppManager::GetDeviceInfo() { + xassert2(callback_ != NULL); + if (callback_) { + return callback_->GetDeviceInfo(); + } + + DeviceInfo empty; + empty.devicename = "DEFAULT"; + empty.devicetype = "UNKNOWN"; + +#ifdef ANDROID + empty.devicetype = "ANDROID"; +#elif defined(__WIN32__) + empty.devicetype = "WINDOWS"; +#elif defined(__APPLE__) +#if TARGET_OS_IPHONE + empty.devicetype = "IPHONE"; +#else + empty.devicetype = "APPLE"; +#endif +#endif + + return empty; +} + +void AppManager::GetProxyInfo(const std::string& _host, uint64_t _timetick) { + xinfo_function(TSF "time tick:%_, host:%_", _timetick, _host); + mars::comm::ProxyInfo proxy_info; + if (!callback_->GetProxyInfo(_host, proxy_info)) { + std::lock_guard lock(slproxymutex_); + if (_timetick != slproxytimetick_) { + return; + } + ++slproxycount_; + return; + } + + { + std::lock_guard lock(slproxymutex_); + if (_timetick != slproxytimetick_) { + return; + } + ++slproxycount_; + proxy_info_ = proxy_info; + if (mars::comm::kProxyNone == proxy_info_.type || !proxy_info_.ip.empty() || proxy_info_.host.empty()) { + got_proxy_ = true; + return; + } + } + + mars::comm::DNS dns; + std::vector ips; + dns.GetHostByName(proxy_info_.host, ips); + + if (ips.empty()) { + return; + } + + { + std::lock_guard lock(slproxymutex_); + proxy_info_.ip = ips.front(); + got_proxy_ = true; + } +} + +void AppManager::__CheckCommSetting(const std::string& key) { +#ifdef ANDROID + xinfo2(TSF "AppConfig CheckCommSetting key:%_", key); + if (key == kKeyAlarmStartWakeupLook) { + int wakeup = GetConfig(kKeyAlarmStartWakeupLook, kAlarmStartWakeupLook); + comm::Alarm::SetStartAlarmWakeLock(wakeup); + } else if (key == kKeyAlarmOnWakeupLook) { + int wakeup = GetConfig(kKeyAlarmOnWakeupLook, kAlarmOnWakeupLook); + comm::Alarm::SetOnAlarmWakeLock(wakeup); + } +#endif +} + +// #if TARGET_OS_IPHONE +void AppManager::ClearProxyInfo() { + std::lock_guard lock(slproxymutex_); + slproxytimetick_ = gettickcount(); + slproxycount_ = 0; + got_proxy_ = false; + proxy_info_.type = mars::comm::kProxyNone; +} +// #endif + +AppManager* GetDefaultAppManager() { + auto* context = mars::boot::Context::CreateContext("default"); + auto* manager = context->GetManager(); + return manager; +} + +} // namespace app +} // namespace mars diff --git a/mars/app/app_manager.h b/mars/app/app_manager.h new file mode 100644 index 000000000..69b9927f3 --- /dev/null +++ b/mars/app/app_manager.h @@ -0,0 +1,95 @@ +// +// Created by Changpeng Pan on 2022/8/29. +// + +#ifndef MMNET_APP_MANAGER_H +#define MMNET_APP_MANAGER_H + +#include +#include +#include +#include + +#include "mars/app/app.h" +//#include "mars/boost/any.hpp" +#include "mars/boot/base_manager.h" +#include "mars/boot/context.h" +#include "mars/comm/comm_data.h" +#include "mars/comm/time_utils.h" +#include "mars/xlog/xlogger.h" + +namespace mars { +namespace app { + +class AppManager : public mars::boot::BaseManager { + public: + explicit AppManager(mars::boot::Context* context); + ~AppManager() override; + std::string GetName() override; + + private: + mars::boot::Context* context_; + + public: + void SetCallback(Callback* callback); + mars::comm::ProxyInfo GetProxyInfo(const std::string& _host); + std::string GetAppFilePath(); + AccountInfo GetAccountInfo(); + std::string GetAppUserName(); // WinBase.h里面定义了GetUserName这个宏 + std::string GetRecentUserName(); + unsigned int GetClientVersion(); + DeviceInfo GetDeviceInfo(); + + public: + void GetProxyInfo(const std::string& _host, uint64_t _timetick); + // #if TARGET_OS_IPHONE + void ClearProxyInfo(); + // #endif + + template + T GetConfig(const std::string& key, T default_value) { + xinfo2(TSF "AppConfig GetConfig key:%_, default value:%_", key, default_value); + std::unique_lock lock(mutex_); + auto it = config_.find(key); + auto type_it = types_.find(key); + if (it == config_.end() || type_it == types_.end() || types_.at(key).empty() + || types_.at(key) != std::type_index(typeid(T)).name()) { + xwarn2(TSF "AppConfig GetConfig return default value. "); + return default_value; + } + // return boost::any_cast(it->second); + return *static_cast(it->second); + } + + template + void SetConfig(const std::string& key, T value) { + xinfo2(TSF "AppConfig SetConfig key:%_, value:%_", key, value); + std::unique_lock lock(mutex_); + config_[key] = new T(value); + types_[key] = std::type_index(typeid(T)).name(); + lock.unlock(); + __CheckCommSetting(key); + } + + void __CheckCommSetting(const std::string& key); + + private: + Callback* callback_; + mars::comm::ProxyInfo proxy_info_; + bool got_proxy_ = false; + std::timed_mutex slproxymutex_; + std::thread slproxythread_; + uint64_t slproxytimetick_ = gettickcount(); + int slproxycount_ = 0; + + std::mutex mutex_; + // std::unordered_map config_; + std::unordered_map config_; + std::unordered_map types_; +}; + +AppManager* GetDefaultAppManager(); +} // namespace app +} // namespace mars + +#endif // MMNET_APP_MANAGER_H diff --git a/mars/app/compiler_util.h b/mars/app/compiler_util.h new file mode 100644 index 000000000..707b991d2 --- /dev/null +++ b/mars/app/compiler_util.h @@ -0,0 +1,33 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +/* + * compiler_util.h + * + * Created on: 2017-3-28 + * Author: jehoochen + */ + +#ifndef APP_COMPILER_UTIL_H_ +#define APP_COMPILER_UTIL_H_ + +#if defined(_MSC_VER) && defined(MARS_USE_DLLS) +#ifdef MARS_APP_EXPORTS +#define MARS_APP_EXPORT __declspec(dllexport) +#else +#define MARS_APP_EXPORT __declspec(dllimport) +#endif +#else +#define MARS_APP_EXPORT +#endif + +#endif /* APP_COMPILER_UTIL_H_ */ diff --git a/mars/app/jni/Android.mk b/mars/app/jni/Android.mk deleted file mode 100644 index 00f6dd7d6..000000000 --- a/mars/app/jni/Android.mk +++ /dev/null @@ -1,2 +0,0 @@ -LOCAL_PATH :=$(call my-dir) -include $(LOCAL_PATH)/../../mk_template/android_template.mk \ No newline at end of file diff --git a/mars/app/jni/Application.mk b/mars/app/jni/Application.mk deleted file mode 100644 index cdda64028..000000000 --- a/mars/app/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_LOCAL_PATH :=$(call my-dir) -include $(APP_LOCAL_PATH)/../../mk_template/application_template.mk \ No newline at end of file diff --git a/mars/app/jni/app_manager_callback_wrapper.cc b/mars/app/jni/app_manager_callback_wrapper.cc new file mode 100644 index 000000000..1dda66d7c --- /dev/null +++ b/mars/app/jni/app_manager_callback_wrapper.cc @@ -0,0 +1,135 @@ +// +// Created by Cpan on 2022/9/7. +// + +#include "app_manager_callback_wrapper.h" + +#include "mars/comm/jni/jnicat/jnicat_core.h" +#include "mars/comm/jni/util/comm_function.h" +#include "mars/comm/jni/util/scope_jenv.h" +#include "mars/comm/jni/util/scoped_jstring.h" +#include "mars/comm/jni/util/var_cache.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/thread/mutex.h" +#include "mars/comm/xlogger/xlogger.h" + +namespace mars { +namespace app { + +DEFINE_FIND_CLASS(KC2Java, "com/tencent/mars/app/AppManager$CallBack") + +AppManagerJniCallback::AppManagerJniCallback(JNIEnv* env, jobject callback) { + callback_inst_ = env->NewGlobalRef(callback); + jclass objClass = env->GetObjectClass(callback); + if (objClass) { + callbacks_class_ = reinterpret_cast(env->NewGlobalRef(objClass)); + env->DeleteLocalRef(objClass); + } +} + +AppManagerJniCallback::~AppManagerJniCallback() { + jnienv_ptr env; + env->DeleteGlobalRef(callback_inst_); +} + +bool AppManagerJniCallback::GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) { + return false; +} + +DEFINE_FIND_METHOD(KC2Java_getAppFilePath, KC2Java, "getAppFilePath", "()Ljava/lang/String;") +std::string AppManagerJniCallback::GetAppFilePath() { + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + jstring jstr = (jstring)JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getAppFilePath).l; + std::string filePath; + if (NULL != jstr) { + filePath.assign(ScopedJstring(env, jstr).GetChar()); + env->DeleteLocalRef(jstr); + } else { + xerror2(TSF "getAppFilePath error"); + } + return filePath; +} + +DEFINE_FIND_METHOD(KC2Java_getAccountInfo, KC2Java, "getAccountInfo", "()Lcom/tencent/mars/app/AppLogic$AccountInfo;") +AccountInfo AppManagerJniCallback::GetAccountInfo() { + xverbose_function(); + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + AccountInfo info; + jobject ret_obj = JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getAccountInfo).l; + if (NULL == ret_obj) { + xerror2(TSF "getAccountInfo error return null"); + return info; + } + + jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i; + jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l; + + info.uin = (long)uin; + + if (username_jstr != NULL) { + info.username = ScopedJstring(env, username_jstr).GetChar(); + env->DeleteLocalRef(username_jstr); + } + + env->DeleteLocalRef(ret_obj); + return info; +} + +DEFINE_FIND_METHOD(KC2Java_getClientVersion, KC2Java, "getClientVersion", "()I") +unsigned int AppManagerJniCallback::GetClientVersion() { + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + return JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getClientVersion).i; +} + +DEFINE_FIND_CLASS(KC2JavaDeviceInfo, "com/tencent/mars/app/AppLogic$DeviceInfo") +DEFINE_FIND_METHOD(KC2Java_getDeviceType, KC2Java, "getDeviceType", "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;") +DeviceInfo AppManagerJniCallback::GetDeviceInfo() { + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + DeviceInfo info; + jobject ret_obj = JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_getDeviceType).l; + + if (NULL == ret_obj) { + xerror2(TSF "getDeviceType error return null"); + return info; + } + + jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l; + + static comm::Mutex mutex; + comm::ScopedLock lock(mutex); + + if (NULL != devicename_jstr) { + ScopedJstring scoped_jstr(env, devicename_jstr); + + jsize len = env->GetStringUTFLength(devicename_jstr); + info.devicename = std::string(scoped_jstr.GetChar(), len); + + env->DeleteLocalRef(devicename_jstr); + } + + jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l; + if (NULL != devicetype_jstr) { + ScopedJstring scoped_jstr(env, devicetype_jstr); + + jsize len = env->GetStringUTFLength(devicetype_jstr); + info.devicetype = std::string(scoped_jstr.GetChar(), len); + + env->DeleteLocalRef(devicetype_jstr); + } + return info; +} + +} // namespace app +} // namespace mars \ No newline at end of file diff --git a/mars/app/jni/app_manager_callback_wrapper.h b/mars/app/jni/app_manager_callback_wrapper.h new file mode 100644 index 000000000..c0913a8b6 --- /dev/null +++ b/mars/app/jni/app_manager_callback_wrapper.h @@ -0,0 +1,39 @@ +// +// Created by Cpan on 2022/9/7. +// + +#ifndef MMNET_APP_MANAGER_CALLBACK_WRAPPER_H +#define MMNET_APP_MANAGER_CALLBACK_WRAPPER_H + +#include + +#include "mars/app/app.h" + +namespace mars { +namespace app { + +class AppManagerJniCallback : public Callback { + public: + AppManagerJniCallback(JNIEnv* env, jobject callback); + virtual ~AppManagerJniCallback(); + + private: + jobject callback_inst_; + jclass callbacks_class_; + + public: + virtual bool GetProxyInfo(const std::string& _host, mars::comm::ProxyInfo& _proxy_info) override; + + virtual std::string GetAppFilePath() override; + + virtual AccountInfo GetAccountInfo() override; + + virtual unsigned int GetClientVersion() override; + + virtual DeviceInfo GetDeviceInfo() override; +}; + +} // namespace app +} // namespace mars + +#endif // MMNET_APP_MANAGER_CALLBACK_WRAPPER_H diff --git a/mars/app/jni/app_manager_wrapper.cc b/mars/app/jni/app_manager_wrapper.cc new file mode 100644 index 000000000..751c652f0 --- /dev/null +++ b/mars/app/jni/app_manager_wrapper.cc @@ -0,0 +1,98 @@ +// +// Created by Cpan on 2022/9/7. +// + +#include + +#include "comm/jni/jnicat/jnicat_core.h" +#include "comm/jni/jnicat/jnicat_object_wrapper.h" +#include "mars/app/app.h" +#include "mars/app/app_manager.h" +#include "mars/app/jni/app_manager_callback_wrapper.h" +#include "mars/boot/context.h" +#include "mars/comm/jni/util/scoped_jstring.h" + +using namespace mars::boot; + +namespace mars { +namespace app { + +class JniAppManager { + public: + static void JniCreateAppManagerFromHandle(JNIEnv* env, jobject instance, jlong handle) { + auto app_manager_cpp = (AppManager*)j2c_cast(handle); + auto appManagerWrapper = new jnicat::JniObjectWrapper(app_manager_cpp); + appManagerWrapper->instantiate(env, instance); + } + + static void JniCreateAppManagerFromContext(JNIEnv* env, jobject instance, jobject context) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, context); + auto app_manager_cpp = new AppManager(context_cpp); + auto appManagerWrapper = new jnicat::JniObjectWrapper(app_manager_cpp); + appManagerWrapper->instantiate(env, instance); + } + + static void JniOnDestroyAppManager(JNIEnv* env, jobject instance) { + auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance); + jnicat::JniObjectWrapper::dispose(env, instance, "callbackHandle"); + app_manager_cpp->SetCallback(nullptr); + jnicat::JniObjectWrapper::dispose(env, instance); + } + + static void JniSetCallback(JNIEnv* env, jobject instance, jobject callback) { + auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance); + auto appManagerJniCallback = new AppManagerJniCallback(env, callback); + auto appManagerCallbackWrapper = new jnicat::JniObjectWrapper(appManagerJniCallback); + appManagerCallbackWrapper->instantiate(env, instance, "callbackHandle"); + app_manager_cpp->SetCallback(appManagerJniCallback); + } + + static void JniSetConfigBooleanValue(JNIEnv* env, jobject instance, jstring jkey, jboolean jvalue) { + auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance); + std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar()); + bool value = (jvalue == JNI_TRUE); + app_manager_cpp->SetConfig(key, value); + } + + static void JniSetConfigIntValue(JNIEnv* env, jobject instance, jstring jkey, jint jvalue) { + auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance); + std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar()); + int value = static_cast(jvalue); + app_manager_cpp->SetConfig(key, value); + } + + static void JniSetConfigStringValue(JNIEnv* env, jobject instance, jstring jkey, jstring jvalue) { + auto app_manager_cpp = jnicat::JniObjectWrapper::object(env, instance); + std::string key = (NULL == jkey ? "" : ScopedJstring(env, jkey).GetChar()); + std::string value = (NULL == jvalue ? "" : ScopedJstring(env, jvalue).GetChar()); + app_manager_cpp->SetConfig(key, value); + } +}; + +static const JNINativeMethod kAppManagerJniMethods[] = { + {"OnJniCreateAppManagerFromHandle", "(J)V", (void*)&mars::app::JniAppManager::JniCreateAppManagerFromHandle}, + {"OnJniCreateAppManagerFromContext", + "(Ljava/lang/Object;)V", + (void*)&mars::app::JniAppManager::JniCreateAppManagerFromContext}, + {"OnJniDestroyAppManager", "()V", (void*)&mars::app::JniAppManager::JniOnDestroyAppManager}, + {"OnJniSetCallback", "(Ljava/lang/Object;)V", (void*)&mars::app::JniAppManager::JniSetCallback}, + {"OnJniSetConfigBooleanValue", + "(Ljava/lang/String;Z)V", + (void*)&mars::app::JniAppManager::JniSetConfigBooleanValue}, + {"OnJniSetConfigIntValue", "(Ljava/lang/String;I)V", (void*)&mars::app::JniAppManager::JniSetConfigIntValue}, + {"OnJniSetConfigStringValue", + "(Ljava/lang/String;Ljava/lang/String;)V", + (void*)&mars::app::JniAppManager::JniSetConfigStringValue}, +}; + +static const size_t kAppManagerJniMethodsCount = sizeof(kAppManagerJniMethods) / sizeof(JNINativeMethod); +JNICAT_DEFINE_JNI_METHOD(kAppManagerInterface, + "com/tencent/mars/app/AppManager", + kAppManagerJniMethods, + kAppManagerJniMethodsCount) + +} // namespace app +} // namespace mars + +void ExportAppManager() { +} diff --git a/mars/app/jni/build.conf b/mars/app/jni/build.conf deleted file mode 100644 index 7760951b6..000000000 --- a/mars/app/jni/build.conf +++ /dev/null @@ -1,10 +0,0 @@ -TEMP_LOCAL_PATH :=$(call my-dir) - -SELF_BUILD_CMD := BUILD_STATIC_LIBRARY -SELF_LOCAL_MODULE := appcomm - -SELF_LOCAL_EXPORT_C_INCLUDES := $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../interface -SELF_LOCAL_EXPORT_SRC_FILES := - -SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../comm/jni/export.mk -SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../log/jni/export.mk diff --git a/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc b/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc index 69740d735..9339d3045 100644 --- a/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc +++ b/mars/app/jni/com_tencent_mars_app_AppLogic_C2Java.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -13,7 +13,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -27,153 +27,233 @@ * author : yanguoyue */ - +#ifndef USE_CPP_CALLBACK #include + #include +#include "mars/app/app.h" #include "mars/comm/autobuffer.h" +#include "mars/comm/jni/util/comm_function.h" +#include "mars/comm/jni/util/scope_jenv.h" #include "mars/comm/jni/util/scoped_jstring.h" -#include "mars/comm/xlogger/xlogger.h" #include "mars/comm/jni/util/var_cache.h" -#include "mars/comm/jni/util/scope_jenv.h" -#include "mars/comm/jni/util/comm_function.h" - -#include "mars/app/app.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/thread/mutex.h" +#include "mars/comm/xlogger/xlogger.h" +#ifndef NATIVE_CALLBACK DEFINE_FIND_CLASS(KC2Java, "com/tencent/mars/app/AppLogic") +#endif // NATIVE_CALLBACK namespace mars { namespace app { +#ifdef NATIVE_CALLBACK +static std::weak_ptr applogic_native_callback_instance; + +void SetAppLogicNativeCallback(std::shared_ptr _cb) { + applogic_native_callback_instance = _cb; +} + +#define CALL_NATIVE_CALLBACK_RETURN_FUN(fun, default_value) \ + { \ + auto cb = applogic_native_callback_instance.lock(); \ + if (cb) { \ + return (cb->fun); \ + } \ + xwarn2("applogic native callback is null"); \ + return (default_value); \ + } + +#define DEFINE_FIND_EMPTY_STATIC_METHOD(methodid) const static JniMethodInfo methodid = JniMethodInfo("", "", ""); + +#endif // NATIVE_CALLBACK + +#ifndef NATIVE_CALLBACK DEFINE_FIND_STATIC_METHOD(KC2Java_getAppFilePath, KC2Java, "getAppFilePath", "()Ljava/lang/String;") +#else +DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getAppFilePath) +#endif std::string GetAppFilePath() { - xverbose_function(); + xverbose_function(); + +#ifdef NATIVE_CALLBACK + CALL_NATIVE_CALLBACK_RETURN_FUN(GetAppFilePath(), std::string("")); +#endif VarCache* cache_instance = VarCache::Singleton(); - ScopeJEnv scope_jenv(cache_instance->GetJvm()); - JNIEnv *env = scope_jenv.GetEnv(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); - jstring path = (jstring)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAppFilePath).l; - if (NULL == path) { - xerror2(TSF"getAppFilePath error return null"); - return ""; - } + jstring path = (jstring)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAppFilePath).l; + if (NULL == path) { + xerror2(TSF "getAppFilePath error return null"); + return ""; + } - std::string app_path = ScopedJstring(env, path).GetChar(); - env->DeleteLocalRef(path); + std::string app_path = ScopedJstring(env, path).GetChar(); + env->DeleteLocalRef(path); - return app_path; + return app_path; } -DEFINE_FIND_STATIC_METHOD(KC2Java_getAccountInfo, KC2Java, "getAccountInfo", "()Lcom/tencent/mars/app/AppLogic$AccountInfo;") +#ifndef NATIVE_CALLBACK +DEFINE_FIND_STATIC_METHOD(KC2Java_getAccountInfo, + KC2Java, + "getAccountInfo", + "()Lcom/tencent/mars/app/AppLogic$AccountInfo;") +#else +DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getAccountInfo) +#endif AccountInfo GetAccountInfo() { - xverbose_function(); + xverbose_function(); +#ifdef NATIVE_CALLBACK + CALL_NATIVE_CALLBACK_RETURN_FUN(GetAccountInfo(), AccountInfo()); +#else VarCache* cache_instance = VarCache::Singleton(); - ScopeJEnv scope_jenv(cache_instance->GetJvm()); - JNIEnv *env = scope_jenv.GetEnv(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); - AccountInfo info; - jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l; - if (NULL == ret_obj) { - xerror2(TSF"getAccountInfo error return null"); - return info; - } + AccountInfo info; + jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l; + if (NULL == ret_obj) { + xerror2(TSF "getAccountInfo error return null"); + return info; + } - jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i; - jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l; + jlong uin = JNU_GetField(env, ret_obj, "uin", "J").i; + jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l; - info.uin = (long)uin; + info.uin = (long)uin; - if (username_jstr != NULL) { - info.username = ScopedJstring(env, username_jstr).GetChar(); - env->DeleteLocalRef(username_jstr); - } + if (username_jstr != NULL) { + info.username = ScopedJstring(env, username_jstr).GetChar(); + env->DeleteLocalRef(username_jstr); + } - env->DeleteLocalRef(ret_obj); - return info; + env->DeleteLocalRef(ret_obj); + return info; +#endif } -std::string GetUserName() { +std::string GetAppUserName() { xverbose_function(); +#ifdef NATIVE_CALLBACK + CALL_NATIVE_CALLBACK_RETURN_FUN(GetAppUserName(), std::string("")); +#endif VarCache* cache_instance = VarCache::Singleton(); ScopeJEnv scope_jenv(cache_instance->GetJvm()); - JNIEnv *env = scope_jenv.GetEnv(); + JNIEnv* env = scope_jenv.GetEnv(); jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getAccountInfo).l; - if (NULL == ret_obj) { - return std::string(); - } - - jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l; - - env->DeleteLocalRef(ret_obj); - - if (username_jstr != NULL) { - const char* name = env->GetStringUTFChars(username_jstr, NULL); - std::string user_name(name); - env->ReleaseStringUTFChars(username_jstr, name); - env->DeleteLocalRef(username_jstr); - return user_name; - } else { - return std::string(); - } + if (NULL == ret_obj) { + return std::string(); + } + + jstring username_jstr = (jstring)JNU_GetField(env, ret_obj, "userName", "Ljava/lang/String;").l; + + env->DeleteLocalRef(ret_obj); + + if (username_jstr != NULL) { + const char* name = env->GetStringUTFChars(username_jstr, NULL); + std::string user_name(name); + env->ReleaseStringUTFChars(username_jstr, name); + env->DeleteLocalRef(username_jstr); + return user_name; + } else { + return std::string(); + } } std::string GetRecentUserName() { - return GetUserName(); + return GetAppUserName(); } +#ifndef NATIVE_CALLBACK DEFINE_FIND_STATIC_METHOD(KC2Java_getClientVersion, KC2Java, "getClientVersion", "()I") +#else +DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getClientVersion) +#endif unsigned int GetClientVersion() { +#ifdef NATIVE_CALLBACK + CALL_NATIVE_CALLBACK_RETURN_FUN(GetClientVersion(), 0); +#endif + static unsigned int s_version = 0; + if (0 != s_version) { + return s_version; + } - static unsigned int s_version = 0; - if (0 != s_version) { - return s_version; - } - - VarCache* cache_instance = VarCache::Singleton(); - ScopeJEnv scope_jenv(cache_instance->GetJvm()); - JNIEnv *env = scope_jenv.GetEnv(); - s_version = (unsigned int)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getClientVersion).i; + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + s_version = (unsigned int)JNU_CallStaticMethodByMethodInfo(env, KC2Java_getClientVersion).i; - return s_version; + return s_version; } -DEFINE_FIND_STATIC_METHOD(KC2Java_getDeviceType, KC2Java, "getDeviceType", "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;") +#ifndef NATIVE_CALLBACK +DEFINE_FIND_STATIC_METHOD(KC2Java_getDeviceType, + KC2Java, + "getDeviceType", + "()Lcom/tencent/mars/app/AppLogic$DeviceInfo;") +#else +DEFINE_FIND_EMPTY_STATIC_METHOD(KC2Java_getDeviceType) +#endif DeviceInfo GetDeviceInfo() { - xverbose_function(); + xverbose_function(); +#ifdef NATIVE_CALLBACK + CALL_NATIVE_CALLBACK_RETURN_FUN(GetDeviceInfo(), DeviceInfo()); +#endif - static DeviceInfo s_info; - if (!s_info.devicename.empty() || !s_info.devicetype.empty()) { - return s_info; - } + static DeviceInfo s_info; + if (!s_info.devicename.empty() || !s_info.devicetype.empty()) { + return s_info; + } - VarCache* cache_instance = VarCache::Singleton(); - ScopeJEnv scope_jenv(cache_instance->GetJvm()); - JNIEnv *env = scope_jenv.GetEnv(); + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getDeviceType).l; + if (NULL == ret_obj) { + xerror2(TSF "GetDeviceInfo error return null"); + return s_info; + } + + jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l; + + static comm::Mutex mutex; + comm::ScopedLock lock(mutex); - jobject ret_obj = JNU_CallStaticMethodByMethodInfo(env, KC2Java_getDeviceType).l; - if (NULL == ret_obj) { - xerror2(TSF"GetDeviceInfo error return null"); - return s_info; - } + if (NULL != devicename_jstr) { + ScopedJstring scoped_jstr(env, devicename_jstr); - jstring devicename_jstr = (jstring)JNU_GetField(env, ret_obj, "devicename", "Ljava/lang/String;").l; + jsize len = env->GetStringUTFLength(devicename_jstr); + s_info.devicename = std::string(scoped_jstr.GetChar(), len); - if (NULL != devicename_jstr) { - s_info.devicename = ScopedJstring(env, devicename_jstr).GetChar(); - env->DeleteLocalRef(devicename_jstr); - } + env->DeleteLocalRef(devicename_jstr); + } - jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l; - if (NULL != devicetype_jstr) { - s_info.devicetype = ScopedJstring(env, devicetype_jstr).GetChar(); - env->DeleteLocalRef(devicetype_jstr); - } + jstring devicetype_jstr = (jstring)JNU_GetField(env, ret_obj, "devicetype", "Ljava/lang/String;").l; + if (NULL != devicetype_jstr) { + ScopedJstring scoped_jstr(env, devicetype_jstr); + + jsize len = env->GetStringUTFLength(devicetype_jstr); + s_info.devicetype = std::string(scoped_jstr.GetChar(), len); + + env->DeleteLocalRef(devicetype_jstr); + } + + return s_info; +} - return s_info; +mars::comm::ProxyInfo GetProxyInfo(const std::string& _host) { + return mars::comm::ProxyInfo(); } -}} +} // namespace app +} // namespace mars +#endif diff --git a/mars/app/jni/export.mk b/mars/app/jni/export.mk deleted file mode 100644 index c59b7a960..000000000 --- a/mars/app/jni/export.mk +++ /dev/null @@ -1,5 +0,0 @@ -EXPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_EXPORT_C_INCLUDES:= -SELF_LOCAL_EXPORT_SRC_FILES := -SELF_LOCAL_EXPORT_LDLIBS := -include $(EXPORT_LOCAL_PATH)/../../mk_template/export_template.mk \ No newline at end of file diff --git a/mars/app/jni/import.mk b/mars/app/jni/import.mk deleted file mode 100644 index 22ef0a8e0..000000000 --- a/mars/app/jni/import.mk +++ /dev/null @@ -1,3 +0,0 @@ -IMPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_IMPORT_LIBRARIES_PATH := -include $(IMPORT_LOCAL_PATH)/../../mk_template/import_template.mk \ No newline at end of file diff --git a/mars/app/jni/sources.mk b/mars/app/jni/sources.mk deleted file mode 100644 index c13e2e436..000000000 --- a/mars/app/jni/sources.mk +++ /dev/null @@ -1,21 +0,0 @@ - -TEMP_LOCAL_PATH :=$(call my-dir) - -LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../log/src/ $(TEMP_LOCAL_PATH)/../ - -include $(TEMP_LOCAL_PATH)/../../mk_template/flags.mk -LOCAL_CFLAGS += -fvisibility=hidden - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/unix/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../ $(TEMP_LOCAL_PATH)/../../../ \ No newline at end of file diff --git a/mars/app/mmcomm-watch.xcodeproj/project.pbxproj b/mars/app/mmcomm-watch.xcodeproj/project.pbxproj deleted file mode 100644 index 94ecbe1e3..000000000 --- a/mars/app/mmcomm-watch.xcodeproj/project.pbxproj +++ /dev/null @@ -1,372 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 13635A031981F37600EED49B /* ActiveLogic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359EB1981F37600EED49B /* ActiveLogic.cpp */; }; - 13635A041981F37600EED49B /* HttpRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359ED1981F37600EED49B /* HttpRequest.cpp */; }; - 13635A051981F37600EED49B /* logic_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F01981F37600EED49B /* logic_utils.cpp */; }; - 13635A061981F37600EED49B /* MMNewGetDns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F31981F37600EED49B /* MMNewGetDns.cpp */; }; - 13635A071981F37600EED49B /* newdns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F61981F37600EED49B /* newdns.cpp */; }; - 13635A081981F37600EED49B /* SocketUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359F81981F37600EED49B /* SocketUtils.cpp */; }; - 13635A091981F37600EED49B /* MMStackReportBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 136359FC1981F37600EED49B /* MMStackReportBase.cpp */; }; - 1392E92E1A834D890093185B /* MMFileReport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1392E92C1A834D890093185B /* MMFileReport.cpp */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 136359EB1981F37600EED49B /* ActiveLogic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveLogic.cpp; sourceTree = ""; }; - 136359EC1981F37600EED49B /* ActiveLogic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveLogic.h; sourceTree = ""; }; - 136359ED1981F37600EED49B /* HttpRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpRequest.cpp; sourceTree = ""; }; - 136359EE1981F37600EED49B /* HttpRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpRequest.h; sourceTree = ""; }; - 136359EF1981F37600EED49B /* HttpUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpUtils.h; sourceTree = ""; }; - 136359F01981F37600EED49B /* logic_utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logic_utils.cpp; sourceTree = ""; }; - 136359F11981F37600EED49B /* logic_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logic_utils.h; sourceTree = ""; }; - 136359F21981F37600EED49B /* MMComm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMComm.h; sourceTree = ""; }; - 136359F31981F37600EED49B /* MMNewGetDns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMNewGetDns.cpp; sourceTree = ""; }; - 136359F41981F37600EED49B /* MMNewGetDns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMNewGetDns.h; sourceTree = ""; }; - 136359F51981F37600EED49B /* MMStackReportBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMStackReportBase.h; sourceTree = ""; }; - 136359F61981F37600EED49B /* newdns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = newdns.cpp; sourceTree = ""; }; - 136359F71981F37600EED49B /* platform_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_logic.h; sourceTree = ""; }; - 136359F81981F37600EED49B /* SocketUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketUtils.cpp; sourceTree = ""; }; - 136359F91981F37600EED49B /* SocketUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketUtils.h; sourceTree = ""; }; - 136359FA1981F37600EED49B /* SpecialINI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecialINI.h; sourceTree = ""; }; - 136359FC1981F37600EED49B /* MMStackReportBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMStackReportBase.cpp; sourceTree = ""; }; - 136359FD1981F37600EED49B /* MMStackReportBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMStackReportBase.h; sourceTree = ""; }; - 137FEC26197621A30055BFF6 /* newdnscfg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = newdnscfg.h; sourceTree = ""; }; - 1392E92C1A834D890093185B /* MMFileReport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MMFileReport.cpp; sourceTree = ""; }; - 1392E92D1A834D890093185B /* MMFileReport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFileReport.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libmmcomm-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libmmcomm-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 136359EA1981F37600EED49B /* src */ = { - isa = PBXGroup; - children = ( - 1392E92C1A834D890093185B /* MMFileReport.cpp */, - 1392E92D1A834D890093185B /* MMFileReport.h */, - 136359EB1981F37600EED49B /* ActiveLogic.cpp */, - 136359EC1981F37600EED49B /* ActiveLogic.h */, - 136359ED1981F37600EED49B /* HttpRequest.cpp */, - 136359EE1981F37600EED49B /* HttpRequest.h */, - 136359EF1981F37600EED49B /* HttpUtils.h */, - 136359F01981F37600EED49B /* logic_utils.cpp */, - 136359F11981F37600EED49B /* logic_utils.h */, - 136359F21981F37600EED49B /* MMComm.h */, - 136359F31981F37600EED49B /* MMNewGetDns.cpp */, - 136359F41981F37600EED49B /* MMNewGetDns.h */, - 136359F51981F37600EED49B /* MMStackReportBase.h */, - 136359F61981F37600EED49B /* newdns.cpp */, - 136359F71981F37600EED49B /* platform_logic.h */, - 136359F81981F37600EED49B /* SocketUtils.cpp */, - 136359F91981F37600EED49B /* SocketUtils.h */, - 136359FA1981F37600EED49B /* SpecialINI.h */, - 136359FB1981F37600EED49B /* unix */, - ); - path = src; - sourceTree = ""; - }; - 136359FB1981F37600EED49B /* unix */ = { - isa = PBXGroup; - children = ( - 136359FC1981F37600EED49B /* MMStackReportBase.cpp */, - 136359FD1981F37600EED49B /* MMStackReportBase.h */, - ); - path = unix; - sourceTree = ""; - }; - 137FEC25197621A30055BFF6 /* cfg */ = { - isa = PBXGroup; - children = ( - 137FEC26197621A30055BFF6 /* newdnscfg.h */, - ); - path = cfg; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 136359EA1981F37600EED49B /* src */, - 137FEC25197621A30055BFF6 /* cfg */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libmmcomm-watch.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* mmcomm-watch */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "mmcomm-watch" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "mmcomm-watch"; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libmmcomm-watch.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "mmcomm-watch" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* mmcomm-watch */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13635A091981F37600EED49B /* MMStackReportBase.cpp in Sources */, - 13635A071981F37600EED49B /* newdns.cpp in Sources */, - 13635A051981F37600EED49B /* logic_utils.cpp in Sources */, - 13635A061981F37600EED49B /* MMNewGetDns.cpp in Sources */, - 13635A031981F37600EED49B /* ActiveLogic.cpp in Sources */, - 13635A081981F37600EED49B /* SocketUtils.cpp in Sources */, - 13635A041981F37600EED49B /* HttpRequest.cpp in Sources */, - 1392E92E1A834D890093185B /* MMFileReport.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = watchos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = watchos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/mmcomm.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - ../comm/crypt, - ../comm, - ../openssl/export_include, - ../log/src, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/mmcomm.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - ../comm/crypt, - ../comm, - ../openssl/export_include, - ../log/src, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "mmcomm-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "mmcomm-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/app/src/traffic_statistics.cc b/mars/app/src/traffic_statistics.cc new file mode 100644 index 000000000..f023d104e --- /dev/null +++ b/mars/app/src/traffic_statistics.cc @@ -0,0 +1,112 @@ +/* + * traffic_statistics.cc + * + * Created on: 2012-9-18 + * Author: garryyan + * Copyright (c) 2013-2015 Tencent. All rights reserved. + * + */ + +#include "traffic_statistics.h" + +#include + +#include "mars/app/app.h" +#include "mars/comm/platform_comm.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/time_utils.h" +#include "mars/comm/xlogger/xlogger.h" + +using namespace mars::app; +using namespace mars::comm; + +TrafficStatistics::TrafficStatistics() +: report_timeout_(10 * 1000 /*10s*/) +, report_size_threshold_(10 * 1024 /*10KB*/) +, wifi_recv_data_size_(0) +, wifi_send_data_size_(0) +, mobile_recv_data_size_(0) +, mobile_send_data_size_(0) +, last_report_time_(gettickcount()) { +} + +TrafficStatistics::TrafficStatistics(unsigned long _report_tmo, unsigned int _report_size_threshold) +: report_timeout_(_report_tmo) +, report_size_threshold_(_report_size_threshold) +, wifi_recv_data_size_(0) +, wifi_send_data_size_(0) +, mobile_recv_data_size_(0) +, mobile_send_data_size_(0) +, last_report_time_(gettickcount()) { +} + +TrafficStatistics::~TrafficStatistics() { + xinfo_function(); + // Flush(); +} +void TrafficStatistics::SetCallback( + const boost::function& _func_report_flow) { + ScopedLock lock(mutex_); + xassert2(!func_report_flow_); + func_report_flow_ = _func_report_flow; +} +void TrafficStatistics::Flush() { + ScopedLock lock(mutex_); + __ReportData(); +} + +void TrafficStatistics::Data(unsigned int _send, unsigned int _recv) { + ScopedLock lock(mutex_); + + if (0 < _send || 0 < _recv) { + if (kMobile != getNetInfo()) + wifi_recv_data_size_ += _recv; + else + mobile_recv_data_size_ += _recv; + + if (kMobile != getNetInfo()) + wifi_send_data_size_ += _send; + else + mobile_send_data_size_ += _send; + } + + if (__IsShouldReport()) + __ReportData(); +} + +void TrafficStatistics::__ReportData() { + if (func_report_flow_) { + if (wifi_recv_data_size_ > 0 || wifi_send_data_size_ || mobile_recv_data_size_ || mobile_send_data_size_) + func_report_flow_(wifi_recv_data_size_, + wifi_send_data_size_, + mobile_recv_data_size_, + mobile_send_data_size_); + xdebug2(TSF "wifi:%_, r:%_, mobile:s:%_, r:%_", + wifi_send_data_size_, + wifi_recv_data_size_, + mobile_send_data_size_, + mobile_recv_data_size_); + } else { + xassert2(false, + TSF "wifi:s:%_, r:%_, mobile:s:%_, r:%_", + wifi_send_data_size_, + wifi_recv_data_size_, + mobile_send_data_size_, + mobile_recv_data_size_); + } + wifi_recv_data_size_ = 0; + wifi_send_data_size_ = 0; + mobile_recv_data_size_ = 0; + mobile_send_data_size_ = 0; + last_report_time_ = gettickcount(); +} + +bool TrafficStatistics::__IsShouldReport() const { + if ((gettickcount() - last_report_time_ > report_timeout_) + || (wifi_recv_data_size_ + wifi_send_data_size_ + mobile_recv_data_size_ + mobile_send_data_size_ + > report_size_threshold_)) { + return true; + } + + return false; +} diff --git a/mars/app/src/traffic_statistics.h b/mars/app/src/traffic_statistics.h new file mode 100644 index 000000000..54f0fe3e6 --- /dev/null +++ b/mars/app/src/traffic_statistics.h @@ -0,0 +1,55 @@ +/* + * traffic_statistics.h + * + * Created on: 2012-9-18 + * Author: garryyan + * Copyright (c) 2013-2015 Tencent. All rights reserved. + * + */ + +#ifndef STN_SRC_TRAFFIC_STATISTICS_H_ +#define STN_SRC_TRAFFIC_STATISTICS_H_ + +#include "boost/function.hpp" +#include "boost/signals2.hpp" +#include "mars/comm/singleton.h" +#include "mars/comm/thread/mutex.h" + +namespace mars { +namespace app { + +class TrafficStatistics { + public: + TrafficStatistics(); + TrafficStatistics(unsigned long _report_tmo, unsigned int _report_size_threshold); + ~TrafficStatistics(); + void Data(unsigned int _send, unsigned int _recv); + void Flush(); + void SetCallback(const boost::function& _func_report_flow); + + private: + TrafficStatistics(const TrafficStatistics&); + TrafficStatistics& operator=(const TrafficStatistics&); + + private: + void __ReportData(); + bool __IsShouldReport() const; + + private: + const unsigned long report_timeout_; + const unsigned int report_size_threshold_; + + boost::function + func_report_flow_; + + unsigned int wifi_recv_data_size_; + unsigned int wifi_send_data_size_; + unsigned int mobile_recv_data_size_; + unsigned int mobile_send_data_size_; + uint64_t last_report_time_; + comm::Mutex mutex_; +}; +} // namespace app +} // namespace mars + +#endif // STN_SRC_TRAFFIC_STATISTICS_H_ diff --git a/mars/app/src/wp/platform_logic.cpp b/mars/app/src/wp/platform_logic.cpp index 6c33da810..bbb0c1a81 100644 --- a/mars/app/src/wp/platform_logic.cpp +++ b/mars/app/src/wp/platform_logic.cpp @@ -1,125 +1,107 @@ #include "../../interface/app.h" -#include "runtime_logic.h" -#include "xlogger.h" #include "comm\platform_comm.h" +#include "runtime_logic.h" #include "runtime_utils.h" +#include "xlogger.h" using namespace PublicComponent; using namespace Platform; -std::string getUserNameNoLog() -{ - String^ psUserName = Runtime2Cs_Logic::Singleton()->getUserName(); +std::string getUserNameNoLog() { + String ^ psUserName = Runtime2Cs_Logic::Singleton()->GetAppUserName(); - //std::wstring wsUsername(psUserName->Data()); - std::string sUsername = String2stdstring(psUserName); - //sUsername.assign(wsUsername.begin(), wsUsername.end()); + // std::wstring wsUsername(psUserName->Data()); + std::string sUsername = String2stdstring(psUserName); + // sUsername.assign(wsUsername.begin(), wsUsername.end()); - return sUsername; + return sUsername; } -std::string getUserName() -{ - xverbose_function(); +std::string GetAppUserName() { + xverbose_function(); - std::string userName = getUserNameNoLog(); - xdebug2(TSF"userName= %0", userName); + std::string userName = getUserNameNoLog(); + xdebug2(TSF "userName= %0", userName); return userName; } // ���ص�ǰ�û������û�У�����֮ǰ��½���Ǹ��û�����Ҫ���ؿվͿ��� -//wp�ͷ��ص�ǰusername -std::string getRecentUserName() -{ - xverbose_function(); +// wp�ͷ��ص�ǰusername +std::string getRecentUserName() { + xverbose_function(); - return getUserName(); + return GetAppUserName(); } -unsigned int getClientVersionNoLog() -{ - return Runtime2Cs_Logic::Singleton()->getClientVersion(); +unsigned int getClientVersionNoLog() { + return Runtime2Cs_Logic::Singleton()->getClientVersion(); } -unsigned int getClientVersion() -{ - xverbose_function(); +unsigned int getClientVersion() { + xverbose_function(); - unsigned int clientVersion = getClientVersionNoLog(); + unsigned int clientVersion = getClientVersionNoLog(); - xdebug2(TSF"clientVersion= %0", clientVersion); - return clientVersion; + xdebug2(TSF "clientVersion= %0", clientVersion); + return clientVersion; } - -AccountInfo getAccountInfo() -{ - xverbose_function(); - AccountInfo accountInfo; - AccountInfoRef^ inforef = Runtime2Cs_Logic::Singleton()->getAccountInfo(); - if(inforef != nullptr) - { - accountInfo.qquin = inforef->qquin; - accountInfo.uin = inforef->uin; - //std::wstring wsUsername(inforef->username->Data()); - accountInfo.username = String2stdstring(inforef->username); - } - - return accountInfo; +AccountInfo getAccountInfo() { + xverbose_function(); + AccountInfo accountInfo; + AccountInfoRef ^ inforef = Runtime2Cs_Logic::Singleton()->getAccountInfo(); + if (inforef != nullptr) { + accountInfo.qquin = inforef->qquin; + accountInfo.uin = inforef->uin; + // std::wstring wsUsername(inforef->username->Data()); + accountInfo.username = String2stdstring(inforef->username); + } + + return accountInfo; } -void getUplodLogExtrasInfo(std::string& _extrasinfo) -{ - xverbose_function(); - String^ psExInfo = Runtime2Cs_Logic::Singleton()->getUplodLogExtrasInfo(); - - //std::wstring wsExinfo2(TSFpsExInfo->Data()); - _extrasinfo = String2stdstring(psExInfo); +void getUplodLogExtrasInfo(std::string& _extrasinfo) { + xverbose_function(); + String ^ psExInfo = Runtime2Cs_Logic::Singleton()->getUplodLogExtrasInfo(); + + // std::wstring wsExinfo2(TSFpsExInfo->Data()); + _extrasinfo = String2stdstring(psExInfo); } -void getWatchDogPath(std::string& _watchDogPath) -{ - xverbose_function(); - _watchDogPath = getAppFilePath(); - _watchDogPath += "\\watchdog\\"; +void getWatchDogPath(std::string& _watchDogPath) { + xverbose_function(); + _watchDogPath = getAppFilePath(); + _watchDogPath += "\\watchdog\\"; } -void getKVCommPath(std::string& _kvCommPath) -{ - xverbose_function(); - _kvCommPath = getAppFilePath(); - _kvCommPath += "\\kvcomm\\"; +void getKVCommPath(std::string& _kvCommPath) { + xverbose_function(); + _kvCommPath = getAppFilePath(); + _kvCommPath += "\\kvcomm\\"; } -void getCrashFilePath(std::string& filePath, int timespan) -{ - xverbose_function(); - String^ psfilePath = Runtime2Cs_Logic::Singleton()->getCrashFilePath(timespan); - - //std::wstring wsfilePath(psfilePath->Data()); - filePath = String2stdstring(psfilePath); +void getCrashFilePath(std::string& filePath, int timespan) { + xverbose_function(); + String ^ psfilePath = Runtime2Cs_Logic::Singleton()->getCrashFilePath(timespan); + + // std::wstring wsfilePath(psfilePath->Data()); + filePath = String2stdstring(psfilePath); } -unsigned int getNextNoopTime() -{ - return Runtime2Cs_Logic::Singleton()->getNextNoopTime(); +unsigned int getNextNoopTime() { + return Runtime2Cs_Logic::Singleton()->getNextNoopTime(); } -unsigned int getNoopInterval() -{ - return Runtime2Cs_Logic::Singleton()->getNoopInterval(); +unsigned int getNoopInterval() { + return Runtime2Cs_Logic::Singleton()->getNoopInterval(); } -std::string getDeviceType() -{ - return String2stdstring(Runtime2Cs_Logic::Singleton()->getDeviceType()); +std::string getDeviceType() { + return String2stdstring(Runtime2Cs_Logic::Singleton()->getDeviceType()); } -std::string getCurLanguage() -{ - String^ curLanguage = Runtime2Cs_Logic::Singleton()->getCurLanguage(); - return String2stdstring(curLanguage); +std::string getCurLanguage() { + String ^ curLanguage = Runtime2Cs_Logic::Singleton()->getCurLanguage(); + return String2stdstring(curLanguage); } -std::string getDeviceInfo() -{ - return ""; +std::string getDeviceInfo() { + return ""; } - diff --git a/mars/app/win32proj/app.vcxproj b/mars/app/win32proj/app.vcxproj deleted file mode 100644 index a61389604..000000000 --- a/mars/app/win32proj/app.vcxproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {A941CF29-3C28-464B-80D5-DFCB8A3C57A9} - Win32Proj - app - 8.1 - - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - false - v120_xp - true - Unicode - - - - - - - - - - - - - $(SolutionDir)/../../;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath) - - - $(SolutionDir)/../../;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath) - true - - - - - - TurnOffAllWarnings - Disabled - WIN32;_DEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions) - mars/comm/projdef.h - - - Windows - true - - - - - TurnOffAllWarnings - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions) - mars/comm/projdef.h - OldStyle - - - Windows - true - true - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mars/app/win32proj/app.vcxproj.filters b/mars/app/win32proj/app.vcxproj.filters deleted file mode 100644 index 4849a2dfe..000000000 --- a/mars/app/win32proj/app.vcxproj.filters +++ /dev/null @@ -1,33 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Header Files - - - Header Files - - - - - Source Files - - - \ No newline at end of file diff --git a/mars/app/win32proj/app.vcxproj.user b/mars/app/win32proj/app.vcxproj.user deleted file mode 100644 index ef5ff2a1f..000000000 --- a/mars/app/win32proj/app.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/mars/baseevent/.cproject b/mars/baseevent/.cproject deleted file mode 100644 index 12d4b4fd9..000000000 --- a/mars/baseevent/.cproject +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mars/baseevent/.project b/mars/baseevent/.project deleted file mode 100644 index ddc318a7b..000000000 --- a/mars/baseevent/.project +++ /dev/null @@ -1,76 +0,0 @@ - - - baseevent_mars - - - comm_mars - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - ndk-build - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - NDK_DEBGU=0 V=1 LIBPREFIX=wechat -j2 - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/mars/baseevent/CMakeLists.txt b/mars/baseevent/CMakeLists.txt new file mode 100644 index 000000000..b24005c02 --- /dev/null +++ b/mars/baseevent/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +project (baseevent) + +include(../comm/utils.cmake) +include(../comm/CMakeExtraFlags.txt) + + +include_directories(.) +include_directories(src) +include_directories(..) +include_directories(../..) +include_directories(../comm) +include_directories(../../..) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) +source_group(src FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + +if(MSVC) + add_definitions(/FI"../../comm/projdef.h") + include_directories(../comm/windows) +elseif(ANDROID) + file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) +endif() + +BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") + + diff --git a/mars/baseevent/active_logic.h b/mars/baseevent/active_logic.h index ca0d26253..1b6578d1d 100644 --- a/mars/baseevent/active_logic.h +++ b/mars/baseevent/active_logic.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * active_logic.h * @@ -20,18 +20,25 @@ #ifndef MMCOMM_SRC_ACTIVE_LOGIC_H_ #define MMCOMM_SRC_ACTIVE_LOGIC_H_ -#include "boost/signals2.hpp" +#include +#include "boost/signals2.hpp" #include "mars/comm/alarm.h" +#include "mars/comm/singleton.h" #include "mars/comm/thread/mutex.h" -class ActiveLogic -{ -public: - boost::signals2::signal SignalForeground; - boost::signals2::signal SignalActive; +namespace mars { +namespace comm { + +class ActiveLogic { + public: + // SINGLETON_INTRUSIVE(ActiveLogic, new ActiveLogic, delete); + boost::signals2::signal SignalForeground; + boost::signals2::signal SignalActive; + static std::shared_ptr Instance(); + static void Release(); -public: + public: ActiveLogic(); virtual ~ActiveLogic(); @@ -41,14 +48,19 @@ class ActiveLogic bool IsForeground() const; uint64_t LastForegroundChangeTime() const; -private: + void SwitchActiveStateForDebug(bool _active); + + private: void __OnInActive(); -private: - bool isforeground_; - bool isactive_; - Alarm alarm_; + private: + bool isforeground_; + bool isactive_; + Alarm alarm_; uint64_t lastforegroundchangetime_; + static std::shared_ptr inst_; }; -#endif // MMCOMM_SRC_ACTIVE_LOGIC_H_ +} // namespace comm +} // namespace mars +#endif // MMCOMM_SRC_ACTIVE_LOGIC_H_ diff --git a/mars/baseevent/base_logic.h b/mars/baseevent/base_logic.h index 64cc6d2d7..2f34039f7 100644 --- a/mars/baseevent/base_logic.h +++ b/mars/baseevent/base_logic.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * baseprj.h * @@ -20,15 +20,23 @@ #ifndef MARS_BASELOGIC_H_ #define MARS_BASELOGIC_H_ -namespace mars{ -namespace baseevent{ - void OnCreate(); - void OnDestroy(); - void OnSingalCrash(int _sig); - void OnExceptionCrash(); - void OnForeground(bool _isforeground); - void OnNetworkChange(); -} -} +#include + +#include + +namespace mars { +namespace baseevent { +void OnCreate(); +void OnInitBeforeOnCreate(int _encoder_status); +void OnInitBeforeOnCreateV2(int _encoder_status, std::string _encoder_name); +void OnDestroy(); +void OnSingalCrash(int _sig); +void OnExceptionCrash(); +void OnForeground(bool _isforeground); +void OnNetworkChange(); +void OnNetworkDataChange(const char* _tag, int32_t _send, int32_t _recv); +void OnAlarm(int64_t _id); +} // namespace baseevent +} // namespace mars #endif /* MARS_BASELOGIC_H_ */ diff --git a/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj b/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj deleted file mode 100644 index b870a68ab..000000000 --- a/mars/baseevent/baseevent-mac.xcodeproj/project.pbxproj +++ /dev/null @@ -1,531 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 55D908181CC7BC370076CBD9 /* active_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908151CC7BC370076CBD9 /* active_logic.cc */; }; - 55D908191CC7BC370076CBD9 /* baseprj.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908161CC7BC370076CBD9 /* baseprj.cc */; }; - 55D9081A1CC7BC370076CBD9 /* baseprjevent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D908171CC7BC370076CBD9 /* baseprjevent.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1F25BF081CD3646400AC1003 /* active_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = active_logic.h; sourceTree = ""; }; - 1F25BF091CD3646400AC1003 /* base_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base_logic.h; sourceTree = ""; }; - 1F25BF0A1CD3646400AC1003 /* baseevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseevent.h; sourceTree = ""; }; - 1F25BF0B1CD3646400AC1003 /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; }; - 55D908151CC7BC370076CBD9 /* active_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = active_logic.cc; sourceTree = ""; }; - 55D908161CC7BC370076CBD9 /* baseprj.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cc; sourceTree = ""; }; - 55D908171CC7BC370076CBD9 /* baseprjevent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cc; sourceTree = ""; }; - 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbaseevent.a; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 1F25BF081CD3646400AC1003 /* active_logic.h */, - 1F25BF091CD3646400AC1003 /* base_logic.h */, - 1F25BF0A1CD3646400AC1003 /* baseevent.h */, - 1F25BF0B1CD3646400AC1003 /* baseprjevent.h */, - 55D908141CC7BC370076CBD9 /* src */, - 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */, - ); - sourceTree = ""; - }; - 55D908141CC7BC370076CBD9 /* src */ = { - isa = PBXGroup; - children = ( - 55D908151CC7BC370076CBD9 /* active_logic.cc */, - 55D908161CC7BC370076CBD9 /* baseprj.cc */, - 55D908171CC7BC370076CBD9 /* baseprjevent.cc */, - ); - path = src; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* baseevent */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = baseevent; - productName = PublicComponent; - productReference = 55D9C0821CC7B1C90076CBD9 /* libbaseevent.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = felixzhou; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent-mac" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A01E177887B0004F5DDA; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* baseevent */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 55D9081A1CC7BC370076CBD9 /* baseprjevent.cc in Sources */, - 55D908181CC7BC370076CBD9 /* active_logic.cc in Sources */, - 55D908191CC7BC370076CBD9 /* baseprj.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.10; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - SDKROOT = macosx10.10; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "DEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "NDEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent-mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/baseevent/baseevent.h b/mars/baseevent/baseevent.h index d741380c5..3eedec6bc 100644 --- a/mars/baseevent/baseevent.h +++ b/mars/baseevent/baseevent.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -20,8 +20,8 @@ #ifndef BASEEVENT_INTERFACE_BASEEVENT_H_ #define BASEEVENT_INTERFACE_BASEEVENT_H_ -#include #include +#include #ifdef ANDROID #include @@ -29,12 +29,12 @@ namespace mars { namespace baseevent { - extern void addLoadModule(std::string _module_name); +extern void addLoadModule(std::string _module_name); - extern jobject getLoadLibraries(JNIEnv *_env); +extern jobject getLoadLibraries(JNIEnv* _env); -} -} +} // namespace baseevent +} // namespace mars #endif diff --git a/mars/baseevent/baseevent.xcodeproj/project.pbxproj b/mars/baseevent/baseevent.xcodeproj/project.pbxproj deleted file mode 100644 index df195dc4c..000000000 --- a/mars/baseevent/baseevent.xcodeproj/project.pbxproj +++ /dev/null @@ -1,322 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 13A2285C19755CB40035828E /* baseprj.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285719755CB40035828E /* baseprj.cc */; }; - 13A2285D19755CB40035828E /* baseprjevent.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285919755CB40035828E /* baseprjevent.cc */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; - 4F9D08F51C7C261400E2CEE6 /* active_logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 13A2285719755CB40035828E /* baseprj.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cc; sourceTree = ""; }; - 13A2285919755CB40035828E /* baseprjevent.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cc; sourceTree = ""; }; - 1F25B3071CD334C400AC1003 /* active_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = active_logic.h; sourceTree = ""; }; - 1F25B3081CD334C400AC1003 /* base_logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base_logic.h; sourceTree = ""; }; - 1F25B3091CD334C400AC1003 /* baseevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseevent.h; sourceTree = ""; }; - 1F25B30A1CD334C400AC1003 /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libbaseevent.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbaseevent.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = active_logic.cc; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 13A2285619755CB40035828E /* src */ = { - isa = PBXGroup; - children = ( - 4F9D08F41C7C261400E2CEE6 /* active_logic.cc */, - 13A2285719755CB40035828E /* baseprj.cc */, - 13A2285919755CB40035828E /* baseprjevent.cc */, - ); - path = src; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 1F25B3071CD334C400AC1003 /* active_logic.h */, - 1F25B3081CD334C400AC1003 /* base_logic.h */, - 1F25B3091CD334C400AC1003 /* baseevent.h */, - 1F25B30A1CD334C400AC1003 /* baseprjevent.h */, - 13A2285619755CB40035828E /* src */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libbaseevent.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* baseevent */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = baseevent; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libbaseevent.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* baseevent */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4F9D08F51C7C261400E2CEE6 /* active_logic.cc in Sources */, - 13A2285D19755CB40035828E /* baseprjevent.cc in Sources */, - 13A2285C19755CB40035828E /* baseprj.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = default; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - ENABLE_BITCODE = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = baseevent; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = "line-tables-only"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - ENABLE_BITCODE = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = baseevent; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseevent" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseevent" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj b/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj deleted file mode 100644 index 258e546ff..000000000 --- a/mars/baseevent/baseprj-watch.xcodeproj/project.pbxproj +++ /dev/null @@ -1,312 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 13A2285B19755CB40035828E /* Objc2C_Comm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285519755CB40035828E /* Objc2C_Comm.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13A2285C19755CB40035828E /* baseprj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285719755CB40035828E /* baseprj.cpp */; }; - 13A2285D19755CB40035828E /* baseprjevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13A2285919755CB40035828E /* baseprjevent.cpp */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 13A2285519755CB40035828E /* Objc2C_Comm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Objc2C_Comm.mm; sourceTree = ""; }; - 13A2285719755CB40035828E /* baseprj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprj.cpp; sourceTree = ""; }; - 13A2285819755CB40035828E /* baseprj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprj.h; sourceTree = ""; }; - 13A2285919755CB40035828E /* baseprjevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = baseprjevent.cpp; sourceTree = ""; }; - 13A2285A19755CB40035828E /* baseprjevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = baseprjevent.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libbaseprj-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbaseprj-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 13A2285419755CB40035828E /* objc */ = { - isa = PBXGroup; - children = ( - 13A2285519755CB40035828E /* Objc2C_Comm.mm */, - ); - path = objc; - sourceTree = ""; - }; - 13A2285619755CB40035828E /* src */ = { - isa = PBXGroup; - children = ( - 13A2285719755CB40035828E /* baseprj.cpp */, - 13A2285819755CB40035828E /* baseprj.h */, - 13A2285919755CB40035828E /* baseprjevent.cpp */, - 13A2285A19755CB40035828E /* baseprjevent.h */, - ); - path = src; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 13A2285419755CB40035828E /* objc */, - 13A2285619755CB40035828E /* src */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libbaseprj-watch.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* baseprj-watch */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseprj-watch" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "baseprj-watch"; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libbaseprj-watch.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseprj-watch" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* baseprj-watch */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13A2285B19755CB40035828E /* Objc2C_Comm.mm in Sources */, - 13A2285D19755CB40035828E /* baseprjevent.cpp in Sources */, - 13A2285C19755CB40035828E /* baseprj.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = watchos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = watchos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ../comm; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = "/tmp/$(PROJECT_NAME).dst"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ../comm; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "baseprj-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "baseprj-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/baseevent/baseprjevent.h b/mars/baseevent/baseprjevent.h index 55dc0006b..fd470562c 100644 --- a/mars/baseevent/baseprjevent.h +++ b/mars/baseevent/baseprjevent.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * baseprjevent.h * @@ -22,13 +22,17 @@ #include "boost/signals2.hpp" -extern boost::signals2::signal& GetSignalOnCreate(); -extern boost::signals2::signal& GetSignalOnDestroy(); -extern boost::signals2::signal& GetSignalOnSingalCrash(); -extern boost::signals2::signal& GetSignalOnExceptionCrash(); -extern boost::signals2::signal& GetSignalOnForeground(); -extern boost::signals2::signal& GetSignalOnNetworkChange(); +extern boost::signals2::signal& GetSignalOnCreate(); +extern boost::signals2::signal& GetSignalOnInitBeforeOnCreate(); +extern boost::signals2::signal& +GetSignalOnInitBeforeOnCreateV2(); +extern boost::signals2::signal& GetSignalOnDestroy(); +extern boost::signals2::signal& GetSignalOnSingalCrash(); +extern boost::signals2::signal& GetSignalOnExceptionCrash(); +extern boost::signals2::signal& GetSignalOnForeground(); +extern boost::signals2::signal& GetSignalOnNetworkChange(); -extern boost::signals2::signal& GetSignalOnNetworkDataChange(); +extern boost::signals2::signal& GetSignalOnNetworkDataChange(); +extern boost::signals2::signal& GetSignalOnAlarm(); #endif /* BASEPRJEVENT_H_ */ diff --git a/mars/baseevent/compiler_util.h b/mars/baseevent/compiler_util.h new file mode 100644 index 000000000..5646dae9f --- /dev/null +++ b/mars/baseevent/compiler_util.h @@ -0,0 +1,33 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +/* + * compiler_util.h + * + * Created on: 2017-3-28 + * Author: jehoochen + */ + +#ifndef BASEEVENT_COMPILER_UTIL_H_ +#define BASEEVENT_COMPILER_UTIL_H_ + +#if defined(_MSC_VER) && defined(MARS_USE_DLLS) +#ifdef MARS_BASEEVENT_EXPORTS +#define MARS_BASEEVENT_EXPORT __declspec(dllexport) +#else +#define MARS_BASEEVENT_EXPORT __declspec(dllimport) +#endif +#else +#define MARS_BASEEVENT_EXPORT +#endif + +#endif /* BASEEVENT_COMPILER_UTIL_H_ */ diff --git a/mars/baseevent/jni/Android.mk b/mars/baseevent/jni/Android.mk deleted file mode 100644 index 00f6dd7d6..000000000 --- a/mars/baseevent/jni/Android.mk +++ /dev/null @@ -1,2 +0,0 @@ -LOCAL_PATH :=$(call my-dir) -include $(LOCAL_PATH)/../../mk_template/android_template.mk \ No newline at end of file diff --git a/mars/baseevent/jni/Application.mk b/mars/baseevent/jni/Application.mk deleted file mode 100644 index cdda64028..000000000 --- a/mars/baseevent/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_LOCAL_PATH :=$(call my-dir) -include $(APP_LOCAL_PATH)/../../mk_template/application_template.mk \ No newline at end of file diff --git a/mars/baseevent/jni/build.conf b/mars/baseevent/jni/build.conf deleted file mode 100644 index 4cae3a948..000000000 --- a/mars/baseevent/jni/build.conf +++ /dev/null @@ -1,8 +0,0 @@ -TEMP_LOCAL_PATH :=$(call my-dir) - -SELF_BUILD_CMD := BUILD_STATIC_LIBRARY -SELF_LOCAL_MODULE := baseevent - -SELF_LOCAL_EXPORT_C_INCLUDES := $(TEMP_LOCAL_PATH)/../../ - -SELF_LOCAL_IMPORT_LIBRARIES_PATH += $(TEMP_LOCAL_PATH)/../../comm/jni/export.mk \ No newline at end of file diff --git a/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc b/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc index 604b53d35..753f9d1dc 100644 --- a/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc +++ b/mars/baseevent/jni/com_tencent_mars_BaseEvent.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,80 +10,85 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. -/** - * created on : 2012-07-19 - * author : yanguoyue - */ - -#include -#include - -#include "comm/jni/util/scoped_jstring.h" - -#include "mars/baseevent/base_logic.h" -#include "mars/baseevent/baseevent.h" - -//DEFINE_FIND_CLASS(KBaseEventJava2C, "com/tencent/mars/BaseEvent"); - -namespace mars { -namespace baseevent { - - std::vector* getLoadModuleVec(){ - static std::vector sg_modules; - return &sg_modules; - } - - void addLoadModule(std::string _module_name) { - getLoadModuleVec()->push_back(_module_name); - } - - jobject getLoadLibraries(JNIEnv *_env) { - jclass list_cls = _env->FindClass("java/util/ArrayList"); - jmethodID list_costruct = _env->GetMethodID(list_cls, "", "()V"); - jobject list_obj = _env->NewObject(list_cls , list_costruct); - - jmethodID list_add = _env->GetMethodID(list_cls, "add", "(Ljava/lang/Object;)Z"); - - for(std::vector::iterator iter = getLoadModuleVec()->begin(); iter != getLoadModuleVec()->end(); ++iter){ - _env->CallBooleanMethod(list_obj , list_add , ScopedJstring(_env, (*iter).c_str()).GetJstr()); - } - - return list_obj; - } -} -} - -extern "C" { - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onCreate(JNIEnv* env, jclass) -{ - mars::baseevent::OnCreate(); -} - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onDestroy(JNIEnv* env, jclass) -{ - mars::baseevent::OnDestroy(); -} - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onForeground (JNIEnv *, jclass, jboolean _isforeground) -{ - mars::baseevent::OnForeground(_isforeground); -} - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onNetworkChange (JNIEnv *, jclass) -{ - mars::baseevent::OnNetworkChange(); -} - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onSingalCrash(JNIEnv *, jclass, jint _sig){ - mars::baseevent::OnSingalCrash((int)_sig); -} - -JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onExceptionCrash(JNIEnv*, jclass){ - mars::baseevent::OnExceptionCrash(); -} - -} - -void ExportBaseEvent() { -} +/** + * created on : 2012-07-19 + * author : yanguoyue + */ + +#include +#include + +#include "comm/jni/util/scoped_jstring.h" +#include "mars/baseevent/base_logic.h" +#include "mars/baseevent/baseevent.h" + +// DEFINE_FIND_CLASS(KBaseEventJava2C, "com/tencent/mars/BaseEvent"); + +namespace mars { +namespace baseevent { + +std::vector* getLoadModuleVec() { + static std::vector sg_modules; + return &sg_modules; +} + +void addLoadModule(std::string _module_name) { + getLoadModuleVec()->push_back(_module_name); +} + +jobject getLoadLibraries(JNIEnv* _env) { + jclass list_cls = _env->FindClass("java/util/ArrayList"); + jmethodID list_costruct = _env->GetMethodID(list_cls, "", "()V"); + jobject list_obj = _env->NewObject(list_cls, list_costruct); + + jmethodID list_add = _env->GetMethodID(list_cls, "add", "(Ljava/lang/Object;)Z"); + + for (std::vector::iterator iter = getLoadModuleVec()->begin(); iter != getLoadModuleVec()->end(); + ++iter) { + _env->CallBooleanMethod(list_obj, list_add, ScopedJstring(_env, (*iter).c_str()).GetJstr()); + } + + return list_obj; +} +} // namespace baseevent +} // namespace mars + +extern "C" { + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onCreate(JNIEnv* env, jclass) { + mars::baseevent::OnCreate(); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onInitConfigBeforeOnCreate(JNIEnv* env, + jclass, + jint _packer_encoder_version) { + mars::baseevent::OnInitBeforeOnCreate(_packer_encoder_version); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onDestroy(JNIEnv* env, jclass) { + mars::baseevent::OnDestroy(); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onForeground(JNIEnv*, jclass, jboolean _isforeground) { + mars::baseevent::OnForeground(_isforeground); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onNetworkChange(JNIEnv*, jclass) { + mars::baseevent::OnNetworkChange(); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onSingalCrash(JNIEnv*, jclass, jint _sig) { + mars::baseevent::OnSingalCrash((int)_sig); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_BaseEvent_onExceptionCrash(JNIEnv*, jclass) { + mars::baseevent::OnExceptionCrash(); +} + +JNIEXPORT void JNICALL Java_com_tencent_mars_comm_Alarm_onAlarm(JNIEnv* env, jclass, jlong _id) { + mars::baseevent::OnAlarm((int64_t)_id); +} +} + +void ExportBaseEvent() { +} diff --git a/mars/baseevent/jni/export.mk b/mars/baseevent/jni/export.mk deleted file mode 100644 index c59b7a960..000000000 --- a/mars/baseevent/jni/export.mk +++ /dev/null @@ -1,5 +0,0 @@ -EXPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_EXPORT_C_INCLUDES:= -SELF_LOCAL_EXPORT_SRC_FILES := -SELF_LOCAL_EXPORT_LDLIBS := -include $(EXPORT_LOCAL_PATH)/../../mk_template/export_template.mk \ No newline at end of file diff --git a/mars/baseevent/jni/import.mk b/mars/baseevent/jni/import.mk deleted file mode 100644 index 22ef0a8e0..000000000 --- a/mars/baseevent/jni/import.mk +++ /dev/null @@ -1,3 +0,0 @@ -IMPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_IMPORT_LIBRARIES_PATH := -include $(IMPORT_LOCAL_PATH)/../../mk_template/import_template.mk \ No newline at end of file diff --git a/mars/baseevent/jni/sources.mk b/mars/baseevent/jni/sources.mk deleted file mode 100644 index 7e182315f..000000000 --- a/mars/baseevent/jni/sources.mk +++ /dev/null @@ -1,17 +0,0 @@ -TEMP_LOCAL_PATH :=$(call my-dir) - -include $(TEMP_LOCAL_PATH)/../../mk_template/flags.mk - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/../*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/../src/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -LOCAL_C_INCLUDES += $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../src $(TEMP_LOCAL_PATH)/../../ $(TEMP_LOCAL_PATH)/../../../ diff --git a/mars/baseevent/src/active_logic.cc b/mars/baseevent/src/active_logic.cc index 9d434240b..1defeb02c 100644 --- a/mars/baseevent/src/active_logic.cc +++ b/mars/baseevent/src/active_logic.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,126 +10,153 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. -/* - * active_logic.cc - * - * Created on: 2012-8-22 - * Author: yerungui - */ - -#include "boost/bind.hpp" - -#include "mars/baseevent/active_logic.h" -#include "mars/baseevent/baseprjevent.h" -#include "mars/comm/singleton.h" -#include "mars/comm/xlogger/xlogger.h" -#include "mars/comm/thread/lock.h" -#include "mars/comm/time_utils.h" -#include "mars/comm/bootrun.h" -#include "mars/comm/messagequeue/message_queue.h" - -static void onForeground(bool _isforeground) { - SINGLETON_STRONG(ActiveLogic)->OnForeground(_isforeground); -} - -static void __initbind_baseprjevent() { - GetSignalOnForeground().connect(&onForeground); -} - -BOOT_RUN_STARTUP(__initbind_baseprjevent); - -#ifdef ANDROID -#define INACTIVE_TIMEOUT (10*60*1000) //ms -#elif defined Q_OS_BLACKBERRY -#define INACTIVE_TIMEOUT (10*60*1000) //ms -#elif defined _WIN32 -#define INACTIVE_TIMEOUT (10*60*1000) //ms -#else -#define INACTIVE_TIMEOUT (10*60*1000) //ms -#endif - - -ActiveLogic::ActiveLogic() -: isforeground_(false), isactive_(true) -, alarm_(boost::bind(&ActiveLogic::__OnInActive, this), false) -, lastforegroundchangetime_(::gettickcount()) -{ - xinfo_function(); -#ifndef __APPLE__ - if (!alarm_.Start(INACTIVE_TIMEOUT)) - { - xerror2(TSF"m_alarm.Start false"); - } -#endif -} - -ActiveLogic::~ActiveLogic() -{ - xinfo_function(); - MessageQueue::CancelMessage(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()), (MessageQueue::MessageTitle_t)this); - MessageQueue::WaitForRuningLockEnd(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue())); -} - -void ActiveLogic::OnForeground(bool _isforeground) -{ - if (MessageQueue::GetDefMessageQueue()!=MessageQueue::CurrentThreadMessageQueue()) - { - MessageQueue::AsyncInvoke(boost::bind(&ActiveLogic::OnForeground, this, _isforeground), (MessageQueue::MessageTitle_t)this, mq::DefAsyncInvokeHandler(mq::GetDefMessageQueue())); - return; - } - - xgroup2_define(group); - xinfo2(TSF"OnForeground:%0, change:%1, ", _isforeground, _isforeground!=isforeground_) >> group; - - if (_isforeground == isforeground_) return; - - bool oldisactive = isactive_; - isactive_ = true; - isforeground_ = _isforeground; - lastforegroundchangetime_ = ::gettickcount(); - alarm_.Cancel(); - - if (!isforeground_) - { -#ifndef __APPLE__ - if (!alarm_.Start(INACTIVE_TIMEOUT)) - { - xerror2(TSF"m_alarm.Start false") >> group; - } -#endif - } - - bool isnotify = oldisactive!=isactive_; - SignalForeground(isforeground_); - - if (isnotify) - { - xinfo2(TSF"active change:%0", isactive_) >> group; - SignalActive(isactive_); - } -} - -bool ActiveLogic::IsActive() const -{ - return isactive_; -} - -bool ActiveLogic::IsForeground() const -{ - return isforeground_; -} - -uint64_t ActiveLogic::LastForegroundChangeTime() const -{ - return lastforegroundchangetime_; -} - -void ActiveLogic::__OnInActive() -{ - xdebug_function(); - if (!isforeground_) isactive_ = false; - - bool isactive = isactive_; - xinfo2(TSF"active change:%0", isactive_); - SignalActive(isactive); -} +/* + * active_logic.cc + * + * Created on: 2012-8-22 + * Author: yerungui + */ + +#include "mars/baseevent/active_logic.h" + +#include "boost/bind.hpp" +#include "mars/baseevent/baseprjevent.h" +#include "mars/comm/bootrun.h" +#include "mars/comm/messagequeue/message_queue.h" +#include "mars/comm/singleton.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/thread/mutex.h" +#include "mars/comm/time_utils.h" +#include "mars/comm/xlogger/xlogger.h" + +namespace mars { +namespace comm { + +static void onForeground(bool _isforeground) { + ActiveLogic::Instance()->OnForeground(_isforeground); +} + +static void __initbind_baseprjevent() { + GetSignalOnForeground().connect(&onForeground); +} + +BOOT_RUN_STARTUP(__initbind_baseprjevent); + +#define INACTIVE_TIMEOUT (10 * 60 * 1000) // ms + +#ifdef ANDROID +static void onAlarm(int64_t id) { + Alarm::onAlarmImpl(id); +} +static const int kAlarmType = 100; +#endif + +std::shared_ptr ActiveLogic::inst_ = nullptr; +std::shared_ptr ActiveLogic::Instance() { + static Mutex mtx; + if (!inst_) { + ScopedLock lock(mtx); + if (!inst_) { + inst_ = std::make_shared(); + } + } + + return inst_; +} + +void ActiveLogic::Release() { + inst_ = nullptr; +} + +ActiveLogic::ActiveLogic() +: isforeground_(false) +, isactive_(true) +, alarm_(boost::bind(&ActiveLogic::__OnInActive, this), false) +, lastforegroundchangetime_(::gettickcount()) { + xinfo_function(TSF "MQ:%_, this:%_", MessageQueue::GetDefMessageQueue(), this); + +#ifdef __ANDROID__ + GetSignalOnAlarm().connect(&onAlarm); + alarm_.SetType(kAlarmType); +#endif +#ifndef __APPLE__ + if (!alarm_.Start(INACTIVE_TIMEOUT)) { + xerror2(TSF "m_alarm.Start false"); + } +#endif +} + +ActiveLogic::~ActiveLogic() { + xinfo_function(); + MessageQueue::CancelMessage(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue()), + (MessageQueue::MessageTitle_t)this); + MessageQueue::WaitForRunningLockEnd(MessageQueue::DefAsyncInvokeHandler(MessageQueue::GetDefMessageQueue())); +} + +void ActiveLogic::OnForeground(bool _isforeground) { + if (MessageQueue::GetDefMessageQueue() != MessageQueue::CurrentThreadMessageQueue()) { + MessageQueue::AsyncInvoke(boost::bind(&ActiveLogic::OnForeground, this, _isforeground), + (MessageQueue::MessageTitle_t)this, + mq::DefAsyncInvokeHandler(mq::GetDefMessageQueue()), + "ActiveLogic::OnForeground"); + return; + } + + xgroup2_define(group); + xinfo2(TSF "OnForeground:%0, change:%1, this:%2", _isforeground, _isforeground != isforeground_, this) >> group; + + if (_isforeground == isforeground_) + return; + + bool oldisactive = isactive_; + isactive_ = true; + isforeground_ = _isforeground; + lastforegroundchangetime_ = ::gettickcount(); + alarm_.Cancel(); + + if (!isforeground_) { +#ifndef __APPLE__ + if (!alarm_.Start(INACTIVE_TIMEOUT)) { + xerror2(TSF "m_alarm.Start false") >> group; + } +#endif + } + + bool isnotify = oldisactive != isactive_; + SignalForeground(isforeground_); + + if (isnotify) { + xinfo2(TSF "active change:%0", isactive_) >> group; + SignalActive(isactive_); + } +} + +bool ActiveLogic::IsActive() const { + return isactive_; +} + +bool ActiveLogic::IsForeground() const { + return isforeground_; +} + +uint64_t ActiveLogic::LastForegroundChangeTime() const { + return lastforegroundchangetime_; +} + +void ActiveLogic::__OnInActive() { + xdebug_function(); + if (!isforeground_) + isactive_ = false; + + bool isactive = isactive_; + xinfo2(TSF "active change:%0", isactive_); + SignalActive(isactive); +} + +void ActiveLogic::SwitchActiveStateForDebug(bool _active) { + isactive_ = _active; + __OnInActive(); +} + +} // namespace comm +} // namespace mars \ No newline at end of file diff --git a/mars/baseevent/src/baseprj.cc b/mars/baseevent/src/baseprj.cc index 332b7bca3..4a601d315 100644 --- a/mars/baseevent/src/baseprj.cc +++ b/mars/baseevent/src/baseprj.cc @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * baseprj.cpp * @@ -17,43 +17,62 @@ * Author: yerungui */ +#include "mars/baseevent/base_logic.h" #include "mars/baseevent/baseprjevent.h" - -#include "mars/comm/compiler_util.h" #include "mars/comm/bootregister.h" +#include "mars/comm/platform_comm.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/time_utils.h" + +using namespace mars::comm; + +namespace mars { +namespace baseevent { + +void OnCreate() { + GetSignalOnCreate()(); +} + +void OnInitBeforeOnCreate(int _encoder_status) { + GetSignalOnInitBeforeOnCreate()(_encoder_status); +} + +void OnInitBeforeOnCreateV2(int _encoder_status, std::string _encoder_name) { + GetSignalOnInitBeforeOnCreateV2()(_encoder_status, _encoder_name); +} -namespace mars{ - namespace baseevent{ - - void OnCreate() - { - GetSignalOnCreate()(); - } - - void OnDestroy() - { - GetSignalOnDestroy()(); - } - - void OnSingalCrash(int _sig) - { - GetSignalOnSingalCrash()(_sig); - } - - void OnExceptionCrash() - { - GetSignalOnExceptionCrash()(); - } - - void OnForeground(bool _isforeground) - { - GetSignalOnForeground()(_isforeground); - } - - void OnNetworkChange() - { - GetSignalOnNetworkChange()(); - } - } +void OnDestroy() { + GetSignalOnDestroy()(); } +void OnSingalCrash(int _sig) { + GetSignalOnSingalCrash()(_sig); +} + +void OnExceptionCrash() { + GetSignalOnExceptionCrash()(); +} + +void OnForeground(bool _isforeground) { + GetSignalOnForeground()(_isforeground); +} + +void OnNetworkChange() { +#ifdef __APPLE__ + FlushReachability(); +#endif + OnPlatformNetworkChange(); + GetSignalOnNetworkChange()(); +} + +void OnNetworkDataChange(const char* _tag, int32_t _send, int32_t _recv) { + GetSignalOnNetworkDataChange()(_tag, _send, _recv); +} + +#ifdef ANDROID +void OnAlarm(int64_t _id) { + GetSignalOnAlarm()(_id); +} +#endif +} // namespace baseevent +} // namespace mars diff --git a/mars/baseevent/src/baseprjevent.cc b/mars/baseevent/src/baseprjevent.cc index 35292c50e..49420ba88 100644 --- a/mars/baseevent/src/baseprjevent.cc +++ b/mars/baseevent/src/baseprjevent.cc @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * baseprjevent.cpp * @@ -19,44 +19,52 @@ #include "mars/baseevent/baseprjevent.h" -boost::signals2::signal& GetSignalOnCreate() -{ - static boost::signals2::signal SignalOnCreate; - return SignalOnCreate; +boost::signals2::signal& GetSignalOnCreate() { + static boost::signals2::signal SignalOnCreate; + return SignalOnCreate; +} + +boost::signals2::signal& GetSignalOnInitBeforeOnCreate() { + static boost::signals2::signal SignalOnInitBeforeOnCreate; + return SignalOnInitBeforeOnCreate; } -boost::signals2::signal& GetSignalOnDestroy() -{ - static boost::signals2::signal SignalOnDestroy; - return SignalOnDestroy; +boost::signals2::signal& GetSignalOnInitBeforeOnCreateV2() { + static boost::signals2::signal SignalOnInitBeforeOnCreateV2; + return SignalOnInitBeforeOnCreateV2; } -boost::signals2::signal& GetSignalOnSingalCrash() -{ - static boost::signals2::signal SignalOnSingalCrash; - return SignalOnSingalCrash; +boost::signals2::signal& GetSignalOnDestroy() { + static boost::signals2::signal SignalOnDestroy; + return SignalOnDestroy; } -boost::signals2::signal& GetSignalOnExceptionCrash() -{ - static boost::signals2::signal SignalOnExceptionCrash; - return SignalOnExceptionCrash; +boost::signals2::signal& GetSignalOnSingalCrash() { + static boost::signals2::signal SignalOnSingalCrash; + return SignalOnSingalCrash; } -boost::signals2::signal& GetSignalOnForeground() -{ - static boost::signals2::signal SignalOnForeground; - return SignalOnForeground; +boost::signals2::signal& GetSignalOnExceptionCrash() { + static boost::signals2::signal SignalOnExceptionCrash; + return SignalOnExceptionCrash; } -boost::signals2::signal& GetSignalOnNetworkChange() -{ - static boost::signals2::signal SignalOnNetworkChange; - return SignalOnNetworkChange; +boost::signals2::signal& GetSignalOnForeground() { + static boost::signals2::signal SignalOnForeground; + return SignalOnForeground; } +boost::signals2::signal& GetSignalOnNetworkChange() { + static boost::signals2::signal SignalOnNetworkChange; + return SignalOnNetworkChange; +} -boost::signals2::signal& GetSignalOnNetworkDataChange() { - static boost::signals2::signal SignalOnNetworkDataChange; +boost::signals2::signal& GetSignalOnNetworkDataChange() { + static boost::signals2::signal SignalOnNetworkDataChange; return SignalOnNetworkDataChange; } + +boost::signals2::signal& GetSignalOnAlarm() { + static boost::signals2::signal SignalOnAlarm; + return SignalOnAlarm; +} diff --git a/mars/baseevent/win32proj/baseevent.vcxproj b/mars/baseevent/win32proj/baseevent.vcxproj deleted file mode 100644 index 3d463b0c0..000000000 --- a/mars/baseevent/win32proj/baseevent.vcxproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {198E58C9-A8AE-49B2-85CF-FCF9349502B1} - Win32Proj - baseevent - 8.1 - - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - false - v120_xp - true - Unicode - - - - - - - - - - - - - $(SolutionDir)/../;$(SolutionDir)/../../;$(SolutionDir)/../comm/;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath) - - - $(SolutionDir)/../;$(SolutionDir)/../../;$(SolutionDir)/../comm/;$(SolutionDir)/../comm/windows;$(SolutionDir)/../comm/windows/zlib;$(ProjectDir)/../src;$(IncludePath) - - - - - - TurnOffAllWarnings - Disabled - WIN32;_DEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions) - mars/comm/projdef.h - - - Windows - true - - - - - TurnOffAllWarnings - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;NOMINMAX;%(PreprocessorDefinitions) - mars/comm/projdef.h - OldStyle - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mars/baseevent/win32proj/baseevent.vcxproj.filters b/mars/baseevent/win32proj/baseevent.vcxproj.filters deleted file mode 100644 index 98ee16870..000000000 --- a/mars/baseevent/win32proj/baseevent.vcxproj.filters +++ /dev/null @@ -1,45 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/mars/baseevent/win32proj/baseevent.vcxproj.user b/mars/baseevent/win32proj/baseevent.vcxproj.user deleted file mode 100644 index ef5ff2a1f..000000000 --- a/mars/baseevent/win32proj/baseevent.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/mars/boost/CMakeLists.txt b/mars/boost/CMakeLists.txt new file mode 100644 index 000000000..50b88fe09 --- /dev/null +++ b/mars/boost/CMakeLists.txt @@ -0,0 +1,86 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") +add_compile_options(-w) # 屏蔽所有编译警告 + +project (mars-boost) + +include(../comm/utils.cmake) + +include_directories(.) +include_directories(..) + +add_definitions(-DBOOST_NO_EXCEPTIONS) + +set(SELF_SRC_FILES + libs/atomic/src/lockpool.cpp + libs/date_time/src/gregorian/date_generators.cpp + libs/date_time/src/gregorian/gregorian_types.cpp + libs/date_time/src/gregorian/greg_month.cpp + libs/date_time/src/gregorian/greg_weekday.cpp + libs/date_time/src/posix_time/posix_time_types.cpp + libs/exception/src/clone_current_exception_non_intrusive.cpp + libs/filesystem/src/codecvt_error_category.cpp + libs/filesystem/src/operations.cpp + libs/filesystem/src/path.cpp + libs/filesystem/src/path_traits.cpp + libs/filesystem/src/portability.cpp + libs/filesystem/src/unique_path.cpp + libs/filesystem/src/utf8_codecvt_facet.cpp + libs/filesystem/src/windows_file_codecvt.cpp + libs/iostreams/src/file_descriptor.cpp + libs/iostreams/src/mapped_file.cpp + libs/smart_ptr/src/sp_collector.cpp + libs/smart_ptr/src/sp_debug_hooks.cpp + libs/system/src/error_code.cpp + libs/thread/src/future.cpp) + + +if(MSVC) + include_directories(../comm/windows) + list(APPEND SELF_SRC_FILES + libs/thread/src/win32/thread.cpp + libs/thread/src/win32/tss_dll.cpp + libs/thread/src/win32/tss_pe.cpp) + +endif() + +if(ANDROID) + file(GLOB SELF_ANDROID_SRC_FILE + libs/coroutine/src/*.cpp + libs/coroutine/src/detail/*.cpp + libs/coroutine/src/posix/*.cpp + libs/context/src/*.cpp + libs/context/src/posix/*.cpp) + + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILE}) + enable_language(ASM) + + if(ANDROID_ABI MATCHES "^armeabi(-v7a)?$") + list(APPEND SELF_SRC_FILES + libs/context/src/asm/jump_arm_aapcs_elf_gas.S + libs/context/src/asm/make_arm_aapcs_elf_gas.S) + elseif(ANDROID_ABI STREQUAL arm64-v8a) + list(APPEND SELF_SRC_FILES + libs/context/src/asm/jump_arm64_aapcs_elf_gas.S + libs/context/src/asm/make_arm64_aapcs_elf_gas.S) + elseif(ANDROID_ABI STREQUAL x86) + list(APPEND SELF_SRC_FILES + libs/context/src/asm/jump_i386_sysv_elf_gas.S + libs/context/src/asm/make_i386_sysv_elf_gas.S) + elseif(ANDROID_ABI STREQUAL x86_64) + list(APPEND SELF_SRC_FILES + libs/context/src/asm/jump_x86_64_sysv_elf_gas.S + libs/context/src/asm/make_x86_64_sysv_elf_gas.S) + endif() + +endif() + + +add_library(${PROJECT_NAME} STATIC ${SELF_SRC_FILES}) + +install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_SYSTEM_NAME}.out) + + + diff --git a/mars/boost/boost.vcxproj b/mars/boost/boost.vcxproj deleted file mode 100644 index 2353c2ec9..000000000 --- a/mars/boost/boost.vcxproj +++ /dev/null @@ -1,2331 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {0F71334B-8B28-4106-A8A5-9E4F46B195EE} - boost - 8.1 - - - - Application - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - Application - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - $(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)../;$(ProjectDir)../comm/windows/ - - - - Level3 - Disabled - true - - - - - Level3 - Disabled - true - - - - - Level3 - MaxSpeed - true - true - true - - - true - true - - - - - Level3 - MaxSpeed - true - true - true - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mars/boost/boost.vcxproj.filters b/mars/boost/boost.vcxproj.filters index 40add43cb..fcd8b282f 100644 --- a/mars/boost/boost.vcxproj.filters +++ b/mars/boost/boost.vcxproj.filters @@ -6635,9 +6635,6 @@ 源文件 - - 源文件 - 源文件 @@ -6647,5 +6644,8 @@ 源文件 + + 源文件 + \ No newline at end of file diff --git a/mars/boost/boost.vcxproj.user b/mars/boost/boost.vcxproj.user deleted file mode 100644 index abe8dd896..000000000 --- a/mars/boost/boost.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/mars/boost/boost_stdexcept b/mars/boost/boost_stdexcept index 0ad2482eb..e72fc833f 100644 --- a/mars/boost/boost_stdexcept +++ b/mars/boost/boost_stdexcept @@ -5,7 +5,7 @@ #include #include - +/* namespace std { @@ -55,5 +55,5 @@ namespace std }; -} +} */ #endif diff --git a/mars/boost/config/user.hpp b/mars/boost/config/user.hpp index 8362b2ccb..d10c1d94f 100644 --- a/mars/boost/config/user.hpp +++ b/mars/boost/config/user.hpp @@ -143,3 +143,9 @@ #ifdef ANDROID //only for android stlport #include "boost/boost_stdexcept" #endif + +#ifdef WIN32 + #ifdef BOOST_HAS_GETTIMEOFDAY + # undef BOOST_HAS_GETTIMEOFDAY + #endif +#endif diff --git a/mars/boost/coroutine/standard_stack_allocator.hpp b/mars/boost/coroutine/standard_stack_allocator.hpp index 43cc21738..bdebc845b 100644 --- a/mars/boost/coroutine/standard_stack_allocator.hpp +++ b/mars/boost/coroutine/standard_stack_allocator.hpp @@ -17,7 +17,7 @@ #include #include - +#include #include #include #include @@ -40,7 +40,7 @@ struct basic_standard_stack_allocator BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= size) ); void * limit = std::malloc( size); - if ( ! limit) mars_boost::throw_exception(std::bad_alloc());//throw std::bad_alloc(); + if (!limit) mars_boost::throw_exception(std::bad_alloc());//throw std::bad_alloc(); ctx.size = size; ctx.sp = static_cast< char * >( limit) + ctx.size; @@ -60,7 +60,7 @@ struct basic_standard_stack_allocator #endif void * limit = static_cast< char * >( ctx.sp) - ctx.size; - std::free( limit); + std::free(limit); } }; diff --git a/mars/boost/exception/detail/clone_current_exception.hpp b/mars/boost/exception/detail/clone_current_exception.hpp index e40576f8a..ef60e4ce9 100644 --- a/mars/boost/exception/detail/clone_current_exception.hpp +++ b/mars/boost/exception/detail/clone_current_exception.hpp @@ -13,7 +13,7 @@ #endif #ifdef BOOST_NO_EXCEPTIONS -# error This header requires exception handling to be enabled. +//# error This header requires exception handling to be enabled. #endif namespace mars_boost {} namespace boost = mars_boost; namespace diff --git a/mars/boost/iostreams/detail/ios.hpp b/mars/boost/iostreams/detail/ios.hpp index 18ed6304b..8fa73ab83 100644 --- a/mars/boost/iostreams/detail/ios.hpp +++ b/mars/boost/iostreams/detail/ios.hpp @@ -47,8 +47,8 @@ namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { nam class failure : public std::exception { public: explicit failure(const std::string& what_arg) : what_(what_arg) { } - virtual ~failure()_GABIXX_NOEXCEPT {} - virtual const char* what() const _GABIXX_NOEXCEPT{ return what_.c_str(); }; + virtual ~failure() {} + virtual const char* what() const throw() { return what_.c_str(); }; private: std::string what_; }; diff --git a/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S b/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S index 35dcc7415..30f0a51d9 100644 --- a/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S +++ b/mars/boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S @@ -37,7 +37,7 @@ * * *******************************************************/ -#if defined(__arm64__) +#if defined(__aarch64__) .cpu generic+fp+simd .text .align 2 diff --git a/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S b/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S index b64ab94be..ddb236f6e 100644 --- a/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S +++ b/mars/boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S @@ -37,7 +37,7 @@ * * *******************************************************/ -#if defined(__arm64__) +#if defined(__aarch64__) .cpu generic+fp+simd .text .align 2 diff --git a/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp b/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp index 7c600c8df..8b58e5970 100644 --- a/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp +++ b/mars/boost/libs/exception/src/clone_current_exception_non_intrusive.cpp @@ -7,7 +7,7 @@ //Based on an exception_ptr implementation by Anthony Williams. #ifdef BOOST_NO_EXCEPTIONS -#error This file requires exception handling to be enabled. +//#error This file requires exception handling to be enabled. #endif #include diff --git a/mars/boost/libs/filesystem/src/operations.cpp b/mars/boost/libs/filesystem/src/operations.cpp index 11726f81f..6b0874a32 100644 --- a/mars/boost/libs/filesystem/src/operations.cpp +++ b/mars/boost/libs/filesystem/src/operations.cpp @@ -10,7 +10,9 @@ //--------------------------------------------------------------------------------------// -// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355) +// define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355) +// Google Android NDK is broken though as it doesn't provide truncate() declaration when _FILE_OFFSET_BITS=64 is defined (https://github.com/boostorg/filesystem/issues/65) +#if !defined(__ANDROID__) || (__ANDROID_API__+0) >= 21 || defined(__CRYSTAX__) #if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) #define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, #endif @@ -28,6 +30,7 @@ #else #define _FILE_OFFSET_BITS 64 #endif +#endif // !defined(__ANDROID__) || (__ANDROID_API__+0) >= 21 || defined(__CRYSTAX__) // define BOOST_FILESYSTEM_SOURCE so that knows // the library is being built (possibly exporting rather than importing code) @@ -44,7 +47,8 @@ #include #include #include -#include +#include +#include #include // for malloc, free #include #include // for remove, rename @@ -1593,6 +1597,12 @@ namespace detail BOOST_FILESYSTEM_DECL void resize_file(const path& p, uintmax_t size, system::error_code* ec) { +# if defined(BOOST_POSIX_API) + if (BOOST_UNLIKELY(size > static_cast< uintmax_t >((std::numeric_limits< off_t >::max)()))) { + error(system::errc::file_too_large, p, ec, "mars_boost::filesystem::resize_file"); + return; + } +# endif error(!BOOST_RESIZE_FILE(p.c_str(), size) ? BOOST_ERRNO : 0, p, ec, "mars_boost::filesystem::resize_file"); } @@ -2060,8 +2070,7 @@ namespace inline int readdir_r_simulator(DIR * dirp, struct dirent * entry, struct dirent ** result)// *result set to 0 on end of directory { - errno = 0; - + # if !defined(__CYGWIN__)\ && defined(_POSIX_THREAD_SAFE_FUNCTIONS)\ && defined(_SC_THREAD_SAFE_FUNCTIONS)\ @@ -2074,6 +2083,7 @@ namespace struct dirent * p; *result = 0; + errno = 0; if ((p = ::readdir(dirp))== 0) return errno; std::strcpy(entry->d_name, p->d_name); diff --git a/mars/boost/libs/iostreams/src/mapped_file.cpp b/mars/boost/libs/iostreams/src/mapped_file.cpp index 54a0de15c..5b456c546 100644 --- a/mars/boost/libs/iostreams/src/mapped_file.cpp +++ b/mars/boost/libs/iostreams/src/mapped_file.cpp @@ -416,8 +416,10 @@ void mapped_file_impl::try_map_file(param_type p) 0, 0, NULL ); - if (mapped_handle_ == NULL) - cleanup_and_throw("failed create mapping"); + if (mapped_handle_ == NULL) { // modified by Tencent garryyan 2018.05.17 + cleanup_and_throw("failed create mapping"); + return; + } // Access data DWORD access = priv ? diff --git a/mars/boost/libs/thread/src/win32/thread.cpp b/mars/boost/libs/thread/src/win32/thread.cpp index 4888237a5..f0850cdc9 100644 --- a/mars/boost/libs/thread/src/win32/thread.cpp +++ b/mars/boost/libs/thread/src/win32/thread.cpp @@ -63,7 +63,9 @@ namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost for (async_states_t::iterator i = async_states_.begin(), e = async_states_.end(); i != e; ++i) { +#ifndef BOOST_NO_EXCEPTIONS (*i)->make_ready(); +#endif } } } diff --git a/mars/boost/predef/other/endian.h b/mars/boost/predef/other/endian.h index 1faf32c9a..bcc284799 100644 --- a/mars/boost/predef/other/endian.h +++ b/mars/boost/predef/other/endian.h @@ -69,19 +69,36 @@ information and acquired knowledge: # endif # endif # endif -# if defined(__BYTE_ORDER) -# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) -# undef BOOST_ENDIAN_BIG_BYTE -# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE -# endif -# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) -# undef BOOST_ENDIAN_LITTLE_BYTE -# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE -# endif -# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN) -# undef BOOST_ENDIAN_LITTLE_WORD -# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE -# endif +# ifdef WIN32 +# if defined(__BYTE_ORDER) +# if defined(__BIG_ENDIAN) && __BYTE_ORDER == __BIG_ENDIAN +# undef BOOST_ENDIAN_BIG_BYTE +# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN +# undef BOOST_ENDIAN_LITTLE_BYTE +# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__PDP_ENDIAN) && __BYTE_ORDER == __PDP_ENDIAN +# undef BOOST_ENDIAN_LITTLE_WORD +# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE +# endif +# endif +# else +# if defined(__BYTE_ORDER) +# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN) +# undef BOOST_ENDIAN_BIG_BYTE +# define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN) +# undef BOOST_ENDIAN_LITTLE_BYTE +# define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE +# endif +# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN) +# undef BOOST_ENDIAN_LITTLE_WORD +# define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE +# endif +# endif # endif # if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER) # if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN) diff --git a/mars/boost/uuid/uuid_io.hpp b/mars/boost/uuid/uuid_io.hpp new file mode 100644 index 000000000..6c4be4706 --- /dev/null +++ b/mars/boost/uuid/uuid_io.hpp @@ -0,0 +1,198 @@ +// Boost uuid_io.hpp header file ----------------------------------------------// + +// Copyright 2009 Andy Tompkins. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Revision History +// 20 Mar 2009 - Initial Revision +// 28 Nov 2009 - disabled deprecated warnings for MSVC + +#ifndef BOOST_UUID_IO_HPP +#define BOOST_UUID_IO_HPP + +#include +#include +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) +#pragma warning(push) // Save warning settings. +#pragma warning(disable : 4996) // Disable deprecated std::ctype::widen, std::copy +#endif + +namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { + namespace uuids { + +template + std::basic_ostream& operator<<(std::basic_ostream &os, uuid const& u) +{ + io::ios_flags_saver flags_saver(os); + io::basic_ios_fill_saver fill_saver(os); + + const typename std::basic_ostream::sentry ok(os); + if (ok) { + const std::streamsize width = os.width(0); + const std::streamsize uuid_width = 36; + const std::ios_base::fmtflags flags = os.flags(); + const typename std::basic_ios::char_type fill = os.fill(); + if (flags & (std::ios_base::right | std::ios_base::internal)) { + for (std::streamsize i=uuid_width; i(*i_data); + if (i == 3 || i == 5 || i == 7 || i == 9) { + os << os.widen('-'); + } + } + + if (flags & std::ios_base::left) { + for (std::streamsize s=uuid_width; s + std::basic_istream& operator>>(std::basic_istream &is, uuid &u) +{ + const typename std::basic_istream::sentry ok(is); + if (ok) { + unsigned char data[16]; + + typedef std::ctype ctype_t; + ctype_t const& ctype = std::use_facet(is.getloc()); + + ch xdigits[16]; + { + char szdigits[] = "0123456789ABCDEF"; + ctype.widen(szdigits, szdigits+16, xdigits); + } + ch*const xdigits_end = xdigits+16; + + ch c; + for (std::size_t i=0; i> c; + c = ctype.toupper(c); + + ch* f = std::find(xdigits, xdigits_end, c); + if (f == xdigits_end) { + is.setstate(std::ios_base::failbit); + break; + } + + unsigned char byte = static_cast(std::distance(&xdigits[0], f)); + + is >> c; + c = ctype.toupper(c); + f = std::find(xdigits, xdigits_end, c); + if (f == xdigits_end) { + is.setstate(std::ios_base::failbit); + break; + } + + byte <<= 4; + byte |= static_cast(std::distance(&xdigits[0], f)); + + data[i] = byte; + + if (is) { + if (i == 3 || i == 5 || i == 7 || i == 9) { + is >> c; + if (c != is.widen('-')) is.setstate(std::ios_base::failbit); + } + } + } + + if (is) { + std::copy(data, data+16, u.begin()); + } + } + return is; +} + +namespace detail { +inline char to_char(size_t i) { + if (i <= 9) { + return static_cast('0' + i); + } else { + return static_cast('a' + (i-10)); + } +} + +inline wchar_t to_wchar(size_t i) { + if (i <= 9) { + return static_cast(L'0' + i); + } else { + return static_cast(L'a' + (i-10)); + } +} + +} // namespace detail + +inline std::string to_string(uuid const& u) +{ + std::string result; + result.reserve(36); + + std::size_t i=0; + for (uuid::const_iterator it_data = u.begin(); it_data!=u.end(); ++it_data, ++i) { + const size_t hi = ((*it_data) >> 4) & 0x0F; + result += detail::to_char(hi); + + const size_t lo = (*it_data) & 0x0F; + result += detail::to_char(lo); + + if (i == 3 || i == 5 || i == 7 || i == 9) { + result += '-'; + } + } + return result; +} + +#ifndef BOOST_NO_STD_WSTRING +inline std::wstring to_wstring(uuid const& u) +{ + std::wstring result; + result.reserve(36); + + std::size_t i=0; + for (uuid::const_iterator it_data = u.begin(); it_data!=u.end(); ++it_data, ++i) { + const size_t hi = ((*it_data) >> 4) & 0x0F; + result += detail::to_wchar(hi); + + const size_t lo = (*it_data) & 0x0F; + result += detail::to_wchar(lo); + + if (i == 3 || i == 5 || i == 7 || i == 9) { + result += L'-'; + } + } + return result; +} + +#endif + +}} //namespace boost::uuids + +#if defined(_MSC_VER) +#pragma warning(pop) // Restore warnings to previous state. +#endif + +#endif // BOOST_UUID_IO_HPP diff --git a/mars/boot/CMakeLists.txt b/mars/boot/CMakeLists.txt new file mode 100644 index 000000000..7c073d878 --- /dev/null +++ b/mars/boot/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +project(boot) + +include(../comm/utils.cmake) +include(../comm/CMakeExtraFlags.txt) + +include_directories(.) +include_directories(src) +include_directories(..) +include_directories(../..) +include_directories(../comm) +include_directories(../../..) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) +source_group(src FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + +if (MSVC) + add_definitions(/FI"../../comm/projdef.h") + include_directories(../comm/windows) +elseif (ANDROID) + if (NOT CPP_CALL_BACK) + file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) + endif () + if (NATIVE_CALLBACK) + add_definitions(-DNATIVE_CALLBACK) + endif () + + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) +endif () + +BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") diff --git a/mars/boot/base_manager.h b/mars/boot/base_manager.h new file mode 100644 index 000000000..1b663691f --- /dev/null +++ b/mars/boot/base_manager.h @@ -0,0 +1,25 @@ +// +// Created by Cpan on 2022/9/16. +// + +#ifndef MMNET_BASE_MANAGER_H +#define MMNET_BASE_MANAGER_H + +#include +#include +#include +#include + +namespace mars { +namespace boot { + +class BaseManager { + public: + virtual ~BaseManager() { + } + virtual std::string GetName() = 0; +}; +} // namespace boot +} // namespace mars + +#endif // MMNET_BASE_MANAGER_H diff --git a/mars/boot/context.cc b/mars/boot/context.cc new file mode 100644 index 000000000..1a20a7b22 --- /dev/null +++ b/mars/boot/context.cc @@ -0,0 +1,86 @@ +// +// Created by Cpan on 2022/10/19. +// + +#include "context.h" + +#include + +namespace mars { +namespace boot { + +std::map Context::s_context_map_; +std::recursive_mutex Context::s_mutex_; +std::atomic Context::s_context_index; + +Context* Context::CreateContext(const std::string& context_id) { + S_SCOPED_LOCK(); + if (!context_id.empty()) { + auto iter = s_context_map_.find(context_id); + if (iter != s_context_map_.end()) { + return iter->second; + } else { + auto context = new Context(); + context->SetContextId(context_id); + s_context_map_[context_id] = context; + return context; + } + } else { + s_context_index++; + auto context = new Context(); + std::stringstream ss; + ss << std::to_string(s_context_index) << ":" << std::to_string(reinterpret_cast(context)); + auto tmp_context_id = ss.str(); + context->SetContextId(tmp_context_id); + s_context_map_[tmp_context_id] = context; + return context; + } +} + +void Context::DestroyContext(Context* context) { + S_SCOPED_LOCK(); + if (context != nullptr) { + auto context_id = context->GetContextId(); + s_context_map_.erase(context_id); + delete context; + } +} + +Context::Context() { + Init(); +} + +Context::~Context() { + UnInit(); +} + +int Context::Init() { + S_SCOPED_LOCK(); + if (!is_init_) { + is_init_ = true; + } + return 0; +} + +int Context::UnInit() { + S_SCOPED_LOCK(); + if (!is_init_) { + return -1; + } + is_init_ = false; + return 0; +} + +void Context::SetContextId(const std::string& context_id) { + context_id_ = context_id; +} + +const std::string& Context::GetContextId() { + return context_id_; +} + +} // namespace boot +} // namespace mars + +void ExportContext() { +} diff --git a/mars/boot/context.h b/mars/boot/context.h new file mode 100644 index 000000000..41557959f --- /dev/null +++ b/mars/boot/context.h @@ -0,0 +1,109 @@ +// +// Created by Changpeng Pan on 2022/9/13. +// + +#ifndef MMNET_BASE_CONTEXT_H +#define MMNET_BASE_CONTEXT_H + +#include +#include +#include +#include +#include +#include + +#include "base_manager.h" + +#define S_SCOPED_LOCK() std::unique_lock s_lock(s_mutex_) + +namespace mars { +namespace boot { + +class Context { + public: + Context(); + ~Context(); + + public: + int Init(); + int UnInit(); + void SetContextId(const std::string& context_id); + const std::string& GetContextId(); + + public: + static Context* CreateContext(const std::string& context_id); + static void DestroyContext(Context* context); + + public: + template ::value>::type* = nullptr> + void AddManager(T* mgr) { + S_SCOPED_LOCK(); + std::string clazz_name = ((BaseManager*)mgr)->GetName(); + manager_map_[clazz_name] = mgr; + } + + template ::value>::type* = nullptr> + T* GetManager() { + S_SCOPED_LOCK(); + std::string clazz_name = typeid(T).name(); + // when context delete, then manager map will be null. + if (!manager_map_.empty() && manager_map_.find(clazz_name) != manager_map_.end()) { + return (T*)manager_map_[clazz_name]; + } + return NULL; + } + + template ::value>::type* = nullptr> + void RemoveManager(T* mgr) { + S_SCOPED_LOCK(); + std::string clazz_name = ((BaseManager*)mgr)->GetName(); + if (manager_map_.find(clazz_name) != manager_map_.end()) { + manager_map_.erase(clazz_name); + } + } + + void AddManagerWithName(std::string name, BaseManager* mgr) { + std::string clazz_name = mgr->GetName(); + java_clazz_name_c_clazz_name_map_[name] = clazz_name; + AddManager(mgr); + } + + void* GetManagerByName(std::string name) { + if (java_clazz_name_c_clazz_name_map_.find(name) != java_clazz_name_c_clazz_name_map_.end()) { + std::string clazz_name = java_clazz_name_c_clazz_name_map_[name]; + if (manager_map_.find(clazz_name) != manager_map_.end()) { + return manager_map_[clazz_name]; + } + } + return NULL; + } + + void RemoveManagerWithName(std::string name, BaseManager* mgr) { + if (java_clazz_name_c_clazz_name_map_.find(name) != java_clazz_name_c_clazz_name_map_.end()) { + java_clazz_name_c_clazz_name_map_.erase(name); + } + RemoveManager(mgr); + } + + private: + bool is_init_ = false; + std::string context_id_; + std::recursive_mutex mutex_; + std::map manager_map_; + std::map java_clazz_name_c_clazz_name_map_; + + private: + static std::map s_context_map_; + static std::recursive_mutex s_mutex_; + static std::atomic s_context_index; +}; + +template +std::shared_ptr make_context_ptr(Args&&... args) { + return std::shared_ptr(Context::CreateContext(std::forward(args)...), Context::DestroyContext); +} + +} // namespace boot +} // namespace mars + +#endif // MMNET_BASE_CONTEXT_H diff --git a/mars/boot/jni/context_wrapper.cc b/mars/boot/jni/context_wrapper.cc new file mode 100644 index 000000000..a67bc750a --- /dev/null +++ b/mars/boot/jni/context_wrapper.cc @@ -0,0 +1,86 @@ +// +// Created by Changpeng Pan on 2022/9/13. +// + +#include + +#include "comm/jni/jnicat/jnicat_core.h" +#include "comm/jni/jnicat/jnicat_object_wrapper.h" +#include "mars/boot/base_manager.h" +#include "mars/boot/context.h" +#include "mars/comm/xlogger/xlogger.h" + +using namespace mars::boot; + +namespace mars { +namespace app { + +class JniContext { + private: + public: + static void JniCreateContext(JNIEnv* env, jobject instance, jstring context_id) { + auto context_cpp = boot::Context::CreateContext(j2c_cast(context_id)); + auto contextWrapper = new jnicat::JniObjectWrapper(context_cpp); + contextWrapper->instantiate(env, instance); + } + + static void JniCreateContextFromHandle(JNIEnv* env, jobject instance, jlong handle) { + auto context_cpp = (Context*)j2c_cast(handle); + auto contextWrapper = new jnicat::JniObjectWrapper(context_cpp); + contextWrapper->instantiate(env, instance); + } + + static void JniOnDestroyContext(JNIEnv* env, jobject instance) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + context_cpp->DestroyContext(context_cpp); + jnicat::JniObjectWrapper::dispose(env, instance); + } + + static jint JniInit(JNIEnv* env, jobject instance) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + return c2j_cast(jint, context_cpp->Init()); + } + + static jint JniUnInit(JNIEnv* env, jobject instance) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + return c2j_cast(jint, context_cpp->UnInit()); + } + + static void JniAddManager(JNIEnv* env, jobject instance, jstring name, jobject manager) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + auto manager_cpp = jnicat::JniObjectWrapper::object(env, manager); + context_cpp->AddManagerWithName(j2c_cast(name), manager_cpp); + } + + static jlong JniGetManager(JNIEnv* env, jobject instance, jstring name) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + jlong handle = c2j_cast(jlong, (int64_t)context_cpp->GetManagerByName(j2c_cast(name))); + return handle; + } + + static void JniRemoveManager(JNIEnv* env, jobject instance, jstring name, jobject manager) { + auto context_cpp = jnicat::JniObjectWrapper::object(env, instance); + auto manager_cpp = jnicat::JniObjectWrapper::object(env, manager); + context_cpp->RemoveManagerWithName(j2c_cast(name), manager_cpp); + } +}; + +static const JNINativeMethod kContextJniMethods[] = { + {"OnJniCreateContext", "(Ljava/lang/String;)V", (void*)&JniContext::JniCreateContext}, + {"OnJniDestroyContext", "()V", (void*)&JniContext::JniOnDestroyContext}, + {"OnJniCreateContextFromHandle", "(J)V", (void*)&JniContext::JniCreateContextFromHandle}, + {"OnJniInit", "()I", (void*)&JniContext::JniInit}, + {"OnJniUnInit", "()I", (void*)&JniContext::JniUnInit}, + {"OnJniAddManager", "(Ljava/lang/String;Ljava/lang/Object;)V", (void*)&JniContext::JniAddManager}, + {"OnJniGetManager", "(Ljava/lang/String;)J", (void*)&JniContext::JniGetManager}, + {"OnJniRemoveManager", "(Ljava/lang/String;Ljava/lang/Object;)V", (void*)&JniContext::JniRemoveManager}, +}; + +static const size_t kContextJniMethodsCount = sizeof(kContextJniMethods) / sizeof(JNINativeMethod); +JNICAT_DEFINE_JNI_METHOD(kContextInterface, "com/tencent/mars/app/Context", kContextJniMethods, kContextJniMethodsCount) + +} // namespace app +} // namespace mars + +void ExportJniContext() { +} \ No newline at end of file diff --git a/mars/build.gradle b/mars/build.gradle index bf2b8be3a..aa9f2bdca 100644 --- a/mars/build.gradle +++ b/mars/build.gradle @@ -3,12 +3,12 @@ buildscript { repositories { mavenLocal() - jcenter() + google() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' - classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" + classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'digital.wup:android-maven-publish:3.6.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -18,7 +18,8 @@ buildscript { allprojects { repositories { mavenLocal() - jcenter() + google() + mavenCentral() } } diff --git a/mars/build_android.py b/mars/build_android.py new file mode 100755 index 000000000..1add09f6c --- /dev/null +++ b/mars/build_android.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python3 +import os +import sys +import glob +import time +import shutil +import platform + +from mars_utils import * + + +SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + +def system_is_windows(): + return platform.system() == 'Windows' + +def system_architecture_is64(): + return platform.machine().endswith('64') + + +if system_is_windows(): + ANDROID_GENERATOR = '-G "Unix Makefiles"' +else: + ANDROID_GENERATOR = '' + +try: + NDK_ROOT = os.environ['NDK_ROOT'] +except KeyError as identifier: + NDK_ROOT = '' + + +BUILD_OUT_PATH = 'cmake_build/Android' +ANDROID_LIBS_INSTALL_PATH = BUILD_OUT_PATH + '/' +ANDROID_BUILD_CMD = 'cmake "%s" %s -DANDROID_ABI="%s" ' \ + '-DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%s/build/cmake/android.toolchain.cmake ' \ + '-DANDROID_TOOLCHAIN=clang -DANDROID_NDK=%s ' \ + '-DANDROID_PLATFORM=android-21 ' \ + '-DANDROID_STL="c++_shared" ' \ + '&& cmake --build . %s --config Release -- -j8' +ANDROID_SYMBOL_PATH = 'libraries/mars_android_sdk/obj/local/' +ANDROID_LIBS_PATH = 'libraries/mars_android_sdk/libs/' +ANDROID_XLOG_SYMBOL_PATH = 'libraries/mars_xlog_sdk/obj/local/' +ANDROID_XLOG_LIBS_PATH = 'libraries/mars_xlog_sdk/libs/' + + +ANDROID_STRIP_FILE = { + 'armeabi': NDK_ROOT + '/toolchains/arm-linux-androideabi-4.9/prebuilt/%s/bin/arm-linux-androideabi-strip', + 'armeabi-v7a': NDK_ROOT + '/toolchains/arm-linux-androideabi-4.9/prebuilt/%s/bin/arm-linux-androideabi-strip', + 'x86': NDK_ROOT + '/toolchains/x86-4.9/prebuilt/%s/bin/i686-linux-android-strip', + 'arm64-v8a': NDK_ROOT + '/toolchains/aarch64-linux-android-4.9/prebuilt/%s/bin/aarch64-linux-android-strip', + 'x86_64': NDK_ROOT + '/toolchains/x86_64-4.9/prebuilt/%s/bin/x86_64-linux-android-strip', + } + + +ANDROID_STL_FILE = { + 'armeabi': NDK_ROOT + '/sources/cxx-stl/llvm-libc++/libs/armeabi/libc++_shared.so', + 'armeabi-v7a': NDK_ROOT + '/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so', + 'x86': NDK_ROOT + '/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so', + 'arm64-v8a': NDK_ROOT + '/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so', + 'x86_64': NDK_ROOT + '/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so', + } + + +def get_android_strip_cmd(arch): + + system_str = platform.system().lower() + if (system_architecture_is64()): + system_str = system_str + '-x86_64' + else: + pass + + strip_cmd = ANDROID_STRIP_FILE[arch] %(system_str) + print('Android strip cmd:%s' %(strip_cmd)) + return strip_cmd + + +def build_android(incremental, arch, target_option=''): + + before_time = time.time() + + clean(BUILD_OUT_PATH, incremental) + os.chdir(BUILD_OUT_PATH) + + build_cmd = ANDROID_BUILD_CMD %(SCRIPT_PATH, ANDROID_GENERATOR, arch, NDK_ROOT, NDK_ROOT, target_option) + print("build cmd:" + build_cmd) + ret = os.system(build_cmd) + os.chdir(SCRIPT_PATH) + + if 0 != ret: + print('!!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!') + return False + + if len(target_option) > 0: + symbol_path = ANDROID_XLOG_SYMBOL_PATH + lib_path = ANDROID_XLOG_LIBS_PATH + else: + symbol_path = ANDROID_SYMBOL_PATH + lib_path = ANDROID_LIBS_PATH + + if not os.path.exists(symbol_path): + os.makedirs(symbol_path) + + symbol_path = symbol_path + arch + if os.path.exists(symbol_path): + shutil.rmtree(symbol_path) + + os.mkdir(symbol_path) + + + if not os.path.exists(lib_path): + os.makedirs(lib_path) + + lib_path = lib_path + arch + if os.path.exists(lib_path): + shutil.rmtree(lib_path) + + os.mkdir(lib_path) + + + for f in glob.glob(ANDROID_LIBS_INSTALL_PATH + "*.so"): + shutil.copy(f, symbol_path) + shutil.copy(f, lib_path) + + # copy stl + shutil.copy(ANDROID_STL_FILE[arch], symbol_path) + shutil.copy(ANDROID_STL_FILE[arch], lib_path) + + + #strip + strip_cmd = get_android_strip_cmd(arch) + for f in glob.glob('%s/*.so' %(lib_path)): + os.system('%s %s' %(strip_cmd, f)) + + print('==================Output========================') + print('libs(release): %s' %(lib_path)) + print('symbols(must store permanently): %s' %(symbol_path)) + + + after_time = time.time() + + print("use time:%d s" % (int(after_time - before_time))) + return True + +def main(incremental, archs, target_option='', tag=''): + if not check_ndk_env(): + return + + gen_mars_revision_file(SCRIPT_PATH + '/comm', tag) + + # if os.path.exists(ANDROID_LIBS_PATH): + # shutil.rmtree(ANDROID_LIBS_PATH) + + # if os.path.exists(ANDROID_SYMBOL_PATH): + # shutil.rmtree(ANDROID_SYMBOL_PATH) + + for arch in archs: + if not build_android(incremental, arch, target_option): + return + +if __name__ == '__main__': + + while True: + if len(sys.argv) >= 3: + archs = sys.argv[2:] + main(False, archs, tag=sys.argv[1]) + break + else: + archs = {'armeabi-v7a', 'arm64-v8a'} + num = input('Enter menu:\n1. Clean && build mars.\n2. Build incrementally mars.\n3. Clean && build xlog.\n4. Exit\n') + if num == '1': + main(False, archs) + break + elif num == '2': + main(True, archs) + break + elif num == '3': + main(False, archs, '--target libzstd_static marsxlog') + break + elif num == '4': + break + else: + main(False, archs) + break + + diff --git a/mars/build_ios.py b/mars/build_ios.py new file mode 100755 index 000000000..12f6ddd68 --- /dev/null +++ b/mars/build_ios.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +import os +import sys +import glob + +from mars_utils import * + + +SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + +BUILD_OUT_PATH = 'cmake_build/iOS' +INSTALL_PATH = BUILD_OUT_PATH + '/iOS.out' + +IOS_BUILD_SIMULATOR_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1 && make -j8 && make install' +IOS_BUILD_OS_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1 && make -j8 && make install' + +GEN_IOS_OS_PROJ = 'cmake ../.. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS -DIOS_ARCH="arm64" -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DENABLE_VISIBILITY=1' +OPEN_SSL_ARCHS = ['x86_64', 'arm64'] + + +def build_ios(tag=''): + gen_mars_revision_file('comm', tag) + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(IOS_BUILD_OS_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build os fail!!!!!!!!!!!!!!!') + return False + + libtool_os_dst_lib = INSTALL_PATH + '/os' + libtool_src_lib = glob.glob(INSTALL_PATH + '/*.a') + libtool_src_lib.append(BUILD_OUT_PATH + '/zstd/libzstd.a') + + if not libtool_libs(libtool_src_lib, libtool_os_dst_lib): + return False + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + ret = os.system(IOS_BUILD_SIMULATOR_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build simulator fail!!!!!!!!!!!!!!!') + return False + + libtool_simulator_dst_lib = INSTALL_PATH + '/simulator' + if not libtool_libs(libtool_src_lib, libtool_simulator_dst_lib): + return False + + lipo_src_libs = [] + lipo_src_libs.append(libtool_os_dst_lib) + lipo_src_libs.append(libtool_simulator_dst_lib) + ssl_lib = INSTALL_PATH + '/ssl' + if not lipo_thin_libs('openssl/openssl_lib_iOS/libssl.a', ssl_lib, OPEN_SSL_ARCHS): + return False + + crypto_lib = INSTALL_PATH + '/crypto' + if not lipo_thin_libs('openssl/openssl_lib_iOS/libcrypto.a', crypto_lib, OPEN_SSL_ARCHS): + return False + + lipo_src_libs.append(ssl_lib) + lipo_src_libs.append(crypto_lib) + + lipo_dst_lib = INSTALL_PATH + '/mars' + + if not libtool_libs(lipo_src_libs, lipo_dst_lib): + return False + + dst_framework_path = INSTALL_PATH + '/mars.framework' + make_static_framework(lipo_dst_lib, dst_framework_path, COMM_COPY_HEADER_FILES, '../') + + print('==================Output========================') + print(dst_framework_path) + return True + +def build_ios_xlog(tag=''): + gen_mars_revision_file('comm', tag) + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(IOS_BUILD_OS_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build os fail!!!!!!!!!!!!!!!') + return False + + libtool_os_dst_lib = INSTALL_PATH + '/os' + libtool_src_libs = [INSTALL_PATH + '/libcomm.a', + INSTALL_PATH + '/libmars-boost.a', + INSTALL_PATH + '/libxlog.a', + BUILD_OUT_PATH + '/zstd/libzstd.a'] + if not libtool_libs(libtool_src_libs, libtool_os_dst_lib): + return False + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + ret = os.system(IOS_BUILD_SIMULATOR_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build simulator fail!!!!!!!!!!!!!!!') + return False + + libtool_simulator_dst_lib = INSTALL_PATH + '/simulator' + if not libtool_libs(libtool_src_libs, libtool_simulator_dst_lib): + return False + + lipo_src_libs = [] + lipo_src_libs.append(libtool_os_dst_lib) + lipo_src_libs.append(libtool_simulator_dst_lib) + lipo_dst_lib = INSTALL_PATH + '/mars' + + if not lipo_libs(lipo_src_libs, lipo_dst_lib): + return False + + dst_framework_path = INSTALL_PATH + '/mars.framework' + make_static_framework(lipo_dst_lib, dst_framework_path, XLOG_COPY_HEADER_FILES, '../') + + print('==================Output========================') + print(dst_framework_path) + + + +def gen_ios_project(): + gen_mars_revision_file('comm') + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(GEN_IOS_OS_PROJ) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!gen fail!!!!!!!!!!!!!!!') + return False + + + print('==================Output========================') + print('project file: %s/%s' %(SCRIPT_PATH, BUILD_OUT_PATH)) + + return True + +def main(): + while True: + if len(sys.argv) >= 2: + build_ios(sys.argv[1]) + break + else: + num = input('Enter menu:\n1. Clean && build mars.\n2. Clean && build xlog.\n3. Gen iOS mars Project.\n4. Exit\n') + if num == '1': + build_ios() + break + if num == '2': + build_ios_xlog() + break + elif num == '3': + gen_ios_project() + break + elif num == '4': + break + else: + build_ios() + break + +if __name__ == '__main__': + main() diff --git a/mars/build_osx.py b/mars/build_osx.py new file mode 100755 index 000000000..3be3d53ce --- /dev/null +++ b/mars/build_osx.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 +import os +import sys +import glob + +from mars_utils import * + + +SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + +BUILD_OUT_PATH = 'cmake_build/OSX' +INSTALL_PATH = BUILD_OUT_PATH + '/Darwin.out' + +OSX_BUILD_OS_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DENABLE_ARC=0 -DENABLE_BITCODE=0 && make -j8 && make install' + +OSX_BUILD_ARM_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DCMAKE_OSX_ARCHITECTURES="arm64" && make -j8 && make install' + +OSX_BUILD_X86_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DENABLE_ARC=0 -DENABLE_BITCODE=0 -DCMAKE_OSX_ARCHITECTURES="x86_64" && make -j8 && make install' + +GEN_OSX_PROJ = 'cmake ../.. -G Xcode -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DENABLE_BITCODE=0' + +def build_osx(tag=''): + gen_mars_revision_file('comm', tag) + + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(OSX_BUILD_OS_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build fail!!!!!!!!!!!!!!!') + return False + + ssl_lib = 'openssl/openssl_lib_osx/libssl.a' + crypto_lib = 'openssl/openssl_lib_osx/libcrypto.a' + libtool_os_dst_lib = INSTALL_PATH + '/mars' + libtool_src_libs = glob.glob(INSTALL_PATH + '/*.a') + libtool_src_libs.append(ssl_lib) + libtool_src_libs.append(crypto_lib) + libtool_src_libs.append(BUILD_OUT_PATH + '/zstd/libzstd.a') + if not libtool_libs(libtool_src_libs, libtool_os_dst_lib): + return False + + dst_framework_path = INSTALL_PATH + '/mars.framework' + make_static_framework(libtool_os_dst_lib, dst_framework_path, COMM_COPY_HEADER_FILES, '../') + + print('==================Output========================') + print(dst_framework_path) + return True + +def build_osx_xlog(tag=''): + gen_mars_revision_file('comm', tag) + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(OSX_BUILD_ARM_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build arm fail!!!!!!!!!!!!!!!') + return False + + libtool_arm_dst_lib = INSTALL_PATH + '/mars_arm' + libtool_src_libs = [INSTALL_PATH + '/libcomm.a', + INSTALL_PATH + '/libmars-boost.a', + INSTALL_PATH + '/libxlog.a', + BUILD_OUT_PATH + '/zstd/libzstd.a'] + if not libtool_libs(libtool_src_libs, libtool_arm_dst_lib): + return False + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + ret = os.system(OSX_BUILD_X86_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build x86 fail!!!!!!!!!!!!!!!') + return False + + libtool_x86_dst_lib = INSTALL_PATH + '/mars_x86' + if not libtool_libs(libtool_src_libs, libtool_x86_dst_lib): + return False + + lipo_src_libs = [] + lipo_src_libs.append(libtool_arm_dst_lib) + lipo_src_libs.append(libtool_x86_dst_lib) + lipo_dst_lib = INSTALL_PATH + '/mars' + + if not lipo_libs(lipo_src_libs, lipo_dst_lib): + return False + + dst_framework_path = INSTALL_PATH + '/mars.framework' + make_static_framework(lipo_dst_lib, dst_framework_path, XLOG_COPY_HEADER_FILES, '../') + + print('==================Output========================') + print(dst_framework_path) + +def gen_ios_project(): + gen_mars_revision_file('comm') + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(GEN_OSX_PROJ) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!gen fail!!!!!!!!!!!!!!!') + return False + + return True + +def main(): + while True: + if len(sys.argv) >= 2: + build_osx(sys.argv[1]) + break + else: + num = input('Enter menu:\n1. Clean && build.\n2. Gen OSX Project.\n3. Build xlog.\n4. Exit\n') + if num == '1': + build_osx() + break + elif num == '2': + gen_ios_project() + break + elif num == '3': + build_osx_xlog() + break + elif num == '4': + break + else: + build_osx() + break + +if __name__ == '__main__': + main() diff --git a/mars/build_watch.py b/mars/build_watch.py new file mode 100755 index 000000000..9ca9673d6 --- /dev/null +++ b/mars/build_watch.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +import os +import sys +import glob + +from mars_utils import * + + +SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + +BUILD_OUT_PATH = 'cmake_build/watchos' +INSTALL_PATH = os.path.join(BUILD_OUT_PATH, 'watchOS.out') + +WATCH_BUILD_SIMULATOR_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=SIMULATOR_WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DARCH="i386" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1 && make -j8 && make install' +WATCH_BUILD_OS_CMD = 'cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=WATCHOS -DIOS_DEPLOYMENT_TARGET=2.0 -DARCH="armv7k;arm64_32" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1 && make -j8 && make install' + +GEN_WATCH_OS_PROJ = 'cmake ../.. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DIOS_PLATFORM=OS -DIOS_DEPLOYMENT_TARGET=2.0 -DIOS_ARCH="armv7;arm64" -DCMAKE_XCODE_ATTRIBUTE_VALID_ARCHS="armv7k;arm64_32" -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DENABLE_VISIBILITY=1' + + +def build_watch(tag=''): + gen_mars_revision_file('comm', tag) + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(WATCH_BUILD_OS_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build os fail!!!!!!!!!!!!!!!') + return False + + libtool_os_dst_lib = INSTALL_PATH + '/os' + if not libtool_libs(glob.glob(INSTALL_PATH + '/*.a'), libtool_os_dst_lib): + return False + + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + ret = os.system(WATCH_BUILD_SIMULATOR_CMD) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!build simulator fail!!!!!!!!!!!!!!!') + return False + + libtool_simulator_dst_lib = INSTALL_PATH + '/simulator' + if not libtool_libs(glob.glob(INSTALL_PATH + '/*.a'), libtool_simulator_dst_lib): + return False + + lipo_src_libs = [] + lipo_src_libs.append(libtool_os_dst_lib) + lipo_src_libs.append(libtool_simulator_dst_lib) + lipo_dst_lib = INSTALL_PATH + '/mars' + + if not lipo_libs(lipo_src_libs, lipo_dst_lib): + return False + + dst_framework_path = INSTALL_PATH + '/mars.framework' + make_static_framework(lipo_dst_lib, dst_framework_path, COMM_COPY_HEADER_FILES, '../') + + print('==================Output========================') + print(dst_framework_path) + return True + +def gen_watch_project(): + gen_mars_revision_file('comm') + clean(BUILD_OUT_PATH) + os.chdir(BUILD_OUT_PATH) + + ret = os.system(GEN_WATCH_OS_PROJ) + os.chdir(SCRIPT_PATH) + if ret != 0: + print('!!!!!!!!!!!gen fail!!!!!!!!!!!!!!!') + return False + + print('==================Output========================') + print('project file: %s/%s' %(SCRIPT_PATH, BUILD_OUT_PATH)) + + return True + +def main(): + while True: + if len(sys.argv) >= 2: + build_watch(sys.argv[1]) + break + else: + num = input('Enter menu:\n1. Clean && build.\n2. Gen Watch Project.\n3. Exit\n') + if num == '1': + build_watch() + break + elif num == '2': + gen_watch_project() + break + elif num == '3': + break + else: + build_watch() + break + +if __name__ == '__main__': + main() diff --git a/mars/build_windows.py b/mars/build_windows.py new file mode 100644 index 000000000..45556eb8b --- /dev/null +++ b/mars/build_windows.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +import os +import glob +import time +import shutil +import argparse +from typing import List +from mars_utils import * + +SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] + + +BUILD_OUT_PATH = 'cmake_build/Windows' +WIN_LIBS_INSTALL_PATH = BUILD_OUT_PATH + "/Windows.out/" +WIN_RESULT_DIR = WIN_LIBS_INSTALL_PATH + 'win/' +WIN_BUILD_CMD = 'cmake ../.. -G "Visual Studio 16 2019" -T v142 && cmake --build . --target install --config %s' +WIN_GEN_PROJECT_CMD = 'cmake ../.. -G "Visual Studio 16 2019" -T v142' +SSL_ARCH = 'x86' + +def build_windows(incremental:bool, tag='', config:str='', lib_exe_path:str = ""): + before_time:float = time.time() + gen_mars_revision_file('comm', tag) + + clean_windows(BUILD_OUT_PATH, incremental) + os.chdir(BUILD_OUT_PATH) + + print("build cmd:" + WIN_BUILD_CMD %config) + ret:int = os.system(WIN_BUILD_CMD %config) + os.chdir(SCRIPT_PATH) + + if 0 != ret: + print('!!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!') + return False + + if os.path.exists(WIN_RESULT_DIR): + shutil.rmtree(WIN_RESULT_DIR) + os.makedirs(WIN_RESULT_DIR) + + src_libs:List[str] = glob.glob(WIN_LIBS_INSTALL_PATH + '*.lib') + src_libs.append('openssl/openssl_lib_windows/%s/libcrypto.lib' %SSL_ARCH) + src_libs.append('openssl/openssl_lib_windows/%s/libssl.lib' %SSL_ARCH) + + merge_win_static_libs(src_libs, WIN_RESULT_DIR + 'mars.lib', lib_exe_path) + + headers:dict[str, str] = dict() + headers.update(COMM_COPY_HEADER_FILES) + headers.update(WIN_COPY_EXT_FILES) + copy_file_mapping(headers, '../', WIN_RESULT_DIR) + sub_folders = ["app", "baseevent", "comm", "boost", "xlog", "sdt", "stn"] + copy_windows_pdb(BUILD_OUT_PATH, sub_folders, config, WIN_LIBS_INSTALL_PATH) + + print('==================Output========================') + print("libs: %s" %(WIN_RESULT_DIR)) + print("pdb files: %s" %(WIN_LIBS_INSTALL_PATH)) + + after_time:float = time.time() + print("use time:%d s" % (int(after_time - before_time))) + return True + +def build_windows_xlog(incremental:bool, tag:str='', config:str='Release', lib_exe_path:str = ""): + before_time:float = time.time() + gen_mars_revision_file('comm', tag) + + clean_windows(BUILD_OUT_PATH, incremental) + os.chdir(BUILD_OUT_PATH) + + print("build cmd:" + WIN_BUILD_CMD %config) + ret:int = os.system(WIN_BUILD_CMD %config) + os.chdir(SCRIPT_PATH) + + if 0 != ret: + print('!!!!!!!!!!!!!!!!!!build fail!!!!!!!!!!!!!!!!!!!!') + return False + + if os.path.exists(WIN_RESULT_DIR): + shutil.rmtree(WIN_RESULT_DIR) + os.makedirs(WIN_RESULT_DIR) + + needed_libs:List[str] = [ + os.path.normpath(WIN_LIBS_INSTALL_PATH + 'comm.lib'), + os.path.normpath(WIN_LIBS_INSTALL_PATH + 'mars-boost.lib'), + os.path.normpath(WIN_LIBS_INSTALL_PATH + 'xlog.lib') + ] + for lib in glob.glob(WIN_LIBS_INSTALL_PATH + '*.lib'): + if os.path.normpath(lib) in needed_libs: + pass + else: + os.remove(lib) + + merge_win_static_libs(needed_libs, WIN_RESULT_DIR + 'xlog.lib', lib_exe_path) + + headers:dict[str, str] = dict() + headers.update(XLOG_COPY_HEADER_FILES) + headers.update(WIN_COPY_EXT_FILES) + copy_file_mapping(headers, '../', WIN_RESULT_DIR) + + sub_folders:List[str] = ["comm", "boost", "xlog"] + copy_windows_pdb(BUILD_OUT_PATH, sub_folders, config, WIN_LIBS_INSTALL_PATH) + + print('==================Output========================') + print("libs: %s" %(WIN_RESULT_DIR)) + print("pdb files: %s" %(WIN_LIBS_INSTALL_PATH)) + + after_time:float = time.time() + print("use time:%d s" % (int(after_time - before_time))) + return True + +def gen_win_project(tag=''): + before_time:float = time.time() + + gen_mars_revision_file('comm', tag) + + clean_windows(BUILD_OUT_PATH, False) + os.chdir(BUILD_OUT_PATH) + ret:int = os.system(WIN_GEN_PROJECT_CMD) + os.chdir(SCRIPT_PATH) + + after_time:float = time.time() + + print("use time:%d s" % (int(after_time - before_time))) + + if 0 != ret: + print('!!!!!!!!!!!!!!!!!!gen project file fail!!!!!!!!!!!!!!!!!!!!') + return False + return True + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--config", type=str, help='''"Release" or "Debug"''') + parser.add_argument("--incremental", type=bool) + group = parser.add_mutually_exclusive_group() + group.add_argument("--xlog", action="store_true") + group.add_argument("--mars", action="store_true") + group.add_argument("--gen_project", action="store_true") + args = parser.parse_args() + + print(args) + assert args.config in ["Release", "Debug", None] and args.incremental in [True, False, None] + incremental:bool = False + config:str = "Release" + if args.config != None: + config = args.config + if args.incremental != None: + incremental = args.incremental + + if "MSVC_BIN_HOST64_PATH" not in os.environ: + DEFAULT_MSVC_BIN_HOST64_PATH = "C:/Program Files (x86)\Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/" + print("please set MSVC_BIN_HOST64_PATH in environ, something like ", DEFAULT_MSVC_BIN_HOST64_PATH) + exit(-1) + LIB_EXE_PATH: str = os.path.join(os.environ["MSVC_BIN_HOST64_PATH"], "x86", "lib.exe") + if not "MSVC_TOOLS_PATH" in os.environ: + DEFAULT_MSVC_TOOLS_PATH = "C:/Program Files (x86)\Microsoft Visual Studio/2019/Professional/Common7/Tools" + print("please set MSVC_TOOLS_PATH in environ, something like ", DEFAULT_MSVC_TOOLS_PATH) + exit(-1) + check_vs_env("\"" + os.path.join(os.environ["MSVC_TOOLS_PATH"], "VsDevCmd.bat") + "\"") + + if args.gen_project: + gen_win_project() + elif args.xlog: + build_windows_xlog(incremental=incremental, config=config, lib_exe_path = LIB_EXE_PATH) + elif args.mars: + build_windows(incremental=incremental, config=config, lib_exe_path = LIB_EXE_PATH) + else: + assert False + + +if __name__ == '__main__': + main() diff --git a/mars/comm/.cproject b/mars/comm/.cproject deleted file mode 100644 index 27eacb04c..000000000 --- a/mars/comm/.cproject +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mars/comm/.project b/mars/comm/.project deleted file mode 100644 index a57e7dff3..000000000 --- a/mars/comm/.project +++ /dev/null @@ -1,85 +0,0 @@ - - comm_mars - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - ndk-build - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - NDK_DEBUG=0 V=1 -j2 LIBPREFIX=wechat - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - 1379331840214 - - 10 - - org.eclipse.ui.ide.multiFilter - 1.0-name-matches-false-false-wp8 - - - - \ No newline at end of file diff --git a/mars/comm/CMakeExtraFlags.txt b/mars/comm/CMakeExtraFlags.txt new file mode 100644 index 000000000..7f44b5d7d --- /dev/null +++ b/mars/comm/CMakeExtraFlags.txt @@ -0,0 +1,22 @@ +if(ANDROID) + + set(SELF_EXTRA_FLAGS "-Werror -Wall -Werror=sign-compare -Wtype-limits -Wuninitialized -Wempty-body") + + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(SELF_EXTRA_FLAGS "${SELF_EXTRA_FLAGS} -Wconsumed -Wno-error=tautological-unsigned-zero-compare -Wno-error=char-subscripts -Wno-error=gnu-designator -Wno-error=unused-variable -Wno-error=missing-braces -Wno-error=tautological-type-limit-compare") + else() + set(SELF_EXTRA_FLAGS "${SELF_EXTRA_FLAGS} -Wclobbered") + endif() + + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SELF_EXTRA_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SELF_EXTRA_FLAGS}") + + + +elseif(APPLE) + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall") + +elseif(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4003 /wd4819 /wd4996 /wd4244 /wd4101 /wd4200 /wd4800 /wd4005 /wd4334") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4003 /wd4819 /wd4996 /wd4244 /wd4101 /wd4200 /wd4800 /wd4005 /wd4334") +endif() diff --git a/mars/comm/CMakeLists.txt b/mars/comm/CMakeLists.txt new file mode 100644 index 000000000..596cfdbc8 --- /dev/null +++ b/mars/comm/CMakeLists.txt @@ -0,0 +1,146 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +project (comm) + +include(utils.cmake) +include(CMakeExtraFlags.txt) + +include_directories(.) +include_directories(..) +include_directories(../..) +include_directories(../openssl/include) +include_directories(alarm) +include_directories(assert) +include_directories(corepattern) +include_directories(crypt) +include_directories(debugger) +include_directories(dns) +include_directories(messagequeue) +include_directories(network) +include_directories(socket) +include_directories(thread) +include_directories(xlogger) +include_directories(owl) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.c *.h) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) +if (USE_EXTERNAL_TINYXML2) + list(REMOVE_ITEM SELF_SRC_FILES "tinyxml2.cc") +endif() + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} alarm/*.cc alarm/*.h) +source_group(assert FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} assert/*.c assert/*.h) +source_group(assert FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} crypt/*.cc crypt/*.c crypt/*.h) +source_group(crypt FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} network/*.cc network/*.c network/*.h) +source_group(network FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} socket/*.cc socket/*.h) +source_group(socket FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} xlogger/*.c xlogger/*.cc xlogger/*.h) +source_group(xlogger FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} corepattern/*.cc corepattern/*.h) +source_group(corepattern FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} dns/*.cc dns/*.h) +source_group(dns FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} messagequeue/*.cc messagequeue/*.h) +source_group(messagequeue FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} owl/mpl/*.cc owl/mpl/*.h) +source_group(owl FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +if(MSVC) + add_definitions(/FI"../projdef.h") + + include_directories(windows) + include_directories(windows/SocketSelect) + include_directories(windows/thread) + include_directories(windows/win32) + include_directories(windows/zlib) + + list(REMOVE_ITEM SELF_SRC_FILES + network/local_routetable.h + network/local_routetable.cc + socket/getsocktcpinfo.h + socket/getsocktcpinfo.cc) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/*.c windows/*.cc windows/*.cpp windows/*.h) + source_group(windows FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/zlib/*.c windows/zlib/*.h) + source_group(windows\\zlib FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/win32/*.cpp windows/win32/*.h) + source_group(windows\\win32 FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/*.cpp windows/*.c windows/*.h) + source_group(windows FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/sys/*.c windows/sys/*.h) + source_group(windows\\sys FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} windows/SocketSelect/*.cc windows/SocketSelect/*.h) + source_group(windows\\SocketSelect FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +else() + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} unix/socket/*.cc unix/socket/*.h) + source_group(unix\\socket FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) +endif() + +if(ANDROID) + add_definitions(-DUSING_XLOG_WEAK_FUNC) + file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} + android/*.cc + android/*.c + jni/*.cc + jni/*.c + jni/util/*.cc + jni/jnicat/*.cpp + unix/xlogger_threadinfo.cc + ) + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) +elseif(APPLE) + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} objc/*.mm objc/*.h) + source_group(objc FILES ${SELF_TEMP_SRC_FILES}) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES} debugger/debugger_utils.c) +elseif(OHOS) + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} ohos/*.cc unix/xlogger_threadinfo.cc) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) +elseif(UNIX) + file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} unix/*.cc) + list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) +endif() + + +BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") + + diff --git a/mars/comm/adler32.c b/mars/comm/adler32.c index 1b9f74c58..82d8a6325 100644 --- a/mars/comm/adler32.c +++ b/mars/comm/adler32.c @@ -7,57 +7,87 @@ #include -#define BASE 65521UL /* largest prime smaller than 65536 */ +#define BASE 65521UL /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ -#define DO1(buf, i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf, i) DO1(buf, i); DO1(buf, i+1); -#define DO4(buf, i) DO2(buf, i); DO2(buf, i+2); -#define DO8(buf, i) DO4(buf, i); DO4(buf, i+4); -#define DO16(buf) DO8(buf, 0); DO8(buf, 8); +#define DO1(buf, i) \ + { \ + adler += (buf)[i]; \ + sum2 += adler; \ + } +#define DO2(buf, i) \ + DO1(buf, i); \ + DO1(buf, i + 1); +#define DO4(buf, i) \ + DO2(buf, i); \ + DO2(buf, i + 2); +#define DO8(buf, i) \ + DO4(buf, i); \ + DO4(buf, i + 4); +#define DO16(buf) \ + DO8(buf, 0); \ + DO8(buf, 8); /* use NO_DIVIDE if your processor does not do division in hardware */ #ifdef NO_DIVIDE -# define MOD(a) \ - do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ +#define MOD(a) \ + do { \ + if (a >= (BASE << 16)) \ + a -= (BASE << 16); \ + if (a >= (BASE << 15)) \ + a -= (BASE << 15); \ + if (a >= (BASE << 14)) \ + a -= (BASE << 14); \ + if (a >= (BASE << 13)) \ + a -= (BASE << 13); \ + if (a >= (BASE << 12)) \ + a -= (BASE << 12); \ + if (a >= (BASE << 11)) \ + a -= (BASE << 11); \ + if (a >= (BASE << 10)) \ + a -= (BASE << 10); \ + if (a >= (BASE << 9)) \ + a -= (BASE << 9); \ + if (a >= (BASE << 8)) \ + a -= (BASE << 8); \ + if (a >= (BASE << 7)) \ + a -= (BASE << 7); \ + if (a >= (BASE << 6)) \ + a -= (BASE << 6); \ + if (a >= (BASE << 5)) \ + a -= (BASE << 5); \ + if (a >= (BASE << 4)) \ + a -= (BASE << 4); \ + if (a >= (BASE << 3)) \ + a -= (BASE << 3); \ + if (a >= (BASE << 2)) \ + a -= (BASE << 2); \ + if (a >= (BASE << 1)) \ + a -= (BASE << 1); \ + if (a >= BASE) \ + a -= BASE; \ } while (0) -# define MOD4(a) \ - do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ +#define MOD4(a) \ + do { \ + if (a >= (BASE << 4)) \ + a -= (BASE << 4); \ + if (a >= (BASE << 3)) \ + a -= (BASE << 3); \ + if (a >= (BASE << 2)) \ + a -= (BASE << 2); \ + if (a >= (BASE << 1)) \ + a -= (BASE << 1); \ + if (a >= BASE) \ + a -= BASE; \ } while (0) #else -# define MOD(a) a %= BASE -# define MOD4(a) a %= BASE +#define MOD(a) a %= BASE +#define MOD4(a) a %= BASE #endif /* ========================================================================= */ -unsigned long adler32( - unsigned long adler, - const unsigned char* buf, - unsigned int len) -{ +unsigned long adler32(unsigned long adler, const unsigned char* buf, unsigned int len) { unsigned long sum2; unsigned n; @@ -88,16 +118,16 @@ unsigned long adler32( } if (adler >= BASE) adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ + MOD4(sum2); /* only added so many BASE's */ return adler | (sum2 << 16); } /* do length NMAX blocks -- requires just one modulo operation */ while (len >= NMAX) { len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ + n = NMAX / 16; /* NMAX is divisible by 16 */ do { - DO16(buf); /* 16 sums unrolled */ + DO16(buf); /* 16 sums unrolled */ buf += 16; } while (--n); MOD(adler); @@ -105,7 +135,7 @@ unsigned long adler32( } /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ + if (len) { /* avoid modulos if none remaining */ while (len >= 16) { len -= 16; DO16(buf); @@ -124,11 +154,7 @@ unsigned long adler32( } /* ========================================================================= */ -unsigned long adler32_combine( - unsigned long adler1, - unsigned long adler2, - unsigned long len2) -{ +unsigned long adler32_combine(unsigned long adler1, unsigned long adler2, unsigned long len2) { unsigned long sum1; unsigned long sum2; unsigned rem; @@ -140,9 +166,13 @@ unsigned long adler32_combine( MOD(sum2); sum1 += (adler2 & 0xffff) + BASE - 1; sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; - if (sum1 > BASE) sum1 -= BASE; - if (sum1 > BASE) sum1 -= BASE; - if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); - if (sum2 > BASE) sum2 -= BASE; + if (sum1 > BASE) + sum1 -= BASE; + if (sum1 > BASE) + sum1 -= BASE; + if (sum2 > (BASE << 1)) + sum2 -= (BASE << 1); + if (sum2 > BASE) + sum2 -= BASE; return sum1 | (sum2 << 16); } diff --git a/mars/comm/adler32.h b/mars/comm/adler32.h index b85172223..3098f2473 100644 --- a/mars/comm/adler32.h +++ b/mars/comm/adler32.h @@ -8,8 +8,7 @@ #include #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif unsigned long adler32(unsigned long adler, const unsigned char* buf, unsigned int len); diff --git a/mars/comm/alarm.cc b/mars/comm/alarm.cc index e874d41cd..7b237e6ff 100644 --- a/mars/comm/alarm.cc +++ b/mars/comm/alarm.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * alarm.cpp * @@ -20,41 +19,59 @@ #include "comm/alarm.h" +#include "alarm/alarm_manager.h" #include "comm/assert/__assert.h" +#include "comm/platform_comm.h" #include "comm/thread/lock.h" #include "comm/time_utils.h" -#include "comm/xlogger/xlogger.h" -#include "comm/platform_comm.h" +using namespace mars::alarm; + +namespace mars { +namespace comm { static Mutex sg_lock; static int64_t sg_seq = 1; -static const MessageQueue::MessageTitle_t KALARM_MESSAGETITLE(0x1F1FF); +const MessageQueue::MessageTitle_t KALARM_MESSAGETITLE(0x1F1FF); +const MessageQueue::MessageTitle_t KALARM_SYSTEMTITLE(0x1F1F1E); #define MAX_LOCK_TIME (5000) #define INVAILD_SEQ (0) -bool Alarm::Start(int _after) { +bool Alarm::Start(int _after, bool _needWake) { ScopedLock lock(sg_lock); - if (INVAILD_SEQ != seq_) return false; + if (INVAILD_SEQ != seq_) + return false; - if (INVAILD_SEQ == sg_seq) sg_seq = 1; + if (INVAILD_SEQ == sg_seq) + sg_seq = 1; int64_t seq = sg_seq++; uint64_t starttime = gettickcount(); - MessageQueue::MessagePost_t mqId = MessageQueue::BroadcastMessage(MessageQueue::GetDefMessageQueue(), MessageQueue::Message(KALARM_MESSAGETITLE, (int64_t)seq, 1), MessageQueue::MessageTiming(_after)); + broadcast_msg_id_ = MessageQueue::BroadcastMessage( + MessageQueue::GetDefMessageQueue(), + MessageQueue::Message(KALARM_MESSAGETITLE, (int64_t)seq, MessageQueue::GetDefMessageQueue(), "Alarm.broadcast"), + MessageQueue::MessageTiming(_after)); - if (MessageQueue::KNullPost == mqId) { - xerror2(TSF"mq alarm return null post, id:%0, after:%1, seq:%2", (uintptr_t)this, _after, seq); + if (MessageQueue::KNullPost == broadcast_msg_id_) { + xerror2(TSF "mq alarm return null post, id:%0, after:%1, seq:%2", (uintptr_t)this, _after, seq); return false; } #ifdef ANDROID - if (!::startAlarm((int64_t) seq, _after)) { - xerror2(TSF"startAlarm error, id:%0, after:%1, seq:%2", (uintptr_t)this, _after, seq); - MessageQueue::CancelMessage(mqId); + bool ret = false; + if (context_ && context_->GetManager() + && context_->GetManager()->IsAlarmCallbackSet()) { + ret = context_->GetManager()->StartAlarm(type_, (int64_t)seq, _after); + } else { + ret = startAlarm(type_, (int64_t)seq, _after); + } + if (_needWake && !ret) { + xerror2(TSF "startAlarm error, id:%0, after:%1, seq:%2", (uintptr_t)this, _after, seq); + MessageQueue::CancelMessage(broadcast_msg_id_); + broadcast_msg_id_ = MessageQueue::KNullPost; return false; } @@ -65,21 +82,40 @@ bool Alarm::Start(int _after) { endtime_ = 0; after_ = _after; seq_ = seq; - xinfo2(TSF"alarm id:%0, after:%1, seq:%2, po.reg.q:%3,po.reg.s:%4,po.s:%5", (uintptr_t)this, _after, seq, mqId.reg.queue, mqId.reg.seq, mqId.seq); + xinfo2(TSF "alarm id:%_, after:%_, seq:%_, po.reg.q:%_,po.reg.s:%_,po.s:%_, MQ:%_", + (uintptr_t)this, + _after, + seq, + broadcast_msg_id_.reg.queue, + broadcast_msg_id_.reg.seq, + broadcast_msg_id_.seq, + MessageQueue::GetDefMessageQueue()); return true; } bool Alarm::Cancel() { ScopedLock lock(sg_lock); + if (broadcast_msg_id_ != MessageQueue::KNullPost) { + MessageQueue::CancelMessage(broadcast_msg_id_); + broadcast_msg_id_ = MessageQueue::KNullPost; + } MessageQueue::CancelMessage(reg_async_.Get()); - - if (INVAILD_SEQ == seq_) return true; + if (INVAILD_SEQ == seq_) + return true; #ifdef ANDROID - if (!::stopAlarm((int64_t)seq_)) { - xwarn2(TSF"stopAlarm error, id:%0, seq:%1", (uintptr_t)this, seq_); + bool ret = false; + if (context_ && context_->GetManager() + && context_->GetManager()->IsAlarmCallbackSet()) { + ret = context_->GetManager()->StopAlarm((int64_t)seq_); + } else { + ret = stopAlarm((int64_t)seq_); + } + + if (!ret) { + xwarn2(TSF "stopAlarm error, id:%0, seq:%1", (uintptr_t)this, seq_); status_ = kCancel; endtime_ = gettickcount(); seq_ = INVAILD_SEQ; @@ -88,7 +124,7 @@ bool Alarm::Cancel() { #endif - xinfo2(TSF"alarm cancel id:%0, seq:%1, after:%2", (uintptr_t)this, seq_, after_); + xinfo2(TSF "alarm cancel id:%0, seq:%1, after:%2", (uintptr_t)this, seq_, after_); status_ = kCancel; endtime_ = gettickcount(); seq_ = INVAILD_SEQ; @@ -111,48 +147,84 @@ int64_t Alarm::ElapseTime() const { if (endtime_ < starttime_) return gettickspan(starttime_); - return endtime_ - starttime_; + return endtime_ - starttime_; } void Alarm::OnAlarm(const MessageQueue::MessagePost_t& _id, MessageQueue::Message& _message) { - if (KALARM_MESSAGETITLE != _message.title) return; + if (KALARM_MESSAGETITLE != _message.title && KALARM_SYSTEMTITLE != _message.title) + return; ScopedLock lock(sg_lock); if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(reg_async_.Get())) { - MessageQueue::AsyncInvoke(boost::bind(&Alarm::OnAlarm, this, _id, _message), (MessageQueue::MessageTitle_t)this, reg_async_.Get()); + MessageQueue::AsyncInvoke(boost::bind(&Alarm::OnAlarm, this, _id, _message), + (MessageQueue::MessageTitle_t)this, + reg_async_.Get(), + "Alarm::OnAlarm"); return; } - if (seq_ != boost::any_cast(_message.body1)) return; + bool isSystemAlarm = (KALARM_SYSTEMTITLE == _message.title); + MessageQueue::MessageQueue_t fromMQ = boost::any_cast(_message.body2); + + if (seq_ != boost::any_cast(_message.body1) || fromMQ != MessageQueue::GetDefMessageQueue()) { + if (fromMQ != MessageQueue::GetDefMessageQueue()) { + xinfo2(TSF "not match:(%_, %_), (%_, %_)", + seq_, + boost::any_cast(_message.body1), + MessageQueue::GetDefMessageQueue(), + fromMQ); + } + return; + } - uint64_t curtime = gettickcount(); - int64_t elapseTime = curtime - starttime_; - int64_t missTime = after_ - elapseTime; + uint64_t curtime = gettickcount(); + int64_t elapseTime = curtime - starttime_; + int64_t missTime = after_ - elapseTime; xgroup2_define(group); - xinfo2(TSF"OnAlarm id:%_, seq:%_, elapsed:%_, after:%_, miss:%_, android alarm:%_, ", (uintptr_t)this, seq_, elapseTime, after_, -missTime, !bool(boost::any_cast(_message.body2))) >> group; + xinfo2(TSF "OnAlarm id:%_, seq:%_, elapsed:%_, after:%_, miss:%_, android alarm:%_, MQ:%_", + (uintptr_t)this, + seq_, + elapseTime, + after_, + -missTime, + isSystemAlarm, + MessageQueue::GetDefMessageQueue()) + >> group; #ifdef ANDROID if (missTime > 0) { if (missTime <= MAX_LOCK_TIME) { - if (NULL == wakelock_) wakelock_ = new WakeUpLock(); + if (NULL == wakelock_) + wakelock_ = new WakeUpLock(); - wakelock_->Lock(missTime + 500); // add 00ms - xinfo2(TSF"wakelock") >> group; + wakelock_->Lock(missTime + wakelock_on_alarm_); // add 00ms 这里有可能是对齐 + xinfo2(TSF "wakelock") >> group; return; } - ::stopAlarm(seq_); + // stopAlarm(seq_); + if (startAlarm(type_, (int64_t)seq_, missTime)) + return; - if (::startAlarm((int64_t) seq_, missTime)) return; + if (context_ && context_->GetManager() + && context_->GetManager()->IsAlarmCallbackSet()) { + context_->GetManager()->StopAlarm(seq_); + if (context_->GetManager()->StartAlarm(type_, (int64_t)seq_, missTime)) + return; + } else { + stopAlarm(seq_); + if (startAlarm(type_, (int64_t)seq_, missTime)) + return; + } - xerror2(TSF"startAlarm err, continue") >> group; + xerror2(TSF "startAlarm err, continue") >> group; } #endif - xinfo2(TSF"runing") >> group; + xinfo2(TSF "runing") >> group; status_ = kOnAlarm; seq_ = INVAILD_SEQ; endtime_ = curtime; @@ -160,7 +232,10 @@ void Alarm::OnAlarm(const MessageQueue::MessagePost_t& _id, MessageQueue::Messag if (inthread_) runthread_.start(); else - MessageQueue::AsyncInvoke(boost::bind(&Alarm::__Run, this), (MessageQueue::MessageTitle_t)this, reg_async_.Get()); + MessageQueue::AsyncInvoke(boost::bind(&Alarm::__Run, this), + (MessageQueue::MessageTitle_t)this, + reg_async_.Get(), + "Alarm::__Run"); } void Alarm::__Run() { @@ -172,5 +247,33 @@ const Thread& Alarm::RunThread() const { } #ifdef ANDROID -#include "jni/OnAlarm.inl" +void Alarm::__StartWakeLock() { + static WakeUpLock wakelock; + wakelock.Lock(wakelock_start_alarm_); + xinfo2(TSF "StartWakeLock"); +} +#endif + +#ifdef ANDROID +void Alarm::onAlarmImpl(int64_t _id) { + xinfo2(TSF "onAlarm id:%_, MQ:%_", _id, MessageQueue::GetDefMessageQueue()); + __StartWakeLock(); // wakelock need be acquired in onalarm thread, or will fail if try to acquire in other threads. + MessageQueue::BroadcastMessage( + MessageQueue::GetDefMessageQueue(), + MessageQueue::Message(KALARM_SYSTEMTITLE, _id, MessageQueue::GetDefMessageQueue(), "KALARM_SYSTEMTITLE.id")); +} + +void Alarm::SetStartAlarmWakeLock(int time) { + xinfo2(TSF "value:%_", time); + wakelock_start_alarm_ = time; +} + +void Alarm::SetOnAlarmWakeLock(int time) { + xinfo2(TSF "value:%_", time); + wakelock_on_alarm_ = time; +} + #endif + +} // namespace comm +} // namespace mars diff --git a/mars/comm/alarm.h b/mars/comm/alarm.h index 6d59ac949..8fe715ef6 100644 --- a/mars/comm/alarm.h +++ b/mars/comm/alarm.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * alarm.h * @@ -22,15 +21,29 @@ #define COMM_ALARM_H_ #include + +#include "boot/context.h" +#include "comm/xlogger/xlogger.h" #include "messagequeue/message_queue.h" -#include "messagequeue/message_queue_utils.h" #ifdef ANDROID #include "android/wakeuplock.h" + +const static char* const kKeyAlarmStartWakeupLook = "AlarmStart"; +const static unsigned int kAlarmStartWakeupLook = 1000; + +const static char* const kKeyAlarmOnWakeupLook = "AlarmOn"; +const static unsigned int kAlarmOnWakeupLook = 500; + +static int wakelock_on_alarm_ = kAlarmOnWakeupLook; +static int wakelock_start_alarm_ = kAlarmStartWakeupLook; #endif +namespace mars { +namespace comm { + class Alarm { - public: + public: enum { kInit, kStart, @@ -38,34 +51,50 @@ class Alarm { kOnAlarm, }; - public: - template - explicit Alarm(const T& _op, bool _inthread = true) - : target_(detail::transform(_op)) - , reg_async_(MessageQueue::InstallAsyncHandler(MessageQueue::GetDefMessageQueue())) - , runthread_(boost::bind(&Alarm::__Run, this), "alarm") - , inthread_(_inthread) - , seq_(0), status_(kInit) - , after_(0) , starttime_(0) , endtime_(0) - , reg_(MessageQueue::InstallMessageHandler(boost::bind(&Alarm::OnAlarm, this, _1, _2), true)) + public: + template + explicit Alarm(const T& _op, bool _inthread = true, mars::boot::Context* _context = nullptr) + : context_(_context) + , target_(detail::transform(_op)) + , reg_async_(MessageQueue::InstallAsyncHandler(MessageQueue::GetDefMessageQueue())) + , broadcast_msg_id_(MessageQueue::KNullPost) + , runthread_(boost::bind(&Alarm::__Run, this), "alarm") + , inthread_(_inthread) + , seq_(0) + , status_(kInit) + , after_(0) + , starttime_(0) + , endtime_(0) + , reg_(MessageQueue::InstallMessageHandler(boost::bind(&Alarm::OnAlarm, this, _1, _2), true)) #ifdef ANDROID - , wakelock_(NULL) + , wakelock_(NULL) + , type_(-1) #endif - {} - - template - explicit Alarm(const T& _op, const MessageQueue::MessageQueue_t& _id) - : target_(detail::transform(_op)) - , reg_async_(MessageQueue::InstallAsyncHandler(_id)) - , runthread_(boost::bind(&Alarm::__Run, this), "alarm") - , inthread_(false) - , seq_(0), status_(kInit) - , after_(0) , starttime_(0) , endtime_(0) - , reg_(MessageQueue::InstallMessageHandler(boost::bind(&Alarm::OnAlarm, this, _1, _2), true)) + { + xinfo2(TSF "handler:(%_,%_)", reg_async_.Get().queue, reg_async_.Get().seq); + } + + template + explicit Alarm(const T& _op, const MessageQueue::MessageQueue_t& _id, mars::boot::Context* _context = nullptr) + : context_(_context) + , target_(detail::transform(_op)) + , reg_async_(MessageQueue::InstallAsyncHandler(_id)) + , broadcast_msg_id_(MessageQueue::KNullPost) + , runthread_(boost::bind(&Alarm::__Run, this), "alarm") + , inthread_(false) + , seq_(0) + , status_(kInit) + , after_(0) + , starttime_(0) + , endtime_(0) + , reg_(MessageQueue::InstallMessageHandler(boost::bind(&Alarm::OnAlarm, this, _1, _2), true)) #ifdef ANDROID - , wakelock_(NULL) + , wakelock_(NULL) + , type_(-1) #endif - {} + { + xinfo2(TSF "handler:(%_,%_)", reg_async_.Get().queue, reg_async_.Get().seq); + } virtual ~Alarm() { Cancel(); @@ -78,7 +107,17 @@ class Alarm { #endif } - bool Start(int _after); // ms +#ifdef ANDROID + static void onAlarmImpl(int64_t _id); + void SetType(int _type) { + type_ = _type; + } + static void __StartWakeLock(); + static void SetStartAlarmWakeLock(int time); + static void SetOnAlarmWakeLock(int time); +#endif + + bool Start(int _after, bool _needWake = true); // ms bool Cancel(); bool IsWaiting() const; @@ -88,30 +127,35 @@ class Alarm { const Thread& RunThread() const; - private: + private: Alarm(const Alarm&); Alarm& operator=(const Alarm&); void OnAlarm(const MessageQueue::MessagePost_t& _id, MessageQueue::Message& _message); - virtual void __Run(); + virtual void __Run(); - private: - Runnable* target_; + private: + mars::boot::Context* context_; + Runnable* target_; MessageQueue::ScopeRegister reg_async_; - Thread runthread_; - bool inthread_; + MessageQueue::MessagePost_t broadcast_msg_id_; + Thread runthread_; + bool inthread_; - int64_t seq_; - int status_; + int64_t seq_; + int status_; - int after_; - uint64_t starttime_; - uint64_t endtime_; + int after_; + uint64_t starttime_; + uint64_t endtime_; MessageQueue::ScopeRegister reg_; #ifdef ANDROID - WakeUpLock* wakelock_; + WakeUpLock* wakelock_; + int type_; #endif }; +} // namespace comm +} // namespace mars #endif /* COMM_ALARM_H_ */ diff --git a/mars/comm/alarm/CMakeLists.txt b/mars/comm/alarm/CMakeLists.txt new file mode 100644 index 000000000..2876cf002 --- /dev/null +++ b/mars/comm/alarm/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 3.6) + +set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Installation directory" FORCE) +message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + +project (alarm) + +include(../comm/CMakeUtils.txt) +include(../comm/CMakeExtraFlags.txt) + +include_directories(.) +include_directories(src) +include_directories(..) +include_directories(../..) +include_directories(../comm) +include_directories(../../..) +include_directories(../boot) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} *.cc *.h) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + +file(GLOB SELF_TEMP_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} src/*.cc src/*.h) +source_group(src FILES ${SELF_TEMP_SRC_FILES}) +list(APPEND SELF_SRC_FILES ${SELF_TEMP_SRC_FILES}) + + +if(MSVC) + add_definitions(/FI"../../comm/projdef.h") + include_directories(../comm/windows) +elseif(ANDROID) + if(NOT CPP_CALL_BACK) + file(GLOB SELF_ANDROID_SRC_FILES RELATIVE ${PROJECT_SOURCE_DIR} jni/*.cc) + endif() + if(NATIVE_CALLBACK) + message("applogic native callback") + add_definitions(-DNATIVE_CALLBACK) + endif() + + list(APPEND SELF_SRC_FILES ${SELF_ANDROID_SRC_FILES}) +endif() + +BuildWithUnitTest("${PROJECT_NAME}" "${SELF_SRC_FILES}") diff --git a/mars/comm/alarm/alarm_manager.cc b/mars/comm/alarm/alarm_manager.cc new file mode 100644 index 000000000..78f6c841f --- /dev/null +++ b/mars/comm/alarm/alarm_manager.cc @@ -0,0 +1,55 @@ +// +// Created by Changpeng Pan on 2023/9/26. +// + +#include "alarm_manager.h" + +#include "mars/comm/xlogger/xlogger.h" + +using namespace mars::boot; + +namespace mars { +namespace alarm { + +AlarmManager::AlarmManager(Context* context) : context_(context) { + xverbose_function(TSF "mars2 context id %_", context_->GetContextId()); +} + +AlarmManager::~AlarmManager() { +} + +std::string AlarmManager::GetName() { + return typeid(AlarmManager).name(); +} + +void AlarmManager::SetCallback(Callback* _callback) { + alarm_callback_ = _callback; +} + +bool AlarmManager::IsAlarmCallbackSet() { + if (alarm_callback_) { + return true; + } + return false; +} + +bool AlarmManager::StartAlarm(int type, int64_t id, int after) { + if (alarm_callback_) { + return alarm_callback_->startAlarm(type, id, after); + } else { + xwarn2(TSF "alarm callback is null."); + } + return false; +} + +bool AlarmManager::StopAlarm(int64_t id) { + if (alarm_callback_) { + return alarm_callback_->stopAlarm(id); + } else { + xwarn2(TSF "alarm callback is null."); + } + return false; +} + +} // namespace alarm +} // namespace mars \ No newline at end of file diff --git a/mars/comm/alarm/alarm_manager.h b/mars/comm/alarm/alarm_manager.h new file mode 100644 index 000000000..87aa1d022 --- /dev/null +++ b/mars/comm/alarm/alarm_manager.h @@ -0,0 +1,42 @@ +// +// Created by Changpeng Pan on 2023/9/26. +// + +#ifndef MMNET_ALARM_MANAGER_H +#define MMNET_ALARM_MANAGER_H + +#include "comm/alarm.h" + +namespace mars { +namespace alarm { + +class Callback { + public: + virtual bool startAlarm(int type, int64_t id, int after) { + return false; + } + virtual bool stopAlarm(int64_t id) { + return false; + } +}; + +class AlarmManager : public mars::boot::BaseManager { + public: + explicit AlarmManager(mars::boot::Context* context); + ~AlarmManager() override; + std::string GetName() override; + + public: + void SetCallback(Callback* _callback); + bool IsAlarmCallbackSet(); + bool StartAlarm(int type, int64_t id, int after); + bool StopAlarm(int64_t id); + + private: + mars::boot::Context* context_; + Callback* alarm_callback_; +}; +} // namespace alarm +} // namespace mars + +#endif // MMNET_ALARM_MANAGER_H diff --git a/mars/comm/alarm/jni/alarm_manager_callback_wrapper.cc b/mars/comm/alarm/jni/alarm_manager_callback_wrapper.cc new file mode 100644 index 000000000..3848f5ff7 --- /dev/null +++ b/mars/comm/alarm/jni/alarm_manager_callback_wrapper.cc @@ -0,0 +1,58 @@ +// +// Created by Changpeng Pan on 2023/9/26. +// + +#include "alarm_manager_callback_wrapper.h" + +#include "mars/comm/jni/jnicat/jnicat_core.h" +#include "mars/comm/jni/util/comm_function.h" +#include "mars/comm/jni/util/scope_jenv.h" +#include "mars/comm/jni/util/scoped_jstring.h" +#include "mars/comm/jni/util/var_cache.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/thread/mutex.h" +#include "mars/comm/xlogger/xlogger.h" + +namespace mars { +namespace alarm { + +DEFINE_FIND_CLASS(KC2Java, "com/tencent/mars/comm/alarm/AlarmManager$CallBack") + +AlarmManagerJniCallback::AlarmManagerJniCallback(JNIEnv* env, jobject callback) { + callback_inst_ = env->NewGlobalRef(callback); + jclass objClass = env->GetObjectClass(callback); + if (objClass) { + callbacks_class_ = reinterpret_cast(env->NewGlobalRef(objClass)); + env->DeleteLocalRef(objClass); + } +} + +AlarmManagerJniCallback::~AlarmManagerJniCallback() { + jnienv_ptr env; + env->DeleteGlobalRef(callback_inst_); +} + +DEFINE_FIND_METHOD(KC2Java_startAlarm, KC2Java, "startAlarm", "(III)Z") +bool AlarmManagerJniCallback::startAlarm(int type, int64_t id, int after) { + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + jboolean ret = + JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_startAlarm, (jint)type, (jint)id, (jint)after).z; + xinfo2(TSF "id= %0, after= %1, type= %2, ret= %3", id, after, type, (bool)ret); + return (bool)ret; +} + +DEFINE_FIND_METHOD(KC2Java_stopAlarm, KC2Java, "stopAlarm", "(I)Z") +bool AlarmManagerJniCallback::stopAlarm(int64_t id) { + VarCache* cache_instance = VarCache::Singleton(); + ScopeJEnv scope_jenv(cache_instance->GetJvm()); + JNIEnv* env = scope_jenv.GetEnv(); + + jboolean ret = JNU_CallMethodByMethodInfo(env, callback_inst_, KC2Java_stopAlarm, (jint)id).z; + xinfo2(TSF "id= %0, ret= %1", id, (bool)ret); + return (bool)ret; +} +} // namespace alarm +} // namespace mars \ No newline at end of file diff --git a/mars/comm/alarm/jni/alarm_manager_callback_wrapper.h b/mars/comm/alarm/jni/alarm_manager_callback_wrapper.h new file mode 100644 index 000000000..40a61e64d --- /dev/null +++ b/mars/comm/alarm/jni/alarm_manager_callback_wrapper.h @@ -0,0 +1,30 @@ +// +// Created by Changpeng Pan on 2023/9/26. +// + +#ifndef MMNET_ALARM_MANAGER_CALLBACK_WRAPPER_H +#define MMNET_ALARM_MANAGER_CALLBACK_WRAPPER_H + +#include + +#include "mars/alarm/alarm_manager.h" + +namespace mars { +namespace alarm { +class AlarmManagerJniCallback : public Callback { + public: + AlarmManagerJniCallback(JNIEnv* env, jobject callback); + virtual ~AlarmManagerJniCallback(); + + private: + jobject callback_inst_; + jclass callbacks_class_; + + public: + virtual bool startAlarm(int type, int64_t id, int after) override; + virtual bool stopAlarm(int64_t id) override; +}; +} // namespace alarm +} // namespace mars + +#endif // MMNET_ALARM_MANAGER_CALLBACK_WRAPPER_H diff --git a/mars/comm/android/android_alarm.h b/mars/comm/android/android_alarm.h new file mode 100644 index 000000000..5d4d7f9eb --- /dev/null +++ b/mars/comm/android/android_alarm.h @@ -0,0 +1,57 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ +#ifndef _UAPI_LINUX_ANDROID_ALARM_H +#define _UAPI_LINUX_ANDROID_ALARM_H +#include +#include +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +enum android_alarm_type { + ANDROID_ALARM_RTC_WAKEUP, + ANDROID_ALARM_RTC, + ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, + /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + ANDROID_ALARM_ELAPSED_REALTIME, + ANDROID_ALARM_SYSTEMTIME, + ANDROID_ALARM_TYPE_COUNT, +}; +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +enum android_alarm_return_flags { + ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP, + ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC, + ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = + /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, + ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME, + ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME, + /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ + ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16 +}; +#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4)) +#define ANDROID_ALARM_WAIT _IO('a', 1) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) +#define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) +#define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) +#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) +#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) +#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/mars/comm/android/callstack.cc b/mars/comm/android/callstack.cc deleted file mode 100644 index 5074738d2..000000000 --- a/mars/comm/android/callstack.cc +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************** - modify: 2012/9/17 - author: Ray -*********************************************************************/ - -#include -#include -#include -#include -#include -#include "callstack.h" - -// #define HAVE_DLADDR 1 - -#if HAVE_DLADDR -#include -#endif - -#define HAVE_CXXABI 0 - -#if HAVE_CXXABI -#include -#endif - - -// #include -// #include -// #include - -#include - -typedef struct { - size_t count; - size_t ignore; - const void** addrs; -} stack_crawl_state_t; - -static _Unwind_Reason_Code trace_function(_Unwind_Context* context, void* arg) { - stack_crawl_state_t* state = (stack_crawl_state_t*)arg; - - if (state->count) { - void* ip = NULL;// = (void*)_Unwind_GetIP(context); - -#if !defined(__arm__) - ip = (void*)_Unwind_GetGR(context, 15); -#else - _Unwind_VRS_Get(context, _UVRSC_CORE, 15, _UVRSD_UINT32, &ip); -#endif - - if (ip) { - if (state->ignore) { - state->ignore--; - } else { - state->addrs[0] = ip; - state->addrs++; - state->count--; - return _URC_NO_REASON; - } - } else { - return _URC_END_OF_STACK; - } - - - } - - if (state->count <= 0) { - return _URC_END_OF_STACK; - } - - return _URC_NO_REASON; - - -} - -#ifdef __GABIXX_UNWIND_H__ -extern "C" -{ - typedef _Unwind_Reason_Code(*_Unwind_Trace_Fn)(_Unwind_Context* context, void* arg); - extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void*); -} -#endif - -static int backtrace(const void** addrs, size_t ignore, size_t size) { - stack_crawl_state_t state; - state.count = size; - state.ignore = ignore; - state.addrs = addrs; - _Unwind_Backtrace(trace_function, (void*)&state); - return size - state.count; -} - - -void android_callstack(char* _out, unsigned int _len) { - android::CallStack cs; - cs.update(2); - std::string strstack = cs.Format(); - strncpy(_out, strstack.c_str(), _len); -} - -/*****************************************************************************/ -namespace android { - -/*****************************************************************************/ - -static -const char* lookup_symbol(const void* addr, void** offset, char* name, size_t bufSize) { -#if HAVE_DLADDR - Dl_info info; - - if (dladdr(addr, &info)) { - *offset = info.dli_saddr; - return info.dli_sname; - } - -#endif - return NULL; -} - -static -int32_t linux_gcc_demangler(const char* mangled_name, char* unmangled_name, size_t buffersize) { - size_t out_len = 0; -#if HAVE_CXXABI - int status = 0; - char* demangled = abi::__cxa_demangle(mangled_name, 0, &out_len, &status); - - if (status == 0) { - // OK - if (out_len < buffersize) - memcpy(unmangled_name, demangled, out_len); - else - out_len = 0; - - free(demangled); - } else { - out_len = 0; - } - -#endif - return out_len; -} - -/*****************************************************************************/ - -class MapInfo { - struct mapinfo { - struct mapinfo* next; - uint64_t start; - uint64_t end; - char name[]; - }; - - const char* map_to_name(uint64_t pc, const char* def, uint64_t* start) { - mapinfo* mi = getMapInfoList(); - - while (mi) { - if ((pc >= mi->start) && (pc < mi->end)) { - if (start) - *start = mi->start; - - return mi->name; - } - - mi = mi->next; - } - - if (start) - *start = 0; - - return def; - } - - mapinfo* parse_maps_line(char* line) { - mapinfo* mi; - int len = strlen(line); - - if (len < 1) return 0; - - line[--len] = 0; - - if (len < 50) return 0; - - if (line[20] != 'x') return 0; - - mi = (mapinfo*)malloc(sizeof(mapinfo) + (len - 47)); - - if (mi == 0) return 0; - - mi->start = strtoull(line, 0, 16); - mi->end = strtoull(line + 9, 0, 16); - mi->next = 0; - strcpy(mi->name, line + 49); // **CPPLINT SKIP** - return mi; - } - - mapinfo* getMapInfoList() { - // Mutex::Autolock _l(mLock); - if (milist == 0) { - char data[1024]; - FILE* fp; - snprintf(data, sizeof(data), "/proc/%d/maps", getpid()); - fp = fopen(data, "r"); - - if (fp) { - while (fgets(data, 1024, fp)) { - mapinfo* mi = parse_maps_line(data); - - if (mi) { - mi->next = milist; - milist = mi; - } - } - - fclose(fp); - } - } - - return milist; - } - mapinfo* milist; - // Mutex mLock; - static MapInfo sMapInfo; - - public: - MapInfo() - : milist(0) { - } - - ~MapInfo() { - while (milist) { - mapinfo* next = milist->next; - free(milist); - milist = next; - } - } - - static const char* mapAddressToName(const void* pc, const char* def, - void const** start) { - uint64_t s; - char const* name = sMapInfo.map_to_name(uint64_t(uintptr_t(pc)), def, &s); - - if (start) { - *start = (void*)s; - } - - return name; - } -}; - -/*****************************************************************************/ - -MapInfo MapInfo::sMapInfo; - -/*****************************************************************************/ - -CallStack::CallStack() - : count_(0) - , tid_(0) { - stack_[0] = 0; -} - -CallStack::CallStack(const CallStack& rhs) - : count_(rhs.count_) - , tid_(rhs.tid_) { - if (count_) { - memcpy(stack_, rhs.stack_, count_ * sizeof(void*)); - } -} - -CallStack::~CallStack() { -} - -CallStack& CallStack::operator = (const CallStack& rhs) { - count_ = rhs.count_; - tid_ = rhs.tid_; - - if (count_) { - memcpy(stack_, rhs.stack_, count_ * sizeof(void*)); - } - - return *this; -} - -bool CallStack::operator == (const CallStack& rhs) const { - if (count_ != rhs.count_) - return false; - - return !count_ || (memcmp(stack_, rhs.stack_, count_ * sizeof(void*)) == 0); -} - -bool CallStack::operator != (const CallStack& rhs) const { - return !operator == (rhs); -} - -bool CallStack::operator < (const CallStack& rhs) const { - if (count_ != rhs.count_) - return count_ < rhs.count_; - - return memcmp(stack_, rhs.stack_, count_ * sizeof(void*)) < 0; -} - -bool CallStack::operator >= (const CallStack& rhs) const { - return !operator < (rhs); -} - -bool CallStack::operator > (const CallStack& rhs) const { - if (count_ != rhs.count_) - return count_ > rhs.count_; - - return memcmp(stack_, rhs.stack_, count_ * sizeof(void*)) > 0; -} - -bool CallStack::operator <= (const CallStack& rhs) const { - return !operator > (rhs); -} - -const void* CallStack::operator [](int index) const { - if (index >= int(count_)) - return 0; - - return stack_[index]; -} - - -void CallStack::clear() { - count_ = 0; - tid_ = 0; -} - -void CallStack::update(int32_t ignoreDepth, int32_t maxDepth) { - tid_ = gettid(); - - if (maxDepth > kMaxDepth) - maxDepth = kMaxDepth; - - count_ = backtrace(stack_, ignoreDepth, maxDepth); -} - -// Return the stack frame name on the designated level -std::string CallStack::toStringSingleLevel(const char* prefix, int32_t level) const { - std::string res; - char namebuf[1024]; - char tmp[256]; - char tmp1[32]; - char tmp2[32]; - void* offs; - - const void* ip = stack_[level]; - - if (!ip) return res; - - if (prefix) res.append(prefix); - - snprintf(tmp1, 32, "#%02d ", level); - res.append(tmp1); - - const char* name = lookup_symbol(ip, &offs, namebuf, sizeof(namebuf)); - - if (name) { - if (linux_gcc_demangler(name, tmp, 256) != 0) - name = tmp; - - snprintf(tmp1, 32, "0x%p: <", ip); - snprintf(tmp2, 32, ">+0x%p", offs); - res.append(tmp1); - res.append(name); - res.append(tmp2); - } else { - void const* start = 0; - name = MapInfo::mapAddressToName(ip, "", &start); - snprintf(tmp, 256, "pc %08lx %s", - long(uintptr_t(ip) - uintptr_t(start)), name); - res.append(tmp); - } - - res.append("\n"); - - return res; -} - -// Dump a stack trace to the log -// void CallStack::dump(const char* prefix) const -//{ -// /* -// * Sending a single long log may be truncated since the stack levels can -// * get very deep. So we request function names of each frame individually. -// */ -// for (int i=0; i>> " << _str_process_name << " <<<\n"; - strstream << toString(); - return strstream.str(); -} - -/*****************************************************************************/ - -}; // namespace android diff --git a/mars/comm/android/callstack.h b/mars/comm/android/callstack.h deleted file mode 100644 index 620600128..000000000 --- a/mars/comm/android/callstack.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/******************************************************************** - modify: 2012/9/17 - author: Ray -*********************************************************************/ - -#ifndef ANDROID_CALLSTACK_H -#define ANDROID_CALLSTACK_H - -#include -#include - -#ifndef __cplusplus - -void android_callstack(char* _out, unsigned int _len); - -#else -#include - -extern "C" void android_callstack(char* _out, unsigned int _len); -// --------------------------------------------------------------------------- - -namespace android { - -class CallStack { - public: - enum { - kMaxDepth = 31 - }; - - CallStack(); - CallStack(const CallStack& rhs); - ~CallStack(); - - CallStack& operator = (const CallStack& rhs); - - bool operator == (const CallStack& rhs) const; - bool operator != (const CallStack& rhs) const; - bool operator < (const CallStack& rhs) const; - bool operator >= (const CallStack& rhs) const; - bool operator > (const CallStack& rhs) const; - bool operator <= (const CallStack& rhs) const; - - const void* operator [](int index) const; - - void clear(); - - void update(int32_t ignoreDepth = 1, int32_t maxDepth = kMaxDepth); - - // Dump a stack trace to the log - // void dump(const char* prefix = 0) const; - - // Return a string (possibly very long) containing the complete stack trace - std::string toString(const char* prefix = 0) const; - pid_t TID() const { return tid_; } - size_t size() const { return count_; } - - std::string Format(const char* _str_build_fingerprint = NULL, const char* _str_process_name = NULL) const; - - private: - // Internal helper function - std::string toStringSingleLevel(const char* prefix, int32_t level) const; - - size_t count_; - pid_t tid_; - const void* stack_[kMaxDepth]; -}; - -}; // namespace android - -#endif -// --------------------------------------------------------------------------- - -#endif // ANDROID_CALLSTACK_H diff --git a/mars/comm/android/dumpcrash_stack.cc b/mars/comm/android/dumpcrash_stack.cc index c2d7f117e..8987a08e5 100644 --- a/mars/comm/android/dumpcrash_stack.cc +++ b/mars/comm/android/dumpcrash_stack.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * DumpCrashStack.cpp * @@ -22,8 +21,7 @@ #include "assert/__assert.h" -static const char gs_crash_dump_header[] = - "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***"; +static const char gs_crash_dump_header[] = "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***"; enum NDK_CRASH_PARSER_STATE { EXPECTS_CRASH_DUMP, @@ -32,7 +30,7 @@ enum NDK_CRASH_PARSER_STATE { EXPECTS_CRASH_DUMP_END, }; -static int __ParseStack(FILE* file, NDK_CRASH_PARSER_STATE& _state, char _strcache[2048], std::string& strout) { +static int __ParseStack(FILE* file, NDK_CRASH_PARSER_STATE& _state, char _strcache[2048], std::string& strout) { ASSERT(file); if (EXPECTS_CRASH_DUMP_END == _state) @@ -72,11 +70,12 @@ void DumpCrashStack::Dump(const std::string& _processname) { char processname[256]; NDK_CRASH_PARSER_STATE state = EXPECTS_CRASH_DUMP; - char strcache[2048]; + char strcache[2048]; snprintf(processname, sizeof(processname), ">>> %s <<<", _processname.c_str()); - FILE* stream = popen("logcat -d -v time -s 'DEBUG:I'", "r"); // 将“ls -l”命令的输出 通过管道读取(“r”参数)到FILE* stream + FILE* stream = + popen("logcat -d -v time -s 'DEBUG:I'", "r"); // 将“ls -l”命令的输出 通过管道读取(“r”参数)到FILE* stream std::string strstack; diff --git a/mars/comm/android/dumpcrash_stack.h b/mars/comm/android/dumpcrash_stack.h index 6d38b235a..ea3086d49 100644 --- a/mars/comm/android/dumpcrash_stack.h +++ b/mars/comm/android/dumpcrash_stack.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * DumpCrashStack.h * @@ -21,18 +20,20 @@ #ifndef DUMPCRASHSTACK_H_ #define DUMPCRASHSTACK_H_ -#include #include +#include class DumpCrashStack { - public: - DumpCrashStack() {} - ~DumpCrashStack() {} + public: + DumpCrashStack() { + } + ~DumpCrashStack() { + } void Dump(const std::string& _processname); const std::vector& StackList() const; - private: + private: std::vector vecdump_; }; diff --git a/mars/comm/android/fatal_assert.h b/mars/comm/android/fatal_assert.h index a6df437ed..384427d3d 100644 --- a/mars/comm/android/fatal_assert.h +++ b/mars/comm/android/fatal_assert.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * fatal_assert.h * @@ -21,17 +20,18 @@ #ifndef FATAL_ASSERT_H_ #define FATAL_ASSERT_H_ -#include #include -#include +#include #include +#include -# if (!__ISO_C_VISIBLE >= 1999) +#if (!__ISO_C_VISIBLE >= 1999) #error "C Version < C99" -# endif +#endif -#define FATAL_ASSERT2(e, fmt, ...) ((e) ? (void)0 : __FATAL_ASSERT2(__FILE__, __LINE__, __func__, #e, fmt, ##__VA_ARGS__)) -#define FATAL_ASSERT(e) FATAL_ASSERT2(e, "") +#define FATAL_ASSERT2(e, fmt, ...) \ + ((e) ? (void)0 : __FATAL_ASSERT2(__FILE__, __LINE__, __func__, #e, fmt, ##__VA_ARGS__)) +#define FATAL_ASSERT(e) FATAL_ASSERT2(e, "") __BEGIN_DECLS @@ -44,15 +44,15 @@ __inline int __sigqueue(pid_t pid, int sig, const union sigval value) { info.si_uid = getuid(); info.si_value = value; - return syscall(__NR_rt_sigqueueinfo, pid, sig, &info); + return syscall(__NR_rt_sigqueueinfo, pid, sig, &info); } -__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 6))) -__inline void __FATAL_ASSERT2(const char* _file, int _line, const char* _func, const char* _expression, const char* _format, ...) { +__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 6))) __inline void +__FATAL_ASSERT2(const char* _file, int _line, const char* _func, const char* _expression, const char* _format, ...) { #pragma pack(push, 1) static struct { char magiccode[4]; - int len; + int len; char data[4096 - sizeof(len) - sizeof(magiccode)]; } extra_info = {{'a', '\x02', '\x02', 'd'}, sizeof(extra_info.data), {0}}; #pragma pack(pop) @@ -61,7 +61,8 @@ __inline void __FATAL_ASSERT2(const char* _file, int _line, const char* _func, va_start(valist, _format); memset(extra_info.data, 0, sizeof(extra_info.data)); - int offset = snprintf(extra_info.data, sizeof(extra_info.data), "%s, %s, %d:[%s],", _file, _func, _line, _expression); + int offset = + snprintf(extra_info.data, sizeof(extra_info.data), "%s, %s, %d:[%s],", _file, _func, _line, _expression); vsnprintf(extra_info.data + offset, sizeof(extra_info.data) - (size_t)offset, _format, valist); va_end(valist); diff --git a/mars/comm/android/getprocessname.c b/mars/comm/android/getprocessname.c index 2a38467bd..192dee6b9 100644 --- a/mars/comm/android/getprocessname.c +++ b/mars/comm/android/getprocessname.c @@ -5,19 +5,20 @@ * Author: 叶润桂 */ - #ifdef ANDROID #include #include + #include "assert/__assert.h" const char* getprocessname() { static char data[1024]; - static char *x = 0; - FILE *fp = 0; + static char* x = 0; + FILE* fp = 0; - if (x) return x; + if (x) + return x; sprintf(data, "/proc/%d/cmdline", getpid()); fp = fopen(data, "r"); @@ -26,7 +27,7 @@ const char* getprocessname() { fclose(fp); } - ASSERT(x); - return x ? x : "UNKNOWN"; + ASSERT(x); + return x ? x : "UNKNOWN"; } #endif diff --git a/mars/comm/android/getprocessname.h b/mars/comm/android/getprocessname.h index 5676bf954..08bca1107 100644 --- a/mars/comm/android/getprocessname.h +++ b/mars/comm/android/getprocessname.h @@ -1,15 +1,14 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. /* * getprocessname.h diff --git a/mars/comm/android/shm.h b/mars/comm/android/shm.h index 2f09c1f13..a2828353d 100644 --- a/mars/comm/android/shm.h +++ b/mars/comm/android/shm.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - #ifndef _SHM_H_ #define _SHM_H_ diff --git a/mars/comm/android/wakeuplock.cc b/mars/comm/android/wakeuplock.cc index e30289990..e89e7910b 100644 --- a/mars/comm/android/wakeuplock.cc +++ b/mars/comm/android/wakeuplock.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * WakeUpLock.cpp * @@ -21,13 +20,16 @@ #ifdef ANDROID #include "wakeuplock.h" + #include "assert/__assert.h" +#include "platform_comm.h" #include "xlogger/xlogger.h" -#include "platform_comm.h" +namespace mars { +namespace comm { WakeUpLock::WakeUpLock() { - object_ = ::wakeupLock_new(); + object_ = wakeupLock_new(); ASSERT(object_); xinfo2("new wakeuplock:%p", object_); } @@ -37,25 +39,27 @@ WakeUpLock::~WakeUpLock() { xinfo2("delete wakeuplock:%p", object_); if (IsLocking()) - ::wakeupLock_Unlock(object_); + wakeupLock_Unlock(object_); - ::wakeupLock_delete(object_); + wakeupLock_delete(object_); } void WakeUpLock::Lock(int64_t _timelock) { - ::wakeupLock_Lock_Timeout(object_, _timelock); + wakeupLock_Lock_Timeout(object_, _timelock); } void WakeUpLock::Lock() { - ::wakeupLock_Lock(object_); + wakeupLock_Lock(object_); } void WakeUpLock::Unlock() { - ::wakeupLock_Unlock(object_); + wakeupLock_Unlock(object_); } bool WakeUpLock::IsLocking() { - return ::wakeupLock_IsLocking(object_); + return wakeupLock_IsLocking(object_); } +} // namespace comm +} // namespace mars #endif diff --git a/mars/comm/android/wakeuplock.h b/mars/comm/android/wakeuplock.h index 7b256ad36..36b1157b0 100644 --- a/mars/comm/android/wakeuplock.h +++ b/mars/comm/android/wakeuplock.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * WakeUpLock.h * @@ -25,8 +24,11 @@ #include +namespace mars { +namespace comm { + class WakeUpLock { - public: + public: WakeUpLock(); ~WakeUpLock(); @@ -35,10 +37,13 @@ class WakeUpLock { void Unlock(); bool IsLocking(); - private: + private: void* object_; }; +} // namespace comm +} // namespace mars + #endif #endif /* WAKEUPLOCK_H_ */ diff --git a/mars/comm/anr.cc b/mars/comm/anr.cc index e8aa0db35..6dc8fbd25 100644 --- a/mars/comm/anr.cc +++ b/mars/comm/anr.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * anr.cpp * @@ -20,60 +19,38 @@ #include "anr.h" -#include #include +#include #ifndef _WIN32 #define __STDC_FORMAT_MACROS #include #endif -#include "comm/thread/thread.h" #include "comm/thread/lock.h" +#include "comm/thread/thread.h" #include "comm/time_utils.h" #include "comm/xlogger/xlogger.h" - +#include "mars/comm/macro.h" #ifdef ANDROID #include "android/fatal_assert.h" #endif -#if !defined(ANDROID) && !defined(__APPLE__) -#define ANR_CHECK_DISABLE -#endif - #ifndef ANR_CHECK_DISABLE -boost::signals2::signal& GetSignalCheckHit() { - static boost::signals2::signal SignalCheckHit; - return SignalCheckHit; +using namespace mars::comm; + +boost::signals2::signal& GetSignalCheckHit() { + static boost::signals2::signal SignalCheckHit; + return SignalCheckHit; } namespace { -struct check_content { - uintptr_t ptr; - const char* file; - const char* func; - int line; - int timeout; - intmax_t tid; - - uint64_t start_time; - uint64_t end_time; - - uint64_t start_tickcount; - uint64_t used_cpu_time; //ms - - bool operator<(const check_content& _ref) const { - return end_time > _ref.end_time; - } -}; - -static std::vector sg_check_heap; -static Mutex sg_mutex; -static Condition sg_cond; -static bool sg_exit = false; - +NO_DESTROY static std::vector sg_check_heap; +NO_DESTROY static Mutex sg_mutex; +NO_DESTROY static Condition sg_cond; +static bool sg_exit = false; static void __unregister_anr_impl(uintptr_t _ptr) { for (std::vector::iterator it = sg_check_heap.begin(); it != sg_check_heap.end(); ++it) { @@ -91,13 +68,31 @@ static void __unregister_anr(uintptr_t _ptr) { sg_cond.notifyAll(lock); } -static void __register_anr(uintptr_t _ptr, const char* _file, const char* _func, int _line, int _timeout) { +static void __register_anr(uintptr_t _ptr, + const char* _file, + const char* _func, + int _line, + int _timeout, + int _call_id, + void* extra_info) { ScopedLock lock(sg_mutex); __unregister_anr_impl(_ptr); - if (0 >= _timeout) return; - - check_content ch = {_ptr, _file, _func, _line, _timeout, xlogger_tid(), clock_app_monotonic(), 0, gettickcount(), 0/*init cpu_time*/}; + if (0 >= _timeout) + return; + + check_content ch = {_ptr, + _file, + _func, + _line, + _timeout, + xlogger_tid(), + clock_app_monotonic(), + 0, + gettickcount(), + 0 /*init cpu_time*/, + _call_id, + extra_info}; ch.end_time = ch.start_time + ch.timeout; sg_check_heap.push_back(ch); @@ -106,8 +101,7 @@ static void __register_anr(uintptr_t _ptr, const char* _file, const char* _func, sg_cond.notifyAll(lock); } - -static const int64_t kEachRoundSleepTime = 15*1000;//ms +static const int64_t kEachRoundSleepTime = 15 * 1000; // ms static const int64_t kTimeDeviation = 500; static bool iOS_style = false; @@ -115,74 +109,102 @@ static void __anr_checker_thread() { while (true) { ScopedLock lock(sg_mutex); - uint64_t round_tick_start = clock_app_monotonic(); - uint64_t use_cpu_time_1 = (uint64_t)(((double)clock()/CLOCKS_PER_SEC)*1000); //ms - - if (sg_exit) return; + uint64_t round_tick_start = clock_app_monotonic(); + clock_t use_cpu_clock_1 = clock(); + uint64_t use_cpu_time_1 = (uint64_t)(((double)use_cpu_clock_1 / CLOCKS_PER_SEC) * 1000); // ms + if (sg_exit) + return; int64_t wait_timeout = 0; bool is_wait_timeout = false; if (sg_check_heap.empty()) { - //wait_timeout = kEachRoundSleepTime; + // wait_timeout = kEachRoundSleepTime; sg_cond.wait(lock); - //is_wait_timeout = (ETIMEDOUT==ret); + // is_wait_timeout = (ETIMEDOUT==ret); } else { - wait_timeout = (sg_check_heap.front().end_time - clock_app_monotonic()); - if (wait_timeout<0) { - xwarn2("@%p", (void*)sg_check_heap.front().ptr)(TSF"wait_timeout:%_, end_time:%_, used_cpu_time:%_, now:%_, anr_checker_size:%_", wait_timeout, - sg_check_heap.front().end_time, sg_check_heap.front().used_cpu_time, clock_app_monotonic(), sg_check_heap.size()); + wait_timeout = iOS_style ? (sg_check_heap.front().timeout - sg_check_heap.front().used_cpu_time) + : (sg_check_heap.front().end_time - clock_app_monotonic()); + if (wait_timeout < 0) { + xwarn2("@%p", (void*)sg_check_heap.front().ptr)(TSF + "wait_timeout:%_, end_time:%_, used_cpu_time:%_, " + "timeout:%_ now:%_, iOS_style:%_, anr_checker_size:%_", + wait_timeout, + sg_check_heap.front().end_time, + sg_check_heap.front().used_cpu_time, + sg_check_heap.front().timeout, + iOS_style, + clock_app_monotonic(), + sg_check_heap.size()); wait_timeout = 0; } wait_timeout = std::min(wait_timeout, kEachRoundSleepTime); int ret = sg_cond.wait(lock, wait_timeout); - //is_wait_timeout = true; - is_wait_timeout = (wait_timeout>0 && ETIMEDOUT==ret); + // is_wait_timeout = true; + is_wait_timeout = (wait_timeout > 0 && ETIMEDOUT == ret); } - int64_t round_tick_elapse = clock_app_monotonic()-round_tick_start; - uint64_t use_cpu_time_2 = (uint64_t)(((double)clock()/CLOCKS_PER_SEC) * 1000); //ms - if (is_wait_timeout && round_tick_elapse > (wait_timeout+kTimeDeviation)) { - xwarn2("@%p", (void*)sg_check_heap.front().ptr)(TSF"now:%_, round_tick_start:%_, round_tick_elapse:%_, wait_timeout:%_, round cputime:%_, anr_checker_size:%_", clock_app_monotonic(), round_tick_start, round_tick_elapse, wait_timeout, use_cpu_time_2-use_cpu_time_1, sg_check_heap.size()); + int64_t round_tick_elapse = clock_app_monotonic() - round_tick_start; + clock_t use_cpu_clock_2 = clock(); + uint64_t use_cpu_time_2 = (uint64_t)(((double)use_cpu_clock_2 / CLOCKS_PER_SEC) * 1000); // ms + if (is_wait_timeout && round_tick_elapse > (wait_timeout + kTimeDeviation)) { + xwarn2("@%p", (void*)sg_check_heap.front().ptr)(TSF + "now:%_, round_tick_start:%_, round_tick_elapse:%_, " + "wait_timeout:%_, round cputime:%_, anr_checker_size:%_", + clock_app_monotonic(), + round_tick_start, + round_tick_elapse, + wait_timeout, + use_cpu_time_2 - use_cpu_time_1, + sg_check_heap.size()); iOS_style = true; } for (std::vector::iterator it = sg_check_heap.begin(); it != sg_check_heap.end(); ++it) { - it->used_cpu_time += (use_cpu_time_2-use_cpu_time_1); + if (use_cpu_time_2 >= use_cpu_time_1) { + it->used_cpu_time += (use_cpu_time_2 - use_cpu_time_1); + } else { + xerror2( + TSF + "use_cpu_time_2:%_, use_cpu_time_1:%_, use_cpu_clock_2:%_, use_cpu_clock_1:%_, CLOCKS_PER_SEC:%_", + use_cpu_time_2, + use_cpu_time_1, + use_cpu_clock_2, + use_cpu_clock_1, + CLOCKS_PER_SEC); + } } bool check_hit = false; if (iOS_style) { - if (!sg_check_heap.empty() && (uint64_t)sg_check_heap.front().timeout <= sg_check_heap.front().used_cpu_time) { + if (!sg_check_heap.empty() + && (uint64_t)sg_check_heap.front().timeout <= sg_check_heap.front().used_cpu_time) { check_hit = true; - GetSignalCheckHit()(true); + GetSignalCheckHit()(true, sg_check_heap.front()); xassert2(sg_check_heap.front().end_time <= clock_app_monotonic(), - "end_time:%" PRIu64", now:%" PRIu64", anr_checker_size:%d, @%p", sg_check_heap.front().end_time, clock_app_monotonic(), (int)sg_check_heap.size(), (void*)sg_check_heap.front().ptr); //old logic is strict than new logic + "end_time:%" PRIu64 ", now:%" PRIu64 ", anr_checker_size:%d, @%p", + sg_check_heap.front().end_time, + clock_app_monotonic(), + (int)sg_check_heap.size(), + (void*)sg_check_heap.front().ptr); // old logic is strict than new logic } } else { - if (!sg_check_heap.empty() && sg_check_heap.front().end_time <= clock_app_monotonic()) { + if (!sg_check_heap.empty() && sg_check_heap.front().end_time <= clock_app_monotonic()) { check_hit = true; - GetSignalCheckHit()(false); + GetSignalCheckHit()(false, sg_check_heap.front()); } } - if (!sg_check_heap.empty() && check_hit) { - check_content& front = sg_check_heap.front(); - __ASSERT2(front.file, front.line, front.func, "anr dead lock", "timeout:%d, tid:%" PRIu64 ", runing time:%" PRIu64 ", real time:%" PRIu64 ", used_cpu_time:%" PRIu64 ", iOS_style:%s, anr_checker_size:%d, @%p", - front.timeout, front.tid, clock_app_monotonic() - front.start_time, gettickcount() - front.start_tickcount, front.used_cpu_time, iOS_style?"true":"false", (int)sg_check_heap.size(), (void*)sg_check_heap.front().ptr); -#ifdef ANDROID - __FATAL_ASSERT2(front.file, front.line, front.func, "anr dead lock", "timeout:%d, tid:%" PRIu64 ", runing time:%" PRIu64 ", real time:%" PRIu64 ", used_cpu_time:%" PRIu64 ", iOS_style:%s, anr_checker_size:%d, @%p", - front.timeout, front.tid, clock_app_monotonic() - front.start_time, gettickcount() - front.start_tickcount, front.used_cpu_time, iOS_style?"true":"false", (int)sg_check_heap.size(), (void*)sg_check_heap.front().ptr); -#endif std::pop_heap(sg_check_heap.begin(), sg_check_heap.end()); sg_check_heap.pop_back(); } } } -static Thread sg_thread(&__anr_checker_thread); -static class startup { - public: +static Thread sg_thread(&__anr_checker_thread); +class startup { + public: startup() { + xinfo2(TSF "startup anr check thread."); sg_thread.start(); } @@ -194,14 +216,20 @@ static class startup { sg_thread.join(); } -} __startup; +}; //__startup; // ios move to app_logic.cc + +// iOS platform want start anr check thread after main thread, so startup by app_logic onCreate event +#if !TARGET_OS_IPHONE +static startup __startup; +#endif + } // namespace #endif -scope_anr::scope_anr(const char* _file, const char* _func, int _line) - : file_(_file), func_(_func), line_(_line) -{} +scope_anr::scope_anr(const char* _file, const char* _func, int _line, int _id, void* _extra_info) +: file_(_file), func_(_func), line_(_line), call_id_(_id), extra_info_(_extra_info) { +} scope_anr::~scope_anr() { #ifndef ANR_CHECK_DISABLE @@ -209,10 +237,14 @@ scope_anr::~scope_anr() { #endif } - void scope_anr::anr(int _timeout) { #ifndef ANR_CHECK_DISABLE - __register_anr(reinterpret_cast(this), file_, func_, line_, _timeout); + __register_anr(reinterpret_cast(this), file_, func_, line_, _timeout, call_id_, extra_info_); #endif } +void startup_anr() { +#ifndef ANR_CHECK_DISABLE + static startup __startup; +#endif +} diff --git a/mars/comm/anr.h b/mars/comm/anr.h index 087afa134..1346fde2d 100644 --- a/mars/comm/anr.h +++ b/mars/comm/anr.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * anr.h * @@ -21,29 +20,66 @@ #ifndef COMM_ANR_H_ #define COMM_ANR_H_ +#include + #include "mars/boost/signals2.hpp" +#if !defined(ANDROID) && !defined(__APPLE__) +#define ANR_CHECK_DISABLE +#endif + +namespace mars { +namespace comm { +struct check_content { + uintptr_t ptr; + std::string file; + std::string func; + int line; + int timeout; + intmax_t tid; + + uint64_t start_time; + uint64_t end_time; + + uint64_t start_tickcount; + uint64_t used_cpu_time; // ms + + int call_id; + ; + void* extra_info; + + bool operator<(const check_content& _ref) const { + return end_time > _ref.end_time; + } +}; +} // namespace comm +} // namespace mars + class scope_anr { - public: - scope_anr(const char* _file = "", const char* _func = "", int _line = 0); + public: + scope_anr(const char* _file = "", const char* _func = "", int _line = 0, int _id = 0, void* _extra_info = NULL); ~scope_anr(); void anr(int _timeout = 15 * 60 * 1000); - private: + private: scope_anr(const scope_anr&); scope_anr& operator=(const scope_anr&); - private: + private: const char* file_; const char* func_; int line_; + int call_id_; + void* extra_info_; }; +extern boost::signals2::signal& GetSignalCheckHit(); +extern void startup_anr(); -extern boost::signals2::signal& GetSignalCheckHit(); - -#define SCOPE_ANR_AUTO(...) scope_anr __anr__var__anonymous_variable__(__FILE__, __func__, __LINE__); __anr__var__anonymous_variable__.anr(__VA_ARGS__) +#define SCOPE_ANR_AUTO(timeout, id, extra_info) \ + scope_anr __anr__var__anonymous_variable__(__FILE__, __func__, __LINE__, id, extra_info); \ + __anr__var__anonymous_variable__.anr(timeout) #define SCOPE_ANR_OBJ(objname) scope_anr objname(__FILE__, __func__, __LINE__) #endif /* COMM_ANR_H_ */ diff --git a/mars/comm/assert/__assert.c b/mars/comm/assert/__assert.c index f48dbf4cb..460e80ed1 100644 --- a/mars/comm/assert/__assert.c +++ b/mars/comm/assert/__assert.c @@ -5,52 +5,41 @@ * Author: yerungui */ - #include #include #include #include -#include "comm/xlogger/xloggerbase.h" #include "comm/compiler_util.h" - -#ifdef ANDROID -#include "comm/android/callstack.h" -#endif +#include "comm/xlogger/xloggerbase.h" #ifndef XLOGGER_TAG #define XLOGGER_TAG "" #endif #if defined(__APPLE__) && (defined(NDEBUG)) -void __assert_rtn(const char *, const char *, int, const char *) __dead2; +void __assert_rtn(const char*, const char*, int, const char*) __dead2; #endif #ifdef WIN32 -#define __assert(__Expression, __FILE, __LINE) (void)((_assert(__Expression, __FILE, __LINE), 0) ) +#define __assert(__Expression, __FILE, __LINE) (void)((_assert(__Expression, __FILE, __LINE), 0)) #define snprintf _snprintf #endif -#ifdef DEBUG -static int sg_enable_assert = 1; +#ifndef NDEBUG +#define IS_ASSERT_ENABLE() 1 #else -static int sg_enable_assert = 0; +#define IS_ASSERT_ENABLE() 0 #endif -void ENABLE_ASSERT() { sg_enable_assert = 1;} -void DISABLE_ASSERT() { sg_enable_assert = 0; } -int IS_ASSERT_ENABLE() { return sg_enable_assert;} - -EXPORT_FUNC void __ASSERT(const char * _pfile, int _line, const char * _pfunc, const char * _pexpression) { - XLoggerInfo info= {0}; +void __ASSERT(const char* _pfile, int _line, const char* _pfunc, const char* _pexpression) { + XLoggerInfo info = XLOGGER_INFO_INITIALIZER; char assertlog[4096] = {'\0'}; - int offset = 0; - - offset += snprintf(assertlog, sizeof(assertlog), "[ASSERT(%s)]", _pexpression); + snprintf(assertlog, sizeof(assertlog), "[ASSERT(%s)]", _pexpression); -#ifdef ANDROID - android_callstack(assertlog+offset, sizeof(assertlog)-offset); -#endif + //#ifdef ANDROID + // android_callstack(assertlog+offset, sizeof(assertlog)-offset); + //#endif info.level = kLevelFatal; info.tag = XLOGGER_TAG; @@ -62,31 +51,55 @@ EXPORT_FUNC void __ASSERT(const char * _pfile, int _line, const char * _pfunc, c info.tid = xlogger_tid(); info.maintid = xlogger_maintid(); - xlogger_Write(&info, assertlog); - + xlogger_Write(&info, assertlog); + if (IS_ASSERT_ENABLE()) { -#if defined(ANDROID) //&& (defined(DEBUG)) +#if defined(ANDROID) //&& (defined(DEBUG)) raise(SIGTRAP); __assert2(_pfile, _line, _pfunc, _pexpression); #endif -#if defined(__APPLE__) //&& (defined(DEBUG)) - __assert_rtn(_pfunc, _pfile, _line, _pexpression); +#if defined(__APPLE__) //&& (defined(DEBUG)) + __assert_rtn(_pfunc, _pfile, _line, _pexpression); #endif } } -void __ASSERTV2(const char * _pfile, int _line, const char * _pfunc, const char * _pexpression, const char * _format, va_list _list) { +void __ASSERTV2(const char* _pfile, + int _line, + const char* _pfunc, + const char* _pexpression, + const char* _format, + va_list _list) { char assertlog[4096] = {'\0'}; - XLoggerInfo info= {kLevelFatal}; - int offset = 0; + XLoggerInfo info = XLOGGER_INFO_INITIALIZER; + info.level = kLevelFatal; - offset += snprintf(assertlog, sizeof(assertlog), "[ASSERT(%s)]", _pexpression); - offset += vsnprintf(assertlog+offset, sizeof(assertlog)-offset, _format, _list); - -#ifdef ANDROID - android_callstack(assertlog+offset, sizeof(assertlog)-offset); -#endif + do { + int offset = snprintf(assertlog, sizeof(assertlog), "[ASSERT(%s)]", _pexpression); + if (offset < 0) { + strncpy(assertlog, "[ASSERT] FAILED!!!", sizeof(assertlog)); + break; + } + if ((size_t)offset >= sizeof(assertlog)) { + break; + } + + size_t leftbytes = sizeof(assertlog) - offset; + int offset2 = vsnprintf(assertlog + offset, leftbytes, _format, _list); + if (offset2 < 0) { + strncat(assertlog + offset, "[ASSERT2] FAILED!!!", leftbytes); + break; + } + if ((size_t)offset2 >= leftbytes) { + break; + } + offset += offset2; + } while (0); + + //#ifdef ANDROID + // android_callstack(assertlog+offset, sizeof(assertlog)-offset); + //#endif info.level = kLevelFatal; info.tag = XLOGGER_TAG; @@ -98,28 +111,27 @@ void __ASSERTV2(const char * _pfile, int _line, const char * _pfunc, const char info.tid = xlogger_tid(); info.maintid = xlogger_maintid(); - xlogger_Write(&info, assertlog); - + xlogger_Write(&info, assertlog); + if (IS_ASSERT_ENABLE()) { -#if defined(ANDROID) //&& (defined(DEBUG)) +#if defined(ANDROID) //&& (defined(DEBUG)) raise(SIGTRAP); __assert2(_pfile, _line, _pfunc, _pexpression); #endif -#if defined(__APPLE__) //&& (defined(DEBUG)) - __assert_rtn(_pfunc, _pfile, _line, _pexpression); +#if defined(__APPLE__) //&& (defined(DEBUG)) + __assert_rtn(_pfunc, _pfile, _line, _pexpression); #endif -#if defined(WIN32) //&& (defined(DEBUG)) - __assert(_pexpression, _pfile, _line); +#if defined(WIN32) //&& (defined(DEBUG)) + __assert(_pexpression, _pfile, _line); #endif } } -void __ASSERT2(const char * _pfile, int _line, const char * _pfunc, const char * _pexpression, const char * _format, ...) { +void __ASSERT2(const char* _pfile, int _line, const char* _pfunc, const char* _pexpression, const char* _format, ...) { va_list valist; va_start(valist, _format); - __ASSERTV2(_pfile, _line, _pfunc, _pexpression, _format, valist); + __ASSERTV2(_pfile, _line, _pfunc, _pexpression, _format, valist); va_end(valist); } - diff --git a/mars/comm/assert/__assert.h b/mars/comm/assert/__assert.h index b75914c55..2667c28cc 100644 --- a/mars/comm/assert/__assert.h +++ b/mars/comm/assert/__assert.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * assert.h * @@ -21,28 +20,35 @@ #ifndef COMM_COMM_ASSERT_H_ #define COMM_COMM_ASSERT_H_ -#include #include +#include -# if (!__ISO_C_VISIBLE >= 1999) +#if (!__ISO_C_VISIBLE >= 1999) #error "C Version < C99" -# endif +#endif -# define ASSERT(e) ((e) ? (void)0 : __ASSERT(__FILE__, __LINE__, __func__, #e)) -# define ASSERT2(e, fmt, ...) ((e) ? (void)0 : __ASSERT2(__FILE__, __LINE__, __func__, #e, fmt, ##__VA_ARGS__)) -# define ASSERTV2(e, fmt, valist) ((e) ? (void)0 : __ASSERTV2(__FILE__, __LINE__, __func__, #e, fmt, valist)) +#define ASSERT(e) ((e) ? (void)0 : __ASSERT(__FILE__, __LINE__, __func__, #e)) +#define ASSERT2(e, fmt, ...) ((e) ? (void)0 : __ASSERT2(__FILE__, __LINE__, __func__, #e, fmt, ##__VA_ARGS__)) +#define ASSERTV2(e, fmt, valist) ((e) ? (void)0 : __ASSERTV2(__FILE__, __LINE__, __func__, #e, fmt, valist)) __BEGIN_DECLS void ENABLE_ASSERT(); void DISABLE_ASSERT(); int IS_ASSERT_ENABLE(); -__attribute__((__nonnull__(1, 3, 4))) -void __ASSERT(const char*, int, const char*, const char*); -__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 6))) -void __ASSERT2(const char*, int, const char*, const char*, const char*, ...); -__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 0))) -void __ASSERTV2(const char*, int, const char*, const char*, const char*, va_list); +__attribute__((__nonnull__(1, 3, 4))) void __ASSERT(const char*, int, const char*, const char*); +__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 6))) void __ASSERT2(const char*, + int, + const char*, + const char*, + const char*, + ...); +__attribute__((__nonnull__(1, 3, 4, 5))) __attribute__((__format__(printf, 5, 0))) void __ASSERTV2(const char*, + int, + const char*, + const char*, + const char*, + va_list); __END_DECLS #endif /* COMM_COMM_ASSERT_H_ */ diff --git a/mars/comm/autobuffer.cc b/mars/comm/autobuffer.cc index bc6da5e94..b2a04ff98 100644 --- a/mars/comm/autobuffer.cc +++ b/mars/comm/autobuffer.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,8 +10,8 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - #include "autobuffer.h" + #include #include #ifndef _WIN32 @@ -21,7 +21,6 @@ #include "mars/comm/assert/__assert.h" - const AutoBuffer KNullAtuoBuffer; #ifndef max @@ -31,34 +30,19 @@ const AutoBuffer KNullAtuoBuffer; #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif -AutoBuffer::AutoBuffer(size_t _nSize) - : parray_(NULL) - , pos_(0) - , length_(0) - , capacity_(0) - , malloc_unitsize_(_nSize) -{} - +AutoBuffer::AutoBuffer(size_t _nSize) : parray_(NULL), pos_(0), length_(0), capacity_(0), malloc_unitsize_(_nSize) { +} AutoBuffer::AutoBuffer(void* _pbuffer, size_t _len, size_t _nSize) - : parray_(NULL) - , pos_(0) - , length_(0) - , capacity_(0) - , malloc_unitsize_(_nSize) { +: parray_(NULL), pos_(0), length_(0), capacity_(0), malloc_unitsize_(_nSize) { Attach(_pbuffer, _len); } AutoBuffer::AutoBuffer(const void* _pbuffer, size_t _len, size_t _nSize) - : parray_(NULL) - , pos_(0) - , length_(0) - , capacity_(0) - , malloc_unitsize_(_nSize) { +: parray_(NULL), pos_(0), length_(0), capacity_(0), malloc_unitsize_(_nSize) { Write(0, _pbuffer, _len); } - AutoBuffer::~AutoBuffer() { Reset(); } @@ -67,23 +51,37 @@ void AutoBuffer::AllocWrite(size_t _readytowrite, bool _changelength) { size_t nLen = Pos() + _readytowrite; __FitSize(nLen); - if (_changelength) length_ = max(nLen, length_); + if (_changelength) + length_ = max(nLen, length_); } void AutoBuffer::AddCapacity(size_t _len) { __FitSize(Capacity() + _len); } +void AutoBuffer::Write(const AutoBuffer& _buffer) { + Write(_buffer.Ptr(), _buffer.Length()); +} + void AutoBuffer::Write(const void* _pbuffer, size_t _len) { Write(Pos(), _pbuffer, _len); Seek(_len, ESeekCur); } +void AutoBuffer::Write(off_t& _pos, const AutoBuffer& _buffer) { + Write((const off_t&)_pos, _buffer.Ptr(), _buffer.Length()); + _pos += _buffer.Length(); +} + void AutoBuffer::Write(off_t& _pos, const void* _pbuffer, size_t _len) { - Write((const off_t&) _pos, _pbuffer, _len); + Write((const off_t&)_pos, _pbuffer, _len); _pos += _len; } +void AutoBuffer::Write(const off_t& _pos, const AutoBuffer& _buffer) { + Write((const off_t&)_pos, _buffer.Ptr(), _buffer.Length()); +} + void AutoBuffer::Write(const off_t& _pos, const void* _pbuffer, size_t _len) { ASSERT(NULL != _pbuffer || 0 == _len); ASSERT(0 <= _pos); @@ -94,7 +92,7 @@ void AutoBuffer::Write(const off_t& _pos, const void* _pbuffer, size_t _len) { memcpy((unsigned char*)Ptr() + _pos, _pbuffer, _len); } -void AutoBuffer::Write(TSeek _seek, const void* _pbuffer, size_t _len){ +void AutoBuffer::Write(TSeek _seek, const void* _pbuffer, size_t _len) { off_t pos = 0; switch (_seek) { case ESeekStart: @@ -110,8 +108,8 @@ void AutoBuffer::Write(TSeek _seek, const void* _pbuffer, size_t _len){ ASSERT(false); break; } - - Write(pos, _pbuffer, _len); + + Write(pos, _pbuffer, _len); } size_t AutoBuffer::Read(void* _pbuffer, size_t _len) { @@ -120,20 +118,20 @@ size_t AutoBuffer::Read(void* _pbuffer, size_t _len) { return readlen; } -size_t AutoBuffer::Read(AutoBuffer& _rhs , size_t _len) { +size_t AutoBuffer::Read(AutoBuffer& _rhs, size_t _len) { size_t readlen = Read(Pos(), _rhs, _len); Seek(readlen, ESeekCur); return readlen; } size_t AutoBuffer::Read(off_t& _pos, void* _pbuffer, size_t _len) const { - size_t readlen = Read((const off_t&) _pos, _pbuffer, _len); + size_t readlen = Read((const off_t&)_pos, _pbuffer, _len); _pos += readlen; return readlen; } size_t AutoBuffer::Read(off_t& _pos, AutoBuffer& _rhs, size_t _len) const { - size_t readlen = Read((const off_t&) _pos, _rhs, _len); + size_t readlen = Read((const off_t&)_pos, _rhs, _len); _pos += readlen; return readlen; } @@ -165,7 +163,8 @@ off_t AutoBuffer::Move(off_t _move_len) { } else { size_t move_len = -_move_len; - if (move_len > Length()) move_len = Length(); + if (move_len > Length()) + move_len = Length(); memmove(parray_, parray_ + move_len, Length() - move_len); Length(move_len < (size_t)Pos() ? Pos() - move_len : 0, Length() - move_len); @@ -174,23 +173,23 @@ off_t AutoBuffer::Move(off_t _move_len) { return Length(); } -void AutoBuffer::Seek(off_t _offset, TSeek _eorigin) { +void AutoBuffer::Seek(off_t _offset, TSeek _eorigin) { switch (_eorigin) { - case ESeekStart: - pos_ = _offset; - break; + case ESeekStart: + pos_ = _offset; + break; - case ESeekCur: - pos_ += _offset; - break; + case ESeekCur: + pos_ += _offset; + break; - case ESeekEnd: - pos_ = length_ + _offset; - break; + case ESeekEnd: + pos_ = length_ + _offset; + break; - default: - ASSERT(false); - break; + default: + ASSERT(false); + break; } if (pos_ < 0) @@ -208,11 +207,11 @@ void AutoBuffer::Length(off_t _pos, size_t _lenght) { Seek(_pos, ESeekStart); } -void* AutoBuffer::Ptr(off_t _offset) { +void* AutoBuffer::Ptr(off_t _offset) { return (char*)parray_ + _offset; } -const void* AutoBuffer::Ptr(off_t _offset) const { +const void* AutoBuffer::Ptr(off_t _offset) const { return (const char*)parray_ + _offset; } @@ -282,22 +281,30 @@ void AutoBuffer::Reset() { void AutoBuffer::__FitSize(size_t _len) { if (_len > capacity_) { - size_t mallocsize = ((_len + malloc_unitsize_ -1)/malloc_unitsize_)*malloc_unitsize_ ; + size_t mallocsize = ((_len + malloc_unitsize_ - 1) / malloc_unitsize_) * malloc_unitsize_; void* p = realloc(parray_, mallocsize); if (NULL == p) { - ASSERT2(p, "_len=%" PRIu64 ", m_nMallocUnitSize=%" PRIu64 ", nMallocSize=%" PRIu64", m_nCapacity=%" PRIu64, - (uint64_t)_len, (uint64_t)malloc_unitsize_, (uint64_t)mallocsize, (uint64_t)capacity_); + ASSERT2(p, + "_len=%" PRIu64 ", m_nMallocUnitSize=%" PRIu64 ", nMallocSize=%" PRIu64 ", m_nCapacity=%" PRIu64, + (uint64_t)_len, + (uint64_t)malloc_unitsize_, + (uint64_t)mallocsize, + (uint64_t)capacity_); + free(parray_); + parray_ = NULL; + capacity_ = 0; + return; } - parray_ = (unsigned char*) p; + parray_ = (unsigned char*)p; - ASSERT2(_len <= 10 * 1024 * 1024, "%u", (uint32_t)_len); + ASSERT2(_len <= 50 * 1024 * 1024, "%u", (uint32_t)_len); ASSERT(parray_); - - memset(parray_+capacity_, 0, mallocsize-capacity_); + + memset(parray_ + capacity_, 0, mallocsize - capacity_); capacity_ = mallocsize; } } diff --git a/mars/comm/autobuffer.h b/mars/comm/autobuffer.h index f9be6cb91..714984020 100644 --- a/mars/comm/autobuffer.h +++ b/mars/comm/autobuffer.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,23 +10,21 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - - #ifndef COMM_AUTOBUFFER_H_ #define COMM_AUTOBUFFER_H_ -#include #include +#include class AutoBuffer { - public: + public: enum TSeek { ESeekStart, ESeekCur, ESeekEnd, }; - public: + public: explicit AutoBuffer(size_t _size = 128); explicit AutoBuffer(void* _pbuffer, size_t _len, size_t _size = 128); explicit AutoBuffer(const void* _pbuffer, size_t _len, size_t _size = 128); @@ -35,40 +33,58 @@ class AutoBuffer { void AllocWrite(size_t _readytowrite, bool _changelength = true); void AddCapacity(size_t _len); - template void Write(const T& _val) - { Write(&_val, sizeof(_val));} + template + void Write(const T& _val) { + Write(&_val, sizeof(_val)); + } - template void Write(off_t& _pos, const T& _val) - { Write(_pos, &_val, sizeof(_val));} + template + void Write(off_t& _pos, const T& _val) { + Write(_pos, &_val, sizeof(_val)); + } - template void Write(const off_t& _pos, const T& _val) - { Write(_pos, &_val, sizeof(_val));} + template + void Write(const off_t& _pos, const T& _val) { + Write(_pos, &_val, sizeof(_val)); + } - void Write(const char* const _val) - { Write(_val, strlen(_val));} + void Write(const char* const _val) { + Write(_val, strlen(_val)); + } - void Write(off_t& _pos, const char* const _val) - { Write(_pos, _val, strlen(_val));} + void Write(off_t& _pos, const char* const _val) { + Write(_pos, _val, strlen(_val)); + } - void Write(const off_t& _pos, const char* const _val) - { Write(_pos, _val, strlen(_val));} + void Write(const off_t& _pos, const char* const _val) { + Write(_pos, _val, strlen(_val)); + } + void Write(const AutoBuffer& _buffer); void Write(const void* _pbuffer, size_t _len); + void Write(off_t& _pos, const AutoBuffer& _buffer); void Write(off_t& _pos, const void* _pbuffer, size_t _len); + void Write(const off_t& _pos, const AutoBuffer& _buffer); void Write(const off_t& _pos, const void* _pbuffer, size_t _len); void Write(TSeek _seek, const void* _pbuffer, size_t _len); - template size_t Read(T& _val) - { return Read(&_val, sizeof(_val)); } + template + size_t Read(T& _val) { + return Read(&_val, sizeof(_val)); + } - template size_t Read(off_t& _pos, T& _val) const - { return Read(_pos, &_val, sizeof(_val)); } + template + size_t Read(off_t& _pos, T& _val) const { + return Read(_pos, &_val, sizeof(_val)); + } - template size_t Read(const off_t& _pos, T& _val) const - { return Read(_pos, &_val, sizeof(_val)); } + template + size_t Read(const off_t& _pos, T& _val) const { + return Read(_pos, &_val, sizeof(_val)); + } size_t Read(void* _pbuffer, size_t _len); - size_t Read(AutoBuffer& _rhs , size_t _len); + size_t Read(AutoBuffer& _rhs, size_t _len); size_t Read(off_t& _pos, void* _pbuffer, size_t _len) const; size_t Read(off_t& _pos, AutoBuffer& _rhs, size_t _len) const; @@ -78,12 +94,12 @@ class AutoBuffer { off_t Move(off_t _move_len); - void Seek(off_t _offset, TSeek _eorigin); + void Seek(off_t _offset, TSeek _eorigin); void Length(off_t _pos, size_t _lenght); - void* Ptr(off_t _offset=0); + void* Ptr(off_t _offset = 0); void* PosPtr(); - const void* Ptr(off_t _offset=0) const; + const void* Ptr(off_t _offset = 0) const; const void* PosPtr() const; off_t Pos() const; @@ -97,14 +113,14 @@ class AutoBuffer { void Reset(); - private: + private: void __FitSize(size_t _len); - private: + private: AutoBuffer(const AutoBuffer& _rhs); - AutoBuffer& operator = (const AutoBuffer& _rhs); + AutoBuffer& operator=(const AutoBuffer& _rhs); - private: + private: unsigned char* parray_; off_t pos_; size_t length_; @@ -114,19 +130,22 @@ class AutoBuffer { extern const AutoBuffer KNullAtuoBuffer; -template class copy_wrapper_helper; +template +class copy_wrapper_helper; template <> class copy_wrapper_helper { - public: - static void copy_constructor(AutoBuffer& _lhs, AutoBuffer& _rhs) - { _lhs.Attach(_rhs); } + public: + static void copy_constructor(AutoBuffer& _lhs, AutoBuffer& _rhs) { + _lhs.Attach(_rhs); + } - static void copy_constructor(AutoBuffer& _lhs, const AutoBuffer& _rhs) - { _lhs.Attach(const_cast(_rhs)); } + static void copy_constructor(AutoBuffer& _lhs, const AutoBuffer& _rhs) { + _lhs.Attach(const_cast(_rhs)); + } - static void destructor(AutoBuffer& _delobj) {} + static void destructor(AutoBuffer& _delobj) { + } }; -#endif //COMM_AUTOBUFFER_H_ - +#endif // COMM_AUTOBUFFER_H_ diff --git a/mars/comm/basepacker.cc b/mars/comm/basepacker.cc index 47842adb6..47b83164f 100644 --- a/mars/comm/basepacker.cc +++ b/mars/comm/basepacker.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * Author: yerungui */ @@ -19,56 +18,71 @@ #include -#include "mars/comm/autobuffer.h" - -#include "socket/unix_socket.h" -#include "ptrbuffer.h" #include "adler32.h" #include "assert/__assert.h" +#include "mars/comm/autobuffer.h" +#include "ptrbuffer.h" +#include "socket/unix_socket.h" #pragma pack(1) struct LongLinkPack { - unsigned char magic; - unsigned char ver; - unsigned char head_length; - unsigned char url_length; - unsigned int total_length; - unsigned int sequence; - unsigned int hash; + unsigned char magic; + unsigned char ver; + unsigned char head_length; + unsigned char url_length; + unsigned int total_length; + unsigned int sequence; + unsigned int hash; }; template class Endian {}; template -class Endian { - public: - inline static T hton(T t) { return t; } - inline static T ntoh(T t) { return t; } +class Endian { + public: + inline static T hton(T t) { + return t; + } + inline static T ntoh(T t) { + return t; + } }; template -class Endian { - public: - static T hton(T t) { return htons(t); } - static T ntoh(T t) { return ntohs(t); } +class Endian { + public: + static T hton(T t) { + return htons(t); + } + static T ntoh(T t) { + return ntohs(t); + } }; template -class Endian { - public: - static T hton(T t) { return htonl(t); } - static T ntoh(T t) { return ntohl(t); } +class Endian { + public: + static T hton(T t) { + return htonl(t); + } + static T ntoh(T t) { + return ntohl(t); + } }; template -inline T hton(T t) { return Endian::hton(t); } +inline T hton(T t) { + return Endian::hton(t); +} template -inline T ntoh(T t) { return Endian::ntoh(t); } +inline T ntoh(T t) { + return Endian::ntoh(t); +} template -inline T SimplePackLength(size_t _datalen) { +inline T SimplePackLength(size_t _datalen) { return (T)(_datalen + sizeof(T)); } @@ -86,11 +100,13 @@ inline void SimplePack(const void* _data, size_t _datalen, PtrBuffer& _outbuf) { template inline int SimpleUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, AutoBuffer& _data) { - if (sizeof(T) > _rawlen) return SIMPLE_CONTINUE; + if (sizeof(T) > _rawlen) + return SIMPLE_CONTINUE; _packlen = ntoh(*(T*)_rawbuf); - if (_packlen > _rawlen) return SIMPLE_CONTINUE_DATA; + if (_packlen > _rawlen) + return SIMPLE_CONTINUE_DATA; _data.Write((const unsigned char*)_rawbuf + sizeof(T), _packlen - sizeof(T)); return SIMPLE_OK; @@ -98,18 +114,19 @@ inline int SimpleUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, A template inline int SimpleUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, PtrBuffer& _data) { - if (sizeof(T) > _rawlen) return SIMPLE_CONTINUE; + if (sizeof(T) > _rawlen) + return SIMPLE_CONTINUE; _packlen = ntoh(*(T*)_rawbuf); - if (_packlen > _rawlen) return SIMPLE_CONTINUE_DATA; + if (_packlen > _rawlen) + return SIMPLE_CONTINUE_DATA; _data.Attach((unsigned char*)_rawbuf + sizeof(T), _packlen - sizeof(T), _packlen - sizeof(T)); return SIMPLE_OK; } - -size_t SimpleShortPackLength(size_t _datalen) { +size_t SimpleShortPackLength(size_t _datalen) { return SimplePackLength(_datalen); } @@ -125,7 +142,7 @@ int SimpleShortUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, Ptr return SimpleUnpack(_rawbuf, _rawlen, _packlen, _data); } -size_t SimpleIntPackLength(size_t _datalen) { +size_t SimpleIntPackLength(size_t _datalen) { return SimplePackLength(_datalen); } @@ -141,7 +158,12 @@ int SimpleIntUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, PtrBu return SimpleUnpack(_rawbuf, _rawlen, _packlen, _data); } -void Packer_Pack(const char* _url, unsigned int _sequence, const void* _data, size_t _datalen, AutoBuffer& _outbuf, bool _dohash) { +void Packer_Pack(const char* _url, + unsigned int _sequence, + const void* _data, + size_t _datalen, + AutoBuffer& _outbuf, + bool _dohash) { ASSERT(_url); size_t url_size = strnlen(_url, 128); ASSERT(0xFF >= sizeof(LongLinkPack) + url_size); @@ -150,7 +172,7 @@ void Packer_Pack(const char* _url, unsigned int _sequence, const void* _data, si st.ver = 0x1; st.head_length = (unsigned char)sizeof(st); st.url_length = url_size; - st.total_length = (unsigned int)(st.head_length + st.url_length + _datalen); + st.total_length = (unsigned int)(st.head_length + st.url_length + _datalen); st.sequence = _sequence; st.magic = (st.head_length + st.url_length + st.total_length) & 0xFF; @@ -159,7 +181,9 @@ void Packer_Pack(const char* _url, unsigned int _sequence, const void* _data, si if (_dohash) { st.hash = (unsigned int)adler32(0, (const unsigned char*)_url, (unsigned int)url_size); - if (NULL != _data && 0 < _datalen) { st.hash = (unsigned int)adler32(st.hash, (const unsigned char*)_data, (unsigned int)_datalen);} + if (NULL != _data && 0 < _datalen) { + st.hash = (unsigned int)adler32(st.hash, (const unsigned char*)_data, (unsigned int)_datalen); + } } st.total_length = htonl(st.total_length); @@ -171,8 +195,14 @@ void Packer_Pack(const char* _url, unsigned int _sequence, const void* _data, si _outbuf.Write(_data, _datalen); } -int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string& _url, unsigned int& _sequence, size_t& _packlen, AutoBuffer& _data) { - if (_rawlen < sizeof(LongLinkPack)) return LONGLINKPACK_CONTINUE; +int Packer_Unpack(const void* _rawbuf, + size_t _rawlen, + std::string& _url, + unsigned int& _sequence, + size_t& _packlen, + AutoBuffer& _data) { + if (_rawlen < sizeof(LongLinkPack)) + return LONGLINKPACK_CONTINUE; LongLinkPack st = {0}; memcpy(&st, _rawbuf, sizeof(LongLinkPack)); @@ -181,28 +211,42 @@ int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string& _url, unsign st.sequence = ntohl(st.sequence); st.hash = ntohl(st.hash); - if (((st.head_length + st.url_length + st.total_length) & 0xFF) != st.magic) return __LINE__; + if (((st.head_length + st.url_length + st.total_length) & 0xFF) != st.magic) + return __LINE__; - if (st.url_length + st.head_length > st.total_length) return __LINE__; + if (st.url_length + st.head_length > st.total_length) + return __LINE__; - if (1024 * 1024 < st.total_length) return __LINE__; + if (1024 * 1024 < st.total_length) + return __LINE__; - if (st.url_length + st.head_length > _rawlen) return LONGLINKPACK_CONTINUE_HEAD; + if (st.url_length + st.head_length > _rawlen) + return LONGLINKPACK_CONTINUE_HEAD; _url.assign((const char*)_rawbuf + st.head_length, st.url_length); _sequence = st.sequence; _packlen = st.total_length; - if (st.total_length > _rawlen) return LONGLINKPACK_CONTINUE_data; + if (st.total_length > _rawlen) + return LONGLINKPACK_CONTINUE_data; - if (0 != st.hash && st.hash != adler32(0, (const unsigned char*)_rawbuf + st.head_length, st.total_length - st.head_length)) return __LINE__; + if (0 != st.hash + && st.hash != adler32(0, (const unsigned char*)_rawbuf + st.head_length, st.total_length - st.head_length)) + return __LINE__; - _data.Write((const char*)_rawbuf + st.head_length + st.url_length, st.total_length - (st.head_length + st.url_length)); + _data.Write((const char*)_rawbuf + st.head_length + st.url_length, + st.total_length - (st.head_length + st.url_length)); return LONGLINKPACK_OK; } -int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string& _url, unsigned int& _sequence, size_t& _packlen, PtrBuffer& _data) { - if (_rawlen < sizeof(LongLinkPack)) return LONGLINKPACK_CONTINUE; +int Packer_Unpack(const void* _rawbuf, + size_t _rawlen, + std::string& _url, + unsigned int& _sequence, + size_t& _packlen, + PtrBuffer& _data) { + if (_rawlen < sizeof(LongLinkPack)) + return LONGLINKPACK_CONTINUE; LongLinkPack st = {0}; memcpy(&st, _rawbuf, sizeof(LongLinkPack)); @@ -211,21 +255,29 @@ int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string& _url, unsign st.sequence = ntohl(st.sequence); st.hash = ntohl(st.hash); - if (((st.head_length + st.url_length + st.total_length) & 0xFF) != st.magic) return __LINE__; + if (((st.head_length + st.url_length + st.total_length) & 0xFF) != st.magic) + return __LINE__; - if (st.url_length + st.head_length > st.total_length) return __LINE__; + if (st.url_length + st.head_length > st.total_length) + return __LINE__; - if (1024 * 1024 < st.total_length) return __LINE__; + if (1024 * 1024 < st.total_length) + return __LINE__; - if (st.url_length + st.head_length > _rawlen) return LONGLINKPACK_CONTINUE_HEAD; + if (st.url_length + st.head_length > _rawlen) + return LONGLINKPACK_CONTINUE_HEAD; _url.assign((const char*)_rawbuf + st.head_length, st.url_length); _sequence = st.sequence; _packlen = st.total_length; - if (st.total_length > _rawlen) return LONGLINKPACK_CONTINUE_data; + if (st.total_length > _rawlen) + return LONGLINKPACK_CONTINUE_data; - if (0 != st.hash && st.hash != adler32(0, (const unsigned char*)_rawbuf + st.head_length, st.total_length - st.head_length)) { return __LINE__; } + if (0 != st.hash + && st.hash != adler32(0, (const unsigned char*)_rawbuf + st.head_length, st.total_length - st.head_length)) { + return __LINE__; + } _data.Attach((char*)_rawbuf + st.head_length + st.url_length, st.total_length - (st.head_length + st.url_length)); return LONGLINKPACK_OK; diff --git a/mars/comm/basepacker.h b/mars/comm/basepacker.h index 9f4e0f72c..10aaccdde 100644 --- a/mars/comm/basepacker.h +++ b/mars/comm/basepacker.h @@ -1,15 +1,14 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. /* * LongLinkPacker.cpp @@ -41,18 +40,33 @@ class AutoBuffer; class PtrBuffer; -size_t SimpleShortPackLength(size_t _datalen); +size_t SimpleShortPackLength(size_t _datalen); void SimpleShortPack(const void* _data, size_t _datalen, AutoBuffer& _outbuf); int SimpleShortUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, AutoBuffer& _data); int SimpleShortUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, PtrBuffer& _data); -size_t SimpleIntPackLength(size_t _datalen); +size_t SimpleIntPackLength(size_t _datalen); void SimpleIntPack(const void* _data, size_t _datalen, AutoBuffer& _outbuf); int SimpleIntUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, AutoBuffer& _data); int SimpleIntUnpack(const void* _rawbuf, size_t _rawlen, size_t& _packlen, PtrBuffer& _data); -void Packer_Pack(const char* _url, unsigned int _sequence, const void* _data, size_t _datalen, AutoBuffer& _outbuf, bool _dohash = true); -int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string &_url, unsigned int& _sequence, size_t& _packlen, AutoBuffer& _data); -int Packer_Unpack(const void* _rawbuf, size_t _rawlen, std::string &_url, unsigned int& _sequence, size_t& _packlen, PtrBuffer& _data); +void Packer_Pack(const char* _url, + unsigned int _sequence, + const void* _data, + size_t _datalen, + AutoBuffer& _outbuf, + bool _dohash = true); +int Packer_Unpack(const void* _rawbuf, + size_t _rawlen, + std::string& _url, + unsigned int& _sequence, + size_t& _packlen, + AutoBuffer& _data); +int Packer_Unpack(const void* _rawbuf, + size_t _rawlen, + std::string& _url, + unsigned int& _sequence, + size_t& _packlen, + PtrBuffer& _data); -#endif // COMM_BASEPACKER_H_ +#endif // COMM_BASEPACKER_H_ diff --git a/mars/comm/boost_exception.cc b/mars/comm/boost_exception.cc index 3880286b5..a88cde3d6 100644 --- a/mars/comm/boost_exception.cc +++ b/mars/comm/boost_exception.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -18,21 +18,14 @@ // #include -#include "comm/xlogger/xlogger.h" -#ifdef ANDROID -#include "comm/android/callstack.h" -#endif +#include "comm/xlogger/xlogger.h" -namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { +namespace mars_boost {} +namespace boost = mars_boost; +namespace mars_boost { - void throw_exception( std::exception const & e ) { - xfatal2(TSF"boost exception:%_", e.what()); - -#ifdef ANDROID - char stack[4096] = {0}; - android_callstack(stack, sizeof(stack)); - xfatal2(TSF"%_", stack); -#endif - } +void throw_exception(std::exception const& e) { + xfatal2(TSF "boost exception:%_", e.what()); } +} // namespace mars_boost diff --git a/mars/comm/bootregister.h b/mars/comm/bootregister.h index 859b91156..1e744e36a 100644 --- a/mars/comm/bootregister.h +++ b/mars/comm/bootregister.h @@ -1,40 +1,36 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. #ifndef COMM_BOOTREGISTER_H_ #define COMM_BOOTREGISTER_H_ #include -#include "comm/compiler_util.h" template -std::vector& BootRegister_Container() -{ +std::vector& BOOT_REGISTER_CONTAINER() { static std::vector s_register; return s_register; } template -bool BootRegister_Add(const T& _data) -{ - BootRegister_Container().push_back(_data); +bool BootRegister_Add(const T& _data) { + BOOT_REGISTER_CONTAINER().push_back(_data); return true; } #define BOOT_REGISTER(data) BOOT_REGISTER_IMPL_I(data, __LINE__) #define BOOT_REGISTER_IMPL_I(data, line) BOOT_REGISTER_IMPL_II(data, line) -#define BOOT_REGISTER_IMPL_II(data, line) VARIABLE_IS_NOT_USED static bool __int_anonymous_##line = BootRegister_Add(data) +#define BOOT_REGISTER_IMPL_II(data, line) \ + VARIABLE_IS_NOT_USED static bool __int_anonymous_##line = BootRegister_Add(data) #define BOOT_REGISTER_CHECK(name, data) VARIABLE_IS_NOT_USED bool __test_##name##_check = BootRegister_Add(data) -#endif // COMM_BOOTREGISTER_H_ +#endif // COMM_BOOTREGISTER_H_ diff --git a/mars/comm/bootrun.h b/mars/comm/bootrun.h index 7675513b6..65dab66f2 100644 --- a/mars/comm/bootrun.h +++ b/mars/comm/bootrun.h @@ -1,15 +1,14 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. /* * bootrun.h @@ -22,20 +21,41 @@ #define COMM_BOOTRUN_H_ #include -#include "comm/compiler_util.h" + +#include "mars/comm/compiler_util.h" #ifdef __cplusplus extern "C" { #endif -__inline int boot_run_atstartup(void (*func)(void)) { func(); return 0;} -__inline int boot_run_atexit(void (*func)(void)) { return atexit(func);} +__inline int __boot_run_atstartup(void (*func)(void)) { + func(); + return 0; +} +__inline int __boot_run_atexit(void (*func)(void)) { + return atexit(func); +} #ifdef __cplusplus } #endif -#define BOOT_RUN_STARTUP(func) VARIABLE_IS_NOT_USED static int __anonymous_run_variable_startup_##func = boot_run_atstartup(func) -#define BOOT_RUN_EXIT(func) VARIABLE_IS_NOT_USED static int __anonymous_run_variable_exit_##func = boot_run_atexit(func) +#define BOOT_RUN_STARTUP(func) \ + VARIABLE_IS_NOT_USED static int __anonymous_run_variable_startup_##func = __boot_run_atstartup(func) +#define BOOT_RUN_EXIT(func) \ + VARIABLE_IS_NOT_USED static int __anonymous_run_variable_exit_##func = __boot_run_atexit(func) + +#define BOOT_RUN_BLOCK_START _BOOT_RUN_BLOCK_START(__LINE__) +#define BOOT_RUN_BLOCK_END \ + if (0) \ + ; \ + else \ + return 0; \ + } \ + (); + +//////////detail impl///////////// +#define __BOOT_RUN_BLOCK_START(line) VARIABLE_IS_NOT_USED static int __anonymous_boot_run_block_variable_##line = []() { +#define _BOOT_RUN_BLOCK_START(line) __BOOT_RUN_BLOCK_START(line) #endif /* COMM_BOOTRUN_H_ */ diff --git a/mars/comm/cache_with_timeout.h b/mars/comm/cache_with_timeout.h new file mode 100644 index 000000000..12ef4bbb6 --- /dev/null +++ b/mars/comm/cache_with_timeout.h @@ -0,0 +1,66 @@ +// +// Created by gjt on 5/15/24. +// + +#ifndef MARS_CACHE_WITH_TIMEOUT_H +#define MARS_CACHE_WITH_TIMEOUT_H + +#include +#include + +#include "mars/comm/xlogger/xlogger.h" +#include "stlutil.h" +#include "time_utils.h" + +template +class CacheWithTimeout { + public: + explicit CacheWithTimeout(uint64_t timeout_ms) { + xinfo2(TSF "timeout_ms:%_", timeout_ms); + timeout_ms_ = timeout_ms; + } + void DeleteTimeOut() { + uint64_t now_time = gettickcount(); + std::lock_guard lock(mtx_); + stlutil::RemoveIfAndErase(cache_, [&](const TWithTime& f) { + bool timeout = now_time - f.second >= timeout_ms_; + if (timeout) { + xinfo2(TSF "cache time:%_", f.second); + } + return timeout; + }); + } + void Update(const T& fragment) { + std::lock_guard lock(mtx_); + stlutil::RemoveIfAndErase(cache_, [&](const TWithTime& it) { + return it.first == fragment; + }); + cache_.emplace_back(fragment, gettickcount()); + } + bool Hit(const T& fragment) { + std::lock_guard lock(mtx_); + return stlutil::AnyOf(cache_, [&](const TWithTime& f) { + return f.first == fragment; + }); + } + using GetIfFunc = std::function; + bool GetIf(const GetIfFunc& f, T& t) { + std::lock_guard lock(mtx_); + auto it = std::find_if(cache_.begin(), cache_.end(), [&](const TWithTime& t) { + return f(t.first); + }); + if (it != cache_.end()) { + t = it->first; + return true; + } + return false; + } + + private: + uint64_t timeout_ms_ = 0; + using TWithTime = std::pair; + std::vector cache_; + std::mutex mtx_; +}; + +#endif // MARS_CACHE_WITH_TIMEOUT_H diff --git a/mars/comm/channel.h b/mars/comm/channel.h new file mode 100644 index 000000000..7aabef211 --- /dev/null +++ b/mars/comm/channel.h @@ -0,0 +1,53 @@ +// +// Created by gjt on 5/15/24. +// + +#ifndef MARS_CHANNEL_H +#define MARS_CHANNEL_H + +#include +#include +#include + +namespace mars { +namespace comm { +// T 必须有默认构造函数,如果没有,请使用std::shared_ptr +// todo 支持unique_ptr,考虑std::forward +template +class Channel { + public: + explicit Channel(uint64_t capacity) { + capacity_ = capacity; + } + void Send(T t) { + std::lock_guard lock(mtx_); + list_.push_back(std::move(t)); + cv_.notify_one(); + } + // timeout_ms是INT64_MAX的话会溢出 + bool RecvWithTimeoutMs(T& t, uint32_t timeout_ms) { + std::unique_lock lock(mtx_); + if (!list_.empty()) { + t = std::move(list_.front()); + list_.pop_front(); + return true; + } + auto timeout_time = std::chrono::steady_clock::now() + std::chrono::milliseconds(timeout_ms); + if (cv_.wait_until(lock, timeout_time) == std::cv_status::timeout) { + return false; + } + t = std::move(list_.front()); + list_.pop_front(); + return true; + } + + private: + std::list list_; + std::mutex mtx_; + std::condition_variable cv_; + uint64_t capacity_ = INT32_MAX; +}; +} // namespace comm +} // namespace mars + +#endif // MARS_CHANNEL_H diff --git a/mars/comm/channel_unittest.cc b/mars/comm/channel_unittest.cc new file mode 100644 index 000000000..5be7b524f --- /dev/null +++ b/mars/comm/channel_unittest.cc @@ -0,0 +1,38 @@ +// +// Created by gjt on 5/16/24. +// + +#include +#include +#include +#include "gtest/gtest.h" +#include "channel.h" +using namespace mars::comm; + +int main() { + const int capacity = 10; + const int thread_num = 10; + const int run_time = 10; + const int sleep_time_ms = 5; + const int small_time_interval_ms = 10; + const int large_time_interval_ms = 1 * 1000; + Channel channel(capacity); + for (uint32_t thread_i = 0; thread_i < capacity; ++thread_i) { + std::thread([&channel, thread_i]() { + for (int i = 0; i < run_time; ++i) { + std::this_thread::sleep_for(std::chrono::milliseconds(random() % sleep_time_ms)); + channel.Send("thread:" + std::to_string(thread_i) + "\trun:" + std::to_string(i)); + } + }).detach(); + } + for (int recv_i = 0; recv_i < thread_num * run_time; ++recv_i) { + std::string recv; + bool succ = channel.RecvWithTimeoutMs(recv, small_time_interval_ms); + EXPECT_TRUE(succ); + std::cout << "succ:" << succ << "\trecv:" << recv << std::endl; + } + std::string recv; + bool succ = channel.RecvWithTimeoutMs(recv, large_time_interval_ms); + EXPECT_TRUE(!succ); + std::cout << "one more recv:" << succ << std::endl; +} \ No newline at end of file diff --git a/mars/comm/comm-mac.xcodeproj/project.pbxproj b/mars/comm/comm-mac.xcodeproj/project.pbxproj deleted file mode 100644 index a431004a8..000000000 --- a/mars/comm/comm-mac.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1340 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1F25BFCD1CD37AF500AC1003 /* lockpool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF9D1CD37AE000AC1003 /* lockpool.cpp */; }; - 1F25BFCE1CD37AF500AC1003 /* date_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA11CD37AE000AC1003 /* date_generators.cpp */; }; - 1F25BFCF1CD37AF500AC1003 /* greg_month.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA21CD37AE000AC1003 /* greg_month.cpp */; }; - 1F25BFD01CD37AF500AC1003 /* greg_names.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA31CD37AE000AC1003 /* greg_names.hpp */; }; - 1F25BFD11CD37AF500AC1003 /* greg_weekday.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA41CD37AE000AC1003 /* greg_weekday.cpp */; }; - 1F25BFD21CD37AF500AC1003 /* gregorian_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA51CD37AE000AC1003 /* gregorian_types.cpp */; }; - 1F25BFD31CD37AF500AC1003 /* posix_time_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFA71CD37AE000AC1003 /* posix_time_types.cpp */; }; - 1F25BFD41CD37AF500AC1003 /* clone_current_exception_non_intrusive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFAA1CD37AE000AC1003 /* clone_current_exception_non_intrusive.cpp */; }; - 1F25BFD51CD37AF500AC1003 /* codecvt_error_category.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFAD1CD37AE000AC1003 /* codecvt_error_category.cpp */; }; - 1F25BFD61CD37AF500AC1003 /* operations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFAE1CD37AE000AC1003 /* operations.cpp */; }; - 1F25BFD71CD37AF500AC1003 /* path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFAF1CD37AE000AC1003 /* path.cpp */; }; - 1F25BFD81CD37AF500AC1003 /* path_traits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB01CD37AE000AC1003 /* path_traits.cpp */; }; - 1F25BFD91CD37AF500AC1003 /* portability.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB11CD37AE000AC1003 /* portability.cpp */; }; - 1F25BFDA1CD37AF500AC1003 /* unique_path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB21CD37AE000AC1003 /* unique_path.cpp */; }; - 1F25BFDB1CD37AF500AC1003 /* utf8_codecvt_facet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB31CD37AE000AC1003 /* utf8_codecvt_facet.cpp */; }; - 1F25BFDC1CD37AF500AC1003 /* windows_file_codecvt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB41CD37AE000AC1003 /* windows_file_codecvt.cpp */; }; - 1F25BFDD1CD37AF500AC1003 /* windows_file_codecvt.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB51CD37AE000AC1003 /* windows_file_codecvt.hpp */; }; - 1F25BFDE1CD37AF500AC1003 /* file_descriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB81CD37AE000AC1003 /* file_descriptor.cpp */; }; - 1F25BFDF1CD37AF500AC1003 /* mapped_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFB91CD37AE000AC1003 /* mapped_file.cpp */; }; - 1F25BFE01CD37AF500AC1003 /* sp_collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFBC1CD37AE000AC1003 /* sp_collector.cpp */; }; - 1F25BFE11CD37AF500AC1003 /* sp_debug_hooks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFBD1CD37AE000AC1003 /* sp_debug_hooks.cpp */; }; - 1F25BFE21CD37AF500AC1003 /* error_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFC01CD37AE000AC1003 /* error_code.cpp */; }; - 1F25BFE31CD37AF500AC1003 /* future.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFC31CD37AE000AC1003 /* future.cpp */; }; - 1F25BFE41CD37AF500AC1003 /* tss_null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BFC81CD37AE000AC1003 /* tss_null.cpp */; }; - 4B0280831DE70343001721C0 /* http.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B0280811DE70343001721C0 /* http.cc */; }; - 4B0280911DE7037B001721C0 /* getsocktcpinfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B0280891DE7037B001721C0 /* getsocktcpinfo.cc */; }; - 4B0280921DE7037B001721C0 /* nat64_prefix_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B02808B1DE7037B001721C0 /* nat64_prefix_util.cc */; }; - 4B0280931DE7037B001721C0 /* unix_socket.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B02808E1DE7037B001721C0 /* unix_socket.cc */; }; - 4B299C011CEF0AEA00E2315B /* boost_exception.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B299C001CEF0AEA00E2315B /* boost_exception.cc */; }; - 4B3C3E0A1E120D9400351897 /* netinfo_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B3C3E081E120D9400351897 /* netinfo_util.cc */; }; - 4B3C3E211E1210A100351897 /* complexconnect.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B3C3E201E1210A100351897 /* complexconnect.cc */; }; - 4BB712531DE8149B00185734 /* socketselect.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4BB712511DE8149B00185734 /* socketselect.cc */; }; - 4BB712F71DE8229A00185734 /* loginfo_extract.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BB712F51DE8229A00185734 /* loginfo_extract.c */; }; - 55D917841CC7BD7A0076CBD9 /* message_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D9093D1CC7BD760076CBD9 /* message_queue.cc */; }; - 55D917851CC7BD7A0076CBD9 /* message_queue_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D9093F1CC7BD760076CBD9 /* message_queue_utils.cc */; }; - 55D918241CC7BD7A0076CBD9 /* mmap_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A141CC7BD770076CBD9 /* mmap_util.cc */; }; - 55D918251CC7BD7A0076CBD9 /* block_socket.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A161CC7BD770076CBD9 /* block_socket.cc */; }; - 55D918271CC7BD7A0076CBD9 /* local_ipstack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A1B1CC7BD770076CBD9 /* local_ipstack.cc */; }; - 55D918281CC7BD7A0076CBD9 /* socket_address.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A1D1CC7BD770076CBD9 /* socket_address.cc */; }; - 55D918291CC7BD7A0076CBD9 /* tcpclient.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A211CC7BD770076CBD9 /* tcpclient.cc */; }; - 55D9182A1CC7BD7A0076CBD9 /* tcpclient_fsm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A231CC7BD770076CBD9 /* tcpclient_fsm.cc */; }; - 55D9182B1CC7BD7A0076CBD9 /* tcpserver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A251CC7BD770076CBD9 /* tcpserver.cc */; }; - 55D9182C1CC7BD7A0076CBD9 /* tcpserver_fsm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A271CC7BD770076CBD9 /* tcpserver_fsm.cc */; }; - 55D9182D1CC7BD7A0076CBD9 /* udpclient.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A291CC7BD770076CBD9 /* udpclient.cc */; }; - 55D9182E1CC7BD7A0076CBD9 /* udpserver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A2B1CC7BD770076CBD9 /* udpserver.cc */; }; - 55D9184A1CC7BD7A0076CBD9 /* getdnssvraddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A741CC7BD770076CBD9 /* getdnssvraddrs.cc */; }; - 55D9184B1CC7BD7A0076CBD9 /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A761CC7BD770076CBD9 /* getgateway.c */; }; - 55D9184C1CC7BD7A0076CBD9 /* getifaddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A781CC7BD770076CBD9 /* getifaddrs.cc */; }; - 55D9184F1CC7BD7A0076CBD9 /* xloggerbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A851CC7BD770076CBD9 /* xloggerbase.c */; }; - 55D918501CC7BD7A0076CBD9 /* alarm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A891CC7BD770076CBD9 /* alarm.cc */; }; - 55D918511CC7BD7A0076CBD9 /* anr.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A8B1CC7BD770076CBD9 /* anr.cc */; }; - 55D918521CC7BD7A0076CBD9 /* __assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A8E1CC7BD770076CBD9 /* __assert.c */; }; - 55D918531CC7BD7A0076CBD9 /* autobuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A901CC7BD770076CBD9 /* autobuffer.cc */; }; - 55D918541CC7BD7A0076CBD9 /* basepacker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A921CC7BD770076CBD9 /* basepacker.cc */; }; - 55D918551CC7BD7A0076CBD9 /* comm_frequency_limit.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A961CC7BD770076CBD9 /* comm_frequency_limit.cc */; }; - 55D918561CC7BD7A0076CBD9 /* coreservice_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90A9D1CC7BD770076CBD9 /* coreservice_base.cc */; }; - 55D9185D1CC7BD7A0076CBD9 /* ibase64.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AAE1CC7BD770076CBD9 /* ibase64.cc */; }; - 55D9185E1CC7BD7A0076CBD9 /* pkcs7_padding.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AB01CC7BD770076CBD9 /* pkcs7_padding.c */; }; - 55D9185F1CC7BD7A0076CBD9 /* debugger_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AB31CC7BD770076CBD9 /* debugger_utils.c */; }; - 55D918601CC7BD7A0076CBD9 /* test_spy_sample.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AB81CC7BD770076CBD9 /* test_spy_sample.cc */; }; - 55D918611CC7BD7A0076CBD9 /* testspy.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90ABA1CC7BD770076CBD9 /* testspy.cc */; }; - 55D918621CC7BD7A0076CBD9 /* dns.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90ABD1CC7BD770076CBD9 /* dns.cc */; }; - 55D9186B1CC7BD7A0076CBD9 /* memdbg.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90ADC1CC7BD770076CBD9 /* memdbg.cc */; }; - 55D9186C1CC7BD7A0076CBD9 /* data_protect_attr.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AE11CC7BD770076CBD9 /* data_protect_attr.mm */; }; - 55D9186D1CC7BD7A0076CBD9 /* objc_timer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AE41CC7BD770076CBD9 /* objc_timer.mm */; }; - 55D9186E1CC7BD7A0076CBD9 /* platform_comm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AE51CC7BD770076CBD9 /* platform_comm.mm */; }; - 55D9186F1CC7BD7A0076CBD9 /* Reachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AE71CC7BD770076CBD9 /* Reachability.mm */; }; - 55D918701CC7BD7A0076CBD9 /* scope_autoreleasepool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AEA1CC7BD770076CBD9 /* scope_autoreleasepool.mm */; }; - 55D918711CC7BD7A0076CBD9 /* ThreadOperationQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AEC1CC7BD770076CBD9 /* ThreadOperationQueue.mm */; }; - 55D918721CC7BD7A0076CBD9 /* xlogger_threadinfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AED1CC7BD770076CBD9 /* xlogger_threadinfo.mm */; }; - 55D918731CC7BD7A0076CBD9 /* ptrbuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AEF1CC7BD770076CBD9 /* ptrbuffer.cc */; }; - 55D918741CC7BD7A0076CBD9 /* singleton.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AF21CC7BD770076CBD9 /* singleton.cc */; }; - 55D918751CC7BD7A0076CBD9 /* strutil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90AF41CC7BD770076CBD9 /* strutil.cc */; }; - 55D918771CC7BD7A0076CBD9 /* tickcount.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90B041CC7BD770076CBD9 /* tickcount.cc */; }; - 55D918781CC7BD7A0076CBD9 /* time_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D90B061CC7BD770076CBD9 /* time_utils.c */; }; - 55D918791CC7BD7A0076CBD9 /* tinyxml2.cc in Sources */ = {isa = PBXBuildFile; fileRef = 55D90B081CC7BD770076CBD9 /* tinyxml2.cc */; }; - 55D91ABB1CC7BD7A0076CBD9 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D9177D1CC7BD7A0076CBD9 /* md5.c */; }; - 55D91ABC1CC7BD7A0076CBD9 /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = 55D9177E1CC7BD7A0076CBD9 /* adler32.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1F25BF9D1CD37AE000AC1003 /* lockpool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = lockpool.cpp; sourceTree = ""; }; - 1F25BFA11CD37AE000AC1003 /* date_generators.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = date_generators.cpp; sourceTree = ""; }; - 1F25BFA21CD37AE000AC1003 /* greg_month.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = greg_month.cpp; sourceTree = ""; }; - 1F25BFA31CD37AE000AC1003 /* greg_names.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = greg_names.hpp; sourceTree = ""; }; - 1F25BFA41CD37AE000AC1003 /* greg_weekday.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = greg_weekday.cpp; sourceTree = ""; }; - 1F25BFA51CD37AE000AC1003 /* gregorian_types.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = gregorian_types.cpp; sourceTree = ""; }; - 1F25BFA71CD37AE000AC1003 /* posix_time_types.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = posix_time_types.cpp; sourceTree = ""; }; - 1F25BFAA1CD37AE000AC1003 /* clone_current_exception_non_intrusive.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = clone_current_exception_non_intrusive.cpp; sourceTree = ""; }; - 1F25BFAD1CD37AE000AC1003 /* codecvt_error_category.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = codecvt_error_category.cpp; sourceTree = ""; }; - 1F25BFAE1CD37AE000AC1003 /* operations.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = operations.cpp; sourceTree = ""; }; - 1F25BFAF1CD37AE000AC1003 /* path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = path.cpp; sourceTree = ""; }; - 1F25BFB01CD37AE000AC1003 /* path_traits.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = path_traits.cpp; sourceTree = ""; }; - 1F25BFB11CD37AE000AC1003 /* portability.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = portability.cpp; sourceTree = ""; }; - 1F25BFB21CD37AE000AC1003 /* unique_path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = unique_path.cpp; sourceTree = ""; }; - 1F25BFB31CD37AE000AC1003 /* utf8_codecvt_facet.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = utf8_codecvt_facet.cpp; sourceTree = ""; }; - 1F25BFB41CD37AE000AC1003 /* windows_file_codecvt.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = windows_file_codecvt.cpp; sourceTree = ""; }; - 1F25BFB51CD37AE000AC1003 /* windows_file_codecvt.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = windows_file_codecvt.hpp; sourceTree = ""; }; - 1F25BFB81CD37AE000AC1003 /* file_descriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = file_descriptor.cpp; sourceTree = ""; }; - 1F25BFB91CD37AE000AC1003 /* mapped_file.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = mapped_file.cpp; sourceTree = ""; }; - 1F25BFBC1CD37AE000AC1003 /* sp_collector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sp_collector.cpp; sourceTree = ""; }; - 1F25BFBD1CD37AE000AC1003 /* sp_debug_hooks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sp_debug_hooks.cpp; sourceTree = ""; }; - 1F25BFC01CD37AE000AC1003 /* error_code.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = error_code.cpp; sourceTree = ""; }; - 1F25BFC31CD37AE000AC1003 /* future.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = future.cpp; sourceTree = ""; }; - 1F25BFC51CD37AE000AC1003 /* once.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = once.cpp; sourceTree = ""; }; - 1F25BFC61CD37AE000AC1003 /* once_atomic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = once_atomic.cpp; sourceTree = ""; }; - 1F25BFC71CD37AE000AC1003 /* thread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = thread.cpp; sourceTree = ""; }; - 1F25BFC81CD37AE000AC1003 /* tss_null.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_null.cpp; sourceTree = ""; }; - 1F25BFCA1CD37AE000AC1003 /* thread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = thread.cpp; sourceTree = ""; }; - 1F25BFCB1CD37AE000AC1003 /* tss_dll.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_dll.cpp; sourceTree = ""; }; - 1F25BFCC1CD37AE000AC1003 /* tss_pe.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_pe.cpp; sourceTree = ""; }; - 4B0280811DE70343001721C0 /* http.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = http.cc; sourceTree = ""; }; - 4B0280821DE70343001721C0 /* http.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = http.h; sourceTree = ""; }; - 4B0280891DE7037B001721C0 /* getsocktcpinfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsocktcpinfo.cc; sourceTree = ""; }; - 4B02808A1DE7037B001721C0 /* getsocktcpinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsocktcpinfo.h; sourceTree = ""; }; - 4B02808B1DE7037B001721C0 /* nat64_prefix_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nat64_prefix_util.cc; sourceTree = ""; }; - 4B02808C1DE7037B001721C0 /* nat64_prefix_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nat64_prefix_util.h; sourceTree = ""; }; - 4B02808E1DE7037B001721C0 /* unix_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unix_socket.cc; sourceTree = ""; }; - 4B299C001CEF0AEA00E2315B /* boost_exception.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = boost_exception.cc; sourceTree = ""; }; - 4B3C3E081E120D9400351897 /* netinfo_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = netinfo_util.cc; sourceTree = ""; }; - 4B3C3E091E120D9400351897 /* netinfo_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = netinfo_util.h; sourceTree = ""; }; - 4B3C3E201E1210A100351897 /* complexconnect.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complexconnect.cc; sourceTree = ""; }; - 4BB712511DE8149B00185734 /* socketselect.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = socketselect.cc; sourceTree = ""; }; - 4BB712521DE8149B00185734 /* socketselect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socketselect.h; sourceTree = ""; }; - 4BB712F51DE8229A00185734 /* loginfo_extract.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = loginfo_extract.c; sourceTree = ""; }; - 4BB712F61DE8229A00185734 /* loginfo_extract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loginfo_extract.h; sourceTree = ""; }; - 4BE038FE1DE7F0C70004CD84 /* CoreWLAN.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreWLAN.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreWLAN.framework; sourceTree = DEVELOPER_DIR; }; - 4BE039001DE7F1090004CD84 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CFNetwork.framework; sourceTree = DEVELOPER_DIR; }; - 4BE039021DE7F11B0004CD84 /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/NetworkExtension.framework; sourceTree = DEVELOPER_DIR; }; - 4BE039041DE7F1250004CD84 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; - 4BE039061DE7F12E0004CD84 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 4BE039081DE7F1350004CD84 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; - 55D9093B1CC7BD760076CBD9 /* verinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = verinfo.h; sourceTree = ""; }; - 55D9093D1CC7BD760076CBD9 /* message_queue.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message_queue.cc; sourceTree = ""; }; - 55D9093E1CC7BD760076CBD9 /* message_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message_queue.h; sourceTree = ""; }; - 55D9093F1CC7BD760076CBD9 /* message_queue_utils.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message_queue_utils.cc; sourceTree = ""; }; - 55D909401CC7BD760076CBD9 /* message_queue_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message_queue_utils.h; sourceTree = ""; }; - 55D90A141CC7BD770076CBD9 /* mmap_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mmap_util.cc; sourceTree = ""; }; - 55D90A161CC7BD770076CBD9 /* block_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = block_socket.cc; sourceTree = ""; }; - 55D90A171CC7BD770076CBD9 /* block_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = block_socket.h; sourceTree = ""; }; - 55D90A191CC7BD770076CBD9 /* complexconnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = complexconnect.h; sourceTree = ""; }; - 55D90A1A1CC7BD770076CBD9 /* ipv6_address_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipv6_address_utils.h; sourceTree = ""; }; - 55D90A1B1CC7BD770076CBD9 /* local_ipstack.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = local_ipstack.cc; sourceTree = ""; }; - 55D90A1C1CC7BD770076CBD9 /* local_ipstack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = local_ipstack.h; sourceTree = ""; }; - 55D90A1D1CC7BD770076CBD9 /* socket_address.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = socket_address.cc; sourceTree = ""; }; - 55D90A1E1CC7BD770076CBD9 /* socket_address.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket_address.h; sourceTree = ""; }; - 55D90A1F1CC7BD770076CBD9 /* socketselect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socketselect.h; sourceTree = ""; }; - 55D90A201CC7BD770076CBD9 /* tcp_fsm_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_fsm_handler.h; sourceTree = ""; }; - 55D90A211CC7BD770076CBD9 /* tcpclient.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpclient.cc; sourceTree = ""; }; - 55D90A221CC7BD770076CBD9 /* tcpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpclient.h; sourceTree = ""; }; - 55D90A231CC7BD770076CBD9 /* tcpclient_fsm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpclient_fsm.cc; sourceTree = ""; }; - 55D90A241CC7BD770076CBD9 /* tcpclient_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpclient_fsm.h; sourceTree = ""; }; - 55D90A251CC7BD770076CBD9 /* tcpserver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpserver.cc; sourceTree = ""; }; - 55D90A261CC7BD770076CBD9 /* tcpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpserver.h; sourceTree = ""; }; - 55D90A271CC7BD770076CBD9 /* tcpserver_fsm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpserver_fsm.cc; sourceTree = ""; }; - 55D90A281CC7BD770076CBD9 /* tcpserver_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpserver_fsm.h; sourceTree = ""; }; - 55D90A291CC7BD770076CBD9 /* udpclient.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = udpclient.cc; sourceTree = ""; }; - 55D90A2A1CC7BD770076CBD9 /* udpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udpclient.h; sourceTree = ""; }; - 55D90A2B1CC7BD770076CBD9 /* udpserver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = udpserver.cc; sourceTree = ""; }; - 55D90A2C1CC7BD770076CBD9 /* udpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udpserver.h; sourceTree = ""; }; - 55D90A2E1CC7BD770076CBD9 /* unix_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix_socket.h; sourceTree = ""; }; - 55D90A721CC7BD770076CBD9 /* compiler_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compiler_util.h; sourceTree = ""; }; - 55D90A741CC7BD770076CBD9 /* getdnssvraddrs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getdnssvraddrs.cc; sourceTree = ""; }; - 55D90A751CC7BD770076CBD9 /* getdnssvraddrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getdnssvraddrs.h; sourceTree = ""; }; - 55D90A761CC7BD770076CBD9 /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = ""; }; - 55D90A771CC7BD770076CBD9 /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = ""; }; - 55D90A781CC7BD770076CBD9 /* getifaddrs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getifaddrs.cc; sourceTree = ""; }; - 55D90A791CC7BD770076CBD9 /* getifaddrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getifaddrs.h; sourceTree = ""; }; - 55D90A801CC7BD770076CBD9 /* android_xlog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = android_xlog.h; sourceTree = ""; }; - 55D90A811CC7BD770076CBD9 /* preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = preprocessor.h; sourceTree = ""; }; - 55D90A821CC7BD770076CBD9 /* test.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test.cpp_; sourceTree = ""; }; - 55D90A831CC7BD770076CBD9 /* test_for_c.c_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_for_c.c_; sourceTree = ""; }; - 55D90A841CC7BD770076CBD9 /* xlogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xlogger.h; sourceTree = ""; }; - 55D90A851CC7BD770076CBD9 /* xloggerbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xloggerbase.c; sourceTree = ""; }; - 55D90A861CC7BD770076CBD9 /* xloggerbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xloggerbase.h; sourceTree = ""; }; - 55D90A881CC7BD770076CBD9 /* adler32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adler32.h; sourceTree = ""; }; - 55D90A891CC7BD770076CBD9 /* alarm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alarm.cc; sourceTree = ""; }; - 55D90A8A1CC7BD770076CBD9 /* alarm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alarm.h; sourceTree = ""; }; - 55D90A8B1CC7BD770076CBD9 /* anr.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = anr.cc; sourceTree = ""; }; - 55D90A8C1CC7BD770076CBD9 /* anr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = anr.h; sourceTree = ""; }; - 55D90A8E1CC7BD770076CBD9 /* __assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __assert.c; sourceTree = ""; }; - 55D90A8F1CC7BD770076CBD9 /* __assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = __assert.h; sourceTree = ""; }; - 55D90A901CC7BD770076CBD9 /* autobuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autobuffer.cc; sourceTree = ""; }; - 55D90A911CC7BD770076CBD9 /* autobuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autobuffer.h; sourceTree = ""; }; - 55D90A921CC7BD770076CBD9 /* basepacker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = basepacker.cc; sourceTree = ""; }; - 55D90A931CC7BD770076CBD9 /* basepacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basepacker.h; sourceTree = ""; }; - 55D90A941CC7BD770076CBD9 /* bootregister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootregister.h; sourceTree = ""; }; - 55D90A951CC7BD770076CBD9 /* bootrun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootrun.h; sourceTree = ""; }; - 55D90A961CC7BD770076CBD9 /* comm_frequency_limit.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = comm_frequency_limit.cc; sourceTree = ""; }; - 55D90A971CC7BD770076CBD9 /* comm_frequency_limit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = comm_frequency_limit.h; sourceTree = ""; }; - 55D90A9B1CC7BD770076CBD9 /* copy_wrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = copy_wrapper.h; sourceTree = ""; }; - 55D90A9D1CC7BD770076CBD9 /* coreservice_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coreservice_base.cc; sourceTree = ""; }; - 55D90A9E1CC7BD770076CBD9 /* coreservice_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coreservice_base.h; sourceTree = ""; }; - 55D90A9F1CC7BD770076CBD9 /* service_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = service_base.h; sourceTree = ""; }; - 55D90AA01CC7BD770076CBD9 /* ServiceImpl.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceImpl.inl; sourceTree = ""; }; - 55D90AAE1CC7BD770076CBD9 /* ibase64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ibase64.cc; sourceTree = ""; }; - 55D90AAF1CC7BD770076CBD9 /* ibase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ibase64.h; sourceTree = ""; }; - 55D90AB01CC7BD770076CBD9 /* pkcs7_padding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pkcs7_padding.c; sourceTree = ""; }; - 55D90AB11CC7BD770076CBD9 /* pkcs7_padding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pkcs7_padding.h; sourceTree = ""; }; - 55D90AB31CC7BD770076CBD9 /* debugger_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debugger_utils.c; sourceTree = ""; }; - 55D90AB41CC7BD770076CBD9 /* debugger_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugger_utils.h; sourceTree = ""; }; - 55D90AB51CC7BD770076CBD9 /* spy.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy.inl; sourceTree = ""; }; - 55D90AB61CC7BD770076CBD9 /* spy_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spy_base.h; sourceTree = ""; }; - 55D90AB71CC7BD770076CBD9 /* spy_impl_helper.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy_impl_helper.inl; sourceTree = ""; }; - 55D90AB81CC7BD770076CBD9 /* test_spy_sample.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_spy_sample.cc; sourceTree = ""; }; - 55D90AB91CC7BD770076CBD9 /* test_spy_sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = test_spy_sample.h; sourceTree = ""; }; - 55D90ABA1CC7BD770076CBD9 /* testspy.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testspy.cc; sourceTree = ""; }; - 55D90ABB1CC7BD770076CBD9 /* testspy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testspy.h; sourceTree = ""; }; - 55D90ABD1CC7BD770076CBD9 /* dns.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dns.cc; sourceTree = ""; }; - 55D90ABE1CC7BD770076CBD9 /* dns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dns.h; sourceTree = ""; }; - 55D90ABF1CC7BD770076CBD9 /* has_member.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = has_member.h; sourceTree = ""; }; - 55D90AC31CC7BD770076CBD9 /* ini.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ini.h; sourceTree = ""; }; - 55D90ADA1CC7BD770076CBD9 /* marcotoolkit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = marcotoolkit.h; sourceTree = ""; }; - 55D90ADB1CC7BD770076CBD9 /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; - 55D90ADC1CC7BD770076CBD9 /* memdbg.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memdbg.cc; sourceTree = ""; }; - 55D90ADD1CC7BD770076CBD9 /* memdbg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memdbg.h; sourceTree = ""; }; - 55D90ADE1CC7BD770076CBD9 /* mmap_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmap_util.h; sourceTree = ""; }; - 55D90AE01CC7BD770076CBD9 /* data_protect_attr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data_protect_attr.h; sourceTree = ""; }; - 55D90AE11CC7BD770076CBD9 /* data_protect_attr.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = data_protect_attr.mm; sourceTree = ""; }; - 55D90AE21CC7BD770076CBD9 /* ip_icmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_icmp.h; sourceTree = ""; }; - 55D90AE31CC7BD770076CBD9 /* objc_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objc_timer.h; sourceTree = ""; }; - 55D90AE41CC7BD770076CBD9 /* objc_timer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = objc_timer.mm; sourceTree = ""; }; - 55D90AE51CC7BD770076CBD9 /* platform_comm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = platform_comm.mm; sourceTree = ""; }; - 55D90AE61CC7BD770076CBD9 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; - 55D90AE71CC7BD770076CBD9 /* Reachability.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Reachability.mm; sourceTree = ""; }; - 55D90AE81CC7BD770076CBD9 /* route.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; }; - 55D90AE91CC7BD770076CBD9 /* scope_autoreleasepool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_autoreleasepool.h; sourceTree = ""; }; - 55D90AEA1CC7BD770076CBD9 /* scope_autoreleasepool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = scope_autoreleasepool.mm; sourceTree = ""; }; - 55D90AEB1CC7BD770076CBD9 /* ThreadOperationQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadOperationQueue.h; sourceTree = ""; }; - 55D90AEC1CC7BD770076CBD9 /* ThreadOperationQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThreadOperationQueue.mm; sourceTree = ""; }; - 55D90AED1CC7BD770076CBD9 /* xlogger_threadinfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = xlogger_threadinfo.mm; sourceTree = ""; }; - 55D90AEE1CC7BD770076CBD9 /* platform_comm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_comm.h; sourceTree = ""; }; - 55D90AEF1CC7BD770076CBD9 /* ptrbuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ptrbuffer.cc; sourceTree = ""; }; - 55D90AF01CC7BD770076CBD9 /* ptrbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ptrbuffer.h; sourceTree = ""; }; - 55D90AF11CC7BD770076CBD9 /* scope_recursion_limit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_recursion_limit.h; sourceTree = ""; }; - 55D90AF21CC7BD770076CBD9 /* singleton.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = singleton.cc; sourceTree = ""; }; - 55D90AF31CC7BD770076CBD9 /* singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = singleton.h; sourceTree = ""; }; - 55D90AF41CC7BD770076CBD9 /* strutil.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strutil.cc; sourceTree = ""; }; - 55D90AF51CC7BD770076CBD9 /* strutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strutil.h; sourceTree = ""; }; - 55D90AF91CC7BD770076CBD9 /* atomic_oper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomic_oper.h; sourceTree = ""; }; - 55D90AFA1CC7BD770076CBD9 /* bind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bind.h; sourceTree = ""; }; - 55D90AFB1CC7BD770076CBD9 /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 55D90AFC1CC7BD770076CBD9 /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 55D90AFD1CC7BD770076CBD9 /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 55D90AFE1CC7BD770076CBD9 /* mutexvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutexvector.h; sourceTree = ""; }; - 55D90AFF1CC7BD770076CBD9 /* runnable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runnable.h; sourceTree = ""; }; - 55D90B001CC7BD770076CBD9 /* spinlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spinlock.h; sourceTree = ""; }; - 55D90B011CC7BD770076CBD9 /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 55D90B021CC7BD770076CBD9 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 55D90B031CC7BD770076CBD9 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 55D90B041CC7BD770076CBD9 /* tickcount.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tickcount.cc; sourceTree = ""; }; - 55D90B051CC7BD770076CBD9 /* tickcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tickcount.h; sourceTree = ""; }; - 55D90B061CC7BD770076CBD9 /* time_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = time_utils.c; sourceTree = ""; }; - 55D90B071CC7BD770076CBD9 /* time_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time_utils.h; sourceTree = ""; }; - 55D90B081CC7BD770076CBD9 /* tinyxml2.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cc; sourceTree = ""; }; - 55D90B091CC7BD770076CBD9 /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = ""; }; - 55D90B0F1CC7BD770076CBD9 /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 55D90B101CC7BD770076CBD9 /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 55D90B111CC7BD770076CBD9 /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 55D90B121CC7BD770076CBD9 /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 55D90B131CC7BD770076CBD9 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 55D90B141CC7BD770076CBD9 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 55D9177D1CC7BD7A0076CBD9 /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5.c; sourceTree = ""; }; - 55D9177E1CC7BD7A0076CBD9 /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = ""; }; - 55D9C0821CC7B1C90076CBD9 /* libcomm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcomm.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F138F5511DEED3B600546CBB /* coro_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coro_socket.cc; sourceTree = ""; }; - F138F5521DEED3B600546CBB /* coro_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coro_socket.h; sourceTree = ""; }; - F138F5531DEED3B600546CBB /* coroutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coroutine.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1F25BF9A1CD37AE000AC1003 /* libs */ = { - isa = PBXGroup; - children = ( - 1F25BF9B1CD37AE000AC1003 /* atomic */, - 1F25BF9E1CD37AE000AC1003 /* date_time */, - 1F25BFA81CD37AE000AC1003 /* exception */, - 1F25BFAB1CD37AE000AC1003 /* filesystem */, - 1F25BFB61CD37AE000AC1003 /* iostreams */, - 1F25BFBA1CD37AE000AC1003 /* smart_ptr */, - 1F25BFBE1CD37AE000AC1003 /* system */, - 1F25BFC11CD37AE000AC1003 /* thread */, - ); - name = libs; - path = ../boost/libs; - sourceTree = ""; - }; - 1F25BF9B1CD37AE000AC1003 /* atomic */ = { - isa = PBXGroup; - children = ( - 1F25BF9C1CD37AE000AC1003 /* src */, - ); - path = atomic; - sourceTree = ""; - }; - 1F25BF9C1CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF9D1CD37AE000AC1003 /* lockpool.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF9E1CD37AE000AC1003 /* date_time */ = { - isa = PBXGroup; - children = ( - 1F25BF9F1CD37AE000AC1003 /* src */, - ); - path = date_time; - sourceTree = ""; - }; - 1F25BF9F1CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFA01CD37AE000AC1003 /* gregorian */, - 1F25BFA61CD37AE000AC1003 /* posix_time */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFA01CD37AE000AC1003 /* gregorian */ = { - isa = PBXGroup; - children = ( - 1F25BFA11CD37AE000AC1003 /* date_generators.cpp */, - 1F25BFA21CD37AE000AC1003 /* greg_month.cpp */, - 1F25BFA31CD37AE000AC1003 /* greg_names.hpp */, - 1F25BFA41CD37AE000AC1003 /* greg_weekday.cpp */, - 1F25BFA51CD37AE000AC1003 /* gregorian_types.cpp */, - ); - path = gregorian; - sourceTree = ""; - }; - 1F25BFA61CD37AE000AC1003 /* posix_time */ = { - isa = PBXGroup; - children = ( - 1F25BFA71CD37AE000AC1003 /* posix_time_types.cpp */, - ); - path = posix_time; - sourceTree = ""; - }; - 1F25BFA81CD37AE000AC1003 /* exception */ = { - isa = PBXGroup; - children = ( - 1F25BFA91CD37AE000AC1003 /* src */, - ); - path = exception; - sourceTree = ""; - }; - 1F25BFA91CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFAA1CD37AE000AC1003 /* clone_current_exception_non_intrusive.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFAB1CD37AE000AC1003 /* filesystem */ = { - isa = PBXGroup; - children = ( - 1F25BFAC1CD37AE000AC1003 /* src */, - ); - path = filesystem; - sourceTree = ""; - }; - 1F25BFAC1CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFAD1CD37AE000AC1003 /* codecvt_error_category.cpp */, - 1F25BFAE1CD37AE000AC1003 /* operations.cpp */, - 1F25BFAF1CD37AE000AC1003 /* path.cpp */, - 1F25BFB01CD37AE000AC1003 /* path_traits.cpp */, - 1F25BFB11CD37AE000AC1003 /* portability.cpp */, - 1F25BFB21CD37AE000AC1003 /* unique_path.cpp */, - 1F25BFB31CD37AE000AC1003 /* utf8_codecvt_facet.cpp */, - 1F25BFB41CD37AE000AC1003 /* windows_file_codecvt.cpp */, - 1F25BFB51CD37AE000AC1003 /* windows_file_codecvt.hpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFB61CD37AE000AC1003 /* iostreams */ = { - isa = PBXGroup; - children = ( - 1F25BFB71CD37AE000AC1003 /* src */, - ); - path = iostreams; - sourceTree = ""; - }; - 1F25BFB71CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFB81CD37AE000AC1003 /* file_descriptor.cpp */, - 1F25BFB91CD37AE000AC1003 /* mapped_file.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFBA1CD37AE000AC1003 /* smart_ptr */ = { - isa = PBXGroup; - children = ( - 1F25BFBB1CD37AE000AC1003 /* src */, - ); - path = smart_ptr; - sourceTree = ""; - }; - 1F25BFBB1CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFBC1CD37AE000AC1003 /* sp_collector.cpp */, - 1F25BFBD1CD37AE000AC1003 /* sp_debug_hooks.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFBE1CD37AE000AC1003 /* system */ = { - isa = PBXGroup; - children = ( - 1F25BFBF1CD37AE000AC1003 /* src */, - ); - path = system; - sourceTree = ""; - }; - 1F25BFBF1CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFC01CD37AE000AC1003 /* error_code.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFC11CD37AE000AC1003 /* thread */ = { - isa = PBXGroup; - children = ( - 1F25BFC21CD37AE000AC1003 /* src */, - ); - path = thread; - sourceTree = ""; - }; - 1F25BFC21CD37AE000AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BFC31CD37AE000AC1003 /* future.cpp */, - 1F25BFC41CD37AE000AC1003 /* pthread */, - 1F25BFC81CD37AE000AC1003 /* tss_null.cpp */, - 1F25BFC91CD37AE000AC1003 /* win32 */, - ); - path = src; - sourceTree = ""; - }; - 1F25BFC41CD37AE000AC1003 /* pthread */ = { - isa = PBXGroup; - children = ( - 1F25BFC51CD37AE000AC1003 /* once.cpp */, - 1F25BFC61CD37AE000AC1003 /* once_atomic.cpp */, - 1F25BFC71CD37AE000AC1003 /* thread.cpp */, - ); - path = pthread; - sourceTree = ""; - }; - 1F25BFC91CD37AE000AC1003 /* win32 */ = { - isa = PBXGroup; - children = ( - 1F25BFCA1CD37AE000AC1003 /* thread.cpp */, - 1F25BFCB1CD37AE000AC1003 /* tss_dll.cpp */, - 1F25BFCC1CD37AE000AC1003 /* tss_pe.cpp */, - ); - path = win32; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - F138F5501DEED3B600546CBB /* coroutine */, - 4B0280811DE70343001721C0 /* http.cc */, - 4B0280821DE70343001721C0 /* http.h */, - 4B299C001CEF0AEA00E2315B /* boost_exception.cc */, - 1F25BF9A1CD37AE000AC1003 /* libs */, - 55D9093B1CC7BD760076CBD9 /* verinfo.h */, - 55D9093C1CC7BD760076CBD9 /* messagequeue */, - 55D90A141CC7BD770076CBD9 /* mmap_util.cc */, - 55D90A151CC7BD770076CBD9 /* socket */, - 55D90A721CC7BD770076CBD9 /* compiler_util.h */, - 55D90A731CC7BD770076CBD9 /* network */, - 55D90A7F1CC7BD770076CBD9 /* xlogger */, - 55D90A881CC7BD770076CBD9 /* adler32.h */, - 55D90A891CC7BD770076CBD9 /* alarm.cc */, - 55D90A8A1CC7BD770076CBD9 /* alarm.h */, - 55D90A8B1CC7BD770076CBD9 /* anr.cc */, - 55D90A8C1CC7BD770076CBD9 /* anr.h */, - 55D90A8D1CC7BD770076CBD9 /* assert */, - 55D90A901CC7BD770076CBD9 /* autobuffer.cc */, - 55D90A911CC7BD770076CBD9 /* autobuffer.h */, - 55D90A921CC7BD770076CBD9 /* basepacker.cc */, - 55D90A931CC7BD770076CBD9 /* basepacker.h */, - 55D90A941CC7BD770076CBD9 /* bootregister.h */, - 55D90A951CC7BD770076CBD9 /* bootrun.h */, - 55D90A961CC7BD770076CBD9 /* comm_frequency_limit.cc */, - 55D90A971CC7BD770076CBD9 /* comm_frequency_limit.h */, - 55D90A9B1CC7BD770076CBD9 /* copy_wrapper.h */, - 55D90A9C1CC7BD770076CBD9 /* corepattern */, - 55D90AAD1CC7BD770076CBD9 /* crypt */, - 55D90AB21CC7BD770076CBD9 /* debugger */, - 55D90ABC1CC7BD770076CBD9 /* dns */, - 55D90ABF1CC7BD770076CBD9 /* has_member.h */, - 55D90AC31CC7BD770076CBD9 /* ini.h */, - 55D90ADA1CC7BD770076CBD9 /* marcotoolkit.h */, - 55D90ADB1CC7BD770076CBD9 /* md5.h */, - 55D90ADC1CC7BD770076CBD9 /* memdbg.cc */, - 55D90ADD1CC7BD770076CBD9 /* memdbg.h */, - 55D90ADE1CC7BD770076CBD9 /* mmap_util.h */, - 55D90ADF1CC7BD770076CBD9 /* objc */, - 55D90AEE1CC7BD770076CBD9 /* platform_comm.h */, - 55D90AEF1CC7BD770076CBD9 /* ptrbuffer.cc */, - 55D90AF01CC7BD770076CBD9 /* ptrbuffer.h */, - 55D90AF11CC7BD770076CBD9 /* scope_recursion_limit.h */, - 55D90AF21CC7BD770076CBD9 /* singleton.cc */, - 55D90AF31CC7BD770076CBD9 /* singleton.h */, - 55D90AF41CC7BD770076CBD9 /* strutil.cc */, - 55D90AF51CC7BD770076CBD9 /* strutil.h */, - 55D90AF81CC7BD770076CBD9 /* thread */, - 55D90B041CC7BD770076CBD9 /* tickcount.cc */, - 55D90B051CC7BD770076CBD9 /* tickcount.h */, - 55D90B061CC7BD770076CBD9 /* time_utils.c */, - 55D90B071CC7BD770076CBD9 /* time_utils.h */, - 55D90B081CC7BD770076CBD9 /* tinyxml2.cc */, - 55D90B091CC7BD770076CBD9 /* tinyxml2.h */, - 55D90B0A1CC7BD770076CBD9 /* unix */, - 55D9177D1CC7BD7A0076CBD9 /* md5.c */, - 55D9177E1CC7BD7A0076CBD9 /* adler32.c */, - 55D9C0821CC7B1C90076CBD9 /* libcomm.a */, - 4BE038FD1DE7F0C70004CD84 /* Frameworks */, - ); - sourceTree = ""; - }; - 4BB712501DE8149B00185734 /* SocketSelect */ = { - isa = PBXGroup; - children = ( - 4BB712511DE8149B00185734 /* socketselect.cc */, - 4BB712521DE8149B00185734 /* socketselect.h */, - ); - path = SocketSelect; - sourceTree = ""; - }; - 4BE038FD1DE7F0C70004CD84 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 4BE039081DE7F1350004CD84 /* CoreFoundation.framework */, - 4BE039061DE7F12E0004CD84 /* Foundation.framework */, - 4BE039041DE7F1250004CD84 /* SystemConfiguration.framework */, - 4BE039021DE7F11B0004CD84 /* NetworkExtension.framework */, - 4BE039001DE7F1090004CD84 /* CFNetwork.framework */, - 4BE038FE1DE7F0C70004CD84 /* CoreWLAN.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 55D9093C1CC7BD760076CBD9 /* messagequeue */ = { - isa = PBXGroup; - children = ( - 55D9093D1CC7BD760076CBD9 /* message_queue.cc */, - 55D9093E1CC7BD760076CBD9 /* message_queue.h */, - 55D9093F1CC7BD760076CBD9 /* message_queue_utils.cc */, - 55D909401CC7BD760076CBD9 /* message_queue_utils.h */, - ); - path = messagequeue; - sourceTree = ""; - }; - 55D90A151CC7BD770076CBD9 /* socket */ = { - isa = PBXGroup; - children = ( - 4B3C3E201E1210A100351897 /* complexconnect.cc */, - 4B0280891DE7037B001721C0 /* getsocktcpinfo.cc */, - 4B02808A1DE7037B001721C0 /* getsocktcpinfo.h */, - 4B02808B1DE7037B001721C0 /* nat64_prefix_util.cc */, - 4B02808C1DE7037B001721C0 /* nat64_prefix_util.h */, - 4B02808E1DE7037B001721C0 /* unix_socket.cc */, - 55D90A161CC7BD770076CBD9 /* block_socket.cc */, - 55D90A171CC7BD770076CBD9 /* block_socket.h */, - 55D90A191CC7BD770076CBD9 /* complexconnect.h */, - 55D90A1A1CC7BD770076CBD9 /* ipv6_address_utils.h */, - 55D90A1B1CC7BD770076CBD9 /* local_ipstack.cc */, - 55D90A1C1CC7BD770076CBD9 /* local_ipstack.h */, - 55D90A1D1CC7BD770076CBD9 /* socket_address.cc */, - 55D90A1E1CC7BD770076CBD9 /* socket_address.h */, - 55D90A1F1CC7BD770076CBD9 /* socketselect.h */, - 55D90A201CC7BD770076CBD9 /* tcp_fsm_handler.h */, - 55D90A211CC7BD770076CBD9 /* tcpclient.cc */, - 55D90A221CC7BD770076CBD9 /* tcpclient.h */, - 55D90A231CC7BD770076CBD9 /* tcpclient_fsm.cc */, - 55D90A241CC7BD770076CBD9 /* tcpclient_fsm.h */, - 55D90A251CC7BD770076CBD9 /* tcpserver.cc */, - 55D90A261CC7BD770076CBD9 /* tcpserver.h */, - 55D90A271CC7BD770076CBD9 /* tcpserver_fsm.cc */, - 55D90A281CC7BD770076CBD9 /* tcpserver_fsm.h */, - 55D90A291CC7BD770076CBD9 /* udpclient.cc */, - 55D90A2A1CC7BD770076CBD9 /* udpclient.h */, - 55D90A2B1CC7BD770076CBD9 /* udpserver.cc */, - 55D90A2C1CC7BD770076CBD9 /* udpserver.h */, - 55D90A2E1CC7BD770076CBD9 /* unix_socket.h */, - ); - path = socket; - sourceTree = ""; - }; - 55D90A731CC7BD770076CBD9 /* network */ = { - isa = PBXGroup; - children = ( - 4B3C3E081E120D9400351897 /* netinfo_util.cc */, - 4B3C3E091E120D9400351897 /* netinfo_util.h */, - 55D90A741CC7BD770076CBD9 /* getdnssvraddrs.cc */, - 55D90A751CC7BD770076CBD9 /* getdnssvraddrs.h */, - 55D90A761CC7BD770076CBD9 /* getgateway.c */, - 55D90A771CC7BD770076CBD9 /* getgateway.h */, - 55D90A781CC7BD770076CBD9 /* getifaddrs.cc */, - 55D90A791CC7BD770076CBD9 /* getifaddrs.h */, - ); - path = network; - sourceTree = ""; - }; - 55D90A7F1CC7BD770076CBD9 /* xlogger */ = { - isa = PBXGroup; - children = ( - 4BB712F51DE8229A00185734 /* loginfo_extract.c */, - 4BB712F61DE8229A00185734 /* loginfo_extract.h */, - 55D90A801CC7BD770076CBD9 /* android_xlog.h */, - 55D90A811CC7BD770076CBD9 /* preprocessor.h */, - 55D90A821CC7BD770076CBD9 /* test.cpp_ */, - 55D90A831CC7BD770076CBD9 /* test_for_c.c_ */, - 55D90A841CC7BD770076CBD9 /* xlogger.h */, - 55D90A851CC7BD770076CBD9 /* xloggerbase.c */, - 55D90A861CC7BD770076CBD9 /* xloggerbase.h */, - ); - path = xlogger; - sourceTree = ""; - }; - 55D90A8D1CC7BD770076CBD9 /* assert */ = { - isa = PBXGroup; - children = ( - 55D90A8E1CC7BD770076CBD9 /* __assert.c */, - 55D90A8F1CC7BD770076CBD9 /* __assert.h */, - ); - path = assert; - sourceTree = ""; - }; - 55D90A9C1CC7BD770076CBD9 /* corepattern */ = { - isa = PBXGroup; - children = ( - 55D90A9D1CC7BD770076CBD9 /* coreservice_base.cc */, - 55D90A9E1CC7BD770076CBD9 /* coreservice_base.h */, - 55D90A9F1CC7BD770076CBD9 /* service_base.h */, - 55D90AA01CC7BD770076CBD9 /* ServiceImpl.inl */, - ); - path = corepattern; - sourceTree = ""; - }; - 55D90AAD1CC7BD770076CBD9 /* crypt */ = { - isa = PBXGroup; - children = ( - 55D90AAE1CC7BD770076CBD9 /* ibase64.cc */, - 55D90AAF1CC7BD770076CBD9 /* ibase64.h */, - 55D90AB01CC7BD770076CBD9 /* pkcs7_padding.c */, - 55D90AB11CC7BD770076CBD9 /* pkcs7_padding.h */, - ); - path = crypt; - sourceTree = ""; - }; - 55D90AB21CC7BD770076CBD9 /* debugger */ = { - isa = PBXGroup; - children = ( - 55D90AB31CC7BD770076CBD9 /* debugger_utils.c */, - 55D90AB41CC7BD770076CBD9 /* debugger_utils.h */, - 55D90AB51CC7BD770076CBD9 /* spy.inl */, - 55D90AB61CC7BD770076CBD9 /* spy_base.h */, - 55D90AB71CC7BD770076CBD9 /* spy_impl_helper.inl */, - 55D90AB81CC7BD770076CBD9 /* test_spy_sample.cc */, - 55D90AB91CC7BD770076CBD9 /* test_spy_sample.h */, - 55D90ABA1CC7BD770076CBD9 /* testspy.cc */, - 55D90ABB1CC7BD770076CBD9 /* testspy.h */, - ); - path = debugger; - sourceTree = ""; - }; - 55D90ABC1CC7BD770076CBD9 /* dns */ = { - isa = PBXGroup; - children = ( - 55D90ABD1CC7BD770076CBD9 /* dns.cc */, - 55D90ABE1CC7BD770076CBD9 /* dns.h */, - ); - path = dns; - sourceTree = ""; - }; - 55D90ADF1CC7BD770076CBD9 /* objc */ = { - isa = PBXGroup; - children = ( - 55D90AE01CC7BD770076CBD9 /* data_protect_attr.h */, - 55D90AE11CC7BD770076CBD9 /* data_protect_attr.mm */, - 55D90AE21CC7BD770076CBD9 /* ip_icmp.h */, - 55D90AE31CC7BD770076CBD9 /* objc_timer.h */, - 55D90AE41CC7BD770076CBD9 /* objc_timer.mm */, - 55D90AE51CC7BD770076CBD9 /* platform_comm.mm */, - 55D90AE61CC7BD770076CBD9 /* Reachability.h */, - 55D90AE71CC7BD770076CBD9 /* Reachability.mm */, - 55D90AE81CC7BD770076CBD9 /* route.h */, - 55D90AE91CC7BD770076CBD9 /* scope_autoreleasepool.h */, - 55D90AEA1CC7BD770076CBD9 /* scope_autoreleasepool.mm */, - 55D90AEB1CC7BD770076CBD9 /* ThreadOperationQueue.h */, - 55D90AEC1CC7BD770076CBD9 /* ThreadOperationQueue.mm */, - 55D90AED1CC7BD770076CBD9 /* xlogger_threadinfo.mm */, - ); - path = objc; - sourceTree = ""; - }; - 55D90AF81CC7BD770076CBD9 /* thread */ = { - isa = PBXGroup; - children = ( - 55D90AF91CC7BD770076CBD9 /* atomic_oper.h */, - 55D90AFA1CC7BD770076CBD9 /* bind.h */, - 55D90AFB1CC7BD770076CBD9 /* condition.h */, - 55D90AFC1CC7BD770076CBD9 /* lock.h */, - 55D90AFD1CC7BD770076CBD9 /* mutex.h */, - 55D90AFE1CC7BD770076CBD9 /* mutexvector.h */, - 55D90AFF1CC7BD770076CBD9 /* runnable.h */, - 55D90B001CC7BD770076CBD9 /* spinlock.h */, - 55D90B011CC7BD770076CBD9 /* test_case.cpp_ */, - 55D90B021CC7BD770076CBD9 /* thread.h */, - 55D90B031CC7BD770076CBD9 /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - 55D90B0A1CC7BD770076CBD9 /* unix */ = { - isa = PBXGroup; - children = ( - 4BB712501DE8149B00185734 /* SocketSelect */, - 55D90B0E1CC7BD770076CBD9 /* thread */, - ); - path = unix; - sourceTree = ""; - }; - 55D90B0E1CC7BD770076CBD9 /* thread */ = { - isa = PBXGroup; - children = ( - 55D90B0F1CC7BD770076CBD9 /* condition.h */, - 55D90B101CC7BD770076CBD9 /* lock.h */, - 55D90B111CC7BD770076CBD9 /* mutex.h */, - 55D90B121CC7BD770076CBD9 /* test_case.cpp_ */, - 55D90B131CC7BD770076CBD9 /* thread.h */, - 55D90B141CC7BD770076CBD9 /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - F138F5501DEED3B600546CBB /* coroutine */ = { - isa = PBXGroup; - children = ( - F138F5511DEED3B600546CBB /* coro_socket.cc */, - F138F5521DEED3B600546CBB /* coro_socket.h */, - F138F5531DEED3B600546CBB /* coroutine.h */, - ); - path = coroutine; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* comm */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = comm; - productName = PublicComponent; - productReference = 55D9C0821CC7B1C90076CBD9 /* libcomm.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = felixzhou; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm-mac" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A01E177887B0004F5DDA; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* comm */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1F25BFCD1CD37AF500AC1003 /* lockpool.cpp in Sources */, - 1F25BFCE1CD37AF500AC1003 /* date_generators.cpp in Sources */, - 1F25BFCF1CD37AF500AC1003 /* greg_month.cpp in Sources */, - 1F25BFD01CD37AF500AC1003 /* greg_names.hpp in Sources */, - 1F25BFD11CD37AF500AC1003 /* greg_weekday.cpp in Sources */, - 1F25BFD21CD37AF500AC1003 /* gregorian_types.cpp in Sources */, - 4B0280931DE7037B001721C0 /* unix_socket.cc in Sources */, - 1F25BFD31CD37AF500AC1003 /* posix_time_types.cpp in Sources */, - 1F25BFD41CD37AF500AC1003 /* clone_current_exception_non_intrusive.cpp in Sources */, - 1F25BFD51CD37AF500AC1003 /* codecvt_error_category.cpp in Sources */, - 1F25BFD61CD37AF500AC1003 /* operations.cpp in Sources */, - 1F25BFD71CD37AF500AC1003 /* path.cpp in Sources */, - 1F25BFD81CD37AF500AC1003 /* path_traits.cpp in Sources */, - 1F25BFD91CD37AF500AC1003 /* portability.cpp in Sources */, - 1F25BFDA1CD37AF500AC1003 /* unique_path.cpp in Sources */, - 1F25BFDB1CD37AF500AC1003 /* utf8_codecvt_facet.cpp in Sources */, - 4B0280831DE70343001721C0 /* http.cc in Sources */, - 1F25BFDC1CD37AF500AC1003 /* windows_file_codecvt.cpp in Sources */, - 1F25BFDD1CD37AF500AC1003 /* windows_file_codecvt.hpp in Sources */, - 1F25BFDE1CD37AF500AC1003 /* file_descriptor.cpp in Sources */, - 1F25BFDF1CD37AF500AC1003 /* mapped_file.cpp in Sources */, - 1F25BFE01CD37AF500AC1003 /* sp_collector.cpp in Sources */, - 1F25BFE11CD37AF500AC1003 /* sp_debug_hooks.cpp in Sources */, - 1F25BFE21CD37AF500AC1003 /* error_code.cpp in Sources */, - 1F25BFE31CD37AF500AC1003 /* future.cpp in Sources */, - 1F25BFE41CD37AF500AC1003 /* tss_null.cpp in Sources */, - 55D91ABC1CC7BD7A0076CBD9 /* adler32.c in Sources */, - 55D918601CC7BD7A0076CBD9 /* test_spy_sample.cc in Sources */, - 55D9186F1CC7BD7A0076CBD9 /* Reachability.mm in Sources */, - 55D918781CC7BD7A0076CBD9 /* time_utils.c in Sources */, - 4B0280911DE7037B001721C0 /* getsocktcpinfo.cc in Sources */, - 55D918241CC7BD7A0076CBD9 /* mmap_util.cc in Sources */, - 4B299C011CEF0AEA00E2315B /* boost_exception.cc in Sources */, - 55D9185E1CC7BD7A0076CBD9 /* pkcs7_padding.c in Sources */, - 55D9184A1CC7BD7A0076CBD9 /* getdnssvraddrs.cc in Sources */, - 4B0280921DE7037B001721C0 /* nat64_prefix_util.cc in Sources */, - 55D918551CC7BD7A0076CBD9 /* comm_frequency_limit.cc in Sources */, - 55D918611CC7BD7A0076CBD9 /* testspy.cc in Sources */, - 55D9186D1CC7BD7A0076CBD9 /* objc_timer.mm in Sources */, - 55D918621CC7BD7A0076CBD9 /* dns.cc in Sources */, - 55D918731CC7BD7A0076CBD9 /* ptrbuffer.cc in Sources */, - 55D918271CC7BD7A0076CBD9 /* local_ipstack.cc in Sources */, - 55D9182D1CC7BD7A0076CBD9 /* udpclient.cc in Sources */, - 4B3C3E0A1E120D9400351897 /* netinfo_util.cc in Sources */, - 55D9186C1CC7BD7A0076CBD9 /* data_protect_attr.mm in Sources */, - 4B3C3E211E1210A100351897 /* complexconnect.cc in Sources */, - 55D918521CC7BD7A0076CBD9 /* __assert.c in Sources */, - 55D9182C1CC7BD7A0076CBD9 /* tcpserver_fsm.cc in Sources */, - 55D918721CC7BD7A0076CBD9 /* xlogger_threadinfo.mm in Sources */, - 55D9182B1CC7BD7A0076CBD9 /* tcpserver.cc in Sources */, - 55D9182A1CC7BD7A0076CBD9 /* tcpclient_fsm.cc in Sources */, - 55D9186B1CC7BD7A0076CBD9 /* memdbg.cc in Sources */, - 55D918281CC7BD7A0076CBD9 /* socket_address.cc in Sources */, - 55D918541CC7BD7A0076CBD9 /* basepacker.cc in Sources */, - 55D9184F1CC7BD7A0076CBD9 /* xloggerbase.c in Sources */, - 55D918291CC7BD7A0076CBD9 /* tcpclient.cc in Sources */, - 55D918701CC7BD7A0076CBD9 /* scope_autoreleasepool.mm in Sources */, - 55D917841CC7BD7A0076CBD9 /* message_queue.cc in Sources */, - 55D918511CC7BD7A0076CBD9 /* anr.cc in Sources */, - 55D9184B1CC7BD7A0076CBD9 /* getgateway.c in Sources */, - 55D9182E1CC7BD7A0076CBD9 /* udpserver.cc in Sources */, - 55D918711CC7BD7A0076CBD9 /* ThreadOperationQueue.mm in Sources */, - 55D918771CC7BD7A0076CBD9 /* tickcount.cc in Sources */, - 55D918251CC7BD7A0076CBD9 /* block_socket.cc in Sources */, - 55D91ABB1CC7BD7A0076CBD9 /* md5.c in Sources */, - 55D918501CC7BD7A0076CBD9 /* alarm.cc in Sources */, - 55D9186E1CC7BD7A0076CBD9 /* platform_comm.mm in Sources */, - 55D918531CC7BD7A0076CBD9 /* autobuffer.cc in Sources */, - 4BB712531DE8149B00185734 /* socketselect.cc in Sources */, - 55D918791CC7BD7A0076CBD9 /* tinyxml2.cc in Sources */, - 55D9184C1CC7BD7A0076CBD9 /* getifaddrs.cc in Sources */, - 55D918751CC7BD7A0076CBD9 /* strutil.cc in Sources */, - 4BB712F71DE8229A00185734 /* loginfo_extract.c in Sources */, - 55D9185F1CC7BD7A0076CBD9 /* debugger_utils.c in Sources */, - 55D917851CC7BD7A0076CBD9 /* message_queue_utils.cc in Sources */, - 55D918561CC7BD7A0076CBD9 /* coreservice_base.cc in Sources */, - 55D9185D1CC7BD7A0076CBD9 /* ibase64.cc in Sources */, - 55D918741CC7BD7A0076CBD9 /* singleton.cc in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.10; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; - MACOSX_DEPLOYMENT_TARGET = 10.7; - SDKROOT = macosx10.10; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "DEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - "$(PROJECT_DIR)/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/build/Release-iphoneos", - "$(PROJECT_DIR)/build/Release-iphonesimulator", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/PublicComponent.dst; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NETWORK=1", - "KVCOMM=1", - "XLOGGER=1", - "NDEBUG=1", - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/src, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - $SOURCE_ROOT/../comm, - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/comm/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/comm/build/Release-iphoneos", - "$(PROJECT_DIR)/comm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/arm64", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphoneos/netchecker.build/Objects-normal/armv7", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/i386", - "$(PROJECT_DIR)/netchecker/build/netchecker.build/Release-iphonesimulator/netchecker.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/netchecker/build/Release-iphoneos", - "$(PROJECT_DIR)/netchecker/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdntran/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdntran/build/Release-iphoneos", - "$(PROJECT_DIR)/cdntran/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/Release-iphoneos", - "$(PROJECT_DIR)/streamcdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphoneos/streamcdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/streamcdn/build/streamcdn.build/Release-iphonesimulator/streamcdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphoneos/mmjpeg.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmjpeg/build/mmjpeg.build/Release-iphonesimulator/mmjpeg.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphoneos", - "$(PROJECT_DIR)/mmjpeg/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmjpeg/obj/local/armeabi", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/arm64", - "$(PROJECT_DIR)/app/build/app.build/Release-iphoneos/app.build/Objects-normal/armv7", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/app.build/Release-iphonesimulator/app.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/app/build/appcomm.build/Release-iphonesimulator/appcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/app/build/Release-iphoneos", - "$(PROJECT_DIR)/app/build/Release-iphonesimulator", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphoneos/baseevent.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseevent.build/Release-iphonesimulator/baseevent.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/arm64", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphoneos/baseprj.build/Objects-normal/armv7", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/i386", - "$(PROJECT_DIR)/baseevent/build/baseprj.build/Release-iphonesimulator/baseprj.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/baseevent/build/Release-iphoneos", - "$(PROJECT_DIR)/baseevent/build/Release-iphonesimulator", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphoneos/cdn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdn.build/Release-iphonesimulator/cdn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/arm64", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphoneos/cdntran.build/Objects-normal/armv7", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/i386", - "$(PROJECT_DIR)/cdn/build/cdntran.build/Release-iphonesimulator/cdntran.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/cdn/build/Release-iphoneos", - "$(PROJECT_DIR)/cdn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/arm64", - "$(PROJECT_DIR)/log/build/log.build/Release-iphoneos/log.build/Objects-normal/armv7", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/i386", - "$(PROJECT_DIR)/log/build/log.build/Release-iphonesimulator/log.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/log/build/Release-iphoneos", - "$(PROJECT_DIR)/log/build/Release-iphonesimulator", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/arm64", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphoneos/magicbox.build/Objects-normal/armv7", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/i386", - "$(PROJECT_DIR)/magicbox/build/magicbox.build/Release-iphonesimulator/magicbox.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/magicbox/build/Release-iphoneos", - "$(PROJECT_DIR)/magicbox/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphoneos/mmcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/mmcomm/build/mmcomm.build/Release-iphonesimulator/mmcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/mmcomm/build/Release-iphoneos", - "$(PROJECT_DIR)/mmcomm/build/Release-iphonesimulator", - "$(PROJECT_DIR)/mmcomm/obj/local/armeabi", - "$(PROJECT_DIR)/mmjpeg/build/Release", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/arm64", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphoneos/protobuf.build/Objects-normal/armv7", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/i386", - "$(PROJECT_DIR)/protobuf/build/protobuf.build/Release-iphonesimulator/protobuf.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/protobuf/build/Release-iphoneos", - "$(PROJECT_DIR)/protobuf/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/Release-iphoneos", - "$(PROJECT_DIR)/sdt/build/Release-iphonesimulator", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/arm64", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphoneos/sdt.build/Objects-normal/armv7", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/i386", - "$(PROJECT_DIR)/sdt/build/sdt.build/Release-iphonesimulator/sdt.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphoneos/kvcomm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/kvcomm.build/Release-iphonesimulator/kvcomm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/smc/build/Release-iphoneos", - "$(PROJECT_DIR)/smc/build/Release-iphonesimulator", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/arm64", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphoneos/smc.build/Objects-normal/armv7", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/i386", - "$(PROJECT_DIR)/smc/build/smc.build/Release-iphonesimulator/smc.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/stn/build/Release-iphoneos", - "$(PROJECT_DIR)/stn/build/Release-iphonesimulator", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/arm64", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphoneos/stn.build/Objects-normal/armv7", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/i386", - "$(PROJECT_DIR)/stn/build/stn.build/Release-iphonesimulator/stn.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/arm64", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphoneos/openssl.build/Objects-normal/armv7", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/i386", - "$(PROJECT_DIR)/openssl/build/openssl.build/Release-iphonesimulator/openssl.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/openssl/build/Release-iphoneos", - "$(PROJECT_DIR)/openssl/build/Release-iphonesimulator", - "$(PROJECT_DIR)/openssl/obj/local/armeabi", - "$(PROJECT_DIR)/build/comm.build/Release-iphoneos/comm.build/Objects-normal/arm64", - "$(PROJECT_DIR)/build/comm.build/Release-iphoneos/comm.build/Objects-normal/armv7", - "$(PROJECT_DIR)/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/i386", - "$(PROJECT_DIR)/build/comm.build/Release-iphonesimulator/comm.build/Objects-normal/x86_64", - "$(PROJECT_DIR)/build/Release-iphoneos", - "$(PROJECT_DIR)/build/Release-iphonesimulator", - ); - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = macosx; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm-mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/comm/comm-watch.xcodeproj/project.pbxproj b/mars/comm/comm-watch.xcodeproj/project.pbxproj deleted file mode 100644 index 3470c5352..000000000 --- a/mars/comm/comm-watch.xcodeproj/project.pbxproj +++ /dev/null @@ -1,4940 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 13704D7B197E444C00ED4EF8 /* date_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D53197E444C00ED4EF8 /* date_generators.cpp */; }; - 13704D7D197E444C00ED4EF8 /* greg_weekday.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D56197E444C00ED4EF8 /* greg_weekday.cpp */; }; - 13704D7E197E444C00ED4EF8 /* gregorian_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D57197E444C00ED4EF8 /* gregorian_types.cpp */; }; - 13704D7F197E444C00ED4EF8 /* posix_time_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D59197E444C00ED4EF8 /* posix_time_types.cpp */; }; - 13704D86197E444C00ED4EF8 /* sp_collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D66197E444C00ED4EF8 /* sp_collector.cpp */; }; - 13704D87197E444C00ED4EF8 /* sp_debug_hooks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13704D67197E444C00ED4EF8 /* sp_debug_hooks.cpp */; }; - 1392E92B1A834D770093185B /* XorCrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1392E9291A834D770093185B /* XorCrypt.cpp */; }; - 13E9F2FE19754DE6007591EC /* __assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9419754DE1007591EC /* __assert.c */; }; - 13E9F2FF19754DE6007591EC /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9619754DE1007591EC /* adler32.c */; }; - 13E9F30019754DE6007591EC /* alarm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9819754DE1007591EC /* alarm.cpp */; }; - 13E9F30119754DE6007591EC /* Autobuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9A19754DE1007591EC /* Autobuffer.cpp */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F31919754DE6007591EC /* CommFrequencyLimit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F28219754DE5007591EC /* CommFrequencyLimit.cpp */; }; - 13E9F31A19754DE6007591EC /* CoreServiceBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F28719754DE5007591EC /* CoreServiceBase.cpp */; }; - 13E9F32119754DE6007591EC /* crypt.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F29919754DE5007591EC /* crypt.c */; }; - 13E9F32219754DE6007591EC /* iBase64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F29A19754DE5007591EC /* iBase64.cpp */; }; - 13E9F32419754DE6007591EC /* rbdes.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F29E19754DE5007591EC /* rbdes.c */; }; - 13E9F32519754DE6007591EC /* debugger_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A219754DE5007591EC /* debugger_utils.c */; }; - 13E9F32619754DE6007591EC /* test_spy_sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A719754DE5007591EC /* test_spy_sample.cpp */; }; - 13E9F32719754DE6007591EC /* testspy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A919754DE5007591EC /* testspy.cpp */; }; - 13E9F32819754DE6007591EC /* DNS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2AB19754DE5007591EC /* DNS.cpp */; }; - 13E9F32919754DE6007591EC /* http.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2AF19754DE5007591EC /* http.cpp */; }; - 13E9F32A19754DE6007591EC /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B319754DE5007591EC /* md5.c */; }; - 13E9F32B19754DE6007591EC /* memdbg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B519754DE5007591EC /* memdbg.cpp */; }; - 13E9F32C19754DE6007591EC /* MessageQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B819754DE5007591EC /* MessageQueue.cpp */; }; - 13E9F32D19754DE6007591EC /* MessageQueueUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2BA19754DE5007591EC /* MessageQueueUtils.cpp */; }; - 13E9F32E19754DE6007591EC /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2BD19754DE5007591EC /* getgateway.c */; }; - 13E9F32F19754DE6007591EC /* objc_timer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C219754DE5007591EC /* objc_timer.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33019754DE6007591EC /* platform_comm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C319754DE5007591EC /* platform_comm.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33119754DE6007591EC /* Reachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C519754DE5007591EC /* Reachability.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33219754DE6007591EC /* scope_autoreleasepool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33319754DE6007591EC /* ThreadOperationQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33419754DE6007591EC /* xlogger_threadinfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33519754DE6007591EC /* PtrBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CD19754DE5007591EC /* PtrBuffer.cpp */; }; - 13E9F33619754DE6007591EC /* singleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D019754DE5007591EC /* singleton.cpp */; }; - 13E9F33719754DE6007591EC /* ComplexConnect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D319754DE5007591EC /* ComplexConnect.cpp */; }; - 13E9F33819754DE6007591EC /* TcpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D619754DE5007591EC /* TcpClient.cpp */; }; - 13E9F33919754DE6007591EC /* unix_socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D819754DE5007591EC /* unix_socket.c */; }; - 13E9F33A19754DE6007591EC /* strutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2DA19754DE5007591EC /* strutil.cpp */; }; - 13E9F33B19754DE6007591EC /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2E819754DE5007591EC /* tinyxml2.cpp */; }; - 13E9F33C19754DE6007591EC /* SocketSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2EC19754DE6007591EC /* SocketSelect.cpp */; }; - 13E9F33D19754DE6007591EC /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2F519754DE6007591EC /* utils.c */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33E19754DE6007591EC /* xloggerbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2FC19754DE6007591EC /* xloggerbase.c */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; - 425BA5811A14AD0600073A45 /* tickcount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 425BA57F1A14AD0600073A45 /* tickcount.cpp */; }; - 4F516B751A19F3B20006EC9D /* getifaddrs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F516B731A19F3B20006EC9D /* getifaddrs.cpp */; }; - 4FC0D7CF19A3681B00E8CB6E /* TcpClientFSM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FC0D7CD19A3681B00E8CB6E /* TcpClientFSM.cpp */; }; - 4FC0D7D219A4898100E8CB6E /* anr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FC0D7D019A4898100E8CB6E /* anr.cpp */; }; - 4FCB62C71A307EFA00E57EE0 /* TcpServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62C31A307EFA00E57EE0 /* TcpServer.cpp */; }; - 4FCB62C81A307EFA00E57EE0 /* TcpServerFSM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62C51A307EFA00E57EE0 /* TcpServerFSM.cpp */; }; - 4FCB62DB1A30802600E57EE0 /* BasePacker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62D91A30802600E57EE0 /* BasePacker.cpp */; }; - F16A602F1ACD7FEE0085FBDD /* file_descriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F16A602B1ACD7FEE0085FBDD /* file_descriptor.cpp */; }; - F16A60301ACD7FEE0085FBDD /* gzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F16A602C1ACD7FEE0085FBDD /* gzip.cpp */; }; - F16A60311ACD7FEE0085FBDD /* mapped_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F16A602D1ACD7FEE0085FBDD /* mapped_file.cpp */; }; - F16A60321ACD7FEE0085FBDD /* zlib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F16A602E1ACD7FEE0085FBDD /* zlib.cpp */; }; - F1C0DAFD19C862DF0056DE44 /* UdpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F1C0DAF919C862DF0056DE44 /* UdpClient.cpp */; }; - F1C0DAFE19C862DF0056DE44 /* UdpServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F1C0DAFB19C862DF0056DE44 /* UdpServer.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 13704D51197E444C00ED4EF8 /* date_time.doc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = date_time.doc; sourceTree = ""; }; - 13704D53197E444C00ED4EF8 /* date_generators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = date_generators.cpp; sourceTree = ""; }; - 13704D54197E444C00ED4EF8 /* greg_month.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = greg_month.cpp; sourceTree = ""; }; - 13704D55197E444C00ED4EF8 /* greg_names.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greg_names.hpp; sourceTree = ""; }; - 13704D56197E444C00ED4EF8 /* greg_weekday.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = greg_weekday.cpp; sourceTree = ""; }; - 13704D57197E444C00ED4EF8 /* gregorian_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gregorian_types.cpp; sourceTree = ""; }; - 13704D59197E444C00ED4EF8 /* posix_time_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = posix_time_types.cpp; sourceTree = ""; }; - 13704D66197E444C00ED4EF8 /* sp_collector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sp_collector.cpp; sourceTree = ""; }; - 13704D67197E444C00ED4EF8 /* sp_debug_hooks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sp_debug_hooks.cpp; sourceTree = ""; }; - 1392E9291A834D770093185B /* XorCrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XorCrypt.cpp; sourceTree = ""; }; - 1392E92A1A834D770093185B /* XorCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XorCrypt.h; sourceTree = ""; }; - 13E9EA9419754DE1007591EC /* __assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = __assert.c; sourceTree = ""; }; - 13E9EA9519754DE1007591EC /* __assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = __assert.h; sourceTree = ""; }; - 13E9EA9619754DE1007591EC /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = ""; }; - 13E9EA9719754DE1007591EC /* adler32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adler32.h; sourceTree = ""; }; - 13E9EA9819754DE1007591EC /* alarm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alarm.cpp; sourceTree = ""; }; - 13E9EA9919754DE1007591EC /* alarm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alarm.h; sourceTree = ""; }; - 13E9EA9A19754DE1007591EC /* Autobuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autobuffer.cpp; sourceTree = ""; }; - 13E9EA9B19754DE1007591EC /* Autobuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Autobuffer.h; sourceTree = ""; }; - 13E9EA9D19754DE1007591EC /* aligned_storage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = aligned_storage.hpp; sourceTree = ""; }; - 13E9EA9E19754DE1007591EC /* any.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = any.hpp; sourceTree = ""; }; - 13E9EAA019754DE1007591EC /* assert.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = assert.hpp; sourceTree = ""; }; - 13E9EABA19754DE1007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EABB19754DE1007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EABC19754DE1007591EC /* bind_cc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_cc.hpp; sourceTree = ""; }; - 13E9EABD19754DE1007591EC /* bind_mf2_cc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_mf2_cc.hpp; sourceTree = ""; }; - 13E9EABE19754DE1007591EC /* bind_mf_cc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_mf_cc.hpp; sourceTree = ""; }; - 13E9EABF19754DE1007591EC /* bind_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_template.hpp; sourceTree = ""; }; - 13E9EAC019754DE1007591EC /* mem_fn.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_fn.hpp; sourceTree = ""; }; - 13E9EAC119754DE1007591EC /* mem_fn_cc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_fn_cc.hpp; sourceTree = ""; }; - 13E9EAC219754DE1007591EC /* mem_fn_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_fn_template.hpp; sourceTree = ""; }; - 13E9EAC319754DE1007591EC /* mem_fn_vw.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_fn_vw.hpp; sourceTree = ""; }; - 13E9EAC419754DE1007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EAC519754DE1007591EC /* storage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = storage.hpp; sourceTree = ""; }; - 13E9EAC619754DE1007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EACA19754DE1007591EC /* checked_delete.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = checked_delete.hpp; sourceTree = ""; }; - 13E9EAED19754DE1007591EC /* borland_prefix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = borland_prefix.hpp; sourceTree = ""; }; - 13E9EAEE19754DE1007591EC /* borland_suffix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = borland_suffix.hpp; sourceTree = ""; }; - 13E9EAEF19754DE1007591EC /* msvc_prefix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_prefix.hpp; sourceTree = ""; }; - 13E9EAF019754DE1007591EC /* msvc_suffix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_suffix.hpp; sourceTree = ""; }; - 13E9EAF119754DE1007591EC /* abi_prefix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = abi_prefix.hpp; sourceTree = ""; }; - 13E9EAF219754DE1007591EC /* abi_suffix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = abi_suffix.hpp; sourceTree = ""; }; - 13E9EAF319754DE1007591EC /* auto_link.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = auto_link.hpp; sourceTree = ""; }; - 13E9EAF519754DE1007591EC /* borland.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = borland.hpp; sourceTree = ""; }; - 13E9EAF619754DE1007591EC /* clang.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clang.hpp; sourceTree = ""; }; - 13E9EAF719754DE1007591EC /* codegear.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = codegear.hpp; sourceTree = ""; }; - 13E9EAF819754DE1007591EC /* comeau.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comeau.hpp; sourceTree = ""; }; - 13E9EAF919754DE1007591EC /* common_edg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common_edg.hpp; sourceTree = ""; }; - 13E9EAFA19754DE1007591EC /* compaq_cxx.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compaq_cxx.hpp; sourceTree = ""; }; - 13E9EAFB19754DE1007591EC /* cray.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cray.hpp; sourceTree = ""; }; - 13E9EAFC19754DE1007591EC /* digitalmars.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = digitalmars.hpp; sourceTree = ""; }; - 13E9EAFD19754DE1007591EC /* gcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gcc.hpp; sourceTree = ""; }; - 13E9EAFE19754DE1007591EC /* gcc_xml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gcc_xml.hpp; sourceTree = ""; }; - 13E9EAFF19754DE1007591EC /* greenhills.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greenhills.hpp; sourceTree = ""; }; - 13E9EB0019754DE1007591EC /* hp_acc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = hp_acc.hpp; sourceTree = ""; }; - 13E9EB0119754DE1007591EC /* intel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intel.hpp; sourceTree = ""; }; - 13E9EB0219754DE1007591EC /* kai.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = kai.hpp; sourceTree = ""; }; - 13E9EB0319754DE1007591EC /* metrowerks.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = metrowerks.hpp; sourceTree = ""; }; - 13E9EB0419754DE1007591EC /* mpw.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mpw.hpp; sourceTree = ""; }; - 13E9EB0519754DE1007591EC /* nvcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nvcc.hpp; sourceTree = ""; }; - 13E9EB0619754DE1007591EC /* pathscale.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pathscale.hpp; sourceTree = ""; }; - 13E9EB0719754DE1007591EC /* pgi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pgi.hpp; sourceTree = ""; }; - 13E9EB0819754DE1007591EC /* sgi_mipspro.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sgi_mipspro.hpp; sourceTree = ""; }; - 13E9EB0919754DE1007591EC /* sunpro_cc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sunpro_cc.hpp; sourceTree = ""; }; - 13E9EB0A19754DE1007591EC /* vacpp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vacpp.hpp; sourceTree = ""; }; - 13E9EB0B19754DE1007591EC /* visualc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = visualc.hpp; sourceTree = ""; }; - 13E9EB0D19754DE1007591EC /* cmath.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cmath.hpp; sourceTree = ""; }; - 13E9EB0E19754DE1007591EC /* complex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = complex.hpp; sourceTree = ""; }; - 13E9EB0F19754DE1007591EC /* functional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = functional.hpp; sourceTree = ""; }; - 13E9EB1019754DE1007591EC /* memory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = memory.hpp; sourceTree = ""; }; - 13E9EB1119754DE1007591EC /* utility.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utility.hpp; sourceTree = ""; }; - 13E9EB1319754DE1007591EC /* aix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = aix.hpp; sourceTree = ""; }; - 13E9EB1419754DE1007591EC /* amigaos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = amigaos.hpp; sourceTree = ""; }; - 13E9EB1519754DE1007591EC /* beos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = beos.hpp; sourceTree = ""; }; - 13E9EB1619754DE1007591EC /* bsd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bsd.hpp; sourceTree = ""; }; - 13E9EB1719754DE1007591EC /* cray.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cray.hpp; sourceTree = ""; }; - 13E9EB1819754DE1007591EC /* cygwin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cygwin.hpp; sourceTree = ""; }; - 13E9EB1919754DE1007591EC /* hpux.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = hpux.hpp; sourceTree = ""; }; - 13E9EB1A19754DE1007591EC /* irix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = irix.hpp; sourceTree = ""; }; - 13E9EB1B19754DE1007591EC /* linux.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = linux.hpp; sourceTree = ""; }; - 13E9EB1C19754DE1007591EC /* macos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = macos.hpp; sourceTree = ""; }; - 13E9EB1D19754DE1007591EC /* qnxnto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = qnxnto.hpp; sourceTree = ""; }; - 13E9EB1E19754DE1007591EC /* solaris.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = solaris.hpp; sourceTree = ""; }; - 13E9EB1F19754DE1007591EC /* symbian.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = symbian.hpp; sourceTree = ""; }; - 13E9EB2019754DE1007591EC /* vms.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vms.hpp; sourceTree = ""; }; - 13E9EB2119754DE1007591EC /* vxworks.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vxworks.hpp; sourceTree = ""; }; - 13E9EB2219754DE1007591EC /* win32.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = win32.hpp; sourceTree = ""; }; - 13E9EB2319754DE1007591EC /* posix_features.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = posix_features.hpp; sourceTree = ""; }; - 13E9EB2419754DE1007591EC /* requires_threads.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = requires_threads.hpp; sourceTree = ""; }; - 13E9EB2519754DE1007591EC /* select_compiler_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = select_compiler_config.hpp; sourceTree = ""; }; - 13E9EB2619754DE1007591EC /* select_platform_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = select_platform_config.hpp; sourceTree = ""; }; - 13E9EB2719754DE1007591EC /* select_stdlib_config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = select_stdlib_config.hpp; sourceTree = ""; }; - 13E9EB2919754DE1007591EC /* dinkumware.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dinkumware.hpp; sourceTree = ""; }; - 13E9EB2A19754DE1007591EC /* libcomo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libcomo.hpp; sourceTree = ""; }; - 13E9EB2B19754DE1007591EC /* libcpp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libcpp.hpp; sourceTree = ""; }; - 13E9EB2C19754DE1007591EC /* libstdcpp3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = libstdcpp3.hpp; sourceTree = ""; }; - 13E9EB2D19754DE1007591EC /* modena.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modena.hpp; sourceTree = ""; }; - 13E9EB2E19754DE1007591EC /* msl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msl.hpp; sourceTree = ""; }; - 13E9EB2F19754DE1007591EC /* roguewave.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = roguewave.hpp; sourceTree = ""; }; - 13E9EB3019754DE1007591EC /* sgi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sgi.hpp; sourceTree = ""; }; - 13E9EB3119754DE1007591EC /* stlport.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stlport.hpp; sourceTree = ""; }; - 13E9EB3219754DE1007591EC /* vacpp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vacpp.hpp; sourceTree = ""; }; - 13E9EB3319754DE1007591EC /* suffix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = suffix.hpp; sourceTree = ""; }; - 13E9EB3419754DE1007591EC /* user.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = user.hpp; sourceTree = ""; }; - 13E9EB3519754DE1007591EC /* warning_disable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = warning_disable.hpp; sourceTree = ""; }; - 13E9EB3619754DE1007591EC /* config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config.hpp; sourceTree = ""; }; - 13E9EB4619754DE1007591EC /* cstdint.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cstdint.hpp; sourceTree = ""; }; - 13E9EB4719754DE1007591EC /* current_function.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = current_function.hpp; sourceTree = ""; }; - 13E9EB8A19754DE1007591EC /* atomic_count.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count.hpp; sourceTree = ""; }; - 13E9EB8B19754DE1007591EC /* atomic_redef_macros.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_redef_macros.hpp; sourceTree = ""; }; - 13E9EB8C19754DE1007591EC /* atomic_undef_macros.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_undef_macros.hpp; sourceTree = ""; }; - 13E9EB8D19754DE1007591EC /* call_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = call_traits.hpp; sourceTree = ""; }; - 13E9EB8E19754DE1007591EC /* container_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = container_fwd.hpp; sourceTree = ""; }; - 13E9EB8F19754DE1007591EC /* endian.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = endian.hpp; sourceTree = ""; }; - 13E9EB9019754DE1007591EC /* fenv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fenv.hpp; sourceTree = ""; }; - 13E9EB9119754DE1007591EC /* indirect_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = indirect_traits.hpp; sourceTree = ""; }; - 13E9EB9219754DE1007591EC /* interlocked.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interlocked.hpp; sourceTree = ""; }; - 13E9EB9319754DE1007591EC /* is_function_ref_tester.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_function_ref_tester.hpp; sourceTree = ""; }; - 13E9EB9419754DE1007591EC /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - 13E9EB9519754DE1007591EC /* lcast_precision.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lcast_precision.hpp; sourceTree = ""; }; - 13E9EB9619754DE1007591EC /* lightweight_mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lightweight_mutex.hpp; sourceTree = ""; }; - 13E9EB9719754DE1007591EC /* lightweight_test.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lightweight_test.hpp; sourceTree = ""; }; - 13E9EB9819754DE1007591EC /* lightweight_thread.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lightweight_thread.hpp; sourceTree = ""; }; - 13E9EB9919754DE1007591EC /* no_exceptions_support.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = no_exceptions_support.hpp; sourceTree = ""; }; - 13E9EB9A19754DE1007591EC /* ob_call_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ob_call_traits.hpp; sourceTree = ""; }; - 13E9EB9B19754DE1007591EC /* quick_allocator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quick_allocator.hpp; sourceTree = ""; }; - 13E9EB9C19754DE1007591EC /* reference_content.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reference_content.hpp; sourceTree = ""; }; - 13E9EB9D19754DE1007591EC /* scoped_enum_emulation.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scoped_enum_emulation.hpp; sourceTree = ""; }; - 13E9EB9E19754DE1007591EC /* sp_typeinfo.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_typeinfo.hpp; sourceTree = ""; }; - 13E9EBA019754DE1007591EC /* basic_types.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_types.hpp; sourceTree = ""; }; - 13E9EBA119754DE1007591EC /* GetLastError.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = GetLastError.hpp; sourceTree = ""; }; - 13E9EBA219754DE1007591EC /* time.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = time.hpp; sourceTree = ""; }; - 13E9EBA319754DE1007591EC /* timers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = timers.hpp; sourceTree = ""; }; - 13E9EBA419754DE1007591EC /* workaround.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = workaround.hpp; sourceTree = ""; }; - 13E9EBA519754DE1007591EC /* enable_shared_from_this.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_shared_from_this.hpp; sourceTree = ""; }; - 13E9EBA719754DE1007591EC /* current_exception_cast.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = current_exception_cast.hpp; sourceTree = ""; }; - 13E9EBA919754DE1007591EC /* attribute_noreturn.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = attribute_noreturn.hpp; sourceTree = ""; }; - 13E9EBAA19754DE1007591EC /* clone_current_exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clone_current_exception.hpp; sourceTree = ""; }; - 13E9EBAB19754DE1007591EC /* error_info_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = error_info_impl.hpp; sourceTree = ""; }; - 13E9EBAC19754DE1007591EC /* exception_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = exception_ptr.hpp; sourceTree = ""; }; - 13E9EBAD19754DE1007591EC /* is_output_streamable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_output_streamable.hpp; sourceTree = ""; }; - 13E9EBAE19754DE1007591EC /* object_hex_dump.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = object_hex_dump.hpp; sourceTree = ""; }; - 13E9EBAF19754DE1007591EC /* type_info.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_info.hpp; sourceTree = ""; }; - 13E9EBB019754DE1007591EC /* diagnostic_information.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = diagnostic_information.hpp; sourceTree = ""; }; - 13E9EBB119754DE1007591EC /* exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = exception.hpp; sourceTree = ""; }; - 13E9EBB219754DE1007591EC /* get_error_info.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = get_error_info.hpp; sourceTree = ""; }; - 13E9EBB319754DE1007591EC /* info.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = info.hpp; sourceTree = ""; }; - 13E9EBB419754DE1007591EC /* to_string.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = to_string.hpp; sourceTree = ""; }; - 13E9EBB519754DE1007591EC /* to_string_stub.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = to_string_stub.hpp; sourceTree = ""; }; - 13E9EBB919754DE1007591EC /* function_iterate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_iterate.hpp; sourceTree = ""; }; - 13E9EBBA19754DE1007591EC /* gen_maybe_include.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = gen_maybe_include.pl; sourceTree = ""; }; - 13E9EBBB19754DE1007591EC /* maybe_include.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = maybe_include.hpp; sourceTree = ""; }; - 13E9EBBC19754DE1007591EC /* prologue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = prologue.hpp; sourceTree = ""; }; - 13E9EBBD19754DE1007591EC /* function0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function0.hpp; sourceTree = ""; }; - 13E9EBBE19754DE1007591EC /* function1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function1.hpp; sourceTree = ""; }; - 13E9EBBF19754DE1007591EC /* function10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function10.hpp; sourceTree = ""; }; - 13E9EBC019754DE1007591EC /* function2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function2.hpp; sourceTree = ""; }; - 13E9EBC119754DE1007591EC /* function3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function3.hpp; sourceTree = ""; }; - 13E9EBC219754DE1007591EC /* function4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function4.hpp; sourceTree = ""; }; - 13E9EBC319754DE1007591EC /* function5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function5.hpp; sourceTree = ""; }; - 13E9EBC419754DE1007591EC /* function6.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function6.hpp; sourceTree = ""; }; - 13E9EBC519754DE1007591EC /* function7.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function7.hpp; sourceTree = ""; }; - 13E9EBC619754DE1007591EC /* function8.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function8.hpp; sourceTree = ""; }; - 13E9EBC719754DE1007591EC /* function9.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function9.hpp; sourceTree = ""; }; - 13E9EBC819754DE1007591EC /* function_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_base.hpp; sourceTree = ""; }; - 13E9EBC919754DE1007591EC /* function_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_fwd.hpp; sourceTree = ""; }; - 13E9EBCA19754DE1007591EC /* function_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_template.hpp; sourceTree = ""; }; - 13E9EBCB19754DE1007591EC /* function_typeof.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_typeof.hpp; sourceTree = ""; }; - 13E9EBCC19754DE1007591EC /* gen_function_N.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = gen_function_N.pl; sourceTree = ""; }; - 13E9EBCD19754DE1007591EC /* function.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function.hpp; sourceTree = ""; }; - 13E9EBCE19754DE1007591EC /* function_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_equal.hpp; sourceTree = ""; }; - 13E9EBDA19754DE2007591EC /* get_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = get_pointer.hpp; sourceTree = ""; }; - 13E9EBDF19754DE2007591EC /* integer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integer.hpp; sourceTree = ""; }; - 13E9EBE019754DE2007591EC /* integer_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integer_fwd.hpp; sourceTree = ""; }; - 13E9EBE119754DE2007591EC /* integer_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integer_traits.hpp; sourceTree = ""; }; - 13E9EBEC19754DE2007591EC /* intrusive_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intrusive_ptr.hpp; sourceTree = ""; }; - 13E9EBF019754DE2007591EC /* is_placeholder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_placeholder.hpp; sourceTree = ""; }; - 13E9EBF319754DE2007591EC /* config_def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config_def.hpp; sourceTree = ""; }; - 13E9EBF419754DE2007591EC /* config_undef.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config_undef.hpp; sourceTree = ""; }; - 13E9EBF519754DE2007591EC /* enable_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_if.hpp; sourceTree = ""; }; - 13E9EBF619754DE2007591EC /* facade_iterator_category.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = facade_iterator_category.hpp; sourceTree = ""; }; - 13E9EBF719754DE2007591EC /* minimum_category.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minimum_category.hpp; sourceTree = ""; }; - 13E9EBF819754DE2007591EC /* interoperable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interoperable.hpp; sourceTree = ""; }; - 13E9EBF919754DE2007591EC /* iterator_adaptor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_adaptor.hpp; sourceTree = ""; }; - 13E9EBFA19754DE2007591EC /* iterator_categories.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_categories.hpp; sourceTree = ""; }; - 13E9EBFB19754DE2007591EC /* iterator_concepts.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_concepts.hpp; sourceTree = ""; }; - 13E9EBFC19754DE2007591EC /* iterator_facade.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_facade.hpp; sourceTree = ""; }; - 13E9EBFD19754DE2007591EC /* iterator_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_traits.hpp; sourceTree = ""; }; - 13E9EBFE19754DE2007591EC /* reverse_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iterator.hpp; sourceTree = ""; }; - 13E9EBFF19754DE2007591EC /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - 13E9EC0019754DE2007591EC /* last_value.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = last_value.hpp; sourceTree = ""; }; - 13E9EC0119754DE2007591EC /* lexical_cast.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lexical_cast.hpp; sourceTree = ""; }; - 13E9EC3119754DE2007591EC /* limits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = limits.hpp; sourceTree = ""; }; - 13E9EC3219754DE2007591EC /* make_shared.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_shared.hpp; sourceTree = ""; }; - 13E9EC4419754DE2007591EC /* mem_fn.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mem_fn.hpp; sourceTree = ""; }; - 13E9EC4519754DE2007591EC /* memory_order.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = memory_order.hpp; sourceTree = ""; }; - 13E9EC5219754DE2007591EC /* advance.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance.hpp; sourceTree = ""; }; - 13E9EC5319754DE2007591EC /* advance_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_fwd.hpp; sourceTree = ""; }; - 13E9EC5419754DE2007591EC /* always.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = always.hpp; sourceTree = ""; }; - 13E9EC5519754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EC5619754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EC5719754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EC5819754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EC5919754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EC5A19754DE2007591EC /* arg_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg_fwd.hpp; sourceTree = ""; }; - 13E9EC5B19754DE2007591EC /* assert.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = assert.hpp; sourceTree = ""; }; - 13E9EC5C19754DE2007591EC /* at.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = at.hpp; sourceTree = ""; }; - 13E9EC5D19754DE2007591EC /* at_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = at_fwd.hpp; sourceTree = ""; }; - 13E9EC5F19754DE2007591EC /* adl_barrier.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = adl_barrier.hpp; sourceTree = ""; }; - 13E9EC6019754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EC6119754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EC6219754DE2007591EC /* arg_typedef.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg_typedef.hpp; sourceTree = ""; }; - 13E9EC6319754DE2007591EC /* arithmetic_op.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arithmetic_op.hpp; sourceTree = ""; }; - 13E9EC6419754DE2007591EC /* arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arity.hpp; sourceTree = ""; }; - 13E9EC6519754DE2007591EC /* arity_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arity_spec.hpp; sourceTree = ""; }; - 13E9EC6619754DE2007591EC /* at_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = at_impl.hpp; sourceTree = ""; }; - 13E9EC6719754DE2007591EC /* begin_end_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin_end_impl.hpp; sourceTree = ""; }; - 13E9EC6819754DE2007591EC /* clear_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clear_impl.hpp; sourceTree = ""; }; - 13E9EC6919754DE2007591EC /* common_name_wknd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common_name_wknd.hpp; sourceTree = ""; }; - 13E9EC6A19754DE2007591EC /* comparison_op.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comparison_op.hpp; sourceTree = ""; }; - 13E9EC6C19754DE2007591EC /* adl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = adl.hpp; sourceTree = ""; }; - 13E9EC6D19754DE2007591EC /* arrays.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arrays.hpp; sourceTree = ""; }; - 13E9EC6E19754DE2007591EC /* bcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bcc.hpp; sourceTree = ""; }; - 13E9EC6F19754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EC7019754DE2007591EC /* compiler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compiler.hpp; sourceTree = ""; }; - 13E9EC7119754DE2007591EC /* ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ctps.hpp; sourceTree = ""; }; - 13E9EC7219754DE2007591EC /* dependent_nttp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dependent_nttp.hpp; sourceTree = ""; }; - 13E9EC7319754DE2007591EC /* dmc_ambiguous_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dmc_ambiguous_ctps.hpp; sourceTree = ""; }; - 13E9EC7419754DE2007591EC /* dtp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dtp.hpp; sourceTree = ""; }; - 13E9EC7519754DE2007591EC /* eti.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = eti.hpp; sourceTree = ""; }; - 13E9EC7619754DE2007591EC /* forwarding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forwarding.hpp; sourceTree = ""; }; - 13E9EC7719754DE2007591EC /* gcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gcc.hpp; sourceTree = ""; }; - 13E9EC7819754DE2007591EC /* has_apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_apply.hpp; sourceTree = ""; }; - 13E9EC7919754DE2007591EC /* has_xxx.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_xxx.hpp; sourceTree = ""; }; - 13E9EC7A19754DE2007591EC /* integral.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral.hpp; sourceTree = ""; }; - 13E9EC7B19754DE2007591EC /* intel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intel.hpp; sourceTree = ""; }; - 13E9EC7C19754DE2007591EC /* lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda.hpp; sourceTree = ""; }; - 13E9EC7D19754DE2007591EC /* msvc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc.hpp; sourceTree = ""; }; - 13E9EC7E19754DE2007591EC /* msvc_typename.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_typename.hpp; sourceTree = ""; }; - 13E9EC7F19754DE2007591EC /* nttp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nttp.hpp; sourceTree = ""; }; - 13E9EC8019754DE2007591EC /* overload_resolution.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = overload_resolution.hpp; sourceTree = ""; }; - 13E9EC8119754DE2007591EC /* pp_counter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pp_counter.hpp; sourceTree = ""; }; - 13E9EC8219754DE2007591EC /* preprocessor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preprocessor.hpp; sourceTree = ""; }; - 13E9EC8319754DE2007591EC /* static_constant.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = static_constant.hpp; sourceTree = ""; }; - 13E9EC8419754DE2007591EC /* ttp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ttp.hpp; sourceTree = ""; }; - 13E9EC8519754DE2007591EC /* typeof.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof.hpp; sourceTree = ""; }; - 13E9EC8619754DE2007591EC /* use_preprocessed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = use_preprocessed.hpp; sourceTree = ""; }; - 13E9EC8719754DE2007591EC /* workaround.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = workaround.hpp; sourceTree = ""; }; - 13E9EC8819754DE2007591EC /* contains_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = contains_impl.hpp; sourceTree = ""; }; - 13E9EC8919754DE2007591EC /* count_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = count_args.hpp; sourceTree = ""; }; - 13E9EC8A19754DE2007591EC /* find_if_pred.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = find_if_pred.hpp; sourceTree = ""; }; - 13E9EC8B19754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EC8C19754DE2007591EC /* fold_impl_body.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl_body.hpp; sourceTree = ""; }; - 13E9EC8D19754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EC8E19754DE2007591EC /* has_apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_apply.hpp; sourceTree = ""; }; - 13E9EC8F19754DE2007591EC /* has_begin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_begin.hpp; sourceTree = ""; }; - 13E9EC9019754DE2007591EC /* has_rebind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_rebind.hpp; sourceTree = ""; }; - 13E9EC9119754DE2007591EC /* has_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_size.hpp; sourceTree = ""; }; - 13E9EC9219754DE2007591EC /* has_tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_tag.hpp; sourceTree = ""; }; - 13E9EC9319754DE2007591EC /* has_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_type.hpp; sourceTree = ""; }; - 13E9EC9419754DE2007591EC /* include_preprocessed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = include_preprocessed.hpp; sourceTree = ""; }; - 13E9EC9519754DE2007591EC /* inserter_algorithm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inserter_algorithm.hpp; sourceTree = ""; }; - 13E9EC9619754DE2007591EC /* integral_wrapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_wrapper.hpp; sourceTree = ""; }; - 13E9EC9719754DE2007591EC /* is_msvc_eti_arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_msvc_eti_arg.hpp; sourceTree = ""; }; - 13E9EC9819754DE2007591EC /* iter_apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_apply.hpp; sourceTree = ""; }; - 13E9EC9919754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EC9A19754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EC9B19754DE2007591EC /* lambda_arity_param.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_arity_param.hpp; sourceTree = ""; }; - 13E9EC9C19754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EC9D19754DE2007591EC /* lambda_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_spec.hpp; sourceTree = ""; }; - 13E9EC9E19754DE2007591EC /* lambda_support.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_support.hpp; sourceTree = ""; }; - 13E9EC9F19754DE2007591EC /* largest_int.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = largest_int.hpp; sourceTree = ""; }; - 13E9ECA019754DE2007591EC /* logical_op.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = logical_op.hpp; sourceTree = ""; }; - 13E9ECA119754DE2007591EC /* msvc_dtw.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_dtw.hpp; sourceTree = ""; }; - 13E9ECA219754DE2007591EC /* msvc_eti_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_eti_base.hpp; sourceTree = ""; }; - 13E9ECA319754DE2007591EC /* msvc_is_class.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_is_class.hpp; sourceTree = ""; }; - 13E9ECA419754DE2007591EC /* msvc_never_true.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_never_true.hpp; sourceTree = ""; }; - 13E9ECA519754DE2007591EC /* msvc_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = msvc_type.hpp; sourceTree = ""; }; - 13E9ECA619754DE2007591EC /* na.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = na.hpp; sourceTree = ""; }; - 13E9ECA719754DE2007591EC /* na_assert.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = na_assert.hpp; sourceTree = ""; }; - 13E9ECA819754DE2007591EC /* na_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = na_fwd.hpp; sourceTree = ""; }; - 13E9ECA919754DE2007591EC /* na_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = na_spec.hpp; sourceTree = ""; }; - 13E9ECAA19754DE2007591EC /* nested_type_wknd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nested_type_wknd.hpp; sourceTree = ""; }; - 13E9ECAB19754DE2007591EC /* nttp_decl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = nttp_decl.hpp; sourceTree = ""; }; - 13E9ECAC19754DE2007591EC /* numeric_cast_utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numeric_cast_utils.hpp; sourceTree = ""; }; - 13E9ECAD19754DE2007591EC /* numeric_op.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numeric_op.hpp; sourceTree = ""; }; - 13E9ECAE19754DE2007591EC /* O1_size_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = O1_size_impl.hpp; sourceTree = ""; }; - 13E9ECB119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9ECB219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9ECB319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9ECB419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9ECB519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9ECB619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9ECB719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9ECB819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9ECB919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9ECBA19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9ECBB19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9ECBC19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9ECBD19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9ECBE19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9ECBF19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9ECC019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9ECC119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9ECC219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9ECC319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9ECC419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9ECC519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9ECC619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9ECC719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ECC819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9ECC919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9ECCA19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9ECCB19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9ECCC19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9ECCD19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9ECCE19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9ECCF19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9ECD019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9ECD119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9ECD219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9ECD319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9ECD419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9ECD519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9ECD619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ECD719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9ECD819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9ECD919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9ECDA19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9ECDB19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9ECDC19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9ECDD19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9ECDE19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9ECDF19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9ECE119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9ECE219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9ECE319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9ECE419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9ECE519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9ECE619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9ECE719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9ECE819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9ECE919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9ECEA19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9ECEB19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9ECEC19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9ECED19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9ECEE19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9ECEF19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9ECF019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9ECF119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9ECF219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9ECF319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9ECF419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9ECF519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9ECF619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9ECF719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ECF819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9ECF919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9ECFA19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9ECFB19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9ECFC19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9ECFD19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9ECFE19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9ECFF19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9ED0019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9ED0119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9ED0219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9ED0319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9ED0419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9ED0519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9ED0619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED0719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9ED0819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9ED0919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9ED0A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9ED0B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9ED0C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9ED0D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9ED0E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9ED0F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9ED1119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9ED1219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9ED1319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9ED1419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9ED1519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9ED1619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9ED1719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9ED1819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9ED1919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9ED1A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9ED1B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9ED1C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9ED1D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9ED1E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9ED1F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9ED2019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9ED2119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9ED2219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9ED2319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9ED2419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9ED2519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9ED2619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9ED2719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED2819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9ED2919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9ED2A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9ED2B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9ED2C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9ED2D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9ED2E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9ED2F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9ED3019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9ED3119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9ED3219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9ED3319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9ED3419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9ED3519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9ED3619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED3719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9ED3819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9ED3919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9ED3A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9ED3B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9ED3C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9ED3D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9ED3E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9ED3F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9ED4119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9ED4219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9ED4319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9ED4419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9ED4519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9ED4619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9ED4719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9ED4819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9ED4919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9ED4A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9ED4B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9ED4C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9ED4D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9ED4E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9ED4F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9ED5019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9ED5119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9ED5219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9ED5319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9ED5419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9ED5519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9ED5619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9ED5719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED5819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9ED5919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9ED5A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9ED5B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9ED5C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9ED5D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9ED5E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9ED5F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9ED6019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9ED6119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9ED6219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9ED6319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9ED6419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9ED6519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9ED6619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED6719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9ED6819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9ED6919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9ED6A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9ED6B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9ED6C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9ED6D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9ED6E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9ED6F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9ED7119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9ED7219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9ED7319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9ED7419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9ED7519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9ED7619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9ED7719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9ED7819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9ED7919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9ED7A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9ED7B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9ED7C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9ED7D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9ED7E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9ED7F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9ED8019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9ED8119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9ED8219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9ED8319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9ED8419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9ED8519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9ED8619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9ED8719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED8819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9ED8919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9ED8A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9ED8B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9ED8C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9ED8D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9ED8E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9ED8F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9ED9019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9ED9119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9ED9219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9ED9319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9ED9419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9ED9519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9ED9619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9ED9719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9ED9819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9ED9919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9ED9A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9ED9B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9ED9C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9ED9D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9ED9E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9ED9F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EDA119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EDA219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EDA319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EDA419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EDA519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EDA619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EDA719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EDA819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EDA919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EDAA19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EDAB19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EDAC19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EDAD19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EDAE19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EDAF19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EDB019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EDB119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EDB219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EDB319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EDB419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EDB519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EDB619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EDB719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EDB819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EDB919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EDBA19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EDBB19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EDBC19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EDBD19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EDBE19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EDBF19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EDC019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EDC119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EDC219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EDC319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EDC419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EDC519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EDC619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EDC719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EDC819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EDC919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EDCA19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EDCB19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EDCC19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EDCD19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EDCE19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EDCF19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EDD119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EDD219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EDD319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EDD419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EDD519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EDD619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EDD719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EDD819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EDD919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EDDA19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EDDB19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EDDC19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EDDD19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EDDE19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EDDF19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EDE019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EDE119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EDE219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EDE319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EDE419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EDE519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EDE619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EDE719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EDE819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EDE919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EDEA19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EDEB19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EDEC19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EDED19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EDEE19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EDEF19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EDF019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EDF119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EDF219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EDF319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EDF419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EDF519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EDF619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EDF719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EDF819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EDF919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EDFA19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EDFB19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EDFC19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EDFD19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EDFE19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EDFF19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EE0119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EE0219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EE0319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EE0419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EE0519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EE0619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EE0719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EE0819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EE0919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EE0A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EE0B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EE0C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EE0D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EE0E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EE0F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EE1019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EE1119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EE1219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EE1319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EE1419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EE1519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EE1619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EE1719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE1819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EE1919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EE1A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EE1B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EE1C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EE1D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EE1E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EE1F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EE2019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EE2119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EE2219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EE2319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EE2419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EE2519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EE2619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE2719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EE2819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EE2919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EE2A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EE2B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EE2C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EE2D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EE2E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EE2F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EE3119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EE3219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EE3319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EE3419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EE3519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EE3619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EE3719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EE3819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EE3919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EE3A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EE3B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EE3C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EE3D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EE3E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EE3F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EE4019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EE4119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EE4219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EE4319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EE4419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EE4519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EE4619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EE4719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE4819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EE4919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EE4A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EE4B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EE4C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EE4D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EE4E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EE4F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EE5019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EE5119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EE5219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EE5319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EE5419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EE5519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EE5619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE5719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EE5819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EE5919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EE5A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EE5B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EE5C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EE5D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EE5E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EE5F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EE6119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EE6219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EE6319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EE6419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EE6519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EE6619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EE6719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EE6819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EE6919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EE6A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EE6B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EE6C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EE6D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EE6E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EE6F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EE7019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EE7119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EE7219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EE7319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EE7419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EE7519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EE7619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EE7719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE7819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EE7919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EE7A19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EE7B19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EE7C19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EE7D19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EE7E19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EE7F19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EE8019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EE8119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EE8219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EE8319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EE8419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EE8519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EE8619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EE8719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EE8819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EE8919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EE8A19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EE8B19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EE8C19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EE8D19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EE8E19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EE8F19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EE9119754DE2007591EC /* advance_backward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_backward.hpp; sourceTree = ""; }; - 13E9EE9219754DE2007591EC /* advance_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = advance_forward.hpp; sourceTree = ""; }; - 13E9EE9319754DE2007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9EE9419754DE2007591EC /* apply.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply.hpp; sourceTree = ""; }; - 13E9EE9519754DE2007591EC /* apply_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_fwd.hpp; sourceTree = ""; }; - 13E9EE9619754DE2007591EC /* apply_wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = apply_wrap.hpp; sourceTree = ""; }; - 13E9EE9719754DE2007591EC /* arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arg.hpp; sourceTree = ""; }; - 13E9EE9819754DE2007591EC /* basic_bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = basic_bind.hpp; sourceTree = ""; }; - 13E9EE9919754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EE9A19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EE9B19754DE2007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9EE9C19754DE2007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9EE9D19754DE2007591EC /* bitxor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitxor.hpp; sourceTree = ""; }; - 13E9EE9E19754DE2007591EC /* deque.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deque.hpp; sourceTree = ""; }; - 13E9EE9F19754DE2007591EC /* divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = divides.hpp; sourceTree = ""; }; - 13E9EEA019754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EEA119754DE2007591EC /* fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_impl.hpp; sourceTree = ""; }; - 13E9EEA219754DE2007591EC /* full_lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = full_lambda.hpp; sourceTree = ""; }; - 13E9EEA319754DE2007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EEA419754DE2007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EEA519754DE2007591EC /* inherit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inherit.hpp; sourceTree = ""; }; - 13E9EEA619754DE2007591EC /* iter_fold_if_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if_impl.hpp; sourceTree = ""; }; - 13E9EEA719754DE2007591EC /* iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EEA819754DE2007591EC /* lambda_no_ctps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_no_ctps.hpp; sourceTree = ""; }; - 13E9EEA919754DE2007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EEAA19754DE2007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EEAB19754DE2007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EEAC19754DE2007591EC /* list_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list_c.hpp; sourceTree = ""; }; - 13E9EEAD19754DE2007591EC /* map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = map.hpp; sourceTree = ""; }; - 13E9EEAE19754DE2007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EEAF19754DE2007591EC /* modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modulus.hpp; sourceTree = ""; }; - 13E9EEB019754DE2007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EEB119754DE2007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EEB219754DE2007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EEB319754DE2007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EEB419754DE2007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EEB519754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EEB619754DE2007591EC /* reverse_iter_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iter_fold_impl.hpp; sourceTree = ""; }; - 13E9EEB719754DE2007591EC /* set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set.hpp; sourceTree = ""; }; - 13E9EEB819754DE2007591EC /* set_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_c.hpp; sourceTree = ""; }; - 13E9EEB919754DE2007591EC /* shift_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_left.hpp; sourceTree = ""; }; - 13E9EEBA19754DE2007591EC /* shift_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shift_right.hpp; sourceTree = ""; }; - 13E9EEBB19754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EEBC19754DE2007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EEBD19754DE2007591EC /* unpack_args.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unpack_args.hpp; sourceTree = ""; }; - 13E9EEBE19754DE2007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EEBF19754DE2007591EC /* vector_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector_c.hpp; sourceTree = ""; }; - 13E9EEC119754DE2007591EC /* add.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add.hpp; sourceTree = ""; }; - 13E9EEC219754DE2007591EC /* def_params_tail.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = def_params_tail.hpp; sourceTree = ""; }; - 13E9EEC319754DE2007591EC /* default_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = default_params.hpp; sourceTree = ""; }; - 13E9EEC419754DE2007591EC /* enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum.hpp; sourceTree = ""; }; - 13E9EEC519754DE2007591EC /* ext_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ext_params.hpp; sourceTree = ""; }; - 13E9EEC619754DE2007591EC /* filter_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = filter_params.hpp; sourceTree = ""; }; - 13E9EEC719754DE2007591EC /* params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = params.hpp; sourceTree = ""; }; - 13E9EEC819754DE2007591EC /* partial_spec_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = partial_spec_params.hpp; sourceTree = ""; }; - 13E9EEC919754DE2007591EC /* range.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = range.hpp; sourceTree = ""; }; - 13E9EECA19754DE2007591EC /* repeat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = repeat.hpp; sourceTree = ""; }; - 13E9EECB19754DE2007591EC /* sub.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sub.hpp; sourceTree = ""; }; - 13E9EECC19754DE2007591EC /* tuple.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tuple.hpp; sourceTree = ""; }; - 13E9EECD19754DE2007591EC /* push_back_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_back_impl.hpp; sourceTree = ""; }; - 13E9EECE19754DE2007591EC /* push_front_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_front_impl.hpp; sourceTree = ""; }; - 13E9EECF19754DE2007591EC /* reverse_fold_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl.hpp; sourceTree = ""; }; - 13E9EED019754DE2007591EC /* reverse_fold_impl_body.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold_impl_body.hpp; sourceTree = ""; }; - 13E9EED119754DE2007591EC /* sequence_wrapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence_wrapper.hpp; sourceTree = ""; }; - 13E9EED219754DE2007591EC /* size_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_impl.hpp; sourceTree = ""; }; - 13E9EED319754DE2007591EC /* static_cast.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = static_cast.hpp; sourceTree = ""; }; - 13E9EED419754DE2007591EC /* template_arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity.hpp; sourceTree = ""; }; - 13E9EED519754DE2007591EC /* template_arity_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity_fwd.hpp; sourceTree = ""; }; - 13E9EED619754DE2007591EC /* traits_lambda_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = traits_lambda_spec.hpp; sourceTree = ""; }; - 13E9EED719754DE2007591EC /* type_wrapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_wrapper.hpp; sourceTree = ""; }; - 13E9EED819754DE2007591EC /* value_wknd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = value_wknd.hpp; sourceTree = ""; }; - 13E9EED919754DE2007591EC /* yes_no.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = yes_no.hpp; sourceTree = ""; }; - 13E9EEDA19754DE2007591EC /* back_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = back_fwd.hpp; sourceTree = ""; }; - 13E9EEDB19754DE2007591EC /* back_inserter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = back_inserter.hpp; sourceTree = ""; }; - 13E9EEDC19754DE2007591EC /* begin_end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin_end.hpp; sourceTree = ""; }; - 13E9EEDD19754DE2007591EC /* begin_end_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin_end_fwd.hpp; sourceTree = ""; }; - 13E9EEDE19754DE2007591EC /* bind.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind.hpp; sourceTree = ""; }; - 13E9EEDF19754DE2007591EC /* bind_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bind_fwd.hpp; sourceTree = ""; }; - 13E9EEE019754DE2007591EC /* bool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool.hpp; sourceTree = ""; }; - 13E9EEE119754DE2007591EC /* bool_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool_fwd.hpp; sourceTree = ""; }; - 13E9EEE219754DE2007591EC /* clear.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clear.hpp; sourceTree = ""; }; - 13E9EEE319754DE2007591EC /* clear_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clear_fwd.hpp; sourceTree = ""; }; - 13E9EEE419754DE2007591EC /* comparison.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comparison.hpp; sourceTree = ""; }; - 13E9EEE519754DE2007591EC /* contains.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = contains.hpp; sourceTree = ""; }; - 13E9EEE619754DE2007591EC /* contains_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = contains_fwd.hpp; sourceTree = ""; }; - 13E9EEE719754DE2007591EC /* copy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = copy.hpp; sourceTree = ""; }; - 13E9EEE819754DE2007591EC /* deref.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deref.hpp; sourceTree = ""; }; - 13E9EEE919754DE2007591EC /* distance.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distance.hpp; sourceTree = ""; }; - 13E9EEEA19754DE2007591EC /* distance_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distance_fwd.hpp; sourceTree = ""; }; - 13E9EEEB19754DE2007591EC /* empty_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty_fwd.hpp; sourceTree = ""; }; - 13E9EEEC19754DE2007591EC /* equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal_to.hpp; sourceTree = ""; }; - 13E9EEED19754DE2007591EC /* eval_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = eval_if.hpp; sourceTree = ""; }; - 13E9EEEE19754DE2007591EC /* find.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = find.hpp; sourceTree = ""; }; - 13E9EEEF19754DE2007591EC /* find_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = find_if.hpp; sourceTree = ""; }; - 13E9EEF019754DE2007591EC /* fold.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold.hpp; sourceTree = ""; }; - 13E9EEF119754DE2007591EC /* front_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = front_fwd.hpp; sourceTree = ""; }; - 13E9EEF219754DE3007591EC /* front_inserter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = front_inserter.hpp; sourceTree = ""; }; - 13E9EEF319754DE3007591EC /* greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater.hpp; sourceTree = ""; }; - 13E9EEF419754DE3007591EC /* greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = greater_equal.hpp; sourceTree = ""; }; - 13E9EEF519754DE3007591EC /* has_xxx.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_xxx.hpp; sourceTree = ""; }; - 13E9EEF619754DE3007591EC /* identity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = identity.hpp; sourceTree = ""; }; - 13E9EEF719754DE3007591EC /* if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = if.hpp; sourceTree = ""; }; - 13E9EEF819754DE3007591EC /* inserter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inserter.hpp; sourceTree = ""; }; - 13E9EEF919754DE3007591EC /* int.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = int.hpp; sourceTree = ""; }; - 13E9EEFA19754DE3007591EC /* int_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = int_fwd.hpp; sourceTree = ""; }; - 13E9EEFB19754DE3007591EC /* integral_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_c.hpp; sourceTree = ""; }; - 13E9EEFC19754DE3007591EC /* integral_c_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_c_fwd.hpp; sourceTree = ""; }; - 13E9EEFD19754DE3007591EC /* integral_c_tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_c_tag.hpp; sourceTree = ""; }; - 13E9EEFE19754DE3007591EC /* is_placeholder.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_placeholder.hpp; sourceTree = ""; }; - 13E9EEFF19754DE3007591EC /* iter_fold.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold.hpp; sourceTree = ""; }; - 13E9EF0019754DE3007591EC /* iter_fold_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iter_fold_if.hpp; sourceTree = ""; }; - 13E9EF0119754DE3007591EC /* iterator_range.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_range.hpp; sourceTree = ""; }; - 13E9EF0219754DE3007591EC /* iterator_tags.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_tags.hpp; sourceTree = ""; }; - 13E9EF0319754DE3007591EC /* lambda.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda.hpp; sourceTree = ""; }; - 13E9EF0419754DE3007591EC /* lambda_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lambda_fwd.hpp; sourceTree = ""; }; - 13E9EF0519754DE3007591EC /* less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less.hpp; sourceTree = ""; }; - 13E9EF0619754DE3007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9EF0819754DE3007591EC /* arity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arity.hpp; sourceTree = ""; }; - 13E9EF0919754DE3007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EF0A19754DE3007591EC /* unrolling.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unrolling.hpp; sourceTree = ""; }; - 13E9EF0B19754DE3007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EF0E19754DE3007591EC /* begin_end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin_end.hpp; sourceTree = ""; }; - 13E9EF0F19754DE3007591EC /* clear.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clear.hpp; sourceTree = ""; }; - 13E9EF1019754DE3007591EC /* empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty.hpp; sourceTree = ""; }; - 13E9EF1119754DE3007591EC /* front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = front.hpp; sourceTree = ""; }; - 13E9EF1219754DE3007591EC /* include_preprocessed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = include_preprocessed.hpp; sourceTree = ""; }; - 13E9EF1319754DE3007591EC /* item.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = item.hpp; sourceTree = ""; }; - 13E9EF1419754DE3007591EC /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - 13E9EF1519754DE3007591EC /* numbered.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numbered.hpp; sourceTree = ""; }; - 13E9EF1619754DE3007591EC /* numbered_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numbered_c.hpp; sourceTree = ""; }; - 13E9EF1719754DE3007591EC /* O1_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = O1_size.hpp; sourceTree = ""; }; - 13E9EF1819754DE3007591EC /* pop_front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pop_front.hpp; sourceTree = ""; }; - 13E9EF1B19754DE3007591EC /* list10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list10.hpp; sourceTree = ""; }; - 13E9EF1C19754DE3007591EC /* list10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list10_c.hpp; sourceTree = ""; }; - 13E9EF1D19754DE3007591EC /* list20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list20.hpp; sourceTree = ""; }; - 13E9EF1E19754DE3007591EC /* list20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list20_c.hpp; sourceTree = ""; }; - 13E9EF1F19754DE3007591EC /* list30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list30.hpp; sourceTree = ""; }; - 13E9EF2019754DE3007591EC /* list30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list30_c.hpp; sourceTree = ""; }; - 13E9EF2119754DE3007591EC /* list40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list40.hpp; sourceTree = ""; }; - 13E9EF2219754DE3007591EC /* list40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list40_c.hpp; sourceTree = ""; }; - 13E9EF2319754DE3007591EC /* list50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list50.hpp; sourceTree = ""; }; - 13E9EF2419754DE3007591EC /* list50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list50_c.hpp; sourceTree = ""; }; - 13E9EF2519754DE3007591EC /* push_back.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_back.hpp; sourceTree = ""; }; - 13E9EF2619754DE3007591EC /* push_front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_front.hpp; sourceTree = ""; }; - 13E9EF2719754DE3007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9EF2819754DE3007591EC /* tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tag.hpp; sourceTree = ""; }; - 13E9EF2919754DE3007591EC /* list0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list0.hpp; sourceTree = ""; }; - 13E9EF2A19754DE3007591EC /* list0_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list0_c.hpp; sourceTree = ""; }; - 13E9EF2B19754DE3007591EC /* list10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list10.hpp; sourceTree = ""; }; - 13E9EF2C19754DE3007591EC /* list10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list10_c.hpp; sourceTree = ""; }; - 13E9EF2D19754DE3007591EC /* list20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list20.hpp; sourceTree = ""; }; - 13E9EF2E19754DE3007591EC /* list20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list20_c.hpp; sourceTree = ""; }; - 13E9EF2F19754DE3007591EC /* list30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list30.hpp; sourceTree = ""; }; - 13E9EF3019754DE3007591EC /* list30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list30_c.hpp; sourceTree = ""; }; - 13E9EF3119754DE3007591EC /* list40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list40.hpp; sourceTree = ""; }; - 13E9EF3219754DE3007591EC /* list40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list40_c.hpp; sourceTree = ""; }; - 13E9EF3319754DE3007591EC /* list50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list50.hpp; sourceTree = ""; }; - 13E9EF3419754DE3007591EC /* list50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list50_c.hpp; sourceTree = ""; }; - 13E9EF3519754DE3007591EC /* list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = list.hpp; sourceTree = ""; }; - 13E9EF3619754DE3007591EC /* logical.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = logical.hpp; sourceTree = ""; }; - 13E9EF3719754DE3007591EC /* long.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = long.hpp; sourceTree = ""; }; - 13E9EF3819754DE3007591EC /* long_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = long_fwd.hpp; sourceTree = ""; }; - 13E9EF3919754DE3007591EC /* minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = minus.hpp; sourceTree = ""; }; - 13E9EF3A19754DE3007591EC /* multiplies.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = multiplies.hpp; sourceTree = ""; }; - 13E9EF3B19754DE3007591EC /* negate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = negate.hpp; sourceTree = ""; }; - 13E9EF3C19754DE3007591EC /* next.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = next.hpp; sourceTree = ""; }; - 13E9EF3D19754DE3007591EC /* next_prior.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = next_prior.hpp; sourceTree = ""; }; - 13E9EF3E19754DE3007591EC /* not.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not.hpp; sourceTree = ""; }; - 13E9EF3F19754DE3007591EC /* not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not_equal_to.hpp; sourceTree = ""; }; - 13E9EF4019754DE3007591EC /* numeric_cast.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numeric_cast.hpp; sourceTree = ""; }; - 13E9EF4119754DE3007591EC /* O1_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = O1_size.hpp; sourceTree = ""; }; - 13E9EF4219754DE3007591EC /* O1_size_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = O1_size_fwd.hpp; sourceTree = ""; }; - 13E9EF4319754DE3007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9EF4419754DE3007591EC /* pair.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pair.hpp; sourceTree = ""; }; - 13E9EF4519754DE3007591EC /* placeholders.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = placeholders.hpp; sourceTree = ""; }; - 13E9EF4619754DE3007591EC /* plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = plus.hpp; sourceTree = ""; }; - 13E9EF4719754DE3007591EC /* pop_back_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pop_back_fwd.hpp; sourceTree = ""; }; - 13E9EF4819754DE3007591EC /* pop_front_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pop_front_fwd.hpp; sourceTree = ""; }; - 13E9EF4919754DE3007591EC /* prior.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = prior.hpp; sourceTree = ""; }; - 13E9EF4A19754DE3007591EC /* protect.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = protect.hpp; sourceTree = ""; }; - 13E9EF4B19754DE3007591EC /* push_back.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_back.hpp; sourceTree = ""; }; - 13E9EF4C19754DE3007591EC /* push_back_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_back_fwd.hpp; sourceTree = ""; }; - 13E9EF4D19754DE3007591EC /* push_front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_front.hpp; sourceTree = ""; }; - 13E9EF4E19754DE3007591EC /* push_front_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_front_fwd.hpp; sourceTree = ""; }; - 13E9EF4F19754DE3007591EC /* quote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quote.hpp; sourceTree = ""; }; - 13E9EF5019754DE3007591EC /* remove_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_if.hpp; sourceTree = ""; }; - 13E9EF5119754DE3007591EC /* reverse_fold.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_fold.hpp; sourceTree = ""; }; - 13E9EF5219754DE3007591EC /* same_as.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = same_as.hpp; sourceTree = ""; }; - 13E9EF5319754DE3007591EC /* sequence_tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence_tag.hpp; sourceTree = ""; }; - 13E9EF5419754DE3007591EC /* sequence_tag_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sequence_tag_fwd.hpp; sourceTree = ""; }; - 13E9EF5519754DE3007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9EF5619754DE3007591EC /* size_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_fwd.hpp; sourceTree = ""; }; - 13E9EF5719754DE3007591EC /* size_t.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_t.hpp; sourceTree = ""; }; - 13E9EF5819754DE3007591EC /* size_t_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_t_fwd.hpp; sourceTree = ""; }; - 13E9EF5919754DE3007591EC /* tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tag.hpp; sourceTree = ""; }; - 13E9EF5A19754DE3007591EC /* times.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = times.hpp; sourceTree = ""; }; - 13E9EF5D19754DE3007591EC /* at.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = at.hpp; sourceTree = ""; }; - 13E9EF5E19754DE3007591EC /* back.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = back.hpp; sourceTree = ""; }; - 13E9EF5F19754DE3007591EC /* begin_end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin_end.hpp; sourceTree = ""; }; - 13E9EF6019754DE3007591EC /* clear.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clear.hpp; sourceTree = ""; }; - 13E9EF6119754DE3007591EC /* empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty.hpp; sourceTree = ""; }; - 13E9EF6219754DE3007591EC /* front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = front.hpp; sourceTree = ""; }; - 13E9EF6319754DE3007591EC /* include_preprocessed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = include_preprocessed.hpp; sourceTree = ""; }; - 13E9EF6419754DE3007591EC /* item.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = item.hpp; sourceTree = ""; }; - 13E9EF6519754DE3007591EC /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - 13E9EF6619754DE3007591EC /* numbered.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numbered.hpp; sourceTree = ""; }; - 13E9EF6719754DE3007591EC /* numbered_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = numbered_c.hpp; sourceTree = ""; }; - 13E9EF6819754DE3007591EC /* O1_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = O1_size.hpp; sourceTree = ""; }; - 13E9EF6919754DE3007591EC /* pop_back.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pop_back.hpp; sourceTree = ""; }; - 13E9EF6A19754DE3007591EC /* pop_front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pop_front.hpp; sourceTree = ""; }; - 13E9EF6D19754DE3007591EC /* vector10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10.hpp; sourceTree = ""; }; - 13E9EF6E19754DE3007591EC /* vector10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10_c.hpp; sourceTree = ""; }; - 13E9EF6F19754DE3007591EC /* vector20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20.hpp; sourceTree = ""; }; - 13E9EF7019754DE3007591EC /* vector20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20_c.hpp; sourceTree = ""; }; - 13E9EF7119754DE3007591EC /* vector30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30.hpp; sourceTree = ""; }; - 13E9EF7219754DE3007591EC /* vector30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30_c.hpp; sourceTree = ""; }; - 13E9EF7319754DE3007591EC /* vector40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40.hpp; sourceTree = ""; }; - 13E9EF7419754DE3007591EC /* vector40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40_c.hpp; sourceTree = ""; }; - 13E9EF7519754DE3007591EC /* vector50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50.hpp; sourceTree = ""; }; - 13E9EF7619754DE3007591EC /* vector50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50_c.hpp; sourceTree = ""; }; - 13E9EF7819754DE3007591EC /* vector10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10.hpp; sourceTree = ""; }; - 13E9EF7919754DE3007591EC /* vector10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10_c.hpp; sourceTree = ""; }; - 13E9EF7A19754DE3007591EC /* vector20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20.hpp; sourceTree = ""; }; - 13E9EF7B19754DE3007591EC /* vector20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20_c.hpp; sourceTree = ""; }; - 13E9EF7C19754DE3007591EC /* vector30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30.hpp; sourceTree = ""; }; - 13E9EF7D19754DE3007591EC /* vector30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30_c.hpp; sourceTree = ""; }; - 13E9EF7E19754DE3007591EC /* vector40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40.hpp; sourceTree = ""; }; - 13E9EF7F19754DE3007591EC /* vector40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40_c.hpp; sourceTree = ""; }; - 13E9EF8019754DE3007591EC /* vector50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50.hpp; sourceTree = ""; }; - 13E9EF8119754DE3007591EC /* vector50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50_c.hpp; sourceTree = ""; }; - 13E9EF8319754DE3007591EC /* vector10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10.hpp; sourceTree = ""; }; - 13E9EF8419754DE3007591EC /* vector10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10_c.hpp; sourceTree = ""; }; - 13E9EF8519754DE3007591EC /* vector20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20.hpp; sourceTree = ""; }; - 13E9EF8619754DE3007591EC /* vector20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20_c.hpp; sourceTree = ""; }; - 13E9EF8719754DE3007591EC /* vector30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30.hpp; sourceTree = ""; }; - 13E9EF8819754DE3007591EC /* vector30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30_c.hpp; sourceTree = ""; }; - 13E9EF8919754DE3007591EC /* vector40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40.hpp; sourceTree = ""; }; - 13E9EF8A19754DE3007591EC /* vector40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40_c.hpp; sourceTree = ""; }; - 13E9EF8B19754DE3007591EC /* vector50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50.hpp; sourceTree = ""; }; - 13E9EF8C19754DE3007591EC /* vector50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50_c.hpp; sourceTree = ""; }; - 13E9EF8D19754DE3007591EC /* push_back.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_back.hpp; sourceTree = ""; }; - 13E9EF8E19754DE3007591EC /* push_front.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_front.hpp; sourceTree = ""; }; - 13E9EF8F19754DE3007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9EF9019754DE3007591EC /* tag.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tag.hpp; sourceTree = ""; }; - 13E9EF9119754DE3007591EC /* vector0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector0.hpp; sourceTree = ""; }; - 13E9EF9219754DE3007591EC /* vector0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector0.hpp; sourceTree = ""; }; - 13E9EF9319754DE3007591EC /* vector0_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector0_c.hpp; sourceTree = ""; }; - 13E9EF9419754DE3007591EC /* vector10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10.hpp; sourceTree = ""; }; - 13E9EF9519754DE3007591EC /* vector10_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector10_c.hpp; sourceTree = ""; }; - 13E9EF9619754DE3007591EC /* vector20.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20.hpp; sourceTree = ""; }; - 13E9EF9719754DE3007591EC /* vector20_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector20_c.hpp; sourceTree = ""; }; - 13E9EF9819754DE3007591EC /* vector30.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30.hpp; sourceTree = ""; }; - 13E9EF9919754DE3007591EC /* vector30_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector30_c.hpp; sourceTree = ""; }; - 13E9EF9A19754DE3007591EC /* vector40.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40.hpp; sourceTree = ""; }; - 13E9EF9B19754DE3007591EC /* vector40_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector40_c.hpp; sourceTree = ""; }; - 13E9EF9C19754DE3007591EC /* vector50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50.hpp; sourceTree = ""; }; - 13E9EF9D19754DE3007591EC /* vector50_c.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50_c.hpp; sourceTree = ""; }; - 13E9EF9E19754DE3007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9EF9F19754DE3007591EC /* void.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = void.hpp; sourceTree = ""; }; - 13E9EFA019754DE3007591EC /* void_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = void_fwd.hpp; sourceTree = ""; }; - 13E9EFA119754DE3007591EC /* next_prior.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = next_prior.hpp; sourceTree = ""; }; - 13E9EFA219754DE3007591EC /* non_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = non_type.hpp; sourceTree = ""; }; - 13E9EFA319754DE3007591EC /* noncopyable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = noncopyable.hpp; sourceTree = ""; }; - 13E9EFA419754DE3007591EC /* none.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = none.hpp; sourceTree = ""; }; - 13E9EFA519754DE3007591EC /* none_t.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = none_t.hpp; sourceTree = ""; }; - 13E9EFBF19754DE3007591EC /* operators.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = operators.hpp; sourceTree = ""; }; - 13E9EFC119754DE3007591EC /* optional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional.hpp; sourceTree = ""; }; - 13E9EFC219754DE3007591EC /* optional_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional_fwd.hpp; sourceTree = ""; }; - 13E9EFC319754DE3007591EC /* optional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional.hpp; sourceTree = ""; }; - 13E9EFF819754DE3007591EC /* add.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add.hpp; sourceTree = ""; }; - 13E9EFF919754DE3007591EC /* dec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dec.hpp; sourceTree = ""; }; - 13E9EFFB19754DE3007591EC /* div_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = div_base.hpp; sourceTree = ""; }; - 13E9EFFC19754DE3007591EC /* inc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inc.hpp; sourceTree = ""; }; - 13E9EFFD19754DE3007591EC /* mod.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mod.hpp; sourceTree = ""; }; - 13E9EFFE19754DE3007591EC /* sub.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sub.hpp; sourceTree = ""; }; - 13E9F00019754DE3007591EC /* data.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = data.hpp; sourceTree = ""; }; - 13E9F00119754DE3007591EC /* elem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = elem.hpp; sourceTree = ""; }; - 13E9F00219754DE3007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9F00319754DE3007591EC /* cat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cat.hpp; sourceTree = ""; }; - 13E9F00419754DE3007591EC /* comma_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comma_if.hpp; sourceTree = ""; }; - 13E9F00619754DE3007591EC /* less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = less_equal.hpp; sourceTree = ""; }; - 13E9F00819754DE3007591EC /* config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config.hpp; sourceTree = ""; }; - 13E9F00A19754DE3007591EC /* deduce_d.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deduce_d.hpp; sourceTree = ""; }; - 13E9F00D19754DE3007591EC /* while.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = while.hpp; sourceTree = ""; }; - 13E9F00F19754DE3007591EC /* while.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = while.hpp; sourceTree = ""; }; - 13E9F01119754DE3007591EC /* while.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = while.hpp; sourceTree = ""; }; - 13E9F01219754DE3007591EC /* while.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = while.hpp; sourceTree = ""; }; - 13E9F01319754DE3007591EC /* expr_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = expr_if.hpp; sourceTree = ""; }; - 13E9F01419754DE3007591EC /* expr_iif.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = expr_iif.hpp; sourceTree = ""; }; - 13E9F01519754DE3007591EC /* if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = if.hpp; sourceTree = ""; }; - 13E9F01619754DE3007591EC /* iif.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iif.hpp; sourceTree = ""; }; - 13E9F01719754DE3007591EC /* while.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = while.hpp; sourceTree = ""; }; - 13E9F01919754DE3007591EC /* error.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = error.hpp; sourceTree = ""; }; - 13E9F01A19754DE3007591EC /* dec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dec.hpp; sourceTree = ""; }; - 13E9F01C19754DE3007591EC /* auto_rec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = auto_rec.hpp; sourceTree = ""; }; - 13E9F01D19754DE3007591EC /* check.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = check.hpp; sourceTree = ""; }; - 13E9F01F19754DE3007591EC /* auto_rec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = auto_rec.hpp; sourceTree = ""; }; - 13E9F02019754DE3007591EC /* is_binary.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_binary.hpp; sourceTree = ""; }; - 13E9F02119754DE3007591EC /* is_unary.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_unary.hpp; sourceTree = ""; }; - 13E9F02219754DE3007591EC /* empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty.hpp; sourceTree = ""; }; - 13E9F02319754DE3007591EC /* enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum.hpp; sourceTree = ""; }; - 13E9F02419754DE3007591EC /* enum_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_params.hpp; sourceTree = ""; }; - 13E9F02519754DE3007591EC /* enum_params_with_a_default.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_params_with_a_default.hpp; sourceTree = ""; }; - 13E9F02619754DE3007591EC /* enum_shifted_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_shifted_params.hpp; sourceTree = ""; }; - 13E9F02719754DE3007591EC /* expr_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = expr_if.hpp; sourceTree = ""; }; - 13E9F02919754DE3007591EC /* empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty.hpp; sourceTree = ""; }; - 13E9F02A19754DE3007591EC /* identity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = identity.hpp; sourceTree = ""; }; - 13E9F02B19754DE3007591EC /* intercept.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intercept.hpp; sourceTree = ""; }; - 13E9F02C19754DE3007591EC /* overload.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = overload.hpp; sourceTree = ""; }; - 13E9F02D19754DE3007591EC /* identity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = identity.hpp; sourceTree = ""; }; - 13E9F02E19754DE3007591EC /* if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = if.hpp; sourceTree = ""; }; - 13E9F02F19754DE3007591EC /* inc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = inc.hpp; sourceTree = ""; }; - 13E9F03019754DE3007591EC /* iterate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterate.hpp; sourceTree = ""; }; - 13E9F03419754DE3007591EC /* lower1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lower1.hpp; sourceTree = ""; }; - 13E9F03519754DE3007591EC /* lower2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lower2.hpp; sourceTree = ""; }; - 13E9F03619754DE3007591EC /* lower3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lower3.hpp; sourceTree = ""; }; - 13E9F03719754DE3007591EC /* lower4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lower4.hpp; sourceTree = ""; }; - 13E9F03819754DE3007591EC /* lower5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lower5.hpp; sourceTree = ""; }; - 13E9F03919754DE3007591EC /* upper1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = upper1.hpp; sourceTree = ""; }; - 13E9F03A19754DE3007591EC /* upper2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = upper2.hpp; sourceTree = ""; }; - 13E9F03B19754DE3007591EC /* upper3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = upper3.hpp; sourceTree = ""; }; - 13E9F03C19754DE3007591EC /* upper4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = upper4.hpp; sourceTree = ""; }; - 13E9F03D19754DE3007591EC /* upper5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = upper5.hpp; sourceTree = ""; }; - 13E9F03E19754DE3007591EC /* finish.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = finish.hpp; sourceTree = ""; }; - 13E9F04019754DE3007591EC /* forward1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward1.hpp; sourceTree = ""; }; - 13E9F04119754DE3007591EC /* forward2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward2.hpp; sourceTree = ""; }; - 13E9F04219754DE3007591EC /* forward3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward3.hpp; sourceTree = ""; }; - 13E9F04319754DE3007591EC /* forward4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward4.hpp; sourceTree = ""; }; - 13E9F04419754DE3007591EC /* forward5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward5.hpp; sourceTree = ""; }; - 13E9F04519754DE3007591EC /* reverse1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse1.hpp; sourceTree = ""; }; - 13E9F04619754DE3007591EC /* reverse2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse2.hpp; sourceTree = ""; }; - 13E9F04719754DE3007591EC /* reverse3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse3.hpp; sourceTree = ""; }; - 13E9F04819754DE3007591EC /* reverse4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse4.hpp; sourceTree = ""; }; - 13E9F04919754DE3007591EC /* reverse5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse5.hpp; sourceTree = ""; }; - 13E9F04A19754DE3007591EC /* local.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = local.hpp; sourceTree = ""; }; - 13E9F04B19754DE3007591EC /* rlocal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rlocal.hpp; sourceTree = ""; }; - 13E9F04C19754DE3007591EC /* self.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = self.hpp; sourceTree = ""; }; - 13E9F04D19754DE3007591EC /* start.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = start.hpp; sourceTree = ""; }; - 13E9F04E19754DE3007591EC /* iterate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterate.hpp; sourceTree = ""; }; - 13E9F04F19754DE3007591EC /* local.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = local.hpp; sourceTree = ""; }; - 13E9F05019754DE3007591EC /* self.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = self.hpp; sourceTree = ""; }; - 13E9F05219754DE3007591EC /* adt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = adt.hpp; sourceTree = ""; }; - 13E9F05319754DE3007591EC /* append.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = append.hpp; sourceTree = ""; }; - 13E9F05619754DE3007591EC /* fold_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_left.hpp; sourceTree = ""; }; - 13E9F05819754DE3007591EC /* fold_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_left.hpp; sourceTree = ""; }; - 13E9F05919754DE3007591EC /* fold_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_right.hpp; sourceTree = ""; }; - 13E9F05A19754DE3007591EC /* fold_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_left.hpp; sourceTree = ""; }; - 13E9F05B19754DE3007591EC /* fold_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_right.hpp; sourceTree = ""; }; - 13E9F05C19754DE3007591EC /* fold_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_left.hpp; sourceTree = ""; }; - 13E9F05D19754DE3007591EC /* fold_right.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_right.hpp; sourceTree = ""; }; - 13E9F05E19754DE3007591EC /* for_each_i.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for_each_i.hpp; sourceTree = ""; }; - 13E9F05F19754DE3007591EC /* reverse.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse.hpp; sourceTree = ""; }; - 13E9F06019754DE3007591EC /* transform.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = transform.hpp; sourceTree = ""; }; - 13E9F06219754DE3007591EC /* and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = and.hpp; sourceTree = ""; }; - 13E9F06319754DE3007591EC /* bitand.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitand.hpp; sourceTree = ""; }; - 13E9F06419754DE3007591EC /* bitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bitor.hpp; sourceTree = ""; }; - 13E9F06519754DE3007591EC /* bool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool.hpp; sourceTree = ""; }; - 13E9F06619754DE3007591EC /* compl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compl.hpp; sourceTree = ""; }; - 13E9F06719754DE3007591EC /* not.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = not.hpp; sourceTree = ""; }; - 13E9F06819754DE3007591EC /* or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = or.hpp; sourceTree = ""; }; - 13E9F06A19754DE3007591EC /* comma.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comma.hpp; sourceTree = ""; }; - 13E9F06B19754DE3007591EC /* comma_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = comma_if.hpp; sourceTree = ""; }; - 13E9F06C19754DE3007591EC /* paren.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = paren.hpp; sourceTree = ""; }; - 13E9F06D19754DE3007591EC /* paren_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = paren_if.hpp; sourceTree = ""; }; - 13E9F06E19754DE3007591EC /* repeat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = repeat.hpp; sourceTree = ""; }; - 13E9F06F19754DE3007591EC /* repeat_from_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = repeat_from_to.hpp; sourceTree = ""; }; - 13E9F07319754DE3007591EC /* for.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for.hpp; sourceTree = ""; }; - 13E9F07519754DE3007591EC /* for.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for.hpp; sourceTree = ""; }; - 13E9F07619754DE3007591EC /* for.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for.hpp; sourceTree = ""; }; - 13E9F07819754DE3007591EC /* for.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for.hpp; sourceTree = ""; }; - 13E9F07919754DE3007591EC /* enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum.hpp; sourceTree = ""; }; - 13E9F07A19754DE3007591EC /* enum_binary_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_binary_params.hpp; sourceTree = ""; }; - 13E9F07B19754DE3007591EC /* enum_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_params.hpp; sourceTree = ""; }; - 13E9F07C19754DE3007591EC /* enum_params_with_a_default.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_params_with_a_default.hpp; sourceTree = ""; }; - 13E9F07D19754DE3007591EC /* enum_shifted.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_shifted.hpp; sourceTree = ""; }; - 13E9F07E19754DE3007591EC /* enum_shifted_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_shifted_params.hpp; sourceTree = ""; }; - 13E9F07F19754DE3007591EC /* enum_trailing.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_trailing.hpp; sourceTree = ""; }; - 13E9F08019754DE3007591EC /* enum_trailing_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_trailing_params.hpp; sourceTree = ""; }; - 13E9F08119754DE3007591EC /* for.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for.hpp; sourceTree = ""; }; - 13E9F08219754DE4007591EC /* repeat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = repeat.hpp; sourceTree = ""; }; - 13E9F08319754DE4007591EC /* repeat_from_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = repeat_from_to.hpp; sourceTree = ""; }; - 13E9F08519754DE4007591EC /* cat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cat.hpp; sourceTree = ""; }; - 13E9F08719754DE4007591EC /* split.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = split.hpp; sourceTree = ""; }; - 13E9F08819754DE4007591EC /* elem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = elem.hpp; sourceTree = ""; }; - 13E9F08919754DE4007591EC /* enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum.hpp; sourceTree = ""; }; - 13E9F08A19754DE4007591EC /* first_n.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = first_n.hpp; sourceTree = ""; }; - 13E9F08B19754DE4007591EC /* fold_left.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fold_left.hpp; sourceTree = ""; }; - 13E9F08C19754DE4007591EC /* for_each_i.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = for_each_i.hpp; sourceTree = ""; }; - 13E9F08D19754DE4007591EC /* rest_n.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rest_n.hpp; sourceTree = ""; }; - 13E9F08E19754DE4007591EC /* seq.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = seq.hpp; sourceTree = ""; }; - 13E9F08F19754DE4007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9F09019754DE4007591EC /* subseq.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = subseq.hpp; sourceTree = ""; }; - 13E9F09119754DE4007591EC /* transform.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = transform.hpp; sourceTree = ""; }; - 13E9F09419754DE4007591EC /* counter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = counter.hpp; sourceTree = ""; }; - 13E9F09519754DE4007591EC /* def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = def.hpp; sourceTree = ""; }; - 13E9F09619754DE4007591EC /* shared.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared.hpp; sourceTree = ""; }; - 13E9F09719754DE4007591EC /* slot1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot1.hpp; sourceTree = ""; }; - 13E9F09819754DE4007591EC /* slot2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot2.hpp; sourceTree = ""; }; - 13E9F09919754DE4007591EC /* slot3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot3.hpp; sourceTree = ""; }; - 13E9F09A19754DE4007591EC /* slot4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot4.hpp; sourceTree = ""; }; - 13E9F09B19754DE4007591EC /* slot5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot5.hpp; sourceTree = ""; }; - 13E9F09C19754DE4007591EC /* slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot.hpp; sourceTree = ""; }; - 13E9F09D19754DE4007591EC /* stringize.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stringize.hpp; sourceTree = ""; }; - 13E9F09F19754DE4007591EC /* eat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = eat.hpp; sourceTree = ""; }; - 13E9F0A019754DE4007591EC /* elem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = elem.hpp; sourceTree = ""; }; - 13E9F0A119754DE4007591EC /* rem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rem.hpp; sourceTree = ""; }; - 13E9F0A219754DE4007591EC /* to_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = to_list.hpp; sourceTree = ""; }; - 13E9F0A419754DE4007591EC /* elem.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = elem.hpp; sourceTree = ""; }; - 13E9F0A519754DE4007591EC /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - 13E9F0ED19754DE4007591EC /* ref.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ref.hpp; sourceTree = ""; }; - 13E9F0EE19754DE4007591EC /* scoped_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scoped_array.hpp; sourceTree = ""; }; - 13E9F0EF19754DE4007591EC /* scoped_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scoped_ptr.hpp; sourceTree = ""; }; - 13E9F0F019754DE4007591EC /* shared_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_array.hpp; sourceTree = ""; }; - 13E9F0F119754DE4007591EC /* shared_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_ptr.hpp; sourceTree = ""; }; - 13E9F0F219754DE4007591EC /* signal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal.hpp; sourceTree = ""; }; - 13E9F0F419754DE4007591EC /* connection.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = connection.hpp; sourceTree = ""; }; - 13E9F0F619754DE4007591EC /* config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config.hpp; sourceTree = ""; }; - 13E9F0F719754DE4007591EC /* named_slot_map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = named_slot_map.hpp; sourceTree = ""; }; - 13E9F0F819754DE4007591EC /* signal_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal_base.hpp; sourceTree = ""; }; - 13E9F0F919754DE4007591EC /* signals_common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signals_common.hpp; sourceTree = ""; }; - 13E9F0FA19754DE4007591EC /* slot_call_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot_call_iterator.hpp; sourceTree = ""; }; - 13E9F0FB19754DE4007591EC /* signal0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal0.hpp; sourceTree = ""; }; - 13E9F0FC19754DE4007591EC /* signal1.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal1.hpp; sourceTree = ""; }; - 13E9F0FD19754DE4007591EC /* signal10.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal10.hpp; sourceTree = ""; }; - 13E9F0FE19754DE4007591EC /* signal2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal2.hpp; sourceTree = ""; }; - 13E9F0FF19754DE4007591EC /* signal3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal3.hpp; sourceTree = ""; }; - 13E9F10019754DE4007591EC /* signal4.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal4.hpp; sourceTree = ""; }; - 13E9F10119754DE4007591EC /* signal5.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal5.hpp; sourceTree = ""; }; - 13E9F10219754DE4007591EC /* signal6.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal6.hpp; sourceTree = ""; }; - 13E9F10319754DE4007591EC /* signal7.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal7.hpp; sourceTree = ""; }; - 13E9F10419754DE4007591EC /* signal8.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal8.hpp; sourceTree = ""; }; - 13E9F10519754DE4007591EC /* signal9.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal9.hpp; sourceTree = ""; }; - 13E9F10619754DE4007591EC /* signal_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal_template.hpp; sourceTree = ""; }; - 13E9F10719754DE4007591EC /* slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot.hpp; sourceTree = ""; }; - 13E9F10819754DE4007591EC /* trackable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = trackable.hpp; sourceTree = ""; }; - 13E9F10A19754DE4007591EC /* allocate_shared_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = allocate_shared_array.hpp; sourceTree = ""; }; - 13E9F10B19754DE4007591EC /* bad_weak_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bad_weak_ptr.hpp; sourceTree = ""; }; - 13E9F10D19754DE4007591EC /* allocate_array_helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = allocate_array_helper.hpp; sourceTree = ""; }; - 13E9F10E19754DE4007591EC /* array_deleter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = array_deleter.hpp; sourceTree = ""; }; - 13E9F10F19754DE4007591EC /* array_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = array_traits.hpp; sourceTree = ""; }; - 13E9F11019754DE4007591EC /* array_utility.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = array_utility.hpp; sourceTree = ""; }; - 13E9F11119754DE4007591EC /* atomic_count.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count.hpp; sourceTree = ""; }; - 13E9F11219754DE4007591EC /* atomic_count_gcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_gcc.hpp; sourceTree = ""; }; - 13E9F11319754DE4007591EC /* atomic_count_gcc_x86.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_gcc_x86.hpp; sourceTree = ""; }; - 13E9F11419754DE4007591EC /* atomic_count_pthreads.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_pthreads.hpp; sourceTree = ""; }; - 13E9F11519754DE4007591EC /* atomic_count_solaris.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_solaris.hpp; sourceTree = ""; }; - 13E9F11619754DE4007591EC /* atomic_count_sync.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_sync.hpp; sourceTree = ""; }; - 13E9F11719754DE4007591EC /* atomic_count_win32.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = atomic_count_win32.hpp; sourceTree = ""; }; - 13E9F11819754DE4007591EC /* lightweight_mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lightweight_mutex.hpp; sourceTree = ""; }; - 13E9F11919754DE4007591EC /* lwm_nop.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_nop.hpp; sourceTree = ""; }; - 13E9F11A19754DE4007591EC /* lwm_pthreads.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_pthreads.hpp; sourceTree = ""; }; - 13E9F11B19754DE4007591EC /* lwm_win32_cs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_win32_cs.hpp; sourceTree = ""; }; - 13E9F11C19754DE4007591EC /* make_array_helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_array_helper.hpp; sourceTree = ""; }; - 13E9F11D19754DE4007591EC /* operator_bool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = operator_bool.hpp; sourceTree = ""; }; - 13E9F11E19754DE4007591EC /* quick_allocator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = quick_allocator.hpp; sourceTree = ""; }; - 13E9F11F19754DE4007591EC /* shared_array_nmt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_array_nmt.hpp; sourceTree = ""; }; - 13E9F12019754DE4007591EC /* shared_count.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_count.hpp; sourceTree = ""; }; - 13E9F12119754DE4007591EC /* shared_ptr_nmt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_ptr_nmt.hpp; sourceTree = ""; }; - 13E9F12219754DE4007591EC /* sp_convertible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_convertible.hpp; sourceTree = ""; }; - 13E9F12319754DE4007591EC /* sp_counted_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base.hpp; sourceTree = ""; }; - 13E9F12419754DE4007591EC /* sp_counted_base_acc_ia64.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_acc_ia64.hpp; sourceTree = ""; }; - 13E9F12519754DE4007591EC /* sp_counted_base_aix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_aix.hpp; sourceTree = ""; }; - 13E9F12619754DE4007591EC /* sp_counted_base_cw_ppc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_cw_ppc.hpp; sourceTree = ""; }; - 13E9F12719754DE4007591EC /* sp_counted_base_cw_x86.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_cw_x86.hpp; sourceTree = ""; }; - 13E9F12819754DE4007591EC /* sp_counted_base_gcc_ia64.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_gcc_ia64.hpp; sourceTree = ""; }; - 13E9F12919754DE4007591EC /* sp_counted_base_gcc_mips.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_gcc_mips.hpp; sourceTree = ""; }; - 13E9F12A19754DE4007591EC /* sp_counted_base_gcc_ppc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_gcc_ppc.hpp; sourceTree = ""; }; - 13E9F12B19754DE4007591EC /* sp_counted_base_gcc_sparc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_gcc_sparc.hpp; sourceTree = ""; }; - 13E9F12C19754DE4007591EC /* sp_counted_base_gcc_x86.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_gcc_x86.hpp; sourceTree = ""; }; - 13E9F12D19754DE4007591EC /* sp_counted_base_nt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_nt.hpp; sourceTree = ""; }; - 13E9F12E19754DE4007591EC /* sp_counted_base_pt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_pt.hpp; sourceTree = ""; }; - 13E9F12F19754DE4007591EC /* sp_counted_base_snc_ps3.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_snc_ps3.hpp; sourceTree = ""; }; - 13E9F13019754DE4007591EC /* sp_counted_base_solaris.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_solaris.hpp; sourceTree = ""; }; - 13E9F13119754DE4007591EC /* sp_counted_base_spin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_spin.hpp; sourceTree = ""; }; - 13E9F13219754DE4007591EC /* sp_counted_base_sync.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_sync.hpp; sourceTree = ""; }; - 13E9F13319754DE4007591EC /* sp_counted_base_vacpp_ppc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_vacpp_ppc.hpp; sourceTree = ""; }; - 13E9F13419754DE4007591EC /* sp_counted_base_w32.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_base_w32.hpp; sourceTree = ""; }; - 13E9F13519754DE4007591EC /* sp_counted_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_counted_impl.hpp; sourceTree = ""; }; - 13E9F13619754DE4007591EC /* sp_forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_forward.hpp; sourceTree = ""; }; - 13E9F13719754DE4007591EC /* sp_has_sync.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_has_sync.hpp; sourceTree = ""; }; - 13E9F13819754DE4007591EC /* sp_if_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_if_array.hpp; sourceTree = ""; }; - 13E9F13919754DE4007591EC /* sp_nullptr_t.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sp_nullptr_t.hpp; sourceTree = ""; }; - 13E9F13A19754DE4007591EC /* spinlock.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock.hpp; sourceTree = ""; }; - 13E9F13B19754DE4007591EC /* spinlock_gcc_arm.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_gcc_arm.hpp; sourceTree = ""; }; - 13E9F13C19754DE4007591EC /* spinlock_nt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_nt.hpp; sourceTree = ""; }; - 13E9F13D19754DE4007591EC /* spinlock_pool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_pool.hpp; sourceTree = ""; }; - 13E9F13E19754DE4007591EC /* spinlock_pt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_pt.hpp; sourceTree = ""; }; - 13E9F13F19754DE4007591EC /* spinlock_sync.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_sync.hpp; sourceTree = ""; }; - 13E9F14019754DE4007591EC /* spinlock_w32.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spinlock_w32.hpp; sourceTree = ""; }; - 13E9F14119754DE4007591EC /* yield_k.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = yield_k.hpp; sourceTree = ""; }; - 13E9F14219754DE4007591EC /* enable_shared_from_raw.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_shared_from_raw.hpp; sourceTree = ""; }; - 13E9F14319754DE4007591EC /* enable_shared_from_this.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_shared_from_this.hpp; sourceTree = ""; }; - 13E9F14419754DE4007591EC /* intrusive_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intrusive_ptr.hpp; sourceTree = ""; }; - 13E9F14519754DE4007591EC /* intrusive_ref_counter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intrusive_ref_counter.hpp; sourceTree = ""; }; - 13E9F14619754DE4007591EC /* make_shared.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_shared.hpp; sourceTree = ""; }; - 13E9F14719754DE4007591EC /* make_shared_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_shared_array.hpp; sourceTree = ""; }; - 13E9F14819754DE4007591EC /* make_shared_object.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_shared_object.hpp; sourceTree = ""; }; - 13E9F14919754DE4007591EC /* owner_less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = owner_less.hpp; sourceTree = ""; }; - 13E9F14A19754DE4007591EC /* scoped_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scoped_array.hpp; sourceTree = ""; }; - 13E9F14B19754DE4007591EC /* scoped_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scoped_ptr.hpp; sourceTree = ""; }; - 13E9F14C19754DE4007591EC /* shared_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_array.hpp; sourceTree = ""; }; - 13E9F14D19754DE4007591EC /* shared_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_ptr.hpp; sourceTree = ""; }; - 13E9F14E19754DE4007591EC /* weak_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = weak_ptr.hpp; sourceTree = ""; }; - 13E9F14F19754DE4007591EC /* smart_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = smart_ptr.hpp; sourceTree = ""; }; - 13E9F15019754DE4007591EC /* static_assert.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = static_assert.hpp; sourceTree = ""; }; - 13E9F19819754DE4007591EC /* throw_exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = throw_exception.hpp; sourceTree = ""; }; - 13E9F1A119754DE4007591EC /* type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type.hpp; sourceTree = ""; }; - 13E9F1A319754DE4007591EC /* add_const.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_const.hpp; sourceTree = ""; }; - 13E9F1A419754DE4007591EC /* add_cv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_cv.hpp; sourceTree = ""; }; - 13E9F1A519754DE4007591EC /* add_lvalue_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_lvalue_reference.hpp; sourceTree = ""; }; - 13E9F1A619754DE4007591EC /* add_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_pointer.hpp; sourceTree = ""; }; - 13E9F1A719754DE4007591EC /* add_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_reference.hpp; sourceTree = ""; }; - 13E9F1A819754DE4007591EC /* add_rvalue_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_rvalue_reference.hpp; sourceTree = ""; }; - 13E9F1A919754DE4007591EC /* add_volatile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = add_volatile.hpp; sourceTree = ""; }; - 13E9F1AA19754DE4007591EC /* aligned_storage.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = aligned_storage.hpp; sourceTree = ""; }; - 13E9F1AB19754DE4007591EC /* alignment_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = alignment_of.hpp; sourceTree = ""; }; - 13E9F1AC19754DE4007591EC /* arithmetic_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = arithmetic_traits.hpp; sourceTree = ""; }; - 13E9F1AD19754DE4007591EC /* broken_compiler_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = broken_compiler_spec.hpp; sourceTree = ""; }; - 13E9F1AE19754DE4007591EC /* common_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common_type.hpp; sourceTree = ""; }; - 13E9F1AF19754DE4007591EC /* composite_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = composite_traits.hpp; sourceTree = ""; }; - 13E9F1B019754DE4007591EC /* conditional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = conditional.hpp; sourceTree = ""; }; - 13E9F1B119754DE4007591EC /* config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config.hpp; sourceTree = ""; }; - 13E9F1B219754DE4007591EC /* conversion_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = conversion_traits.hpp; sourceTree = ""; }; - 13E9F1B319754DE4007591EC /* cv_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cv_traits.hpp; sourceTree = ""; }; - 13E9F1B419754DE4007591EC /* decay.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = decay.hpp; sourceTree = ""; }; - 13E9F1B619754DE4007591EC /* bool_trait_def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool_trait_def.hpp; sourceTree = ""; }; - 13E9F1B719754DE4007591EC /* bool_trait_undef.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool_trait_undef.hpp; sourceTree = ""; }; - 13E9F1B819754DE4007591EC /* common_type_imp.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common_type_imp.hpp; sourceTree = ""; }; - 13E9F1B919754DE4007591EC /* cv_traits_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cv_traits_impl.hpp; sourceTree = ""; }; - 13E9F1BA19754DE4007591EC /* false_result.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = false_result.hpp; sourceTree = ""; }; - 13E9F1BB19754DE4007591EC /* has_binary_operator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_binary_operator.hpp; sourceTree = ""; }; - 13E9F1BC19754DE4007591EC /* has_postfix_operator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_postfix_operator.hpp; sourceTree = ""; }; - 13E9F1BD19754DE4007591EC /* has_prefix_operator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_prefix_operator.hpp; sourceTree = ""; }; - 13E9F1BE19754DE4007591EC /* ice_and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ice_and.hpp; sourceTree = ""; }; - 13E9F1BF19754DE4007591EC /* ice_eq.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ice_eq.hpp; sourceTree = ""; }; - 13E9F1C019754DE4007591EC /* ice_not.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ice_not.hpp; sourceTree = ""; }; - 13E9F1C119754DE4007591EC /* ice_or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ice_or.hpp; sourceTree = ""; }; - 13E9F1C219754DE4007591EC /* is_function_ptr_helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_function_ptr_helper.hpp; sourceTree = ""; }; - 13E9F1C319754DE4007591EC /* is_function_ptr_tester.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_function_ptr_tester.hpp; sourceTree = ""; }; - 13E9F1C419754DE4007591EC /* is_mem_fun_pointer_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_mem_fun_pointer_impl.hpp; sourceTree = ""; }; - 13E9F1C519754DE4007591EC /* is_mem_fun_pointer_tester.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_mem_fun_pointer_tester.hpp; sourceTree = ""; }; - 13E9F1C619754DE4007591EC /* size_t_trait_def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_t_trait_def.hpp; sourceTree = ""; }; - 13E9F1C719754DE4007591EC /* size_t_trait_undef.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_t_trait_undef.hpp; sourceTree = ""; }; - 13E9F1C819754DE4007591EC /* template_arity_spec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_arity_spec.hpp; sourceTree = ""; }; - 13E9F1C919754DE4007591EC /* type_trait_def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_trait_def.hpp; sourceTree = ""; }; - 13E9F1CA19754DE4007591EC /* type_trait_undef.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_trait_undef.hpp; sourceTree = ""; }; - 13E9F1CB19754DE4007591EC /* wrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wrap.hpp; sourceTree = ""; }; - 13E9F1CC19754DE4007591EC /* yes_no_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = yes_no_type.hpp; sourceTree = ""; }; - 13E9F1CD19754DE4007591EC /* extent.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = extent.hpp; sourceTree = ""; }; - 13E9F1CE19754DE4007591EC /* floating_point_promotion.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = floating_point_promotion.hpp; sourceTree = ""; }; - 13E9F1CF19754DE4007591EC /* function_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = function_traits.hpp; sourceTree = ""; }; - 13E9F1D019754DE4007591EC /* has_bit_and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_and.hpp; sourceTree = ""; }; - 13E9F1D119754DE4007591EC /* has_bit_and_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_and_assign.hpp; sourceTree = ""; }; - 13E9F1D219754DE4007591EC /* has_bit_or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_or.hpp; sourceTree = ""; }; - 13E9F1D319754DE4007591EC /* has_bit_or_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_or_assign.hpp; sourceTree = ""; }; - 13E9F1D419754DE4007591EC /* has_bit_xor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_xor.hpp; sourceTree = ""; }; - 13E9F1D519754DE4007591EC /* has_bit_xor_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_bit_xor_assign.hpp; sourceTree = ""; }; - 13E9F1D619754DE4007591EC /* has_complement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_complement.hpp; sourceTree = ""; }; - 13E9F1D719754DE4007591EC /* has_dereference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_dereference.hpp; sourceTree = ""; }; - 13E9F1D819754DE4007591EC /* has_divides.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_divides.hpp; sourceTree = ""; }; - 13E9F1D919754DE4007591EC /* has_divides_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_divides_assign.hpp; sourceTree = ""; }; - 13E9F1DA19754DE4007591EC /* has_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_equal_to.hpp; sourceTree = ""; }; - 13E9F1DB19754DE4007591EC /* has_greater.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_greater.hpp; sourceTree = ""; }; - 13E9F1DC19754DE4007591EC /* has_greater_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_greater_equal.hpp; sourceTree = ""; }; - 13E9F1DD19754DE4007591EC /* has_left_shift.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_left_shift.hpp; sourceTree = ""; }; - 13E9F1DE19754DE4007591EC /* has_left_shift_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_left_shift_assign.hpp; sourceTree = ""; }; - 13E9F1DF19754DE4007591EC /* has_less.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_less.hpp; sourceTree = ""; }; - 13E9F1E019754DE4007591EC /* has_less_equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_less_equal.hpp; sourceTree = ""; }; - 13E9F1E119754DE4007591EC /* has_logical_and.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_logical_and.hpp; sourceTree = ""; }; - 13E9F1E219754DE4007591EC /* has_logical_not.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_logical_not.hpp; sourceTree = ""; }; - 13E9F1E319754DE4007591EC /* has_logical_or.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_logical_or.hpp; sourceTree = ""; }; - 13E9F1E419754DE4007591EC /* has_minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_minus.hpp; sourceTree = ""; }; - 13E9F1E519754DE4007591EC /* has_minus_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_minus_assign.hpp; sourceTree = ""; }; - 13E9F1E619754DE4007591EC /* has_modulus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_modulus.hpp; sourceTree = ""; }; - 13E9F1E719754DE4007591EC /* has_modulus_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_modulus_assign.hpp; sourceTree = ""; }; - 13E9F1E819754DE4007591EC /* has_multiplies.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_multiplies.hpp; sourceTree = ""; }; - 13E9F1E919754DE4007591EC /* has_multiplies_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_multiplies_assign.hpp; sourceTree = ""; }; - 13E9F1EA19754DE4007591EC /* has_negate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_negate.hpp; sourceTree = ""; }; - 13E9F1EB19754DE4007591EC /* has_new_operator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_new_operator.hpp; sourceTree = ""; }; - 13E9F1EC19754DE4007591EC /* has_not_equal_to.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_not_equal_to.hpp; sourceTree = ""; }; - 13E9F1ED19754DE4007591EC /* has_nothrow_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_nothrow_assign.hpp; sourceTree = ""; }; - 13E9F1EE19754DE4007591EC /* has_nothrow_constructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_nothrow_constructor.hpp; sourceTree = ""; }; - 13E9F1EF19754DE4007591EC /* has_nothrow_copy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_nothrow_copy.hpp; sourceTree = ""; }; - 13E9F1F019754DE4007591EC /* has_nothrow_destructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_nothrow_destructor.hpp; sourceTree = ""; }; - 13E9F1F119754DE4007591EC /* has_operator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_operator.hpp; sourceTree = ""; }; - 13E9F1F219754DE4007591EC /* has_plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_plus.hpp; sourceTree = ""; }; - 13E9F1F319754DE4007591EC /* has_plus_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_plus_assign.hpp; sourceTree = ""; }; - 13E9F1F419754DE4007591EC /* has_post_decrement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_post_decrement.hpp; sourceTree = ""; }; - 13E9F1F519754DE4007591EC /* has_post_increment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_post_increment.hpp; sourceTree = ""; }; - 13E9F1F619754DE4007591EC /* has_pre_decrement.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_pre_decrement.hpp; sourceTree = ""; }; - 13E9F1F719754DE4007591EC /* has_pre_increment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_pre_increment.hpp; sourceTree = ""; }; - 13E9F1F819754DE4007591EC /* has_right_shift.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_right_shift.hpp; sourceTree = ""; }; - 13E9F1F919754DE4007591EC /* has_right_shift_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_right_shift_assign.hpp; sourceTree = ""; }; - 13E9F1FA19754DE4007591EC /* has_trivial_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_assign.hpp; sourceTree = ""; }; - 13E9F1FB19754DE4007591EC /* has_trivial_constructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_constructor.hpp; sourceTree = ""; }; - 13E9F1FC19754DE4007591EC /* has_trivial_copy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_copy.hpp; sourceTree = ""; }; - 13E9F1FD19754DE4007591EC /* has_trivial_destructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_destructor.hpp; sourceTree = ""; }; - 13E9F1FE19754DE4007591EC /* has_trivial_move_assign.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_move_assign.hpp; sourceTree = ""; }; - 13E9F1FF19754DE4007591EC /* has_trivial_move_constructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_trivial_move_constructor.hpp; sourceTree = ""; }; - 13E9F20019754DE4007591EC /* has_unary_minus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_unary_minus.hpp; sourceTree = ""; }; - 13E9F20119754DE4007591EC /* has_unary_plus.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_unary_plus.hpp; sourceTree = ""; }; - 13E9F20219754DE4007591EC /* has_virtual_destructor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = has_virtual_destructor.hpp; sourceTree = ""; }; - 13E9F20319754DE4007591EC /* ice.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ice.hpp; sourceTree = ""; }; - 13E9F20419754DE4007591EC /* integral_constant.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_constant.hpp; sourceTree = ""; }; - 13E9F20519754DE4007591EC /* integral_promotion.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_promotion.hpp; sourceTree = ""; }; - 13E9F20619754DE4007591EC /* intrinsics.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = intrinsics.hpp; sourceTree = ""; }; - 13E9F20719754DE4007591EC /* is_abstract.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_abstract.hpp; sourceTree = ""; }; - 13E9F20819754DE4007591EC /* is_arithmetic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_arithmetic.hpp; sourceTree = ""; }; - 13E9F20919754DE4007591EC /* is_array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_array.hpp; sourceTree = ""; }; - 13E9F20A19754DE4007591EC /* is_base_and_derived.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_base_and_derived.hpp; sourceTree = ""; }; - 13E9F20B19754DE4007591EC /* is_base_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_base_of.hpp; sourceTree = ""; }; - 13E9F20C19754DE4007591EC /* is_class.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_class.hpp; sourceTree = ""; }; - 13E9F20D19754DE4007591EC /* is_complex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_complex.hpp; sourceTree = ""; }; - 13E9F20E19754DE4007591EC /* is_compound.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_compound.hpp; sourceTree = ""; }; - 13E9F20F19754DE4007591EC /* is_const.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_const.hpp; sourceTree = ""; }; - 13E9F21019754DE4007591EC /* is_convertible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_convertible.hpp; sourceTree = ""; }; - 13E9F21119754DE4007591EC /* is_copy_constructible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_copy_constructible.hpp; sourceTree = ""; }; - 13E9F21219754DE4007591EC /* is_empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_empty.hpp; sourceTree = ""; }; - 13E9F21319754DE4007591EC /* is_enum.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_enum.hpp; sourceTree = ""; }; - 13E9F21419754DE4007591EC /* is_float.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_float.hpp; sourceTree = ""; }; - 13E9F21519754DE4007591EC /* is_floating_point.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_floating_point.hpp; sourceTree = ""; }; - 13E9F21619754DE4007591EC /* is_function.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_function.hpp; sourceTree = ""; }; - 13E9F21719754DE4007591EC /* is_fundamental.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_fundamental.hpp; sourceTree = ""; }; - 13E9F21819754DE4007591EC /* is_integral.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_integral.hpp; sourceTree = ""; }; - 13E9F21919754DE4007591EC /* is_lvalue_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_lvalue_reference.hpp; sourceTree = ""; }; - 13E9F21A19754DE4007591EC /* is_member_function_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_member_function_pointer.hpp; sourceTree = ""; }; - 13E9F21B19754DE4007591EC /* is_member_object_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_member_object_pointer.hpp; sourceTree = ""; }; - 13E9F21C19754DE4007591EC /* is_member_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_member_pointer.hpp; sourceTree = ""; }; - 13E9F21D19754DE4007591EC /* is_nothrow_move_assignable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_nothrow_move_assignable.hpp; sourceTree = ""; }; - 13E9F21E19754DE4007591EC /* is_nothrow_move_constructible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_nothrow_move_constructible.hpp; sourceTree = ""; }; - 13E9F21F19754DE4007591EC /* is_object.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_object.hpp; sourceTree = ""; }; - 13E9F22019754DE4007591EC /* is_pod.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_pod.hpp; sourceTree = ""; }; - 13E9F22119754DE4007591EC /* is_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_pointer.hpp; sourceTree = ""; }; - 13E9F22219754DE4007591EC /* is_polymorphic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_polymorphic.hpp; sourceTree = ""; }; - 13E9F22319754DE4007591EC /* is_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_reference.hpp; sourceTree = ""; }; - 13E9F22419754DE4007591EC /* is_rvalue_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_rvalue_reference.hpp; sourceTree = ""; }; - 13E9F22519754DE4007591EC /* is_same.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_same.hpp; sourceTree = ""; }; - 13E9F22619754DE4007591EC /* is_scalar.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_scalar.hpp; sourceTree = ""; }; - 13E9F22719754DE4007591EC /* is_signed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_signed.hpp; sourceTree = ""; }; - 13E9F22819754DE4007591EC /* is_stateless.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_stateless.hpp; sourceTree = ""; }; - 13E9F22919754DE4007591EC /* is_union.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_union.hpp; sourceTree = ""; }; - 13E9F22A19754DE4007591EC /* is_unsigned.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_unsigned.hpp; sourceTree = ""; }; - 13E9F22B19754DE4007591EC /* is_virtual_base_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_virtual_base_of.hpp; sourceTree = ""; }; - 13E9F22C19754DE4007591EC /* is_void.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_void.hpp; sourceTree = ""; }; - 13E9F22D19754DE4007591EC /* is_volatile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_volatile.hpp; sourceTree = ""; }; - 13E9F22E19754DE4007591EC /* make_signed.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_signed.hpp; sourceTree = ""; }; - 13E9F22F19754DE4007591EC /* make_unsigned.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = make_unsigned.hpp; sourceTree = ""; }; - 13E9F23119754DE4007591EC /* remove_all_extents.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_all_extents.hpp; sourceTree = ""; }; - 13E9F23219754DE4007591EC /* remove_bounds.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_bounds.hpp; sourceTree = ""; }; - 13E9F23319754DE4007591EC /* remove_const.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_const.hpp; sourceTree = ""; }; - 13E9F23419754DE4007591EC /* remove_cv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_cv.hpp; sourceTree = ""; }; - 13E9F23519754DE4007591EC /* remove_extent.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_extent.hpp; sourceTree = ""; }; - 13E9F23619754DE4007591EC /* remove_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_pointer.hpp; sourceTree = ""; }; - 13E9F23719754DE4007591EC /* remove_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_reference.hpp; sourceTree = ""; }; - 13E9F23819754DE4007591EC /* remove_volatile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_volatile.hpp; sourceTree = ""; }; - 13E9F23919754DE4007591EC /* typeof.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof.hpp; sourceTree = ""; }; - 13E9F23A19754DE4007591EC /* promote.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = promote.hpp; sourceTree = ""; }; - 13E9F23B19754DE4007591EC /* rank.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rank.hpp; sourceTree = ""; }; - 13E9F23C19754DE4007591EC /* remove_all_extents.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_all_extents.hpp; sourceTree = ""; }; - 13E9F23D19754DE4007591EC /* remove_bounds.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_bounds.hpp; sourceTree = ""; }; - 13E9F23E19754DE4007591EC /* remove_const.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_const.hpp; sourceTree = ""; }; - 13E9F23F19754DE4007591EC /* remove_cv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_cv.hpp; sourceTree = ""; }; - 13E9F24019754DE4007591EC /* remove_extent.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_extent.hpp; sourceTree = ""; }; - 13E9F24119754DE4007591EC /* remove_pointer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_pointer.hpp; sourceTree = ""; }; - 13E9F24219754DE4007591EC /* remove_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_reference.hpp; sourceTree = ""; }; - 13E9F24319754DE4007591EC /* remove_volatile.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_volatile.hpp; sourceTree = ""; }; - 13E9F24419754DE4007591EC /* type_with_alignment.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_with_alignment.hpp; sourceTree = ""; }; - 13E9F24519754DE4007591EC /* type_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_traits.hpp; sourceTree = ""; }; - 13E9F24819754DE4007591EC /* typeof_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof_impl.hpp; sourceTree = ""; }; - 13E9F24919754DE4007591EC /* encode_decode.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = encode_decode.hpp; sourceTree = ""; }; - 13E9F24A19754DE4007591EC /* encode_decode_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = encode_decode_params.hpp; sourceTree = ""; }; - 13E9F24B19754DE4007591EC /* int_encoding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = int_encoding.hpp; sourceTree = ""; }; - 13E9F24C19754DE4007591EC /* integral_template_param.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = integral_template_param.hpp; sourceTree = ""; }; - 13E9F24D19754DE4007591EC /* message.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = message.hpp; sourceTree = ""; }; - 13E9F24E19754DE4007591EC /* modifiers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = modifiers.hpp; sourceTree = ""; }; - 13E9F25019754DE4007591EC /* typeof_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof_impl.hpp; sourceTree = ""; }; - 13E9F25119754DE4007591EC /* native.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = native.hpp; sourceTree = ""; }; - 13E9F25219754DE4007591EC /* pointers_data_members.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pointers_data_members.hpp; sourceTree = ""; }; - 13E9F25319754DE4007591EC /* register_functions.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = register_functions.hpp; sourceTree = ""; }; - 13E9F25419754DE4007591EC /* register_functions_iterate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = register_functions_iterate.hpp; sourceTree = ""; }; - 13E9F25519754DE4007591EC /* register_fundamental.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = register_fundamental.hpp; sourceTree = ""; }; - 13E9F25619754DE4007591EC /* register_mem_functions.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = register_mem_functions.hpp; sourceTree = ""; }; - 13E9F25719754DE4007591EC /* template_encoding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_encoding.hpp; sourceTree = ""; }; - 13E9F25819754DE4007591EC /* template_template_param.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_template_param.hpp; sourceTree = ""; }; - 13E9F25919754DE4007591EC /* type_encoding.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_encoding.hpp; sourceTree = ""; }; - 13E9F25A19754DE4007591EC /* type_template_param.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = type_template_param.hpp; sourceTree = ""; }; - 13E9F25B19754DE4007591EC /* typeof.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof.hpp; sourceTree = ""; }; - 13E9F25C19754DE4007591EC /* typeof_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = typeof_impl.hpp; sourceTree = ""; }; - 13E9F25D19754DE4007591EC /* unsupported.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unsupported.hpp; sourceTree = ""; }; - 13E9F25E19754DE4007591EC /* vector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector.hpp; sourceTree = ""; }; - 13E9F25F19754DE4007591EC /* vector100.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector100.hpp; sourceTree = ""; }; - 13E9F26019754DE4007591EC /* vector150.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector150.hpp; sourceTree = ""; }; - 13E9F26119754DE4007591EC /* vector200.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector200.hpp; sourceTree = ""; }; - 13E9F26219754DE4007591EC /* vector50.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vector50.hpp; sourceTree = ""; }; - 13E9F26419754DE4007591EC /* addressof.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = addressof.hpp; sourceTree = ""; }; - 13E9F26519754DE4007591EC /* base_from_member.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = base_from_member.hpp; sourceTree = ""; }; - 13E9F26619754DE4007591EC /* binary.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = binary.hpp; sourceTree = ""; }; - 13E9F26719754DE4007591EC /* compare_pointees.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = compare_pointees.hpp; sourceTree = ""; }; - 13E9F26819754DE4007591EC /* declval.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = declval.hpp; sourceTree = ""; }; - 13E9F26A19754DE4007591EC /* in_place_factory_prefix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = in_place_factory_prefix.hpp; sourceTree = ""; }; - 13E9F26B19754DE4007591EC /* in_place_factory_suffix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = in_place_factory_suffix.hpp; sourceTree = ""; }; - 13E9F26C19754DE4007591EC /* result_of_iterate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = result_of_iterate.hpp; sourceTree = ""; }; - 13E9F26D19754DE4007591EC /* enable_if.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_if.hpp; sourceTree = ""; }; - 13E9F26E19754DE4007591EC /* identity_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = identity_type.hpp; sourceTree = ""; }; - 13E9F26F19754DE4007591EC /* in_place_factory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = in_place_factory.hpp; sourceTree = ""; }; - 13E9F27019754DE4007591EC /* result_of.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = result_of.hpp; sourceTree = ""; }; - 13E9F27119754DE4007591EC /* swap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = swap.hpp; sourceTree = ""; }; - 13E9F27219754DE4007591EC /* utility.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utility.hpp; sourceTree = ""; }; - 13E9F27D19754DE5007591EC /* version.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = version.hpp; sourceTree = ""; }; - 13E9F27E19754DE5007591EC /* visit_each.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = visit_each.hpp; sourceTree = ""; }; - 13E9F27F19754DE5007591EC /* weak_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = weak_ptr.hpp; sourceTree = ""; }; - 13E9F28019754DE5007591EC /* bootregister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootregister.h; sourceTree = ""; }; - 13E9F28119754DE5007591EC /* bootrun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootrun.h; sourceTree = ""; }; - 13E9F28219754DE5007591EC /* CommFrequencyLimit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommFrequencyLimit.cpp; sourceTree = ""; }; - 13E9F28319754DE5007591EC /* CommFrequencyLimit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommFrequencyLimit.h; sourceTree = ""; }; - 13E9F28419754DE5007591EC /* compiler_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compiler_util.h; sourceTree = ""; }; - 13E9F28519754DE5007591EC /* copy_wrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = copy_wrapper.h; sourceTree = ""; }; - 13E9F28719754DE5007591EC /* CoreServiceBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreServiceBase.cpp; sourceTree = ""; }; - 13E9F28819754DE5007591EC /* CoreServiceBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreServiceBase.h; sourceTree = ""; }; - 13E9F28919754DE5007591EC /* ServiceBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceBase.h; sourceTree = ""; }; - 13E9F28A19754DE5007591EC /* ServiceImpl.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceImpl.inl; sourceTree = ""; }; - 13E9F29819754DE5007591EC /* __crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = __crypt.h; sourceTree = ""; }; - 13E9F29919754DE5007591EC /* crypt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crypt.c; sourceTree = ""; }; - 13E9F29A19754DE5007591EC /* iBase64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = iBase64.cpp; sourceTree = ""; }; - 13E9F29B19754DE5007591EC /* iBase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iBase64.h; sourceTree = ""; }; - 13E9F29E19754DE5007591EC /* rbdes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rbdes.c; sourceTree = ""; }; - 13E9F29F19754DE5007591EC /* rbdes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rbdes.h; sourceTree = ""; }; - 13E9F2A019754DE5007591EC /* cxxnamespacefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxxnamespacefix.h; sourceTree = ""; }; - 13E9F2A219754DE5007591EC /* debugger_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debugger_utils.c; sourceTree = ""; }; - 13E9F2A319754DE5007591EC /* debugger_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugger_utils.h; sourceTree = ""; }; - 13E9F2A419754DE5007591EC /* spy.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy.inl; sourceTree = ""; }; - 13E9F2A519754DE5007591EC /* spy_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spy_base.h; sourceTree = ""; }; - 13E9F2A619754DE5007591EC /* spy_impl_helper.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy_impl_helper.inl; sourceTree = ""; }; - 13E9F2A719754DE5007591EC /* test_spy_sample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_spy_sample.cpp; sourceTree = ""; }; - 13E9F2A819754DE5007591EC /* test_spy_sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = test_spy_sample.h; sourceTree = ""; }; - 13E9F2A919754DE5007591EC /* testspy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testspy.cpp; sourceTree = ""; }; - 13E9F2AA19754DE5007591EC /* testspy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testspy.h; sourceTree = ""; }; - 13E9F2AB19754DE5007591EC /* DNS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNS.cpp; sourceTree = ""; }; - 13E9F2AC19754DE5007591EC /* DNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNS.h; sourceTree = ""; }; - 13E9F2AD19754DE5007591EC /* has_member.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = has_member.h; sourceTree = ""; }; - 13E9F2AF19754DE5007591EC /* http.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = http.cpp; sourceTree = ""; }; - 13E9F2B019754DE5007591EC /* http.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = http.h; sourceTree = ""; }; - 13E9F2B119754DE5007591EC /* INI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INI.h; sourceTree = ""; }; - 13E9F2B219754DE5007591EC /* MarcoToolkit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarcoToolkit.h; sourceTree = ""; }; - 13E9F2B319754DE5007591EC /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5.c; sourceTree = ""; }; - 13E9F2B419754DE5007591EC /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; - 13E9F2B519754DE5007591EC /* memdbg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memdbg.cpp; sourceTree = ""; }; - 13E9F2B619754DE5007591EC /* memdbg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memdbg.h; sourceTree = ""; }; - 13E9F2B819754DE5007591EC /* MessageQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageQueue.cpp; sourceTree = ""; }; - 13E9F2B919754DE5007591EC /* MessageQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageQueue.h; sourceTree = ""; }; - 13E9F2BA19754DE5007591EC /* MessageQueueUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageQueueUtils.cpp; sourceTree = ""; }; - 13E9F2BB19754DE5007591EC /* MessageQueueUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageQueueUtils.h; sourceTree = ""; }; - 13E9F2BD19754DE5007591EC /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = ""; }; - 13E9F2BE19754DE5007591EC /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = ""; }; - 13E9F2C019754DE5007591EC /* ip_icmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_icmp.h; sourceTree = ""; }; - 13E9F2C119754DE5007591EC /* objc_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objc_timer.h; sourceTree = ""; }; - 13E9F2C219754DE5007591EC /* objc_timer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = objc_timer.mm; sourceTree = ""; }; - 13E9F2C319754DE5007591EC /* platform_comm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = platform_comm.mm; sourceTree = ""; }; - 13E9F2C419754DE5007591EC /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; - 13E9F2C519754DE5007591EC /* Reachability.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Reachability.mm; sourceTree = ""; }; - 13E9F2C619754DE5007591EC /* route.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; }; - 13E9F2C719754DE5007591EC /* scope_autoreleasepool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_autoreleasepool.h; sourceTree = ""; }; - 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = scope_autoreleasepool.mm; sourceTree = ""; }; - 13E9F2C919754DE5007591EC /* ThreadOperationQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadOperationQueue.h; sourceTree = ""; }; - 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThreadOperationQueue.mm; sourceTree = ""; }; - 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = xlogger_threadinfo.mm; sourceTree = ""; }; - 13E9F2CC19754DE5007591EC /* platform_comm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_comm.h; sourceTree = ""; }; - 13E9F2CD19754DE5007591EC /* PtrBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PtrBuffer.cpp; sourceTree = ""; }; - 13E9F2CE19754DE5007591EC /* PtrBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PtrBuffer.h; sourceTree = ""; }; - 13E9F2CF19754DE5007591EC /* ScopeRecursionLimit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeRecursionLimit.h; sourceTree = ""; }; - 13E9F2D019754DE5007591EC /* singleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = singleton.cpp; sourceTree = ""; }; - 13E9F2D119754DE5007591EC /* singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = singleton.h; sourceTree = ""; }; - 13E9F2D319754DE5007591EC /* ComplexConnect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexConnect.cpp; sourceTree = ""; }; - 13E9F2D419754DE5007591EC /* ComplexConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexConnect.h; sourceTree = ""; }; - 13E9F2D519754DE5007591EC /* SocketSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketSelect.h; sourceTree = ""; }; - 13E9F2D619754DE5007591EC /* TcpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TcpClient.cpp; sourceTree = ""; }; - 13E9F2D719754DE5007591EC /* TcpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpClient.h; sourceTree = ""; }; - 13E9F2D819754DE5007591EC /* unix_socket.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unix_socket.c; sourceTree = ""; }; - 13E9F2D919754DE5007591EC /* unix_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix_socket.h; sourceTree = ""; }; - 13E9F2DA19754DE5007591EC /* strutil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strutil.cpp; sourceTree = ""; }; - 13E9F2DB19754DE5007591EC /* strutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strutil.h; sourceTree = ""; }; - 13E9F2DD19754DE5007591EC /* atomic_oper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomic_oper.h; sourceTree = ""; }; - 13E9F2DE19754DE5007591EC /* bind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bind.h; sourceTree = ""; }; - 13E9F2DF19754DE5007591EC /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 13E9F2E019754DE5007591EC /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 13E9F2E119754DE5007591EC /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 13E9F2E219754DE5007591EC /* mutexvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutexvector.h; sourceTree = ""; }; - 13E9F2E319754DE5007591EC /* runnable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runnable.h; sourceTree = ""; }; - 13E9F2E419754DE5007591EC /* spinlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spinlock.h; sourceTree = ""; }; - 13E9F2E519754DE5007591EC /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 13E9F2E619754DE5007591EC /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 13E9F2E719754DE5007591EC /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 13E9F2E819754DE5007591EC /* tinyxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cpp; sourceTree = ""; }; - 13E9F2E919754DE6007591EC /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = ""; }; - 13E9F2EC19754DE6007591EC /* SocketSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketSelect.cpp; sourceTree = ""; }; - 13E9F2ED19754DE6007591EC /* SocketSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SocketSelect.h; sourceTree = ""; }; - 13E9F2EF19754DE6007591EC /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 13E9F2F019754DE6007591EC /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 13E9F2F119754DE6007591EC /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 13E9F2F219754DE6007591EC /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 13E9F2F319754DE6007591EC /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 13E9F2F419754DE6007591EC /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 13E9F2F519754DE6007591EC /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utils.c; sourceTree = ""; }; - 13E9F2F619754DE6007591EC /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utils.h; sourceTree = ""; }; - 13E9F2F819754DE6007591EC /* preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = preprocessor.h; sourceTree = ""; }; - 13E9F2F919754DE6007591EC /* test.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test.cpp_; sourceTree = ""; }; - 13E9F2FA19754DE6007591EC /* test_for_c.c_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_for_c.c_; sourceTree = ""; }; - 13E9F2FB19754DE6007591EC /* xlogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xlogger.h; sourceTree = ""; }; - 13E9F2FC19754DE6007591EC /* xloggerbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xloggerbase.c; sourceTree = ""; }; - 13E9F2FD19754DE6007591EC /* xloggerbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xloggerbase.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libcomm-watch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcomm-watch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 425BA57F1A14AD0600073A45 /* tickcount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tickcount.cpp; sourceTree = ""; }; - 425BA5801A14AD0600073A45 /* tickcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tickcount.h; sourceTree = ""; }; - 4F516B731A19F3B20006EC9D /* getifaddrs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getifaddrs.cpp; sourceTree = ""; }; - 4F516B741A19F3B20006EC9D /* getifaddrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getifaddrs.h; sourceTree = ""; }; - 4FB8EE341A370BD400B3A99E /* verinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = verinfo.h; sourceTree = ""; }; - 4FB8EE361A370C0700B3A99E /* connection.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = connection.hpp; sourceTree = ""; }; - 4FB8EE371A370C0700B3A99E /* deconstruct.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deconstruct.hpp; sourceTree = ""; }; - 4FB8EE381A370C0700B3A99E /* deconstruct_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = deconstruct_ptr.hpp; sourceTree = ""; }; - 4FB8EE3A1A370C0700B3A99E /* auto_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = auto_buffer.hpp; sourceTree = ""; }; - 4FB8EE3B1A370C0700B3A99E /* foreign_ptr.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = foreign_ptr.hpp; sourceTree = ""; }; - 4FB8EE3C1A370C0700B3A99E /* lwm_nop.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_nop.hpp; sourceTree = ""; }; - 4FB8EE3D1A370C0700B3A99E /* lwm_pthreads.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_pthreads.hpp; sourceTree = ""; }; - 4FB8EE3E1A370C0700B3A99E /* lwm_win32_cs.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lwm_win32_cs.hpp; sourceTree = ""; }; - 4FB8EE3F1A370C0700B3A99E /* null_output_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = null_output_iterator.hpp; sourceTree = ""; }; - 4FB8EE401A370C0700B3A99E /* preprocessed_arg_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preprocessed_arg_type.hpp; sourceTree = ""; }; - 4FB8EE411A370C0700B3A99E /* preprocessed_arg_type_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preprocessed_arg_type_template.hpp; sourceTree = ""; }; - 4FB8EE421A370C0700B3A99E /* replace_slot_function.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = replace_slot_function.hpp; sourceTree = ""; }; - 4FB8EE431A370C0700B3A99E /* result_type_wrapper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = result_type_wrapper.hpp; sourceTree = ""; }; - 4FB8EE441A370C0700B3A99E /* signal_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal_template.hpp; sourceTree = ""; }; - 4FB8EE451A370C0700B3A99E /* signals_common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signals_common.hpp; sourceTree = ""; }; - 4FB8EE461A370C0700B3A99E /* signals_common_macros.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signals_common_macros.hpp; sourceTree = ""; }; - 4FB8EE471A370C0700B3A99E /* slot_call_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot_call_iterator.hpp; sourceTree = ""; }; - 4FB8EE481A370C0700B3A99E /* slot_groups.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot_groups.hpp; sourceTree = ""; }; - 4FB8EE491A370C0700B3A99E /* slot_template.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot_template.hpp; sourceTree = ""; }; - 4FB8EE4A1A370C0700B3A99E /* tracked_objects_visitor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = tracked_objects_visitor.hpp; sourceTree = ""; }; - 4FB8EE4B1A370C0700B3A99E /* unique_lock.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unique_lock.hpp; sourceTree = ""; }; - 4FB8EE4C1A370C0700B3A99E /* variadic_arg_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = variadic_arg_type.hpp; sourceTree = ""; }; - 4FB8EE4D1A370C0700B3A99E /* variadic_slot_invoker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = variadic_slot_invoker.hpp; sourceTree = ""; }; - 4FB8EE4E1A370C0700B3A99E /* dummy_mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dummy_mutex.hpp; sourceTree = ""; }; - 4FB8EE4F1A370C0700B3A99E /* expired_slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = expired_slot.hpp; sourceTree = ""; }; - 4FB8EE501A370C0700B3A99E /* last_value.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = last_value.hpp; sourceTree = ""; }; - 4FB8EE511A370C0700B3A99E /* mutex.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mutex.hpp; sourceTree = ""; }; - 4FB8EE521A370C0700B3A99E /* optional_last_value.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional_last_value.hpp; sourceTree = ""; }; - 4FB8EE531A370C0700B3A99E /* postconstructible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = postconstructible.hpp; sourceTree = ""; }; - 4FB8EE541A370C0700B3A99E /* predestructible.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = predestructible.hpp; sourceTree = ""; }; - 4FB8EE551A370C0700B3A99E /* preprocessed_signal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preprocessed_signal.hpp; sourceTree = ""; }; - 4FB8EE561A370C0700B3A99E /* preprocessed_slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preprocessed_slot.hpp; sourceTree = ""; }; - 4FB8EE571A370C0700B3A99E /* shared_connection_block.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = shared_connection_block.hpp; sourceTree = ""; }; - 4FB8EE581A370C0700B3A99E /* signal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal.hpp; sourceTree = ""; }; - 4FB8EE591A370C0700B3A99E /* signal_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal_base.hpp; sourceTree = ""; }; - 4FB8EE5A1A370C0700B3A99E /* signal_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = signal_type.hpp; sourceTree = ""; }; - 4FB8EE5B1A370C0700B3A99E /* slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot.hpp; sourceTree = ""; }; - 4FB8EE5C1A370C0700B3A99E /* slot_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = slot_base.hpp; sourceTree = ""; }; - 4FB8EE5D1A370C0700B3A99E /* trackable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = trackable.hpp; sourceTree = ""; }; - 4FB8EE5E1A370C0700B3A99E /* variadic_signal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = variadic_signal.hpp; sourceTree = ""; }; - 4FB8EE5F1A370C0700B3A99E /* variadic_slot.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = variadic_slot.hpp; sourceTree = ""; }; - 4FC0D7CD19A3681B00E8CB6E /* TcpClientFSM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TcpClientFSM.cpp; sourceTree = ""; }; - 4FC0D7CE19A3681B00E8CB6E /* TcpClientFSM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpClientFSM.h; sourceTree = ""; }; - 4FC0D7D019A4898100E8CB6E /* anr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = anr.cpp; sourceTree = ""; }; - 4FC0D7D119A4898100E8CB6E /* anr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = anr.h; sourceTree = ""; }; - 4FCB62C21A307EFA00E57EE0 /* TcpFSMHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpFSMHandler.h; sourceTree = ""; }; - 4FCB62C31A307EFA00E57EE0 /* TcpServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TcpServer.cpp; sourceTree = ""; }; - 4FCB62C41A307EFA00E57EE0 /* TcpServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpServer.h; sourceTree = ""; }; - 4FCB62C51A307EFA00E57EE0 /* TcpServerFSM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TcpServerFSM.cpp; sourceTree = ""; }; - 4FCB62C61A307EFA00E57EE0 /* TcpServerFSM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TcpServerFSM.h; sourceTree = ""; }; - 4FCB62D91A30802600E57EE0 /* BasePacker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BasePacker.cpp; sourceTree = ""; }; - 4FCB62DA1A30802600E57EE0 /* BasePacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasePacker.h; sourceTree = ""; }; - F16A5FBB1ACD7EE50085FBDD /* categories.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = categories.hpp; sourceTree = ""; }; - F16A5FBC1ACD7EE50085FBDD /* char_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = char_traits.hpp; sourceTree = ""; }; - F16A5FBD1ACD7EE50085FBDD /* checked_operations.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = checked_operations.hpp; sourceTree = ""; }; - F16A5FBE1ACD7EE50085FBDD /* close.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = close.hpp; sourceTree = ""; }; - F16A5FBF1ACD7EE50085FBDD /* concepts.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = concepts.hpp; sourceTree = ""; }; - F16A5FC01ACD7EE50085FBDD /* constants.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = constants.hpp; sourceTree = ""; }; - F16A5FC31ACD7EE50085FBDD /* concept_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = concept_adapter.hpp; sourceTree = ""; }; - F16A5FC41ACD7EE50085FBDD /* mode_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mode_adapter.hpp; sourceTree = ""; }; - F16A5FC51ACD7EE50085FBDD /* non_blocking_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = non_blocking_adapter.hpp; sourceTree = ""; }; - F16A5FC61ACD7EE50085FBDD /* output_iterator_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = output_iterator_adapter.hpp; sourceTree = ""; }; - F16A5FC71ACD7EE50085FBDD /* range_adapter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = range_adapter.hpp; sourceTree = ""; }; - F16A5FC81ACD7EE50085FBDD /* bool_trait_def.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bool_trait_def.hpp; sourceTree = ""; }; - F16A5FCA1ACD7EE50085FBDD /* forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward.hpp; sourceTree = ""; }; - F16A5FCB1ACD7EE50085FBDD /* stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stream.hpp; sourceTree = ""; }; - F16A5FCC1ACD7EE50085FBDD /* stream_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stream_buffer.hpp; sourceTree = ""; }; - F16A5FCD1ACD7EE50085FBDD /* buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = buffer.hpp; sourceTree = ""; }; - F16A5FCE1ACD7EE50085FBDD /* call_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = call_traits.hpp; sourceTree = ""; }; - F16A5FCF1ACD7EE50085FBDD /* char_traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = char_traits.hpp; sourceTree = ""; }; - F16A5FD11ACD7EE50085FBDD /* auto_link.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = auto_link.hpp; sourceTree = ""; }; - F16A5FD21ACD7EE50085FBDD /* bzip2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bzip2.hpp; sourceTree = ""; }; - F16A5FD31ACD7EE50085FBDD /* codecvt.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = codecvt.hpp; sourceTree = ""; }; - F16A5FD41ACD7EE50085FBDD /* disable_warnings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = disable_warnings.hpp; sourceTree = ""; }; - F16A5FD51ACD7EE50085FBDD /* dyn_link.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dyn_link.hpp; sourceTree = ""; }; - F16A5FD61ACD7EE50085FBDD /* enable_warnings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_warnings.hpp; sourceTree = ""; }; - F16A5FD71ACD7EE50085FBDD /* fpos.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = fpos.hpp; sourceTree = ""; }; - F16A5FD81ACD7EE50085FBDD /* gcc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gcc.hpp; sourceTree = ""; }; - F16A5FD91ACD7EE50085FBDD /* limits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = limits.hpp; sourceTree = ""; }; - F16A5FDA1ACD7EE50085FBDD /* overload_resolution.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = overload_resolution.hpp; sourceTree = ""; }; - F16A5FDB1ACD7EE50085FBDD /* rtl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rtl.hpp; sourceTree = ""; }; - F16A5FDC1ACD7EE50085FBDD /* unreachable_return.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unreachable_return.hpp; sourceTree = ""; }; - F16A5FDD1ACD7EE50085FBDD /* wide_streams.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wide_streams.hpp; sourceTree = ""; }; - F16A5FDE1ACD7EE50085FBDD /* windows_posix.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = windows_posix.hpp; sourceTree = ""; }; - F16A5FDF1ACD7EE50085FBDD /* zlib.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = zlib.hpp; sourceTree = ""; }; - F16A5FE01ACD7EE50085FBDD /* default_arg.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = default_arg.hpp; sourceTree = ""; }; - F16A5FE11ACD7EE50085FBDD /* dispatch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = dispatch.hpp; sourceTree = ""; }; - F16A5FE21ACD7EE50085FBDD /* double_object.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = double_object.hpp; sourceTree = ""; }; - F16A5FE31ACD7EE50085FBDD /* enable_if_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enable_if_stream.hpp; sourceTree = ""; }; - F16A5FE41ACD7EE50085FBDD /* error.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = error.hpp; sourceTree = ""; }; - F16A5FE51ACD7EE50085FBDD /* execute.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = execute.hpp; sourceTree = ""; }; - F16A5FE61ACD7EE50085FBDD /* file_handle.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = file_handle.hpp; sourceTree = ""; }; - F16A5FE71ACD7EE50085FBDD /* forward.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = forward.hpp; sourceTree = ""; }; - F16A5FE81ACD7EE50085FBDD /* functional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = functional.hpp; sourceTree = ""; }; - F16A5FE91ACD7EE50085FBDD /* ios.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ios.hpp; sourceTree = ""; }; - F16A5FEA1ACD7EE50085FBDD /* iostream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iostream.hpp; sourceTree = ""; }; - F16A5FEB1ACD7EE50085FBDD /* is_dereferenceable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_dereferenceable.hpp; sourceTree = ""; }; - F16A5FEC1ACD7EE50085FBDD /* is_iterator_range.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = is_iterator_range.hpp; sourceTree = ""; }; - F16A5FED1ACD7EE50085FBDD /* optional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional.hpp; sourceTree = ""; }; - F16A5FEE1ACD7EE50085FBDD /* path.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = path.hpp; sourceTree = ""; }; - F16A5FEF1ACD7EE50085FBDD /* push.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push.hpp; sourceTree = ""; }; - F16A5FF01ACD7EE50085FBDD /* push_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = push_params.hpp; sourceTree = ""; }; - F16A5FF11ACD7EE50085FBDD /* resolve.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = resolve.hpp; sourceTree = ""; }; - F16A5FF21ACD7EE50085FBDD /* select.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = select.hpp; sourceTree = ""; }; - F16A5FF31ACD7EE50085FBDD /* select_by_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = select_by_size.hpp; sourceTree = ""; }; - F16A5FF51ACD7EE50085FBDD /* direct_streambuf.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = direct_streambuf.hpp; sourceTree = ""; }; - F16A5FF61ACD7EE50085FBDD /* indirect_streambuf.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = indirect_streambuf.hpp; sourceTree = ""; }; - F16A5FF71ACD7EE50085FBDD /* linked_streambuf.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = linked_streambuf.hpp; sourceTree = ""; }; - F16A5FF81ACD7EE50085FBDD /* streambuf.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = streambuf.hpp; sourceTree = ""; }; - F16A5FF91ACD7EE50085FBDD /* system_failure.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = system_failure.hpp; sourceTree = ""; }; - F16A5FFA1ACD7EE50085FBDD /* template_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = template_params.hpp; sourceTree = ""; }; - F16A5FFC1ACD7EE50085FBDD /* close.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = close.hpp; sourceTree = ""; }; - F16A5FFD1ACD7EE50085FBDD /* read.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = read.hpp; sourceTree = ""; }; - F16A5FFE1ACD7EE50085FBDD /* write.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = write.hpp; sourceTree = ""; }; - F16A5FFF1ACD7EE50085FBDD /* wrap_unwrap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wrap_unwrap.hpp; sourceTree = ""; }; - F16A60011ACD7EE50085FBDD /* array.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = array.hpp; sourceTree = ""; }; - F16A60021ACD7EE50085FBDD /* back_inserter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = back_inserter.hpp; sourceTree = ""; }; - F16A60031ACD7EE50085FBDD /* file_descriptor.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = file_descriptor.hpp; sourceTree = ""; }; - F16A60041ACD7EE50085FBDD /* mapped_file.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mapped_file.hpp; sourceTree = ""; }; - F16A60051ACD7EE50085FBDD /* null.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = null.hpp; sourceTree = ""; }; - F16A60071ACD7EE50085FBDD /* bzip2.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = bzip2.hpp; sourceTree = ""; }; - F16A60081ACD7EE50085FBDD /* gzip.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = gzip.hpp; sourceTree = ""; }; - F16A60091ACD7EE50085FBDD /* symmetric.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = symmetric.hpp; sourceTree = ""; }; - F16A600A1ACD7EE50085FBDD /* zlib.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = zlib.hpp; sourceTree = ""; }; - F16A600B1ACD7EE50085FBDD /* flush.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = flush.hpp; sourceTree = ""; }; - F16A600C1ACD7EE50085FBDD /* get.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = get.hpp; sourceTree = ""; }; - F16A600D1ACD7EE50085FBDD /* imbue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = imbue.hpp; sourceTree = ""; }; - F16A600E1ACD7EE50085FBDD /* input_sequence.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = input_sequence.hpp; sourceTree = ""; }; - F16A600F1ACD7EE50085FBDD /* operations.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = operations.hpp; sourceTree = ""; }; - F16A60101ACD7EE50085FBDD /* operations_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = operations_fwd.hpp; sourceTree = ""; }; - F16A60111ACD7EE50085FBDD /* optimal_buffer_size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optimal_buffer_size.hpp; sourceTree = ""; }; - F16A60121ACD7EE50085FBDD /* output_sequence.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = output_sequence.hpp; sourceTree = ""; }; - F16A60131ACD7EE50085FBDD /* pipeline.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pipeline.hpp; sourceTree = ""; }; - F16A60141ACD7EE50085FBDD /* positioning.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = positioning.hpp; sourceTree = ""; }; - F16A60151ACD7EE50085FBDD /* put.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = put.hpp; sourceTree = ""; }; - F16A60161ACD7EE50085FBDD /* putback.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = putback.hpp; sourceTree = ""; }; - F16A60171ACD7EE50085FBDD /* read.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = read.hpp; sourceTree = ""; }; - F16A60181ACD7EE50085FBDD /* seek.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = seek.hpp; sourceTree = ""; }; - F16A60191ACD7EE50085FBDD /* stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stream.hpp; sourceTree = ""; }; - F16A601A1ACD7EE50085FBDD /* stream_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = stream_buffer.hpp; sourceTree = ""; }; - F16A601B1ACD7EE50085FBDD /* traits.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = traits.hpp; sourceTree = ""; }; - F16A601C1ACD7EE50085FBDD /* traits_fwd.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = traits_fwd.hpp; sourceTree = ""; }; - F16A601D1ACD7EE50085FBDD /* write.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = write.hpp; sourceTree = ""; }; - F16A601E1ACD7F8D0085FBDD /* is_incrementable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = is_incrementable.hpp; path = detail/is_incrementable.hpp; sourceTree = ""; }; - F16A602B1ACD7FEE0085FBDD /* file_descriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_descriptor.cpp; sourceTree = ""; }; - F16A602C1ACD7FEE0085FBDD /* gzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gzip.cpp; sourceTree = ""; }; - F16A602D1ACD7FEE0085FBDD /* mapped_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mapped_file.cpp; sourceTree = ""; }; - F16A602E1ACD7FEE0085FBDD /* zlib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = zlib.cpp; sourceTree = ""; }; - F16A60351ACD80140085FBDD /* equal.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equal.hpp; sourceTree = ""; }; - F16A60361ACD80140085FBDD /* begin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin.hpp; sourceTree = ""; }; - F16A60371ACD80140085FBDD /* concepts.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = concepts.hpp; sourceTree = ""; }; - F16A60381ACD80140085FBDD /* config.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = config.hpp; sourceTree = ""; }; - F16A60391ACD80140085FBDD /* const_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = const_iterator.hpp; sourceTree = ""; }; - F16A603B1ACD80140085FBDD /* begin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = begin.hpp; sourceTree = ""; }; - F16A603C1ACD80140085FBDD /* common.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = common.hpp; sourceTree = ""; }; - F16A603D1ACD80140085FBDD /* const_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = const_iterator.hpp; sourceTree = ""; }; - F16A603E1ACD80140085FBDD /* end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = end.hpp; sourceTree = ""; }; - F16A603F1ACD80140085FBDD /* extract_optional_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = extract_optional_type.hpp; sourceTree = ""; }; - F16A60401ACD80140085FBDD /* implementation_help.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = implementation_help.hpp; sourceTree = ""; }; - F16A60411ACD80140085FBDD /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - F16A60421ACD80140085FBDD /* misc_concept.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = misc_concept.hpp; sourceTree = ""; }; - F16A60431ACD80140085FBDD /* remove_extent.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = remove_extent.hpp; sourceTree = ""; }; - F16A60441ACD80140085FBDD /* safe_bool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = safe_bool.hpp; sourceTree = ""; }; - F16A60451ACD80140085FBDD /* sfinae.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sfinae.hpp; sourceTree = ""; }; - F16A60461ACD80140085FBDD /* size_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_type.hpp; sourceTree = ""; }; - F16A60481ACD80140085FBDD /* end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = end.hpp; sourceTree = ""; }; - F16A60491ACD80140085FBDD /* difference_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = difference_type.hpp; sourceTree = ""; }; - F16A604A1ACD80140085FBDD /* distance.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = distance.hpp; sourceTree = ""; }; - F16A604B1ACD80140085FBDD /* empty.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = empty.hpp; sourceTree = ""; }; - F16A604C1ACD80140085FBDD /* end.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = end.hpp; sourceTree = ""; }; - F16A604D1ACD80140085FBDD /* functions.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = functions.hpp; sourceTree = ""; }; - F16A604E1ACD80140085FBDD /* iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator.hpp; sourceTree = ""; }; - F16A604F1ACD80140085FBDD /* iterator_range.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_range.hpp; sourceTree = ""; }; - F16A60501ACD80140085FBDD /* iterator_range_core.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_range_core.hpp; sourceTree = ""; }; - F16A60511ACD80140085FBDD /* iterator_range_io.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = iterator_range_io.hpp; sourceTree = ""; }; - F16A60521ACD80140085FBDD /* mutable_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mutable_iterator.hpp; sourceTree = ""; }; - F16A60531ACD80140085FBDD /* rbegin.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rbegin.hpp; sourceTree = ""; }; - F16A60541ACD80140085FBDD /* rend.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = rend.hpp; sourceTree = ""; }; - F16A60551ACD80140085FBDD /* result_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = result_iterator.hpp; sourceTree = ""; }; - F16A60561ACD80140085FBDD /* reverse_iterator.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = reverse_iterator.hpp; sourceTree = ""; }; - F16A60571ACD80140085FBDD /* size.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size.hpp; sourceTree = ""; }; - F16A60581ACD80140085FBDD /* size_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = size_type.hpp; sourceTree = ""; }; - F16A60591ACD80140085FBDD /* value_type.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = value_type.hpp; sourceTree = ""; }; - F1C0DAF919C862DF0056DE44 /* UdpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UdpClient.cpp; sourceTree = ""; }; - F1C0DAFA19C862DF0056DE44 /* UdpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UdpClient.h; sourceTree = ""; }; - F1C0DAFB19C862DF0056DE44 /* UdpServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UdpServer.cpp; sourceTree = ""; }; - F1C0DAFC19C862DF0056DE44 /* UdpServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UdpServer.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 13704D4B197E444C00ED4EF8 /* libs */ = { - isa = PBXGroup; - children = ( - F16A60291ACD7FEE0085FBDD /* iostreams */, - 13704D4F197E444C00ED4EF8 /* date_time */, - 13704D64197E444C00ED4EF8 /* smart_ptr */, - ); - path = libs; - sourceTree = ""; - }; - 13704D4F197E444C00ED4EF8 /* date_time */ = { - isa = PBXGroup; - children = ( - 13704D50197E444C00ED4EF8 /* src */, - ); - path = date_time; - sourceTree = ""; - }; - 13704D50197E444C00ED4EF8 /* src */ = { - isa = PBXGroup; - children = ( - 13704D51197E444C00ED4EF8 /* date_time.doc */, - 13704D52197E444C00ED4EF8 /* gregorian */, - 13704D58197E444C00ED4EF8 /* posix_time */, - ); - path = src; - sourceTree = ""; - }; - 13704D52197E444C00ED4EF8 /* gregorian */ = { - isa = PBXGroup; - children = ( - 13704D53197E444C00ED4EF8 /* date_generators.cpp */, - 13704D54197E444C00ED4EF8 /* greg_month.cpp */, - 13704D55197E444C00ED4EF8 /* greg_names.hpp */, - 13704D56197E444C00ED4EF8 /* greg_weekday.cpp */, - 13704D57197E444C00ED4EF8 /* gregorian_types.cpp */, - ); - path = gregorian; - sourceTree = ""; - }; - 13704D58197E444C00ED4EF8 /* posix_time */ = { - isa = PBXGroup; - children = ( - 13704D59197E444C00ED4EF8 /* posix_time_types.cpp */, - ); - path = posix_time; - sourceTree = ""; - }; - 13704D64197E444C00ED4EF8 /* smart_ptr */ = { - isa = PBXGroup; - children = ( - 13704D65197E444C00ED4EF8 /* src */, - ); - path = smart_ptr; - sourceTree = ""; - }; - 13704D65197E444C00ED4EF8 /* src */ = { - isa = PBXGroup; - children = ( - 13704D66197E444C00ED4EF8 /* sp_collector.cpp */, - 13704D67197E444C00ED4EF8 /* sp_debug_hooks.cpp */, - ); - path = src; - sourceTree = ""; - }; - 13E9EA9C19754DE1007591EC /* boost */ = { - isa = PBXGroup; - children = ( - F16A60331ACD80140085FBDD /* range */, - F16A601E1ACD7F8D0085FBDD /* is_incrementable.hpp */, - F16A5FBA1ACD7EE50085FBDD /* iostreams */, - 4FB8EE351A370C0700B3A99E /* signals2 */, - 13704D4B197E444C00ED4EF8 /* libs */, - 13E9EA9D19754DE1007591EC /* aligned_storage.hpp */, - 13E9EA9E19754DE1007591EC /* any.hpp */, - 13E9EAA019754DE1007591EC /* assert.hpp */, - 13E9EAB919754DE1007591EC /* bind */, - 13E9EAC619754DE1007591EC /* bind.hpp */, - 13E9EACA19754DE1007591EC /* checked_delete.hpp */, - 13E9EAEB19754DE1007591EC /* config */, - 13E9EB3619754DE1007591EC /* config.hpp */, - 13E9EB4619754DE1007591EC /* cstdint.hpp */, - 13E9EB4719754DE1007591EC /* current_function.hpp */, - 13E9EB8919754DE1007591EC /* detail */, - 13E9EBA519754DE1007591EC /* enable_shared_from_this.hpp */, - 13E9EBA619754DE1007591EC /* exception */, - 13E9EBB719754DE1007591EC /* function */, - 13E9EBCD19754DE1007591EC /* function.hpp */, - 13E9EBCE19754DE1007591EC /* function_equal.hpp */, - 13E9EBDA19754DE2007591EC /* get_pointer.hpp */, - 13E9EBDF19754DE2007591EC /* integer.hpp */, - 13E9EBE019754DE2007591EC /* integer_fwd.hpp */, - 13E9EBE119754DE2007591EC /* integer_traits.hpp */, - 13E9EBEC19754DE2007591EC /* intrusive_ptr.hpp */, - 13E9EBF019754DE2007591EC /* is_placeholder.hpp */, - 13E9EBF119754DE2007591EC /* iterator */, - 13E9EBFF19754DE2007591EC /* iterator.hpp */, - 13E9EC0019754DE2007591EC /* last_value.hpp */, - 13E9EC0119754DE2007591EC /* lexical_cast.hpp */, - 13E9EC3119754DE2007591EC /* limits.hpp */, - 13E9EC3219754DE2007591EC /* make_shared.hpp */, - 13E9EC4419754DE2007591EC /* mem_fn.hpp */, - 13E9EC4519754DE2007591EC /* memory_order.hpp */, - 13E9EC5119754DE2007591EC /* mpl */, - 13E9EFA119754DE3007591EC /* next_prior.hpp */, - 13E9EFA219754DE3007591EC /* non_type.hpp */, - 13E9EFA319754DE3007591EC /* noncopyable.hpp */, - 13E9EFA419754DE3007591EC /* none.hpp */, - 13E9EFA519754DE3007591EC /* none_t.hpp */, - 13E9EFBF19754DE3007591EC /* operators.hpp */, - 13E9EFC019754DE3007591EC /* optional */, - 13E9EFC319754DE3007591EC /* optional.hpp */, - 13E9EFF619754DE3007591EC /* preprocessor */, - 13E9F0ED19754DE4007591EC /* ref.hpp */, - 13E9F0EE19754DE4007591EC /* scoped_array.hpp */, - 13E9F0EF19754DE4007591EC /* scoped_ptr.hpp */, - 13E9F0F019754DE4007591EC /* shared_array.hpp */, - 13E9F0F119754DE4007591EC /* shared_ptr.hpp */, - 13E9F0F219754DE4007591EC /* signal.hpp */, - 13E9F0F319754DE4007591EC /* signals */, - 13E9F10919754DE4007591EC /* smart_ptr */, - 13E9F14F19754DE4007591EC /* smart_ptr.hpp */, - 13E9F15019754DE4007591EC /* static_assert.hpp */, - 13E9F19819754DE4007591EC /* throw_exception.hpp */, - 13E9F1A119754DE4007591EC /* type.hpp */, - 13E9F1A219754DE4007591EC /* type_traits */, - 13E9F24519754DE4007591EC /* type_traits.hpp */, - 13E9F24619754DE4007591EC /* typeof */, - 13E9F26319754DE4007591EC /* utility */, - 13E9F27219754DE4007591EC /* utility.hpp */, - 13E9F27D19754DE5007591EC /* version.hpp */, - 13E9F27E19754DE5007591EC /* visit_each.hpp */, - 13E9F27F19754DE5007591EC /* weak_ptr.hpp */, - ); - path = boost; - sourceTree = ""; - }; - 13E9EAB919754DE1007591EC /* bind */ = { - isa = PBXGroup; - children = ( - 13E9EABA19754DE1007591EC /* arg.hpp */, - 13E9EABB19754DE1007591EC /* bind.hpp */, - 13E9EABC19754DE1007591EC /* bind_cc.hpp */, - 13E9EABD19754DE1007591EC /* bind_mf2_cc.hpp */, - 13E9EABE19754DE1007591EC /* bind_mf_cc.hpp */, - 13E9EABF19754DE1007591EC /* bind_template.hpp */, - 13E9EAC019754DE1007591EC /* mem_fn.hpp */, - 13E9EAC119754DE1007591EC /* mem_fn_cc.hpp */, - 13E9EAC219754DE1007591EC /* mem_fn_template.hpp */, - 13E9EAC319754DE1007591EC /* mem_fn_vw.hpp */, - 13E9EAC419754DE1007591EC /* placeholders.hpp */, - 13E9EAC519754DE1007591EC /* storage.hpp */, - ); - path = bind; - sourceTree = ""; - }; - 13E9EAEB19754DE1007591EC /* config */ = { - isa = PBXGroup; - children = ( - 13E9EAEC19754DE1007591EC /* abi */, - 13E9EAF119754DE1007591EC /* abi_prefix.hpp */, - 13E9EAF219754DE1007591EC /* abi_suffix.hpp */, - 13E9EAF319754DE1007591EC /* auto_link.hpp */, - 13E9EAF419754DE1007591EC /* compiler */, - 13E9EB0C19754DE1007591EC /* no_tr1 */, - 13E9EB1219754DE1007591EC /* platform */, - 13E9EB2319754DE1007591EC /* posix_features.hpp */, - 13E9EB2419754DE1007591EC /* requires_threads.hpp */, - 13E9EB2519754DE1007591EC /* select_compiler_config.hpp */, - 13E9EB2619754DE1007591EC /* select_platform_config.hpp */, - 13E9EB2719754DE1007591EC /* select_stdlib_config.hpp */, - 13E9EB2819754DE1007591EC /* stdlib */, - 13E9EB3319754DE1007591EC /* suffix.hpp */, - 13E9EB3419754DE1007591EC /* user.hpp */, - 13E9EB3519754DE1007591EC /* warning_disable.hpp */, - ); - path = config; - sourceTree = ""; - }; - 13E9EAEC19754DE1007591EC /* abi */ = { - isa = PBXGroup; - children = ( - 13E9EAED19754DE1007591EC /* borland_prefix.hpp */, - 13E9EAEE19754DE1007591EC /* borland_suffix.hpp */, - 13E9EAEF19754DE1007591EC /* msvc_prefix.hpp */, - 13E9EAF019754DE1007591EC /* msvc_suffix.hpp */, - ); - path = abi; - sourceTree = ""; - }; - 13E9EAF419754DE1007591EC /* compiler */ = { - isa = PBXGroup; - children = ( - 13E9EAF519754DE1007591EC /* borland.hpp */, - 13E9EAF619754DE1007591EC /* clang.hpp */, - 13E9EAF719754DE1007591EC /* codegear.hpp */, - 13E9EAF819754DE1007591EC /* comeau.hpp */, - 13E9EAF919754DE1007591EC /* common_edg.hpp */, - 13E9EAFA19754DE1007591EC /* compaq_cxx.hpp */, - 13E9EAFB19754DE1007591EC /* cray.hpp */, - 13E9EAFC19754DE1007591EC /* digitalmars.hpp */, - 13E9EAFD19754DE1007591EC /* gcc.hpp */, - 13E9EAFE19754DE1007591EC /* gcc_xml.hpp */, - 13E9EAFF19754DE1007591EC /* greenhills.hpp */, - 13E9EB0019754DE1007591EC /* hp_acc.hpp */, - 13E9EB0119754DE1007591EC /* intel.hpp */, - 13E9EB0219754DE1007591EC /* kai.hpp */, - 13E9EB0319754DE1007591EC /* metrowerks.hpp */, - 13E9EB0419754DE1007591EC /* mpw.hpp */, - 13E9EB0519754DE1007591EC /* nvcc.hpp */, - 13E9EB0619754DE1007591EC /* pathscale.hpp */, - 13E9EB0719754DE1007591EC /* pgi.hpp */, - 13E9EB0819754DE1007591EC /* sgi_mipspro.hpp */, - 13E9EB0919754DE1007591EC /* sunpro_cc.hpp */, - 13E9EB0A19754DE1007591EC /* vacpp.hpp */, - 13E9EB0B19754DE1007591EC /* visualc.hpp */, - ); - path = compiler; - sourceTree = ""; - }; - 13E9EB0C19754DE1007591EC /* no_tr1 */ = { - isa = PBXGroup; - children = ( - 13E9EB0D19754DE1007591EC /* cmath.hpp */, - 13E9EB0E19754DE1007591EC /* complex.hpp */, - 13E9EB0F19754DE1007591EC /* functional.hpp */, - 13E9EB1019754DE1007591EC /* memory.hpp */, - 13E9EB1119754DE1007591EC /* utility.hpp */, - ); - path = no_tr1; - sourceTree = ""; - }; - 13E9EB1219754DE1007591EC /* platform */ = { - isa = PBXGroup; - children = ( - 13E9EB1319754DE1007591EC /* aix.hpp */, - 13E9EB1419754DE1007591EC /* amigaos.hpp */, - 13E9EB1519754DE1007591EC /* beos.hpp */, - 13E9EB1619754DE1007591EC /* bsd.hpp */, - 13E9EB1719754DE1007591EC /* cray.hpp */, - 13E9EB1819754DE1007591EC /* cygwin.hpp */, - 13E9EB1919754DE1007591EC /* hpux.hpp */, - 13E9EB1A19754DE1007591EC /* irix.hpp */, - 13E9EB1B19754DE1007591EC /* linux.hpp */, - 13E9EB1C19754DE1007591EC /* macos.hpp */, - 13E9EB1D19754DE1007591EC /* qnxnto.hpp */, - 13E9EB1E19754DE1007591EC /* solaris.hpp */, - 13E9EB1F19754DE1007591EC /* symbian.hpp */, - 13E9EB2019754DE1007591EC /* vms.hpp */, - 13E9EB2119754DE1007591EC /* vxworks.hpp */, - 13E9EB2219754DE1007591EC /* win32.hpp */, - ); - path = platform; - sourceTree = ""; - }; - 13E9EB2819754DE1007591EC /* stdlib */ = { - isa = PBXGroup; - children = ( - 13E9EB2919754DE1007591EC /* dinkumware.hpp */, - 13E9EB2A19754DE1007591EC /* libcomo.hpp */, - 13E9EB2B19754DE1007591EC /* libcpp.hpp */, - 13E9EB2C19754DE1007591EC /* libstdcpp3.hpp */, - 13E9EB2D19754DE1007591EC /* modena.hpp */, - 13E9EB2E19754DE1007591EC /* msl.hpp */, - 13E9EB2F19754DE1007591EC /* roguewave.hpp */, - 13E9EB3019754DE1007591EC /* sgi.hpp */, - 13E9EB3119754DE1007591EC /* stlport.hpp */, - 13E9EB3219754DE1007591EC /* vacpp.hpp */, - ); - path = stdlib; - sourceTree = ""; - }; - 13E9EB8919754DE1007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9EB8A19754DE1007591EC /* atomic_count.hpp */, - 13E9EB8B19754DE1007591EC /* atomic_redef_macros.hpp */, - 13E9EB8C19754DE1007591EC /* atomic_undef_macros.hpp */, - 13E9EB8D19754DE1007591EC /* call_traits.hpp */, - 13E9EB8E19754DE1007591EC /* container_fwd.hpp */, - 13E9EB8F19754DE1007591EC /* endian.hpp */, - 13E9EB9019754DE1007591EC /* fenv.hpp */, - 13E9EB9119754DE1007591EC /* indirect_traits.hpp */, - 13E9EB9219754DE1007591EC /* interlocked.hpp */, - 13E9EB9319754DE1007591EC /* is_function_ref_tester.hpp */, - 13E9EB9419754DE1007591EC /* iterator.hpp */, - 13E9EB9519754DE1007591EC /* lcast_precision.hpp */, - 13E9EB9619754DE1007591EC /* lightweight_mutex.hpp */, - 13E9EB9719754DE1007591EC /* lightweight_test.hpp */, - 13E9EB9819754DE1007591EC /* lightweight_thread.hpp */, - 13E9EB9919754DE1007591EC /* no_exceptions_support.hpp */, - 13E9EB9A19754DE1007591EC /* ob_call_traits.hpp */, - 13E9EB9B19754DE1007591EC /* quick_allocator.hpp */, - 13E9EB9C19754DE1007591EC /* reference_content.hpp */, - 13E9EB9D19754DE1007591EC /* scoped_enum_emulation.hpp */, - 13E9EB9E19754DE1007591EC /* sp_typeinfo.hpp */, - 13E9EB9F19754DE1007591EC /* winapi */, - 13E9EBA419754DE1007591EC /* workaround.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9EB9F19754DE1007591EC /* winapi */ = { - isa = PBXGroup; - children = ( - 13E9EBA019754DE1007591EC /* basic_types.hpp */, - 13E9EBA119754DE1007591EC /* GetLastError.hpp */, - 13E9EBA219754DE1007591EC /* time.hpp */, - 13E9EBA319754DE1007591EC /* timers.hpp */, - ); - path = winapi; - sourceTree = ""; - }; - 13E9EBA619754DE1007591EC /* exception */ = { - isa = PBXGroup; - children = ( - 13E9EBA719754DE1007591EC /* current_exception_cast.hpp */, - 13E9EBA819754DE1007591EC /* detail */, - 13E9EBB019754DE1007591EC /* diagnostic_information.hpp */, - 13E9EBB119754DE1007591EC /* exception.hpp */, - 13E9EBB219754DE1007591EC /* get_error_info.hpp */, - 13E9EBB319754DE1007591EC /* info.hpp */, - 13E9EBB419754DE1007591EC /* to_string.hpp */, - 13E9EBB519754DE1007591EC /* to_string_stub.hpp */, - ); - path = exception; - sourceTree = ""; - }; - 13E9EBA819754DE1007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9EBA919754DE1007591EC /* attribute_noreturn.hpp */, - 13E9EBAA19754DE1007591EC /* clone_current_exception.hpp */, - 13E9EBAB19754DE1007591EC /* error_info_impl.hpp */, - 13E9EBAC19754DE1007591EC /* exception_ptr.hpp */, - 13E9EBAD19754DE1007591EC /* is_output_streamable.hpp */, - 13E9EBAE19754DE1007591EC /* object_hex_dump.hpp */, - 13E9EBAF19754DE1007591EC /* type_info.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9EBB719754DE1007591EC /* function */ = { - isa = PBXGroup; - children = ( - 13E9EBB819754DE1007591EC /* detail */, - 13E9EBBD19754DE1007591EC /* function0.hpp */, - 13E9EBBE19754DE1007591EC /* function1.hpp */, - 13E9EBBF19754DE1007591EC /* function10.hpp */, - 13E9EBC019754DE1007591EC /* function2.hpp */, - 13E9EBC119754DE1007591EC /* function3.hpp */, - 13E9EBC219754DE1007591EC /* function4.hpp */, - 13E9EBC319754DE1007591EC /* function5.hpp */, - 13E9EBC419754DE1007591EC /* function6.hpp */, - 13E9EBC519754DE1007591EC /* function7.hpp */, - 13E9EBC619754DE1007591EC /* function8.hpp */, - 13E9EBC719754DE1007591EC /* function9.hpp */, - 13E9EBC819754DE1007591EC /* function_base.hpp */, - 13E9EBC919754DE1007591EC /* function_fwd.hpp */, - 13E9EBCA19754DE1007591EC /* function_template.hpp */, - 13E9EBCB19754DE1007591EC /* function_typeof.hpp */, - 13E9EBCC19754DE1007591EC /* gen_function_N.pl */, - ); - path = function; - sourceTree = ""; - }; - 13E9EBB819754DE1007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9EBB919754DE1007591EC /* function_iterate.hpp */, - 13E9EBBA19754DE1007591EC /* gen_maybe_include.pl */, - 13E9EBBB19754DE1007591EC /* maybe_include.hpp */, - 13E9EBBC19754DE1007591EC /* prologue.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9EBF119754DE2007591EC /* iterator */ = { - isa = PBXGroup; - children = ( - 13E9EBF219754DE2007591EC /* detail */, - 13E9EBF819754DE2007591EC /* interoperable.hpp */, - 13E9EBF919754DE2007591EC /* iterator_adaptor.hpp */, - 13E9EBFA19754DE2007591EC /* iterator_categories.hpp */, - 13E9EBFB19754DE2007591EC /* iterator_concepts.hpp */, - 13E9EBFC19754DE2007591EC /* iterator_facade.hpp */, - 13E9EBFD19754DE2007591EC /* iterator_traits.hpp */, - 13E9EBFE19754DE2007591EC /* reverse_iterator.hpp */, - ); - path = iterator; - sourceTree = ""; - }; - 13E9EBF219754DE2007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9EBF319754DE2007591EC /* config_def.hpp */, - 13E9EBF419754DE2007591EC /* config_undef.hpp */, - 13E9EBF519754DE2007591EC /* enable_if.hpp */, - 13E9EBF619754DE2007591EC /* facade_iterator_category.hpp */, - 13E9EBF719754DE2007591EC /* minimum_category.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9EC5119754DE2007591EC /* mpl */ = { - isa = PBXGroup; - children = ( - 13E9EC5219754DE2007591EC /* advance.hpp */, - 13E9EC5319754DE2007591EC /* advance_fwd.hpp */, - 13E9EC5419754DE2007591EC /* always.hpp */, - 13E9EC5519754DE2007591EC /* and.hpp */, - 13E9EC5619754DE2007591EC /* apply.hpp */, - 13E9EC5719754DE2007591EC /* apply_fwd.hpp */, - 13E9EC5819754DE2007591EC /* apply_wrap.hpp */, - 13E9EC5919754DE2007591EC /* arg.hpp */, - 13E9EC5A19754DE2007591EC /* arg_fwd.hpp */, - 13E9EC5B19754DE2007591EC /* assert.hpp */, - 13E9EC5C19754DE2007591EC /* at.hpp */, - 13E9EC5D19754DE2007591EC /* at_fwd.hpp */, - 13E9EC5E19754DE2007591EC /* aux_ */, - 13E9EEDA19754DE2007591EC /* back_fwd.hpp */, - 13E9EEDB19754DE2007591EC /* back_inserter.hpp */, - 13E9EEDC19754DE2007591EC /* begin_end.hpp */, - 13E9EEDD19754DE2007591EC /* begin_end_fwd.hpp */, - 13E9EEDE19754DE2007591EC /* bind.hpp */, - 13E9EEDF19754DE2007591EC /* bind_fwd.hpp */, - 13E9EEE019754DE2007591EC /* bool.hpp */, - 13E9EEE119754DE2007591EC /* bool_fwd.hpp */, - 13E9EEE219754DE2007591EC /* clear.hpp */, - 13E9EEE319754DE2007591EC /* clear_fwd.hpp */, - 13E9EEE419754DE2007591EC /* comparison.hpp */, - 13E9EEE519754DE2007591EC /* contains.hpp */, - 13E9EEE619754DE2007591EC /* contains_fwd.hpp */, - 13E9EEE719754DE2007591EC /* copy.hpp */, - 13E9EEE819754DE2007591EC /* deref.hpp */, - 13E9EEE919754DE2007591EC /* distance.hpp */, - 13E9EEEA19754DE2007591EC /* distance_fwd.hpp */, - 13E9EEEB19754DE2007591EC /* empty_fwd.hpp */, - 13E9EEEC19754DE2007591EC /* equal_to.hpp */, - 13E9EEED19754DE2007591EC /* eval_if.hpp */, - 13E9EEEE19754DE2007591EC /* find.hpp */, - 13E9EEEF19754DE2007591EC /* find_if.hpp */, - 13E9EEF019754DE2007591EC /* fold.hpp */, - 13E9EEF119754DE2007591EC /* front_fwd.hpp */, - 13E9EEF219754DE3007591EC /* front_inserter.hpp */, - 13E9EEF319754DE3007591EC /* greater.hpp */, - 13E9EEF419754DE3007591EC /* greater_equal.hpp */, - 13E9EEF519754DE3007591EC /* has_xxx.hpp */, - 13E9EEF619754DE3007591EC /* identity.hpp */, - 13E9EEF719754DE3007591EC /* if.hpp */, - 13E9EEF819754DE3007591EC /* inserter.hpp */, - 13E9EEF919754DE3007591EC /* int.hpp */, - 13E9EEFA19754DE3007591EC /* int_fwd.hpp */, - 13E9EEFB19754DE3007591EC /* integral_c.hpp */, - 13E9EEFC19754DE3007591EC /* integral_c_fwd.hpp */, - 13E9EEFD19754DE3007591EC /* integral_c_tag.hpp */, - 13E9EEFE19754DE3007591EC /* is_placeholder.hpp */, - 13E9EEFF19754DE3007591EC /* iter_fold.hpp */, - 13E9EF0019754DE3007591EC /* iter_fold_if.hpp */, - 13E9EF0119754DE3007591EC /* iterator_range.hpp */, - 13E9EF0219754DE3007591EC /* iterator_tags.hpp */, - 13E9EF0319754DE3007591EC /* lambda.hpp */, - 13E9EF0419754DE3007591EC /* lambda_fwd.hpp */, - 13E9EF0519754DE3007591EC /* less.hpp */, - 13E9EF0619754DE3007591EC /* less_equal.hpp */, - 13E9EF0719754DE3007591EC /* limits */, - 13E9EF0C19754DE3007591EC /* list */, - 13E9EF3519754DE3007591EC /* list.hpp */, - 13E9EF3619754DE3007591EC /* logical.hpp */, - 13E9EF3719754DE3007591EC /* long.hpp */, - 13E9EF3819754DE3007591EC /* long_fwd.hpp */, - 13E9EF3919754DE3007591EC /* minus.hpp */, - 13E9EF3A19754DE3007591EC /* multiplies.hpp */, - 13E9EF3B19754DE3007591EC /* negate.hpp */, - 13E9EF3C19754DE3007591EC /* next.hpp */, - 13E9EF3D19754DE3007591EC /* next_prior.hpp */, - 13E9EF3E19754DE3007591EC /* not.hpp */, - 13E9EF3F19754DE3007591EC /* not_equal_to.hpp */, - 13E9EF4019754DE3007591EC /* numeric_cast.hpp */, - 13E9EF4119754DE3007591EC /* O1_size.hpp */, - 13E9EF4219754DE3007591EC /* O1_size_fwd.hpp */, - 13E9EF4319754DE3007591EC /* or.hpp */, - 13E9EF4419754DE3007591EC /* pair.hpp */, - 13E9EF4519754DE3007591EC /* placeholders.hpp */, - 13E9EF4619754DE3007591EC /* plus.hpp */, - 13E9EF4719754DE3007591EC /* pop_back_fwd.hpp */, - 13E9EF4819754DE3007591EC /* pop_front_fwd.hpp */, - 13E9EF4919754DE3007591EC /* prior.hpp */, - 13E9EF4A19754DE3007591EC /* protect.hpp */, - 13E9EF4B19754DE3007591EC /* push_back.hpp */, - 13E9EF4C19754DE3007591EC /* push_back_fwd.hpp */, - 13E9EF4D19754DE3007591EC /* push_front.hpp */, - 13E9EF4E19754DE3007591EC /* push_front_fwd.hpp */, - 13E9EF4F19754DE3007591EC /* quote.hpp */, - 13E9EF5019754DE3007591EC /* remove_if.hpp */, - 13E9EF5119754DE3007591EC /* reverse_fold.hpp */, - 13E9EF5219754DE3007591EC /* same_as.hpp */, - 13E9EF5319754DE3007591EC /* sequence_tag.hpp */, - 13E9EF5419754DE3007591EC /* sequence_tag_fwd.hpp */, - 13E9EF5519754DE3007591EC /* size.hpp */, - 13E9EF5619754DE3007591EC /* size_fwd.hpp */, - 13E9EF5719754DE3007591EC /* size_t.hpp */, - 13E9EF5819754DE3007591EC /* size_t_fwd.hpp */, - 13E9EF5919754DE3007591EC /* tag.hpp */, - 13E9EF5A19754DE3007591EC /* times.hpp */, - 13E9EF5B19754DE3007591EC /* vector */, - 13E9EF9E19754DE3007591EC /* vector.hpp */, - 13E9EF9F19754DE3007591EC /* void.hpp */, - 13E9EFA019754DE3007591EC /* void_fwd.hpp */, - ); - path = mpl; - sourceTree = ""; - }; - 13E9EC5E19754DE2007591EC /* aux_ */ = { - isa = PBXGroup; - children = ( - 13E9EC5F19754DE2007591EC /* adl_barrier.hpp */, - 13E9EC6019754DE2007591EC /* advance_backward.hpp */, - 13E9EC6119754DE2007591EC /* advance_forward.hpp */, - 13E9EC6219754DE2007591EC /* arg_typedef.hpp */, - 13E9EC6319754DE2007591EC /* arithmetic_op.hpp */, - 13E9EC6419754DE2007591EC /* arity.hpp */, - 13E9EC6519754DE2007591EC /* arity_spec.hpp */, - 13E9EC6619754DE2007591EC /* at_impl.hpp */, - 13E9EC6719754DE2007591EC /* begin_end_impl.hpp */, - 13E9EC6819754DE2007591EC /* clear_impl.hpp */, - 13E9EC6919754DE2007591EC /* common_name_wknd.hpp */, - 13E9EC6A19754DE2007591EC /* comparison_op.hpp */, - 13E9EC6B19754DE2007591EC /* config */, - 13E9EC8819754DE2007591EC /* contains_impl.hpp */, - 13E9EC8919754DE2007591EC /* count_args.hpp */, - 13E9EC8A19754DE2007591EC /* find_if_pred.hpp */, - 13E9EC8B19754DE2007591EC /* fold_impl.hpp */, - 13E9EC8C19754DE2007591EC /* fold_impl_body.hpp */, - 13E9EC8D19754DE2007591EC /* full_lambda.hpp */, - 13E9EC8E19754DE2007591EC /* has_apply.hpp */, - 13E9EC8F19754DE2007591EC /* has_begin.hpp */, - 13E9EC9019754DE2007591EC /* has_rebind.hpp */, - 13E9EC9119754DE2007591EC /* has_size.hpp */, - 13E9EC9219754DE2007591EC /* has_tag.hpp */, - 13E9EC9319754DE2007591EC /* has_type.hpp */, - 13E9EC9419754DE2007591EC /* include_preprocessed.hpp */, - 13E9EC9519754DE2007591EC /* inserter_algorithm.hpp */, - 13E9EC9619754DE2007591EC /* integral_wrapper.hpp */, - 13E9EC9719754DE2007591EC /* is_msvc_eti_arg.hpp */, - 13E9EC9819754DE2007591EC /* iter_apply.hpp */, - 13E9EC9919754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EC9A19754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EC9B19754DE2007591EC /* lambda_arity_param.hpp */, - 13E9EC9C19754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EC9D19754DE2007591EC /* lambda_spec.hpp */, - 13E9EC9E19754DE2007591EC /* lambda_support.hpp */, - 13E9EC9F19754DE2007591EC /* largest_int.hpp */, - 13E9ECA019754DE2007591EC /* logical_op.hpp */, - 13E9ECA119754DE2007591EC /* msvc_dtw.hpp */, - 13E9ECA219754DE2007591EC /* msvc_eti_base.hpp */, - 13E9ECA319754DE2007591EC /* msvc_is_class.hpp */, - 13E9ECA419754DE2007591EC /* msvc_never_true.hpp */, - 13E9ECA519754DE2007591EC /* msvc_type.hpp */, - 13E9ECA619754DE2007591EC /* na.hpp */, - 13E9ECA719754DE2007591EC /* na_assert.hpp */, - 13E9ECA819754DE2007591EC /* na_fwd.hpp */, - 13E9ECA919754DE2007591EC /* na_spec.hpp */, - 13E9ECAA19754DE2007591EC /* nested_type_wknd.hpp */, - 13E9ECAB19754DE2007591EC /* nttp_decl.hpp */, - 13E9ECAC19754DE2007591EC /* numeric_cast_utils.hpp */, - 13E9ECAD19754DE2007591EC /* numeric_op.hpp */, - 13E9ECAE19754DE2007591EC /* O1_size_impl.hpp */, - 13E9ECAF19754DE2007591EC /* preprocessed */, - 13E9EEC019754DE2007591EC /* preprocessor */, - 13E9EECD19754DE2007591EC /* push_back_impl.hpp */, - 13E9EECE19754DE2007591EC /* push_front_impl.hpp */, - 13E9EECF19754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EED019754DE2007591EC /* reverse_fold_impl_body.hpp */, - 13E9EED119754DE2007591EC /* sequence_wrapper.hpp */, - 13E9EED219754DE2007591EC /* size_impl.hpp */, - 13E9EED319754DE2007591EC /* static_cast.hpp */, - 13E9EED419754DE2007591EC /* template_arity.hpp */, - 13E9EED519754DE2007591EC /* template_arity_fwd.hpp */, - 13E9EED619754DE2007591EC /* traits_lambda_spec.hpp */, - 13E9EED719754DE2007591EC /* type_wrapper.hpp */, - 13E9EED819754DE2007591EC /* value_wknd.hpp */, - 13E9EED919754DE2007591EC /* yes_no.hpp */, - ); - path = aux_; - sourceTree = ""; - }; - 13E9EC6B19754DE2007591EC /* config */ = { - isa = PBXGroup; - children = ( - 13E9EC6C19754DE2007591EC /* adl.hpp */, - 13E9EC6D19754DE2007591EC /* arrays.hpp */, - 13E9EC6E19754DE2007591EC /* bcc.hpp */, - 13E9EC6F19754DE2007591EC /* bind.hpp */, - 13E9EC7019754DE2007591EC /* compiler.hpp */, - 13E9EC7119754DE2007591EC /* ctps.hpp */, - 13E9EC7219754DE2007591EC /* dependent_nttp.hpp */, - 13E9EC7319754DE2007591EC /* dmc_ambiguous_ctps.hpp */, - 13E9EC7419754DE2007591EC /* dtp.hpp */, - 13E9EC7519754DE2007591EC /* eti.hpp */, - 13E9EC7619754DE2007591EC /* forwarding.hpp */, - 13E9EC7719754DE2007591EC /* gcc.hpp */, - 13E9EC7819754DE2007591EC /* has_apply.hpp */, - 13E9EC7919754DE2007591EC /* has_xxx.hpp */, - 13E9EC7A19754DE2007591EC /* integral.hpp */, - 13E9EC7B19754DE2007591EC /* intel.hpp */, - 13E9EC7C19754DE2007591EC /* lambda.hpp */, - 13E9EC7D19754DE2007591EC /* msvc.hpp */, - 13E9EC7E19754DE2007591EC /* msvc_typename.hpp */, - 13E9EC7F19754DE2007591EC /* nttp.hpp */, - 13E9EC8019754DE2007591EC /* overload_resolution.hpp */, - 13E9EC8119754DE2007591EC /* pp_counter.hpp */, - 13E9EC8219754DE2007591EC /* preprocessor.hpp */, - 13E9EC8319754DE2007591EC /* static_constant.hpp */, - 13E9EC8419754DE2007591EC /* ttp.hpp */, - 13E9EC8519754DE2007591EC /* typeof.hpp */, - 13E9EC8619754DE2007591EC /* use_preprocessed.hpp */, - 13E9EC8719754DE2007591EC /* workaround.hpp */, - ); - path = config; - sourceTree = ""; - }; - 13E9ECAF19754DE2007591EC /* preprocessed */ = { - isa = PBXGroup; - children = ( - 13E9ECB019754DE2007591EC /* bcc */, - 13E9ECE019754DE2007591EC /* bcc551 */, - 13E9ED1019754DE2007591EC /* bcc_pre590 */, - 13E9ED4019754DE2007591EC /* dmc */, - 13E9ED7019754DE2007591EC /* gcc */, - 13E9EDA019754DE2007591EC /* msvc60 */, - 13E9EDD019754DE2007591EC /* msvc70 */, - 13E9EE0019754DE2007591EC /* mwcw */, - 13E9EE3019754DE2007591EC /* no_ctps */, - 13E9EE6019754DE2007591EC /* no_ttp */, - 13E9EE9019754DE2007591EC /* plain */, - ); - path = preprocessed; - sourceTree = ""; - }; - 13E9ECB019754DE2007591EC /* bcc */ = { - isa = PBXGroup; - children = ( - 13E9ECB119754DE2007591EC /* advance_backward.hpp */, - 13E9ECB219754DE2007591EC /* advance_forward.hpp */, - 13E9ECB319754DE2007591EC /* and.hpp */, - 13E9ECB419754DE2007591EC /* apply.hpp */, - 13E9ECB519754DE2007591EC /* apply_fwd.hpp */, - 13E9ECB619754DE2007591EC /* apply_wrap.hpp */, - 13E9ECB719754DE2007591EC /* arg.hpp */, - 13E9ECB819754DE2007591EC /* basic_bind.hpp */, - 13E9ECB919754DE2007591EC /* bind.hpp */, - 13E9ECBA19754DE2007591EC /* bind_fwd.hpp */, - 13E9ECBB19754DE2007591EC /* bitand.hpp */, - 13E9ECBC19754DE2007591EC /* bitor.hpp */, - 13E9ECBD19754DE2007591EC /* bitxor.hpp */, - 13E9ECBE19754DE2007591EC /* deque.hpp */, - 13E9ECBF19754DE2007591EC /* divides.hpp */, - 13E9ECC019754DE2007591EC /* equal_to.hpp */, - 13E9ECC119754DE2007591EC /* fold_impl.hpp */, - 13E9ECC219754DE2007591EC /* full_lambda.hpp */, - 13E9ECC319754DE2007591EC /* greater.hpp */, - 13E9ECC419754DE2007591EC /* greater_equal.hpp */, - 13E9ECC519754DE2007591EC /* inherit.hpp */, - 13E9ECC619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9ECC719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9ECC819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9ECC919754DE2007591EC /* less.hpp */, - 13E9ECCA19754DE2007591EC /* less_equal.hpp */, - 13E9ECCB19754DE2007591EC /* list.hpp */, - 13E9ECCC19754DE2007591EC /* list_c.hpp */, - 13E9ECCD19754DE2007591EC /* map.hpp */, - 13E9ECCE19754DE2007591EC /* minus.hpp */, - 13E9ECCF19754DE2007591EC /* modulus.hpp */, - 13E9ECD019754DE2007591EC /* not_equal_to.hpp */, - 13E9ECD119754DE2007591EC /* or.hpp */, - 13E9ECD219754DE2007591EC /* placeholders.hpp */, - 13E9ECD319754DE2007591EC /* plus.hpp */, - 13E9ECD419754DE2007591EC /* quote.hpp */, - 13E9ECD519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9ECD619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9ECD719754DE2007591EC /* set.hpp */, - 13E9ECD819754DE2007591EC /* set_c.hpp */, - 13E9ECD919754DE2007591EC /* shift_left.hpp */, - 13E9ECDA19754DE2007591EC /* shift_right.hpp */, - 13E9ECDB19754DE2007591EC /* template_arity.hpp */, - 13E9ECDC19754DE2007591EC /* times.hpp */, - 13E9ECDD19754DE2007591EC /* unpack_args.hpp */, - 13E9ECDE19754DE2007591EC /* vector.hpp */, - 13E9ECDF19754DE2007591EC /* vector_c.hpp */, - ); - path = bcc; - sourceTree = ""; - }; - 13E9ECE019754DE2007591EC /* bcc551 */ = { - isa = PBXGroup; - children = ( - 13E9ECE119754DE2007591EC /* advance_backward.hpp */, - 13E9ECE219754DE2007591EC /* advance_forward.hpp */, - 13E9ECE319754DE2007591EC /* and.hpp */, - 13E9ECE419754DE2007591EC /* apply.hpp */, - 13E9ECE519754DE2007591EC /* apply_fwd.hpp */, - 13E9ECE619754DE2007591EC /* apply_wrap.hpp */, - 13E9ECE719754DE2007591EC /* arg.hpp */, - 13E9ECE819754DE2007591EC /* basic_bind.hpp */, - 13E9ECE919754DE2007591EC /* bind.hpp */, - 13E9ECEA19754DE2007591EC /* bind_fwd.hpp */, - 13E9ECEB19754DE2007591EC /* bitand.hpp */, - 13E9ECEC19754DE2007591EC /* bitor.hpp */, - 13E9ECED19754DE2007591EC /* bitxor.hpp */, - 13E9ECEE19754DE2007591EC /* deque.hpp */, - 13E9ECEF19754DE2007591EC /* divides.hpp */, - 13E9ECF019754DE2007591EC /* equal_to.hpp */, - 13E9ECF119754DE2007591EC /* fold_impl.hpp */, - 13E9ECF219754DE2007591EC /* full_lambda.hpp */, - 13E9ECF319754DE2007591EC /* greater.hpp */, - 13E9ECF419754DE2007591EC /* greater_equal.hpp */, - 13E9ECF519754DE2007591EC /* inherit.hpp */, - 13E9ECF619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9ECF719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9ECF819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9ECF919754DE2007591EC /* less.hpp */, - 13E9ECFA19754DE2007591EC /* less_equal.hpp */, - 13E9ECFB19754DE2007591EC /* list.hpp */, - 13E9ECFC19754DE2007591EC /* list_c.hpp */, - 13E9ECFD19754DE2007591EC /* map.hpp */, - 13E9ECFE19754DE2007591EC /* minus.hpp */, - 13E9ECFF19754DE2007591EC /* modulus.hpp */, - 13E9ED0019754DE2007591EC /* not_equal_to.hpp */, - 13E9ED0119754DE2007591EC /* or.hpp */, - 13E9ED0219754DE2007591EC /* placeholders.hpp */, - 13E9ED0319754DE2007591EC /* plus.hpp */, - 13E9ED0419754DE2007591EC /* quote.hpp */, - 13E9ED0519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9ED0619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9ED0719754DE2007591EC /* set.hpp */, - 13E9ED0819754DE2007591EC /* set_c.hpp */, - 13E9ED0919754DE2007591EC /* shift_left.hpp */, - 13E9ED0A19754DE2007591EC /* shift_right.hpp */, - 13E9ED0B19754DE2007591EC /* template_arity.hpp */, - 13E9ED0C19754DE2007591EC /* times.hpp */, - 13E9ED0D19754DE2007591EC /* unpack_args.hpp */, - 13E9ED0E19754DE2007591EC /* vector.hpp */, - 13E9ED0F19754DE2007591EC /* vector_c.hpp */, - ); - path = bcc551; - sourceTree = ""; - }; - 13E9ED1019754DE2007591EC /* bcc_pre590 */ = { - isa = PBXGroup; - children = ( - 13E9ED1119754DE2007591EC /* advance_backward.hpp */, - 13E9ED1219754DE2007591EC /* advance_forward.hpp */, - 13E9ED1319754DE2007591EC /* and.hpp */, - 13E9ED1419754DE2007591EC /* apply.hpp */, - 13E9ED1519754DE2007591EC /* apply_fwd.hpp */, - 13E9ED1619754DE2007591EC /* apply_wrap.hpp */, - 13E9ED1719754DE2007591EC /* arg.hpp */, - 13E9ED1819754DE2007591EC /* basic_bind.hpp */, - 13E9ED1919754DE2007591EC /* bind.hpp */, - 13E9ED1A19754DE2007591EC /* bind_fwd.hpp */, - 13E9ED1B19754DE2007591EC /* bitand.hpp */, - 13E9ED1C19754DE2007591EC /* bitor.hpp */, - 13E9ED1D19754DE2007591EC /* bitxor.hpp */, - 13E9ED1E19754DE2007591EC /* deque.hpp */, - 13E9ED1F19754DE2007591EC /* divides.hpp */, - 13E9ED2019754DE2007591EC /* equal_to.hpp */, - 13E9ED2119754DE2007591EC /* fold_impl.hpp */, - 13E9ED2219754DE2007591EC /* full_lambda.hpp */, - 13E9ED2319754DE2007591EC /* greater.hpp */, - 13E9ED2419754DE2007591EC /* greater_equal.hpp */, - 13E9ED2519754DE2007591EC /* inherit.hpp */, - 13E9ED2619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9ED2719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9ED2819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9ED2919754DE2007591EC /* less.hpp */, - 13E9ED2A19754DE2007591EC /* less_equal.hpp */, - 13E9ED2B19754DE2007591EC /* list.hpp */, - 13E9ED2C19754DE2007591EC /* list_c.hpp */, - 13E9ED2D19754DE2007591EC /* map.hpp */, - 13E9ED2E19754DE2007591EC /* minus.hpp */, - 13E9ED2F19754DE2007591EC /* modulus.hpp */, - 13E9ED3019754DE2007591EC /* not_equal_to.hpp */, - 13E9ED3119754DE2007591EC /* or.hpp */, - 13E9ED3219754DE2007591EC /* placeholders.hpp */, - 13E9ED3319754DE2007591EC /* plus.hpp */, - 13E9ED3419754DE2007591EC /* quote.hpp */, - 13E9ED3519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9ED3619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9ED3719754DE2007591EC /* set.hpp */, - 13E9ED3819754DE2007591EC /* set_c.hpp */, - 13E9ED3919754DE2007591EC /* shift_left.hpp */, - 13E9ED3A19754DE2007591EC /* shift_right.hpp */, - 13E9ED3B19754DE2007591EC /* template_arity.hpp */, - 13E9ED3C19754DE2007591EC /* times.hpp */, - 13E9ED3D19754DE2007591EC /* unpack_args.hpp */, - 13E9ED3E19754DE2007591EC /* vector.hpp */, - 13E9ED3F19754DE2007591EC /* vector_c.hpp */, - ); - path = bcc_pre590; - sourceTree = ""; - }; - 13E9ED4019754DE2007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9ED4119754DE2007591EC /* advance_backward.hpp */, - 13E9ED4219754DE2007591EC /* advance_forward.hpp */, - 13E9ED4319754DE2007591EC /* and.hpp */, - 13E9ED4419754DE2007591EC /* apply.hpp */, - 13E9ED4519754DE2007591EC /* apply_fwd.hpp */, - 13E9ED4619754DE2007591EC /* apply_wrap.hpp */, - 13E9ED4719754DE2007591EC /* arg.hpp */, - 13E9ED4819754DE2007591EC /* basic_bind.hpp */, - 13E9ED4919754DE2007591EC /* bind.hpp */, - 13E9ED4A19754DE2007591EC /* bind_fwd.hpp */, - 13E9ED4B19754DE2007591EC /* bitand.hpp */, - 13E9ED4C19754DE2007591EC /* bitor.hpp */, - 13E9ED4D19754DE2007591EC /* bitxor.hpp */, - 13E9ED4E19754DE2007591EC /* deque.hpp */, - 13E9ED4F19754DE2007591EC /* divides.hpp */, - 13E9ED5019754DE2007591EC /* equal_to.hpp */, - 13E9ED5119754DE2007591EC /* fold_impl.hpp */, - 13E9ED5219754DE2007591EC /* full_lambda.hpp */, - 13E9ED5319754DE2007591EC /* greater.hpp */, - 13E9ED5419754DE2007591EC /* greater_equal.hpp */, - 13E9ED5519754DE2007591EC /* inherit.hpp */, - 13E9ED5619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9ED5719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9ED5819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9ED5919754DE2007591EC /* less.hpp */, - 13E9ED5A19754DE2007591EC /* less_equal.hpp */, - 13E9ED5B19754DE2007591EC /* list.hpp */, - 13E9ED5C19754DE2007591EC /* list_c.hpp */, - 13E9ED5D19754DE2007591EC /* map.hpp */, - 13E9ED5E19754DE2007591EC /* minus.hpp */, - 13E9ED5F19754DE2007591EC /* modulus.hpp */, - 13E9ED6019754DE2007591EC /* not_equal_to.hpp */, - 13E9ED6119754DE2007591EC /* or.hpp */, - 13E9ED6219754DE2007591EC /* placeholders.hpp */, - 13E9ED6319754DE2007591EC /* plus.hpp */, - 13E9ED6419754DE2007591EC /* quote.hpp */, - 13E9ED6519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9ED6619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9ED6719754DE2007591EC /* set.hpp */, - 13E9ED6819754DE2007591EC /* set_c.hpp */, - 13E9ED6919754DE2007591EC /* shift_left.hpp */, - 13E9ED6A19754DE2007591EC /* shift_right.hpp */, - 13E9ED6B19754DE2007591EC /* template_arity.hpp */, - 13E9ED6C19754DE2007591EC /* times.hpp */, - 13E9ED6D19754DE2007591EC /* unpack_args.hpp */, - 13E9ED6E19754DE2007591EC /* vector.hpp */, - 13E9ED6F19754DE2007591EC /* vector_c.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9ED7019754DE2007591EC /* gcc */ = { - isa = PBXGroup; - children = ( - 13E9ED7119754DE2007591EC /* advance_backward.hpp */, - 13E9ED7219754DE2007591EC /* advance_forward.hpp */, - 13E9ED7319754DE2007591EC /* and.hpp */, - 13E9ED7419754DE2007591EC /* apply.hpp */, - 13E9ED7519754DE2007591EC /* apply_fwd.hpp */, - 13E9ED7619754DE2007591EC /* apply_wrap.hpp */, - 13E9ED7719754DE2007591EC /* arg.hpp */, - 13E9ED7819754DE2007591EC /* basic_bind.hpp */, - 13E9ED7919754DE2007591EC /* bind.hpp */, - 13E9ED7A19754DE2007591EC /* bind_fwd.hpp */, - 13E9ED7B19754DE2007591EC /* bitand.hpp */, - 13E9ED7C19754DE2007591EC /* bitor.hpp */, - 13E9ED7D19754DE2007591EC /* bitxor.hpp */, - 13E9ED7E19754DE2007591EC /* deque.hpp */, - 13E9ED7F19754DE2007591EC /* divides.hpp */, - 13E9ED8019754DE2007591EC /* equal_to.hpp */, - 13E9ED8119754DE2007591EC /* fold_impl.hpp */, - 13E9ED8219754DE2007591EC /* full_lambda.hpp */, - 13E9ED8319754DE2007591EC /* greater.hpp */, - 13E9ED8419754DE2007591EC /* greater_equal.hpp */, - 13E9ED8519754DE2007591EC /* inherit.hpp */, - 13E9ED8619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9ED8719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9ED8819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9ED8919754DE2007591EC /* less.hpp */, - 13E9ED8A19754DE2007591EC /* less_equal.hpp */, - 13E9ED8B19754DE2007591EC /* list.hpp */, - 13E9ED8C19754DE2007591EC /* list_c.hpp */, - 13E9ED8D19754DE2007591EC /* map.hpp */, - 13E9ED8E19754DE2007591EC /* minus.hpp */, - 13E9ED8F19754DE2007591EC /* modulus.hpp */, - 13E9ED9019754DE2007591EC /* not_equal_to.hpp */, - 13E9ED9119754DE2007591EC /* or.hpp */, - 13E9ED9219754DE2007591EC /* placeholders.hpp */, - 13E9ED9319754DE2007591EC /* plus.hpp */, - 13E9ED9419754DE2007591EC /* quote.hpp */, - 13E9ED9519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9ED9619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9ED9719754DE2007591EC /* set.hpp */, - 13E9ED9819754DE2007591EC /* set_c.hpp */, - 13E9ED9919754DE2007591EC /* shift_left.hpp */, - 13E9ED9A19754DE2007591EC /* shift_right.hpp */, - 13E9ED9B19754DE2007591EC /* template_arity.hpp */, - 13E9ED9C19754DE2007591EC /* times.hpp */, - 13E9ED9D19754DE2007591EC /* unpack_args.hpp */, - 13E9ED9E19754DE2007591EC /* vector.hpp */, - 13E9ED9F19754DE2007591EC /* vector_c.hpp */, - ); - path = gcc; - sourceTree = ""; - }; - 13E9EDA019754DE2007591EC /* msvc60 */ = { - isa = PBXGroup; - children = ( - 13E9EDA119754DE2007591EC /* advance_backward.hpp */, - 13E9EDA219754DE2007591EC /* advance_forward.hpp */, - 13E9EDA319754DE2007591EC /* and.hpp */, - 13E9EDA419754DE2007591EC /* apply.hpp */, - 13E9EDA519754DE2007591EC /* apply_fwd.hpp */, - 13E9EDA619754DE2007591EC /* apply_wrap.hpp */, - 13E9EDA719754DE2007591EC /* arg.hpp */, - 13E9EDA819754DE2007591EC /* basic_bind.hpp */, - 13E9EDA919754DE2007591EC /* bind.hpp */, - 13E9EDAA19754DE2007591EC /* bind_fwd.hpp */, - 13E9EDAB19754DE2007591EC /* bitand.hpp */, - 13E9EDAC19754DE2007591EC /* bitor.hpp */, - 13E9EDAD19754DE2007591EC /* bitxor.hpp */, - 13E9EDAE19754DE2007591EC /* deque.hpp */, - 13E9EDAF19754DE2007591EC /* divides.hpp */, - 13E9EDB019754DE2007591EC /* equal_to.hpp */, - 13E9EDB119754DE2007591EC /* fold_impl.hpp */, - 13E9EDB219754DE2007591EC /* full_lambda.hpp */, - 13E9EDB319754DE2007591EC /* greater.hpp */, - 13E9EDB419754DE2007591EC /* greater_equal.hpp */, - 13E9EDB519754DE2007591EC /* inherit.hpp */, - 13E9EDB619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EDB719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EDB819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EDB919754DE2007591EC /* less.hpp */, - 13E9EDBA19754DE2007591EC /* less_equal.hpp */, - 13E9EDBB19754DE2007591EC /* list.hpp */, - 13E9EDBC19754DE2007591EC /* list_c.hpp */, - 13E9EDBD19754DE2007591EC /* map.hpp */, - 13E9EDBE19754DE2007591EC /* minus.hpp */, - 13E9EDBF19754DE2007591EC /* modulus.hpp */, - 13E9EDC019754DE2007591EC /* not_equal_to.hpp */, - 13E9EDC119754DE2007591EC /* or.hpp */, - 13E9EDC219754DE2007591EC /* placeholders.hpp */, - 13E9EDC319754DE2007591EC /* plus.hpp */, - 13E9EDC419754DE2007591EC /* quote.hpp */, - 13E9EDC519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EDC619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EDC719754DE2007591EC /* set.hpp */, - 13E9EDC819754DE2007591EC /* set_c.hpp */, - 13E9EDC919754DE2007591EC /* shift_left.hpp */, - 13E9EDCA19754DE2007591EC /* shift_right.hpp */, - 13E9EDCB19754DE2007591EC /* template_arity.hpp */, - 13E9EDCC19754DE2007591EC /* times.hpp */, - 13E9EDCD19754DE2007591EC /* unpack_args.hpp */, - 13E9EDCE19754DE2007591EC /* vector.hpp */, - 13E9EDCF19754DE2007591EC /* vector_c.hpp */, - ); - path = msvc60; - sourceTree = ""; - }; - 13E9EDD019754DE2007591EC /* msvc70 */ = { - isa = PBXGroup; - children = ( - 13E9EDD119754DE2007591EC /* advance_backward.hpp */, - 13E9EDD219754DE2007591EC /* advance_forward.hpp */, - 13E9EDD319754DE2007591EC /* and.hpp */, - 13E9EDD419754DE2007591EC /* apply.hpp */, - 13E9EDD519754DE2007591EC /* apply_fwd.hpp */, - 13E9EDD619754DE2007591EC /* apply_wrap.hpp */, - 13E9EDD719754DE2007591EC /* arg.hpp */, - 13E9EDD819754DE2007591EC /* basic_bind.hpp */, - 13E9EDD919754DE2007591EC /* bind.hpp */, - 13E9EDDA19754DE2007591EC /* bind_fwd.hpp */, - 13E9EDDB19754DE2007591EC /* bitand.hpp */, - 13E9EDDC19754DE2007591EC /* bitor.hpp */, - 13E9EDDD19754DE2007591EC /* bitxor.hpp */, - 13E9EDDE19754DE2007591EC /* deque.hpp */, - 13E9EDDF19754DE2007591EC /* divides.hpp */, - 13E9EDE019754DE2007591EC /* equal_to.hpp */, - 13E9EDE119754DE2007591EC /* fold_impl.hpp */, - 13E9EDE219754DE2007591EC /* full_lambda.hpp */, - 13E9EDE319754DE2007591EC /* greater.hpp */, - 13E9EDE419754DE2007591EC /* greater_equal.hpp */, - 13E9EDE519754DE2007591EC /* inherit.hpp */, - 13E9EDE619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EDE719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EDE819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EDE919754DE2007591EC /* less.hpp */, - 13E9EDEA19754DE2007591EC /* less_equal.hpp */, - 13E9EDEB19754DE2007591EC /* list.hpp */, - 13E9EDEC19754DE2007591EC /* list_c.hpp */, - 13E9EDED19754DE2007591EC /* map.hpp */, - 13E9EDEE19754DE2007591EC /* minus.hpp */, - 13E9EDEF19754DE2007591EC /* modulus.hpp */, - 13E9EDF019754DE2007591EC /* not_equal_to.hpp */, - 13E9EDF119754DE2007591EC /* or.hpp */, - 13E9EDF219754DE2007591EC /* placeholders.hpp */, - 13E9EDF319754DE2007591EC /* plus.hpp */, - 13E9EDF419754DE2007591EC /* quote.hpp */, - 13E9EDF519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EDF619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EDF719754DE2007591EC /* set.hpp */, - 13E9EDF819754DE2007591EC /* set_c.hpp */, - 13E9EDF919754DE2007591EC /* shift_left.hpp */, - 13E9EDFA19754DE2007591EC /* shift_right.hpp */, - 13E9EDFB19754DE2007591EC /* template_arity.hpp */, - 13E9EDFC19754DE2007591EC /* times.hpp */, - 13E9EDFD19754DE2007591EC /* unpack_args.hpp */, - 13E9EDFE19754DE2007591EC /* vector.hpp */, - 13E9EDFF19754DE2007591EC /* vector_c.hpp */, - ); - path = msvc70; - sourceTree = ""; - }; - 13E9EE0019754DE2007591EC /* mwcw */ = { - isa = PBXGroup; - children = ( - 13E9EE0119754DE2007591EC /* advance_backward.hpp */, - 13E9EE0219754DE2007591EC /* advance_forward.hpp */, - 13E9EE0319754DE2007591EC /* and.hpp */, - 13E9EE0419754DE2007591EC /* apply.hpp */, - 13E9EE0519754DE2007591EC /* apply_fwd.hpp */, - 13E9EE0619754DE2007591EC /* apply_wrap.hpp */, - 13E9EE0719754DE2007591EC /* arg.hpp */, - 13E9EE0819754DE2007591EC /* basic_bind.hpp */, - 13E9EE0919754DE2007591EC /* bind.hpp */, - 13E9EE0A19754DE2007591EC /* bind_fwd.hpp */, - 13E9EE0B19754DE2007591EC /* bitand.hpp */, - 13E9EE0C19754DE2007591EC /* bitor.hpp */, - 13E9EE0D19754DE2007591EC /* bitxor.hpp */, - 13E9EE0E19754DE2007591EC /* deque.hpp */, - 13E9EE0F19754DE2007591EC /* divides.hpp */, - 13E9EE1019754DE2007591EC /* equal_to.hpp */, - 13E9EE1119754DE2007591EC /* fold_impl.hpp */, - 13E9EE1219754DE2007591EC /* full_lambda.hpp */, - 13E9EE1319754DE2007591EC /* greater.hpp */, - 13E9EE1419754DE2007591EC /* greater_equal.hpp */, - 13E9EE1519754DE2007591EC /* inherit.hpp */, - 13E9EE1619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EE1719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EE1819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EE1919754DE2007591EC /* less.hpp */, - 13E9EE1A19754DE2007591EC /* less_equal.hpp */, - 13E9EE1B19754DE2007591EC /* list.hpp */, - 13E9EE1C19754DE2007591EC /* list_c.hpp */, - 13E9EE1D19754DE2007591EC /* map.hpp */, - 13E9EE1E19754DE2007591EC /* minus.hpp */, - 13E9EE1F19754DE2007591EC /* modulus.hpp */, - 13E9EE2019754DE2007591EC /* not_equal_to.hpp */, - 13E9EE2119754DE2007591EC /* or.hpp */, - 13E9EE2219754DE2007591EC /* placeholders.hpp */, - 13E9EE2319754DE2007591EC /* plus.hpp */, - 13E9EE2419754DE2007591EC /* quote.hpp */, - 13E9EE2519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EE2619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EE2719754DE2007591EC /* set.hpp */, - 13E9EE2819754DE2007591EC /* set_c.hpp */, - 13E9EE2919754DE2007591EC /* shift_left.hpp */, - 13E9EE2A19754DE2007591EC /* shift_right.hpp */, - 13E9EE2B19754DE2007591EC /* template_arity.hpp */, - 13E9EE2C19754DE2007591EC /* times.hpp */, - 13E9EE2D19754DE2007591EC /* unpack_args.hpp */, - 13E9EE2E19754DE2007591EC /* vector.hpp */, - 13E9EE2F19754DE2007591EC /* vector_c.hpp */, - ); - path = mwcw; - sourceTree = ""; - }; - 13E9EE3019754DE2007591EC /* no_ctps */ = { - isa = PBXGroup; - children = ( - 13E9EE3119754DE2007591EC /* advance_backward.hpp */, - 13E9EE3219754DE2007591EC /* advance_forward.hpp */, - 13E9EE3319754DE2007591EC /* and.hpp */, - 13E9EE3419754DE2007591EC /* apply.hpp */, - 13E9EE3519754DE2007591EC /* apply_fwd.hpp */, - 13E9EE3619754DE2007591EC /* apply_wrap.hpp */, - 13E9EE3719754DE2007591EC /* arg.hpp */, - 13E9EE3819754DE2007591EC /* basic_bind.hpp */, - 13E9EE3919754DE2007591EC /* bind.hpp */, - 13E9EE3A19754DE2007591EC /* bind_fwd.hpp */, - 13E9EE3B19754DE2007591EC /* bitand.hpp */, - 13E9EE3C19754DE2007591EC /* bitor.hpp */, - 13E9EE3D19754DE2007591EC /* bitxor.hpp */, - 13E9EE3E19754DE2007591EC /* deque.hpp */, - 13E9EE3F19754DE2007591EC /* divides.hpp */, - 13E9EE4019754DE2007591EC /* equal_to.hpp */, - 13E9EE4119754DE2007591EC /* fold_impl.hpp */, - 13E9EE4219754DE2007591EC /* full_lambda.hpp */, - 13E9EE4319754DE2007591EC /* greater.hpp */, - 13E9EE4419754DE2007591EC /* greater_equal.hpp */, - 13E9EE4519754DE2007591EC /* inherit.hpp */, - 13E9EE4619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EE4719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EE4819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EE4919754DE2007591EC /* less.hpp */, - 13E9EE4A19754DE2007591EC /* less_equal.hpp */, - 13E9EE4B19754DE2007591EC /* list.hpp */, - 13E9EE4C19754DE2007591EC /* list_c.hpp */, - 13E9EE4D19754DE2007591EC /* map.hpp */, - 13E9EE4E19754DE2007591EC /* minus.hpp */, - 13E9EE4F19754DE2007591EC /* modulus.hpp */, - 13E9EE5019754DE2007591EC /* not_equal_to.hpp */, - 13E9EE5119754DE2007591EC /* or.hpp */, - 13E9EE5219754DE2007591EC /* placeholders.hpp */, - 13E9EE5319754DE2007591EC /* plus.hpp */, - 13E9EE5419754DE2007591EC /* quote.hpp */, - 13E9EE5519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EE5619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EE5719754DE2007591EC /* set.hpp */, - 13E9EE5819754DE2007591EC /* set_c.hpp */, - 13E9EE5919754DE2007591EC /* shift_left.hpp */, - 13E9EE5A19754DE2007591EC /* shift_right.hpp */, - 13E9EE5B19754DE2007591EC /* template_arity.hpp */, - 13E9EE5C19754DE2007591EC /* times.hpp */, - 13E9EE5D19754DE2007591EC /* unpack_args.hpp */, - 13E9EE5E19754DE2007591EC /* vector.hpp */, - 13E9EE5F19754DE2007591EC /* vector_c.hpp */, - ); - path = no_ctps; - sourceTree = ""; - }; - 13E9EE6019754DE2007591EC /* no_ttp */ = { - isa = PBXGroup; - children = ( - 13E9EE6119754DE2007591EC /* advance_backward.hpp */, - 13E9EE6219754DE2007591EC /* advance_forward.hpp */, - 13E9EE6319754DE2007591EC /* and.hpp */, - 13E9EE6419754DE2007591EC /* apply.hpp */, - 13E9EE6519754DE2007591EC /* apply_fwd.hpp */, - 13E9EE6619754DE2007591EC /* apply_wrap.hpp */, - 13E9EE6719754DE2007591EC /* arg.hpp */, - 13E9EE6819754DE2007591EC /* basic_bind.hpp */, - 13E9EE6919754DE2007591EC /* bind.hpp */, - 13E9EE6A19754DE2007591EC /* bind_fwd.hpp */, - 13E9EE6B19754DE2007591EC /* bitand.hpp */, - 13E9EE6C19754DE2007591EC /* bitor.hpp */, - 13E9EE6D19754DE2007591EC /* bitxor.hpp */, - 13E9EE6E19754DE2007591EC /* deque.hpp */, - 13E9EE6F19754DE2007591EC /* divides.hpp */, - 13E9EE7019754DE2007591EC /* equal_to.hpp */, - 13E9EE7119754DE2007591EC /* fold_impl.hpp */, - 13E9EE7219754DE2007591EC /* full_lambda.hpp */, - 13E9EE7319754DE2007591EC /* greater.hpp */, - 13E9EE7419754DE2007591EC /* greater_equal.hpp */, - 13E9EE7519754DE2007591EC /* inherit.hpp */, - 13E9EE7619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EE7719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EE7819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EE7919754DE2007591EC /* less.hpp */, - 13E9EE7A19754DE2007591EC /* less_equal.hpp */, - 13E9EE7B19754DE2007591EC /* list.hpp */, - 13E9EE7C19754DE2007591EC /* list_c.hpp */, - 13E9EE7D19754DE2007591EC /* map.hpp */, - 13E9EE7E19754DE2007591EC /* minus.hpp */, - 13E9EE7F19754DE2007591EC /* modulus.hpp */, - 13E9EE8019754DE2007591EC /* not_equal_to.hpp */, - 13E9EE8119754DE2007591EC /* or.hpp */, - 13E9EE8219754DE2007591EC /* placeholders.hpp */, - 13E9EE8319754DE2007591EC /* plus.hpp */, - 13E9EE8419754DE2007591EC /* quote.hpp */, - 13E9EE8519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EE8619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EE8719754DE2007591EC /* set.hpp */, - 13E9EE8819754DE2007591EC /* set_c.hpp */, - 13E9EE8919754DE2007591EC /* shift_left.hpp */, - 13E9EE8A19754DE2007591EC /* shift_right.hpp */, - 13E9EE8B19754DE2007591EC /* template_arity.hpp */, - 13E9EE8C19754DE2007591EC /* times.hpp */, - 13E9EE8D19754DE2007591EC /* unpack_args.hpp */, - 13E9EE8E19754DE2007591EC /* vector.hpp */, - 13E9EE8F19754DE2007591EC /* vector_c.hpp */, - ); - path = no_ttp; - sourceTree = ""; - }; - 13E9EE9019754DE2007591EC /* plain */ = { - isa = PBXGroup; - children = ( - 13E9EE9119754DE2007591EC /* advance_backward.hpp */, - 13E9EE9219754DE2007591EC /* advance_forward.hpp */, - 13E9EE9319754DE2007591EC /* and.hpp */, - 13E9EE9419754DE2007591EC /* apply.hpp */, - 13E9EE9519754DE2007591EC /* apply_fwd.hpp */, - 13E9EE9619754DE2007591EC /* apply_wrap.hpp */, - 13E9EE9719754DE2007591EC /* arg.hpp */, - 13E9EE9819754DE2007591EC /* basic_bind.hpp */, - 13E9EE9919754DE2007591EC /* bind.hpp */, - 13E9EE9A19754DE2007591EC /* bind_fwd.hpp */, - 13E9EE9B19754DE2007591EC /* bitand.hpp */, - 13E9EE9C19754DE2007591EC /* bitor.hpp */, - 13E9EE9D19754DE2007591EC /* bitxor.hpp */, - 13E9EE9E19754DE2007591EC /* deque.hpp */, - 13E9EE9F19754DE2007591EC /* divides.hpp */, - 13E9EEA019754DE2007591EC /* equal_to.hpp */, - 13E9EEA119754DE2007591EC /* fold_impl.hpp */, - 13E9EEA219754DE2007591EC /* full_lambda.hpp */, - 13E9EEA319754DE2007591EC /* greater.hpp */, - 13E9EEA419754DE2007591EC /* greater_equal.hpp */, - 13E9EEA519754DE2007591EC /* inherit.hpp */, - 13E9EEA619754DE2007591EC /* iter_fold_if_impl.hpp */, - 13E9EEA719754DE2007591EC /* iter_fold_impl.hpp */, - 13E9EEA819754DE2007591EC /* lambda_no_ctps.hpp */, - 13E9EEA919754DE2007591EC /* less.hpp */, - 13E9EEAA19754DE2007591EC /* less_equal.hpp */, - 13E9EEAB19754DE2007591EC /* list.hpp */, - 13E9EEAC19754DE2007591EC /* list_c.hpp */, - 13E9EEAD19754DE2007591EC /* map.hpp */, - 13E9EEAE19754DE2007591EC /* minus.hpp */, - 13E9EEAF19754DE2007591EC /* modulus.hpp */, - 13E9EEB019754DE2007591EC /* not_equal_to.hpp */, - 13E9EEB119754DE2007591EC /* or.hpp */, - 13E9EEB219754DE2007591EC /* placeholders.hpp */, - 13E9EEB319754DE2007591EC /* plus.hpp */, - 13E9EEB419754DE2007591EC /* quote.hpp */, - 13E9EEB519754DE2007591EC /* reverse_fold_impl.hpp */, - 13E9EEB619754DE2007591EC /* reverse_iter_fold_impl.hpp */, - 13E9EEB719754DE2007591EC /* set.hpp */, - 13E9EEB819754DE2007591EC /* set_c.hpp */, - 13E9EEB919754DE2007591EC /* shift_left.hpp */, - 13E9EEBA19754DE2007591EC /* shift_right.hpp */, - 13E9EEBB19754DE2007591EC /* template_arity.hpp */, - 13E9EEBC19754DE2007591EC /* times.hpp */, - 13E9EEBD19754DE2007591EC /* unpack_args.hpp */, - 13E9EEBE19754DE2007591EC /* vector.hpp */, - 13E9EEBF19754DE2007591EC /* vector_c.hpp */, - ); - path = plain; - sourceTree = ""; - }; - 13E9EEC019754DE2007591EC /* preprocessor */ = { - isa = PBXGroup; - children = ( - 13E9EEC119754DE2007591EC /* add.hpp */, - 13E9EEC219754DE2007591EC /* def_params_tail.hpp */, - 13E9EEC319754DE2007591EC /* default_params.hpp */, - 13E9EEC419754DE2007591EC /* enum.hpp */, - 13E9EEC519754DE2007591EC /* ext_params.hpp */, - 13E9EEC619754DE2007591EC /* filter_params.hpp */, - 13E9EEC719754DE2007591EC /* params.hpp */, - 13E9EEC819754DE2007591EC /* partial_spec_params.hpp */, - 13E9EEC919754DE2007591EC /* range.hpp */, - 13E9EECA19754DE2007591EC /* repeat.hpp */, - 13E9EECB19754DE2007591EC /* sub.hpp */, - 13E9EECC19754DE2007591EC /* tuple.hpp */, - ); - path = preprocessor; - sourceTree = ""; - }; - 13E9EF0719754DE3007591EC /* limits */ = { - isa = PBXGroup; - children = ( - 13E9EF0819754DE3007591EC /* arity.hpp */, - 13E9EF0919754DE3007591EC /* list.hpp */, - 13E9EF0A19754DE3007591EC /* unrolling.hpp */, - 13E9EF0B19754DE3007591EC /* vector.hpp */, - ); - path = limits; - sourceTree = ""; - }; - 13E9EF0C19754DE3007591EC /* list */ = { - isa = PBXGroup; - children = ( - 13E9EF0D19754DE3007591EC /* aux_ */, - 13E9EF2919754DE3007591EC /* list0.hpp */, - 13E9EF2A19754DE3007591EC /* list0_c.hpp */, - 13E9EF2B19754DE3007591EC /* list10.hpp */, - 13E9EF2C19754DE3007591EC /* list10_c.hpp */, - 13E9EF2D19754DE3007591EC /* list20.hpp */, - 13E9EF2E19754DE3007591EC /* list20_c.hpp */, - 13E9EF2F19754DE3007591EC /* list30.hpp */, - 13E9EF3019754DE3007591EC /* list30_c.hpp */, - 13E9EF3119754DE3007591EC /* list40.hpp */, - 13E9EF3219754DE3007591EC /* list40_c.hpp */, - 13E9EF3319754DE3007591EC /* list50.hpp */, - 13E9EF3419754DE3007591EC /* list50_c.hpp */, - ); - path = list; - sourceTree = ""; - }; - 13E9EF0D19754DE3007591EC /* aux_ */ = { - isa = PBXGroup; - children = ( - 13E9EF0E19754DE3007591EC /* begin_end.hpp */, - 13E9EF0F19754DE3007591EC /* clear.hpp */, - 13E9EF1019754DE3007591EC /* empty.hpp */, - 13E9EF1119754DE3007591EC /* front.hpp */, - 13E9EF1219754DE3007591EC /* include_preprocessed.hpp */, - 13E9EF1319754DE3007591EC /* item.hpp */, - 13E9EF1419754DE3007591EC /* iterator.hpp */, - 13E9EF1519754DE3007591EC /* numbered.hpp */, - 13E9EF1619754DE3007591EC /* numbered_c.hpp */, - 13E9EF1719754DE3007591EC /* O1_size.hpp */, - 13E9EF1819754DE3007591EC /* pop_front.hpp */, - 13E9EF1919754DE3007591EC /* preprocessed */, - 13E9EF2519754DE3007591EC /* push_back.hpp */, - 13E9EF2619754DE3007591EC /* push_front.hpp */, - 13E9EF2719754DE3007591EC /* size.hpp */, - 13E9EF2819754DE3007591EC /* tag.hpp */, - ); - path = aux_; - sourceTree = ""; - }; - 13E9EF1919754DE3007591EC /* preprocessed */ = { - isa = PBXGroup; - children = ( - 13E9EF1A19754DE3007591EC /* plain */, - ); - path = preprocessed; - sourceTree = ""; - }; - 13E9EF1A19754DE3007591EC /* plain */ = { - isa = PBXGroup; - children = ( - 13E9EF1B19754DE3007591EC /* list10.hpp */, - 13E9EF1C19754DE3007591EC /* list10_c.hpp */, - 13E9EF1D19754DE3007591EC /* list20.hpp */, - 13E9EF1E19754DE3007591EC /* list20_c.hpp */, - 13E9EF1F19754DE3007591EC /* list30.hpp */, - 13E9EF2019754DE3007591EC /* list30_c.hpp */, - 13E9EF2119754DE3007591EC /* list40.hpp */, - 13E9EF2219754DE3007591EC /* list40_c.hpp */, - 13E9EF2319754DE3007591EC /* list50.hpp */, - 13E9EF2419754DE3007591EC /* list50_c.hpp */, - ); - path = plain; - sourceTree = ""; - }; - 13E9EF5B19754DE3007591EC /* vector */ = { - isa = PBXGroup; - children = ( - 13E9EF5C19754DE3007591EC /* aux_ */, - 13E9EF9219754DE3007591EC /* vector0.hpp */, - 13E9EF9319754DE3007591EC /* vector0_c.hpp */, - 13E9EF9419754DE3007591EC /* vector10.hpp */, - 13E9EF9519754DE3007591EC /* vector10_c.hpp */, - 13E9EF9619754DE3007591EC /* vector20.hpp */, - 13E9EF9719754DE3007591EC /* vector20_c.hpp */, - 13E9EF9819754DE3007591EC /* vector30.hpp */, - 13E9EF9919754DE3007591EC /* vector30_c.hpp */, - 13E9EF9A19754DE3007591EC /* vector40.hpp */, - 13E9EF9B19754DE3007591EC /* vector40_c.hpp */, - 13E9EF9C19754DE3007591EC /* vector50.hpp */, - 13E9EF9D19754DE3007591EC /* vector50_c.hpp */, - ); - path = vector; - sourceTree = ""; - }; - 13E9EF5C19754DE3007591EC /* aux_ */ = { - isa = PBXGroup; - children = ( - 13E9EF5D19754DE3007591EC /* at.hpp */, - 13E9EF5E19754DE3007591EC /* back.hpp */, - 13E9EF5F19754DE3007591EC /* begin_end.hpp */, - 13E9EF6019754DE3007591EC /* clear.hpp */, - 13E9EF6119754DE3007591EC /* empty.hpp */, - 13E9EF6219754DE3007591EC /* front.hpp */, - 13E9EF6319754DE3007591EC /* include_preprocessed.hpp */, - 13E9EF6419754DE3007591EC /* item.hpp */, - 13E9EF6519754DE3007591EC /* iterator.hpp */, - 13E9EF6619754DE3007591EC /* numbered.hpp */, - 13E9EF6719754DE3007591EC /* numbered_c.hpp */, - 13E9EF6819754DE3007591EC /* O1_size.hpp */, - 13E9EF6919754DE3007591EC /* pop_back.hpp */, - 13E9EF6A19754DE3007591EC /* pop_front.hpp */, - 13E9EF6B19754DE3007591EC /* preprocessed */, - 13E9EF8D19754DE3007591EC /* push_back.hpp */, - 13E9EF8E19754DE3007591EC /* push_front.hpp */, - 13E9EF8F19754DE3007591EC /* size.hpp */, - 13E9EF9019754DE3007591EC /* tag.hpp */, - 13E9EF9119754DE3007591EC /* vector0.hpp */, - ); - path = aux_; - sourceTree = ""; - }; - 13E9EF6B19754DE3007591EC /* preprocessed */ = { - isa = PBXGroup; - children = ( - 13E9EF6C19754DE3007591EC /* no_ctps */, - 13E9EF7719754DE3007591EC /* plain */, - 13E9EF8219754DE3007591EC /* typeof_based */, - ); - path = preprocessed; - sourceTree = ""; - }; - 13E9EF6C19754DE3007591EC /* no_ctps */ = { - isa = PBXGroup; - children = ( - 13E9EF6D19754DE3007591EC /* vector10.hpp */, - 13E9EF6E19754DE3007591EC /* vector10_c.hpp */, - 13E9EF6F19754DE3007591EC /* vector20.hpp */, - 13E9EF7019754DE3007591EC /* vector20_c.hpp */, - 13E9EF7119754DE3007591EC /* vector30.hpp */, - 13E9EF7219754DE3007591EC /* vector30_c.hpp */, - 13E9EF7319754DE3007591EC /* vector40.hpp */, - 13E9EF7419754DE3007591EC /* vector40_c.hpp */, - 13E9EF7519754DE3007591EC /* vector50.hpp */, - 13E9EF7619754DE3007591EC /* vector50_c.hpp */, - ); - path = no_ctps; - sourceTree = ""; - }; - 13E9EF7719754DE3007591EC /* plain */ = { - isa = PBXGroup; - children = ( - 13E9EF7819754DE3007591EC /* vector10.hpp */, - 13E9EF7919754DE3007591EC /* vector10_c.hpp */, - 13E9EF7A19754DE3007591EC /* vector20.hpp */, - 13E9EF7B19754DE3007591EC /* vector20_c.hpp */, - 13E9EF7C19754DE3007591EC /* vector30.hpp */, - 13E9EF7D19754DE3007591EC /* vector30_c.hpp */, - 13E9EF7E19754DE3007591EC /* vector40.hpp */, - 13E9EF7F19754DE3007591EC /* vector40_c.hpp */, - 13E9EF8019754DE3007591EC /* vector50.hpp */, - 13E9EF8119754DE3007591EC /* vector50_c.hpp */, - ); - path = plain; - sourceTree = ""; - }; - 13E9EF8219754DE3007591EC /* typeof_based */ = { - isa = PBXGroup; - children = ( - 13E9EF8319754DE3007591EC /* vector10.hpp */, - 13E9EF8419754DE3007591EC /* vector10_c.hpp */, - 13E9EF8519754DE3007591EC /* vector20.hpp */, - 13E9EF8619754DE3007591EC /* vector20_c.hpp */, - 13E9EF8719754DE3007591EC /* vector30.hpp */, - 13E9EF8819754DE3007591EC /* vector30_c.hpp */, - 13E9EF8919754DE3007591EC /* vector40.hpp */, - 13E9EF8A19754DE3007591EC /* vector40_c.hpp */, - 13E9EF8B19754DE3007591EC /* vector50.hpp */, - 13E9EF8C19754DE3007591EC /* vector50_c.hpp */, - ); - path = typeof_based; - sourceTree = ""; - }; - 13E9EFC019754DE3007591EC /* optional */ = { - isa = PBXGroup; - children = ( - 13E9EFC119754DE3007591EC /* optional.hpp */, - 13E9EFC219754DE3007591EC /* optional_fwd.hpp */, - ); - path = optional; - sourceTree = ""; - }; - 13E9EFF619754DE3007591EC /* preprocessor */ = { - isa = PBXGroup; - children = ( - 13E9EFF719754DE3007591EC /* arithmetic */, - 13E9EFFF19754DE3007591EC /* array */, - 13E9F00319754DE3007591EC /* cat.hpp */, - 13E9F00419754DE3007591EC /* comma_if.hpp */, - 13E9F00519754DE3007591EC /* comparison */, - 13E9F00719754DE3007591EC /* config */, - 13E9F00919754DE3007591EC /* control */, - 13E9F01819754DE3007591EC /* debug */, - 13E9F01A19754DE3007591EC /* dec.hpp */, - 13E9F01B19754DE3007591EC /* detail */, - 13E9F02219754DE3007591EC /* empty.hpp */, - 13E9F02319754DE3007591EC /* enum.hpp */, - 13E9F02419754DE3007591EC /* enum_params.hpp */, - 13E9F02519754DE3007591EC /* enum_params_with_a_default.hpp */, - 13E9F02619754DE3007591EC /* enum_shifted_params.hpp */, - 13E9F02719754DE3007591EC /* expr_if.hpp */, - 13E9F02819754DE3007591EC /* facilities */, - 13E9F02D19754DE3007591EC /* identity.hpp */, - 13E9F02E19754DE3007591EC /* if.hpp */, - 13E9F02F19754DE3007591EC /* inc.hpp */, - 13E9F03019754DE3007591EC /* iterate.hpp */, - 13E9F03119754DE3007591EC /* iteration */, - 13E9F05119754DE3007591EC /* list */, - 13E9F06119754DE3007591EC /* logical */, - 13E9F06919754DE3007591EC /* punctuation */, - 13E9F06E19754DE3007591EC /* repeat.hpp */, - 13E9F06F19754DE3007591EC /* repeat_from_to.hpp */, - 13E9F07019754DE3007591EC /* repetition */, - 13E9F08419754DE4007591EC /* seq */, - 13E9F09219754DE4007591EC /* slot */, - 13E9F09D19754DE4007591EC /* stringize.hpp */, - 13E9F09E19754DE4007591EC /* tuple */, - 13E9F0A319754DE4007591EC /* variadic */, - ); - path = preprocessor; - sourceTree = ""; - }; - 13E9EFF719754DE3007591EC /* arithmetic */ = { - isa = PBXGroup; - children = ( - 13E9EFF819754DE3007591EC /* add.hpp */, - 13E9EFF919754DE3007591EC /* dec.hpp */, - 13E9EFFA19754DE3007591EC /* detail */, - 13E9EFFC19754DE3007591EC /* inc.hpp */, - 13E9EFFD19754DE3007591EC /* mod.hpp */, - 13E9EFFE19754DE3007591EC /* sub.hpp */, - ); - path = arithmetic; - sourceTree = ""; - }; - 13E9EFFA19754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9EFFB19754DE3007591EC /* div_base.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9EFFF19754DE3007591EC /* array */ = { - isa = PBXGroup; - children = ( - 13E9F00019754DE3007591EC /* data.hpp */, - 13E9F00119754DE3007591EC /* elem.hpp */, - 13E9F00219754DE3007591EC /* size.hpp */, - ); - path = array; - sourceTree = ""; - }; - 13E9F00519754DE3007591EC /* comparison */ = { - isa = PBXGroup; - children = ( - 13E9F00619754DE3007591EC /* less_equal.hpp */, - ); - path = comparison; - sourceTree = ""; - }; - 13E9F00719754DE3007591EC /* config */ = { - isa = PBXGroup; - children = ( - 13E9F00819754DE3007591EC /* config.hpp */, - ); - path = config; - sourceTree = ""; - }; - 13E9F00919754DE3007591EC /* control */ = { - isa = PBXGroup; - children = ( - 13E9F00A19754DE3007591EC /* deduce_d.hpp */, - 13E9F00B19754DE3007591EC /* detail */, - 13E9F01319754DE3007591EC /* expr_if.hpp */, - 13E9F01419754DE3007591EC /* expr_iif.hpp */, - 13E9F01519754DE3007591EC /* if.hpp */, - 13E9F01619754DE3007591EC /* iif.hpp */, - 13E9F01719754DE3007591EC /* while.hpp */, - ); - path = control; - sourceTree = ""; - }; - 13E9F00B19754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F00C19754DE3007591EC /* dmc */, - 13E9F00E19754DE3007591EC /* edg */, - 13E9F01019754DE3007591EC /* msvc */, - 13E9F01219754DE3007591EC /* while.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F00C19754DE3007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9F00D19754DE3007591EC /* while.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9F00E19754DE3007591EC /* edg */ = { - isa = PBXGroup; - children = ( - 13E9F00F19754DE3007591EC /* while.hpp */, - ); - path = edg; - sourceTree = ""; - }; - 13E9F01019754DE3007591EC /* msvc */ = { - isa = PBXGroup; - children = ( - 13E9F01119754DE3007591EC /* while.hpp */, - ); - path = msvc; - sourceTree = ""; - }; - 13E9F01819754DE3007591EC /* debug */ = { - isa = PBXGroup; - children = ( - 13E9F01919754DE3007591EC /* error.hpp */, - ); - path = debug; - sourceTree = ""; - }; - 13E9F01B19754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F01C19754DE3007591EC /* auto_rec.hpp */, - 13E9F01D19754DE3007591EC /* check.hpp */, - 13E9F01E19754DE3007591EC /* dmc */, - 13E9F02019754DE3007591EC /* is_binary.hpp */, - 13E9F02119754DE3007591EC /* is_unary.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F01E19754DE3007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9F01F19754DE3007591EC /* auto_rec.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9F02819754DE3007591EC /* facilities */ = { - isa = PBXGroup; - children = ( - 13E9F02919754DE3007591EC /* empty.hpp */, - 13E9F02A19754DE3007591EC /* identity.hpp */, - 13E9F02B19754DE3007591EC /* intercept.hpp */, - 13E9F02C19754DE3007591EC /* overload.hpp */, - ); - path = facilities; - sourceTree = ""; - }; - 13E9F03119754DE3007591EC /* iteration */ = { - isa = PBXGroup; - children = ( - 13E9F03219754DE3007591EC /* detail */, - 13E9F04E19754DE3007591EC /* iterate.hpp */, - 13E9F04F19754DE3007591EC /* local.hpp */, - 13E9F05019754DE3007591EC /* self.hpp */, - ); - path = iteration; - sourceTree = ""; - }; - 13E9F03219754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F03319754DE3007591EC /* bounds */, - 13E9F03E19754DE3007591EC /* finish.hpp */, - 13E9F03F19754DE3007591EC /* iter */, - 13E9F04A19754DE3007591EC /* local.hpp */, - 13E9F04B19754DE3007591EC /* rlocal.hpp */, - 13E9F04C19754DE3007591EC /* self.hpp */, - 13E9F04D19754DE3007591EC /* start.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F03319754DE3007591EC /* bounds */ = { - isa = PBXGroup; - children = ( - 13E9F03419754DE3007591EC /* lower1.hpp */, - 13E9F03519754DE3007591EC /* lower2.hpp */, - 13E9F03619754DE3007591EC /* lower3.hpp */, - 13E9F03719754DE3007591EC /* lower4.hpp */, - 13E9F03819754DE3007591EC /* lower5.hpp */, - 13E9F03919754DE3007591EC /* upper1.hpp */, - 13E9F03A19754DE3007591EC /* upper2.hpp */, - 13E9F03B19754DE3007591EC /* upper3.hpp */, - 13E9F03C19754DE3007591EC /* upper4.hpp */, - 13E9F03D19754DE3007591EC /* upper5.hpp */, - ); - path = bounds; - sourceTree = ""; - }; - 13E9F03F19754DE3007591EC /* iter */ = { - isa = PBXGroup; - children = ( - 13E9F04019754DE3007591EC /* forward1.hpp */, - 13E9F04119754DE3007591EC /* forward2.hpp */, - 13E9F04219754DE3007591EC /* forward3.hpp */, - 13E9F04319754DE3007591EC /* forward4.hpp */, - 13E9F04419754DE3007591EC /* forward5.hpp */, - 13E9F04519754DE3007591EC /* reverse1.hpp */, - 13E9F04619754DE3007591EC /* reverse2.hpp */, - 13E9F04719754DE3007591EC /* reverse3.hpp */, - 13E9F04819754DE3007591EC /* reverse4.hpp */, - 13E9F04919754DE3007591EC /* reverse5.hpp */, - ); - path = iter; - sourceTree = ""; - }; - 13E9F05119754DE3007591EC /* list */ = { - isa = PBXGroup; - children = ( - 13E9F05219754DE3007591EC /* adt.hpp */, - 13E9F05319754DE3007591EC /* append.hpp */, - 13E9F05419754DE3007591EC /* detail */, - 13E9F05C19754DE3007591EC /* fold_left.hpp */, - 13E9F05D19754DE3007591EC /* fold_right.hpp */, - 13E9F05E19754DE3007591EC /* for_each_i.hpp */, - 13E9F05F19754DE3007591EC /* reverse.hpp */, - 13E9F06019754DE3007591EC /* transform.hpp */, - ); - path = list; - sourceTree = ""; - }; - 13E9F05419754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F05519754DE3007591EC /* dmc */, - 13E9F05719754DE3007591EC /* edg */, - 13E9F05A19754DE3007591EC /* fold_left.hpp */, - 13E9F05B19754DE3007591EC /* fold_right.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F05519754DE3007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9F05619754DE3007591EC /* fold_left.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9F05719754DE3007591EC /* edg */ = { - isa = PBXGroup; - children = ( - 13E9F05819754DE3007591EC /* fold_left.hpp */, - 13E9F05919754DE3007591EC /* fold_right.hpp */, - ); - path = edg; - sourceTree = ""; - }; - 13E9F06119754DE3007591EC /* logical */ = { - isa = PBXGroup; - children = ( - 13E9F06219754DE3007591EC /* and.hpp */, - 13E9F06319754DE3007591EC /* bitand.hpp */, - 13E9F06419754DE3007591EC /* bitor.hpp */, - 13E9F06519754DE3007591EC /* bool.hpp */, - 13E9F06619754DE3007591EC /* compl.hpp */, - 13E9F06719754DE3007591EC /* not.hpp */, - 13E9F06819754DE3007591EC /* or.hpp */, - ); - path = logical; - sourceTree = ""; - }; - 13E9F06919754DE3007591EC /* punctuation */ = { - isa = PBXGroup; - children = ( - 13E9F06A19754DE3007591EC /* comma.hpp */, - 13E9F06B19754DE3007591EC /* comma_if.hpp */, - 13E9F06C19754DE3007591EC /* paren.hpp */, - 13E9F06D19754DE3007591EC /* paren_if.hpp */, - ); - path = punctuation; - sourceTree = ""; - }; - 13E9F07019754DE3007591EC /* repetition */ = { - isa = PBXGroup; - children = ( - 13E9F07119754DE3007591EC /* detail */, - 13E9F07919754DE3007591EC /* enum.hpp */, - 13E9F07A19754DE3007591EC /* enum_binary_params.hpp */, - 13E9F07B19754DE3007591EC /* enum_params.hpp */, - 13E9F07C19754DE3007591EC /* enum_params_with_a_default.hpp */, - 13E9F07D19754DE3007591EC /* enum_shifted.hpp */, - 13E9F07E19754DE3007591EC /* enum_shifted_params.hpp */, - 13E9F07F19754DE3007591EC /* enum_trailing.hpp */, - 13E9F08019754DE3007591EC /* enum_trailing_params.hpp */, - 13E9F08119754DE3007591EC /* for.hpp */, - 13E9F08219754DE4007591EC /* repeat.hpp */, - 13E9F08319754DE4007591EC /* repeat_from_to.hpp */, - ); - path = repetition; - sourceTree = ""; - }; - 13E9F07119754DE3007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F07219754DE3007591EC /* dmc */, - 13E9F07419754DE3007591EC /* edg */, - 13E9F07619754DE3007591EC /* for.hpp */, - 13E9F07719754DE3007591EC /* msvc */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F07219754DE3007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9F07319754DE3007591EC /* for.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9F07419754DE3007591EC /* edg */ = { - isa = PBXGroup; - children = ( - 13E9F07519754DE3007591EC /* for.hpp */, - ); - path = edg; - sourceTree = ""; - }; - 13E9F07719754DE3007591EC /* msvc */ = { - isa = PBXGroup; - children = ( - 13E9F07819754DE3007591EC /* for.hpp */, - ); - path = msvc; - sourceTree = ""; - }; - 13E9F08419754DE4007591EC /* seq */ = { - isa = PBXGroup; - children = ( - 13E9F08519754DE4007591EC /* cat.hpp */, - 13E9F08619754DE4007591EC /* detail */, - 13E9F08819754DE4007591EC /* elem.hpp */, - 13E9F08919754DE4007591EC /* enum.hpp */, - 13E9F08A19754DE4007591EC /* first_n.hpp */, - 13E9F08B19754DE4007591EC /* fold_left.hpp */, - 13E9F08C19754DE4007591EC /* for_each_i.hpp */, - 13E9F08D19754DE4007591EC /* rest_n.hpp */, - 13E9F08E19754DE4007591EC /* seq.hpp */, - 13E9F08F19754DE4007591EC /* size.hpp */, - 13E9F09019754DE4007591EC /* subseq.hpp */, - 13E9F09119754DE4007591EC /* transform.hpp */, - ); - path = seq; - sourceTree = ""; - }; - 13E9F08619754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F08719754DE4007591EC /* split.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F09219754DE4007591EC /* slot */ = { - isa = PBXGroup; - children = ( - 13E9F09319754DE4007591EC /* detail */, - 13E9F09C19754DE4007591EC /* slot.hpp */, - ); - path = slot; - sourceTree = ""; - }; - 13E9F09319754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F09419754DE4007591EC /* counter.hpp */, - 13E9F09519754DE4007591EC /* def.hpp */, - 13E9F09619754DE4007591EC /* shared.hpp */, - 13E9F09719754DE4007591EC /* slot1.hpp */, - 13E9F09819754DE4007591EC /* slot2.hpp */, - 13E9F09919754DE4007591EC /* slot3.hpp */, - 13E9F09A19754DE4007591EC /* slot4.hpp */, - 13E9F09B19754DE4007591EC /* slot5.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F09E19754DE4007591EC /* tuple */ = { - isa = PBXGroup; - children = ( - 13E9F09F19754DE4007591EC /* eat.hpp */, - 13E9F0A019754DE4007591EC /* elem.hpp */, - 13E9F0A119754DE4007591EC /* rem.hpp */, - 13E9F0A219754DE4007591EC /* to_list.hpp */, - ); - path = tuple; - sourceTree = ""; - }; - 13E9F0A319754DE4007591EC /* variadic */ = { - isa = PBXGroup; - children = ( - 13E9F0A419754DE4007591EC /* elem.hpp */, - 13E9F0A519754DE4007591EC /* size.hpp */, - ); - path = variadic; - sourceTree = ""; - }; - 13E9F0F319754DE4007591EC /* signals */ = { - isa = PBXGroup; - children = ( - 13E9F0F419754DE4007591EC /* connection.hpp */, - 13E9F0F519754DE4007591EC /* detail */, - 13E9F0FB19754DE4007591EC /* signal0.hpp */, - 13E9F0FC19754DE4007591EC /* signal1.hpp */, - 13E9F0FD19754DE4007591EC /* signal10.hpp */, - 13E9F0FE19754DE4007591EC /* signal2.hpp */, - 13E9F0FF19754DE4007591EC /* signal3.hpp */, - 13E9F10019754DE4007591EC /* signal4.hpp */, - 13E9F10119754DE4007591EC /* signal5.hpp */, - 13E9F10219754DE4007591EC /* signal6.hpp */, - 13E9F10319754DE4007591EC /* signal7.hpp */, - 13E9F10419754DE4007591EC /* signal8.hpp */, - 13E9F10519754DE4007591EC /* signal9.hpp */, - 13E9F10619754DE4007591EC /* signal_template.hpp */, - 13E9F10719754DE4007591EC /* slot.hpp */, - 13E9F10819754DE4007591EC /* trackable.hpp */, - ); - path = signals; - sourceTree = ""; - }; - 13E9F0F519754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F0F619754DE4007591EC /* config.hpp */, - 13E9F0F719754DE4007591EC /* named_slot_map.hpp */, - 13E9F0F819754DE4007591EC /* signal_base.hpp */, - 13E9F0F919754DE4007591EC /* signals_common.hpp */, - 13E9F0FA19754DE4007591EC /* slot_call_iterator.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F10919754DE4007591EC /* smart_ptr */ = { - isa = PBXGroup; - children = ( - 13E9F10A19754DE4007591EC /* allocate_shared_array.hpp */, - 13E9F10B19754DE4007591EC /* bad_weak_ptr.hpp */, - 13E9F10C19754DE4007591EC /* detail */, - 13E9F14219754DE4007591EC /* enable_shared_from_raw.hpp */, - 13E9F14319754DE4007591EC /* enable_shared_from_this.hpp */, - 13E9F14419754DE4007591EC /* intrusive_ptr.hpp */, - 13E9F14519754DE4007591EC /* intrusive_ref_counter.hpp */, - 13E9F14619754DE4007591EC /* make_shared.hpp */, - 13E9F14719754DE4007591EC /* make_shared_array.hpp */, - 13E9F14819754DE4007591EC /* make_shared_object.hpp */, - 13E9F14919754DE4007591EC /* owner_less.hpp */, - 13E9F14A19754DE4007591EC /* scoped_array.hpp */, - 13E9F14B19754DE4007591EC /* scoped_ptr.hpp */, - 13E9F14C19754DE4007591EC /* shared_array.hpp */, - 13E9F14D19754DE4007591EC /* shared_ptr.hpp */, - 13E9F14E19754DE4007591EC /* weak_ptr.hpp */, - ); - path = smart_ptr; - sourceTree = ""; - }; - 13E9F10C19754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F10D19754DE4007591EC /* allocate_array_helper.hpp */, - 13E9F10E19754DE4007591EC /* array_deleter.hpp */, - 13E9F10F19754DE4007591EC /* array_traits.hpp */, - 13E9F11019754DE4007591EC /* array_utility.hpp */, - 13E9F11119754DE4007591EC /* atomic_count.hpp */, - 13E9F11219754DE4007591EC /* atomic_count_gcc.hpp */, - 13E9F11319754DE4007591EC /* atomic_count_gcc_x86.hpp */, - 13E9F11419754DE4007591EC /* atomic_count_pthreads.hpp */, - 13E9F11519754DE4007591EC /* atomic_count_solaris.hpp */, - 13E9F11619754DE4007591EC /* atomic_count_sync.hpp */, - 13E9F11719754DE4007591EC /* atomic_count_win32.hpp */, - 13E9F11819754DE4007591EC /* lightweight_mutex.hpp */, - 13E9F11919754DE4007591EC /* lwm_nop.hpp */, - 13E9F11A19754DE4007591EC /* lwm_pthreads.hpp */, - 13E9F11B19754DE4007591EC /* lwm_win32_cs.hpp */, - 13E9F11C19754DE4007591EC /* make_array_helper.hpp */, - 13E9F11D19754DE4007591EC /* operator_bool.hpp */, - 13E9F11E19754DE4007591EC /* quick_allocator.hpp */, - 13E9F11F19754DE4007591EC /* shared_array_nmt.hpp */, - 13E9F12019754DE4007591EC /* shared_count.hpp */, - 13E9F12119754DE4007591EC /* shared_ptr_nmt.hpp */, - 13E9F12219754DE4007591EC /* sp_convertible.hpp */, - 13E9F12319754DE4007591EC /* sp_counted_base.hpp */, - 13E9F12419754DE4007591EC /* sp_counted_base_acc_ia64.hpp */, - 13E9F12519754DE4007591EC /* sp_counted_base_aix.hpp */, - 13E9F12619754DE4007591EC /* sp_counted_base_cw_ppc.hpp */, - 13E9F12719754DE4007591EC /* sp_counted_base_cw_x86.hpp */, - 13E9F12819754DE4007591EC /* sp_counted_base_gcc_ia64.hpp */, - 13E9F12919754DE4007591EC /* sp_counted_base_gcc_mips.hpp */, - 13E9F12A19754DE4007591EC /* sp_counted_base_gcc_ppc.hpp */, - 13E9F12B19754DE4007591EC /* sp_counted_base_gcc_sparc.hpp */, - 13E9F12C19754DE4007591EC /* sp_counted_base_gcc_x86.hpp */, - 13E9F12D19754DE4007591EC /* sp_counted_base_nt.hpp */, - 13E9F12E19754DE4007591EC /* sp_counted_base_pt.hpp */, - 13E9F12F19754DE4007591EC /* sp_counted_base_snc_ps3.hpp */, - 13E9F13019754DE4007591EC /* sp_counted_base_solaris.hpp */, - 13E9F13119754DE4007591EC /* sp_counted_base_spin.hpp */, - 13E9F13219754DE4007591EC /* sp_counted_base_sync.hpp */, - 13E9F13319754DE4007591EC /* sp_counted_base_vacpp_ppc.hpp */, - 13E9F13419754DE4007591EC /* sp_counted_base_w32.hpp */, - 13E9F13519754DE4007591EC /* sp_counted_impl.hpp */, - 13E9F13619754DE4007591EC /* sp_forward.hpp */, - 13E9F13719754DE4007591EC /* sp_has_sync.hpp */, - 13E9F13819754DE4007591EC /* sp_if_array.hpp */, - 13E9F13919754DE4007591EC /* sp_nullptr_t.hpp */, - 13E9F13A19754DE4007591EC /* spinlock.hpp */, - 13E9F13B19754DE4007591EC /* spinlock_gcc_arm.hpp */, - 13E9F13C19754DE4007591EC /* spinlock_nt.hpp */, - 13E9F13D19754DE4007591EC /* spinlock_pool.hpp */, - 13E9F13E19754DE4007591EC /* spinlock_pt.hpp */, - 13E9F13F19754DE4007591EC /* spinlock_sync.hpp */, - 13E9F14019754DE4007591EC /* spinlock_w32.hpp */, - 13E9F14119754DE4007591EC /* yield_k.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F1A219754DE4007591EC /* type_traits */ = { - isa = PBXGroup; - children = ( - 13E9F1A319754DE4007591EC /* add_const.hpp */, - 13E9F1A419754DE4007591EC /* add_cv.hpp */, - 13E9F1A519754DE4007591EC /* add_lvalue_reference.hpp */, - 13E9F1A619754DE4007591EC /* add_pointer.hpp */, - 13E9F1A719754DE4007591EC /* add_reference.hpp */, - 13E9F1A819754DE4007591EC /* add_rvalue_reference.hpp */, - 13E9F1A919754DE4007591EC /* add_volatile.hpp */, - 13E9F1AA19754DE4007591EC /* aligned_storage.hpp */, - 13E9F1AB19754DE4007591EC /* alignment_of.hpp */, - 13E9F1AC19754DE4007591EC /* arithmetic_traits.hpp */, - 13E9F1AD19754DE4007591EC /* broken_compiler_spec.hpp */, - 13E9F1AE19754DE4007591EC /* common_type.hpp */, - 13E9F1AF19754DE4007591EC /* composite_traits.hpp */, - 13E9F1B019754DE4007591EC /* conditional.hpp */, - 13E9F1B119754DE4007591EC /* config.hpp */, - 13E9F1B219754DE4007591EC /* conversion_traits.hpp */, - 13E9F1B319754DE4007591EC /* cv_traits.hpp */, - 13E9F1B419754DE4007591EC /* decay.hpp */, - 13E9F1B519754DE4007591EC /* detail */, - 13E9F1CD19754DE4007591EC /* extent.hpp */, - 13E9F1CE19754DE4007591EC /* floating_point_promotion.hpp */, - 13E9F1CF19754DE4007591EC /* function_traits.hpp */, - 13E9F1D019754DE4007591EC /* has_bit_and.hpp */, - 13E9F1D119754DE4007591EC /* has_bit_and_assign.hpp */, - 13E9F1D219754DE4007591EC /* has_bit_or.hpp */, - 13E9F1D319754DE4007591EC /* has_bit_or_assign.hpp */, - 13E9F1D419754DE4007591EC /* has_bit_xor.hpp */, - 13E9F1D519754DE4007591EC /* has_bit_xor_assign.hpp */, - 13E9F1D619754DE4007591EC /* has_complement.hpp */, - 13E9F1D719754DE4007591EC /* has_dereference.hpp */, - 13E9F1D819754DE4007591EC /* has_divides.hpp */, - 13E9F1D919754DE4007591EC /* has_divides_assign.hpp */, - 13E9F1DA19754DE4007591EC /* has_equal_to.hpp */, - 13E9F1DB19754DE4007591EC /* has_greater.hpp */, - 13E9F1DC19754DE4007591EC /* has_greater_equal.hpp */, - 13E9F1DD19754DE4007591EC /* has_left_shift.hpp */, - 13E9F1DE19754DE4007591EC /* has_left_shift_assign.hpp */, - 13E9F1DF19754DE4007591EC /* has_less.hpp */, - 13E9F1E019754DE4007591EC /* has_less_equal.hpp */, - 13E9F1E119754DE4007591EC /* has_logical_and.hpp */, - 13E9F1E219754DE4007591EC /* has_logical_not.hpp */, - 13E9F1E319754DE4007591EC /* has_logical_or.hpp */, - 13E9F1E419754DE4007591EC /* has_minus.hpp */, - 13E9F1E519754DE4007591EC /* has_minus_assign.hpp */, - 13E9F1E619754DE4007591EC /* has_modulus.hpp */, - 13E9F1E719754DE4007591EC /* has_modulus_assign.hpp */, - 13E9F1E819754DE4007591EC /* has_multiplies.hpp */, - 13E9F1E919754DE4007591EC /* has_multiplies_assign.hpp */, - 13E9F1EA19754DE4007591EC /* has_negate.hpp */, - 13E9F1EB19754DE4007591EC /* has_new_operator.hpp */, - 13E9F1EC19754DE4007591EC /* has_not_equal_to.hpp */, - 13E9F1ED19754DE4007591EC /* has_nothrow_assign.hpp */, - 13E9F1EE19754DE4007591EC /* has_nothrow_constructor.hpp */, - 13E9F1EF19754DE4007591EC /* has_nothrow_copy.hpp */, - 13E9F1F019754DE4007591EC /* has_nothrow_destructor.hpp */, - 13E9F1F119754DE4007591EC /* has_operator.hpp */, - 13E9F1F219754DE4007591EC /* has_plus.hpp */, - 13E9F1F319754DE4007591EC /* has_plus_assign.hpp */, - 13E9F1F419754DE4007591EC /* has_post_decrement.hpp */, - 13E9F1F519754DE4007591EC /* has_post_increment.hpp */, - 13E9F1F619754DE4007591EC /* has_pre_decrement.hpp */, - 13E9F1F719754DE4007591EC /* has_pre_increment.hpp */, - 13E9F1F819754DE4007591EC /* has_right_shift.hpp */, - 13E9F1F919754DE4007591EC /* has_right_shift_assign.hpp */, - 13E9F1FA19754DE4007591EC /* has_trivial_assign.hpp */, - 13E9F1FB19754DE4007591EC /* has_trivial_constructor.hpp */, - 13E9F1FC19754DE4007591EC /* has_trivial_copy.hpp */, - 13E9F1FD19754DE4007591EC /* has_trivial_destructor.hpp */, - 13E9F1FE19754DE4007591EC /* has_trivial_move_assign.hpp */, - 13E9F1FF19754DE4007591EC /* has_trivial_move_constructor.hpp */, - 13E9F20019754DE4007591EC /* has_unary_minus.hpp */, - 13E9F20119754DE4007591EC /* has_unary_plus.hpp */, - 13E9F20219754DE4007591EC /* has_virtual_destructor.hpp */, - 13E9F20319754DE4007591EC /* ice.hpp */, - 13E9F20419754DE4007591EC /* integral_constant.hpp */, - 13E9F20519754DE4007591EC /* integral_promotion.hpp */, - 13E9F20619754DE4007591EC /* intrinsics.hpp */, - 13E9F20719754DE4007591EC /* is_abstract.hpp */, - 13E9F20819754DE4007591EC /* is_arithmetic.hpp */, - 13E9F20919754DE4007591EC /* is_array.hpp */, - 13E9F20A19754DE4007591EC /* is_base_and_derived.hpp */, - 13E9F20B19754DE4007591EC /* is_base_of.hpp */, - 13E9F20C19754DE4007591EC /* is_class.hpp */, - 13E9F20D19754DE4007591EC /* is_complex.hpp */, - 13E9F20E19754DE4007591EC /* is_compound.hpp */, - 13E9F20F19754DE4007591EC /* is_const.hpp */, - 13E9F21019754DE4007591EC /* is_convertible.hpp */, - 13E9F21119754DE4007591EC /* is_copy_constructible.hpp */, - 13E9F21219754DE4007591EC /* is_empty.hpp */, - 13E9F21319754DE4007591EC /* is_enum.hpp */, - 13E9F21419754DE4007591EC /* is_float.hpp */, - 13E9F21519754DE4007591EC /* is_floating_point.hpp */, - 13E9F21619754DE4007591EC /* is_function.hpp */, - 13E9F21719754DE4007591EC /* is_fundamental.hpp */, - 13E9F21819754DE4007591EC /* is_integral.hpp */, - 13E9F21919754DE4007591EC /* is_lvalue_reference.hpp */, - 13E9F21A19754DE4007591EC /* is_member_function_pointer.hpp */, - 13E9F21B19754DE4007591EC /* is_member_object_pointer.hpp */, - 13E9F21C19754DE4007591EC /* is_member_pointer.hpp */, - 13E9F21D19754DE4007591EC /* is_nothrow_move_assignable.hpp */, - 13E9F21E19754DE4007591EC /* is_nothrow_move_constructible.hpp */, - 13E9F21F19754DE4007591EC /* is_object.hpp */, - 13E9F22019754DE4007591EC /* is_pod.hpp */, - 13E9F22119754DE4007591EC /* is_pointer.hpp */, - 13E9F22219754DE4007591EC /* is_polymorphic.hpp */, - 13E9F22319754DE4007591EC /* is_reference.hpp */, - 13E9F22419754DE4007591EC /* is_rvalue_reference.hpp */, - 13E9F22519754DE4007591EC /* is_same.hpp */, - 13E9F22619754DE4007591EC /* is_scalar.hpp */, - 13E9F22719754DE4007591EC /* is_signed.hpp */, - 13E9F22819754DE4007591EC /* is_stateless.hpp */, - 13E9F22919754DE4007591EC /* is_union.hpp */, - 13E9F22A19754DE4007591EC /* is_unsigned.hpp */, - 13E9F22B19754DE4007591EC /* is_virtual_base_of.hpp */, - 13E9F22C19754DE4007591EC /* is_void.hpp */, - 13E9F22D19754DE4007591EC /* is_volatile.hpp */, - 13E9F22E19754DE4007591EC /* make_signed.hpp */, - 13E9F22F19754DE4007591EC /* make_unsigned.hpp */, - 13E9F23019754DE4007591EC /* msvc */, - 13E9F23A19754DE4007591EC /* promote.hpp */, - 13E9F23B19754DE4007591EC /* rank.hpp */, - 13E9F23C19754DE4007591EC /* remove_all_extents.hpp */, - 13E9F23D19754DE4007591EC /* remove_bounds.hpp */, - 13E9F23E19754DE4007591EC /* remove_const.hpp */, - 13E9F23F19754DE4007591EC /* remove_cv.hpp */, - 13E9F24019754DE4007591EC /* remove_extent.hpp */, - 13E9F24119754DE4007591EC /* remove_pointer.hpp */, - 13E9F24219754DE4007591EC /* remove_reference.hpp */, - 13E9F24319754DE4007591EC /* remove_volatile.hpp */, - 13E9F24419754DE4007591EC /* type_with_alignment.hpp */, - ); - path = type_traits; - sourceTree = ""; - }; - 13E9F1B519754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F1B619754DE4007591EC /* bool_trait_def.hpp */, - 13E9F1B719754DE4007591EC /* bool_trait_undef.hpp */, - 13E9F1B819754DE4007591EC /* common_type_imp.hpp */, - 13E9F1B919754DE4007591EC /* cv_traits_impl.hpp */, - 13E9F1BA19754DE4007591EC /* false_result.hpp */, - 13E9F1BB19754DE4007591EC /* has_binary_operator.hpp */, - 13E9F1BC19754DE4007591EC /* has_postfix_operator.hpp */, - 13E9F1BD19754DE4007591EC /* has_prefix_operator.hpp */, - 13E9F1BE19754DE4007591EC /* ice_and.hpp */, - 13E9F1BF19754DE4007591EC /* ice_eq.hpp */, - 13E9F1C019754DE4007591EC /* ice_not.hpp */, - 13E9F1C119754DE4007591EC /* ice_or.hpp */, - 13E9F1C219754DE4007591EC /* is_function_ptr_helper.hpp */, - 13E9F1C319754DE4007591EC /* is_function_ptr_tester.hpp */, - 13E9F1C419754DE4007591EC /* is_mem_fun_pointer_impl.hpp */, - 13E9F1C519754DE4007591EC /* is_mem_fun_pointer_tester.hpp */, - 13E9F1C619754DE4007591EC /* size_t_trait_def.hpp */, - 13E9F1C719754DE4007591EC /* size_t_trait_undef.hpp */, - 13E9F1C819754DE4007591EC /* template_arity_spec.hpp */, - 13E9F1C919754DE4007591EC /* type_trait_def.hpp */, - 13E9F1CA19754DE4007591EC /* type_trait_undef.hpp */, - 13E9F1CB19754DE4007591EC /* wrap.hpp */, - 13E9F1CC19754DE4007591EC /* yes_no_type.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F23019754DE4007591EC /* msvc */ = { - isa = PBXGroup; - children = ( - 13E9F23119754DE4007591EC /* remove_all_extents.hpp */, - 13E9F23219754DE4007591EC /* remove_bounds.hpp */, - 13E9F23319754DE4007591EC /* remove_const.hpp */, - 13E9F23419754DE4007591EC /* remove_cv.hpp */, - 13E9F23519754DE4007591EC /* remove_extent.hpp */, - 13E9F23619754DE4007591EC /* remove_pointer.hpp */, - 13E9F23719754DE4007591EC /* remove_reference.hpp */, - 13E9F23819754DE4007591EC /* remove_volatile.hpp */, - 13E9F23919754DE4007591EC /* typeof.hpp */, - ); - path = msvc; - sourceTree = ""; - }; - 13E9F24619754DE4007591EC /* typeof */ = { - isa = PBXGroup; - children = ( - 13E9F24719754DE4007591EC /* dmc */, - 13E9F24919754DE4007591EC /* encode_decode.hpp */, - 13E9F24A19754DE4007591EC /* encode_decode_params.hpp */, - 13E9F24B19754DE4007591EC /* int_encoding.hpp */, - 13E9F24C19754DE4007591EC /* integral_template_param.hpp */, - 13E9F24D19754DE4007591EC /* message.hpp */, - 13E9F24E19754DE4007591EC /* modifiers.hpp */, - 13E9F24F19754DE4007591EC /* msvc */, - 13E9F25119754DE4007591EC /* native.hpp */, - 13E9F25219754DE4007591EC /* pointers_data_members.hpp */, - 13E9F25319754DE4007591EC /* register_functions.hpp */, - 13E9F25419754DE4007591EC /* register_functions_iterate.hpp */, - 13E9F25519754DE4007591EC /* register_fundamental.hpp */, - 13E9F25619754DE4007591EC /* register_mem_functions.hpp */, - 13E9F25719754DE4007591EC /* template_encoding.hpp */, - 13E9F25819754DE4007591EC /* template_template_param.hpp */, - 13E9F25919754DE4007591EC /* type_encoding.hpp */, - 13E9F25A19754DE4007591EC /* type_template_param.hpp */, - 13E9F25B19754DE4007591EC /* typeof.hpp */, - 13E9F25C19754DE4007591EC /* typeof_impl.hpp */, - 13E9F25D19754DE4007591EC /* unsupported.hpp */, - 13E9F25E19754DE4007591EC /* vector.hpp */, - 13E9F25F19754DE4007591EC /* vector100.hpp */, - 13E9F26019754DE4007591EC /* vector150.hpp */, - 13E9F26119754DE4007591EC /* vector200.hpp */, - 13E9F26219754DE4007591EC /* vector50.hpp */, - ); - path = typeof; - sourceTree = ""; - }; - 13E9F24719754DE4007591EC /* dmc */ = { - isa = PBXGroup; - children = ( - 13E9F24819754DE4007591EC /* typeof_impl.hpp */, - ); - path = dmc; - sourceTree = ""; - }; - 13E9F24F19754DE4007591EC /* msvc */ = { - isa = PBXGroup; - children = ( - 13E9F25019754DE4007591EC /* typeof_impl.hpp */, - ); - path = msvc; - sourceTree = ""; - }; - 13E9F26319754DE4007591EC /* utility */ = { - isa = PBXGroup; - children = ( - 13E9F26419754DE4007591EC /* addressof.hpp */, - 13E9F26519754DE4007591EC /* base_from_member.hpp */, - 13E9F26619754DE4007591EC /* binary.hpp */, - 13E9F26719754DE4007591EC /* compare_pointees.hpp */, - 13E9F26819754DE4007591EC /* declval.hpp */, - 13E9F26919754DE4007591EC /* detail */, - 13E9F26D19754DE4007591EC /* enable_if.hpp */, - 13E9F26E19754DE4007591EC /* identity_type.hpp */, - 13E9F26F19754DE4007591EC /* in_place_factory.hpp */, - 13E9F27019754DE4007591EC /* result_of.hpp */, - 13E9F27119754DE4007591EC /* swap.hpp */, - ); - path = utility; - sourceTree = ""; - }; - 13E9F26919754DE4007591EC /* detail */ = { - isa = PBXGroup; - children = ( - 13E9F26A19754DE4007591EC /* in_place_factory_prefix.hpp */, - 13E9F26B19754DE4007591EC /* in_place_factory_suffix.hpp */, - 13E9F26C19754DE4007591EC /* result_of_iterate.hpp */, - ); - path = detail; - sourceTree = ""; - }; - 13E9F28619754DE5007591EC /* corepattern */ = { - isa = PBXGroup; - children = ( - 13E9F28719754DE5007591EC /* CoreServiceBase.cpp */, - 13E9F28819754DE5007591EC /* CoreServiceBase.h */, - 13E9F28919754DE5007591EC /* ServiceBase.h */, - 13E9F28A19754DE5007591EC /* ServiceImpl.inl */, - ); - path = corepattern; - sourceTree = ""; - }; - 13E9F29719754DE5007591EC /* crypt */ = { - isa = PBXGroup; - children = ( - 1392E9291A834D770093185B /* XorCrypt.cpp */, - 1392E92A1A834D770093185B /* XorCrypt.h */, - 13E9F29819754DE5007591EC /* __crypt.h */, - 13E9F29919754DE5007591EC /* crypt.c */, - 13E9F29A19754DE5007591EC /* iBase64.cpp */, - 13E9F29B19754DE5007591EC /* iBase64.h */, - 13E9F29E19754DE5007591EC /* rbdes.c */, - 13E9F29F19754DE5007591EC /* rbdes.h */, - ); - path = crypt; - sourceTree = ""; - }; - 13E9F2A119754DE5007591EC /* debugger */ = { - isa = PBXGroup; - children = ( - 13E9F2A219754DE5007591EC /* debugger_utils.c */, - 13E9F2A319754DE5007591EC /* debugger_utils.h */, - 13E9F2A419754DE5007591EC /* spy.inl */, - 13E9F2A519754DE5007591EC /* spy_base.h */, - 13E9F2A619754DE5007591EC /* spy_impl_helper.inl */, - 13E9F2A719754DE5007591EC /* test_spy_sample.cpp */, - 13E9F2A819754DE5007591EC /* test_spy_sample.h */, - 13E9F2A919754DE5007591EC /* testspy.cpp */, - 13E9F2AA19754DE5007591EC /* testspy.h */, - ); - path = debugger; - sourceTree = ""; - }; - 13E9F2AE19754DE5007591EC /* http */ = { - isa = PBXGroup; - children = ( - 13E9F2AF19754DE5007591EC /* http.cpp */, - 13E9F2B019754DE5007591EC /* http.h */, - ); - path = http; - sourceTree = ""; - }; - 13E9F2B719754DE5007591EC /* messagequeue */ = { - isa = PBXGroup; - children = ( - 13E9F2B819754DE5007591EC /* MessageQueue.cpp */, - 13E9F2B919754DE5007591EC /* MessageQueue.h */, - 13E9F2BA19754DE5007591EC /* MessageQueueUtils.cpp */, - 13E9F2BB19754DE5007591EC /* MessageQueueUtils.h */, - ); - path = messagequeue; - sourceTree = ""; - }; - 13E9F2BC19754DE5007591EC /* network */ = { - isa = PBXGroup; - children = ( - 4F516B731A19F3B20006EC9D /* getifaddrs.cpp */, - 4F516B741A19F3B20006EC9D /* getifaddrs.h */, - 13E9F2BD19754DE5007591EC /* getgateway.c */, - 13E9F2BE19754DE5007591EC /* getgateway.h */, - ); - path = network; - sourceTree = ""; - }; - 13E9F2BF19754DE5007591EC /* objc */ = { - isa = PBXGroup; - children = ( - 13E9F2C019754DE5007591EC /* ip_icmp.h */, - 13E9F2C119754DE5007591EC /* objc_timer.h */, - 13E9F2C219754DE5007591EC /* objc_timer.mm */, - 13E9F2C319754DE5007591EC /* platform_comm.mm */, - 13E9F2C419754DE5007591EC /* Reachability.h */, - 13E9F2C519754DE5007591EC /* Reachability.mm */, - 13E9F2C619754DE5007591EC /* route.h */, - 13E9F2C719754DE5007591EC /* scope_autoreleasepool.h */, - 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */, - 13E9F2C919754DE5007591EC /* ThreadOperationQueue.h */, - 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */, - 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */, - ); - path = objc; - sourceTree = ""; - }; - 13E9F2D219754DE5007591EC /* socket */ = { - isa = PBXGroup; - children = ( - 4FCB62C21A307EFA00E57EE0 /* TcpFSMHandler.h */, - 4FCB62C31A307EFA00E57EE0 /* TcpServer.cpp */, - 4FCB62C41A307EFA00E57EE0 /* TcpServer.h */, - 4FCB62C51A307EFA00E57EE0 /* TcpServerFSM.cpp */, - 4FCB62C61A307EFA00E57EE0 /* TcpServerFSM.h */, - F1C0DAF919C862DF0056DE44 /* UdpClient.cpp */, - F1C0DAFA19C862DF0056DE44 /* UdpClient.h */, - F1C0DAFB19C862DF0056DE44 /* UdpServer.cpp */, - F1C0DAFC19C862DF0056DE44 /* UdpServer.h */, - 4FC0D7CD19A3681B00E8CB6E /* TcpClientFSM.cpp */, - 4FC0D7CE19A3681B00E8CB6E /* TcpClientFSM.h */, - 13E9F2D319754DE5007591EC /* ComplexConnect.cpp */, - 13E9F2D419754DE5007591EC /* ComplexConnect.h */, - 13E9F2D519754DE5007591EC /* SocketSelect.h */, - 13E9F2D619754DE5007591EC /* TcpClient.cpp */, - 13E9F2D719754DE5007591EC /* TcpClient.h */, - 13E9F2D819754DE5007591EC /* unix_socket.c */, - 13E9F2D919754DE5007591EC /* unix_socket.h */, - ); - path = socket; - sourceTree = ""; - }; - 13E9F2DC19754DE5007591EC /* thread */ = { - isa = PBXGroup; - children = ( - 13E9F2DD19754DE5007591EC /* atomic_oper.h */, - 13E9F2DE19754DE5007591EC /* bind.h */, - 13E9F2DF19754DE5007591EC /* condition.h */, - 13E9F2E019754DE5007591EC /* lock.h */, - 13E9F2E119754DE5007591EC /* mutex.h */, - 13E9F2E219754DE5007591EC /* mutexvector.h */, - 13E9F2E319754DE5007591EC /* runnable.h */, - 13E9F2E419754DE5007591EC /* spinlock.h */, - 13E9F2E519754DE5007591EC /* test_case.cpp_ */, - 13E9F2E619754DE5007591EC /* thread.h */, - 13E9F2E719754DE5007591EC /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - 13E9F2EA19754DE6007591EC /* unix */ = { - isa = PBXGroup; - children = ( - 13E9F2EB19754DE6007591EC /* SocketSelect */, - 13E9F2EE19754DE6007591EC /* thread */, - ); - path = unix; - sourceTree = ""; - }; - 13E9F2EB19754DE6007591EC /* SocketSelect */ = { - isa = PBXGroup; - children = ( - 13E9F2EC19754DE6007591EC /* SocketSelect.cpp */, - 13E9F2ED19754DE6007591EC /* SocketSelect.h */, - ); - path = SocketSelect; - sourceTree = ""; - }; - 13E9F2EE19754DE6007591EC /* thread */ = { - isa = PBXGroup; - children = ( - 13E9F2EF19754DE6007591EC /* condition.h */, - 13E9F2F019754DE6007591EC /* lock.h */, - 13E9F2F119754DE6007591EC /* mutex.h */, - 13E9F2F219754DE6007591EC /* test_case.cpp_ */, - 13E9F2F319754DE6007591EC /* thread.h */, - 13E9F2F419754DE6007591EC /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - 13E9F2F719754DE6007591EC /* xlogger */ = { - isa = PBXGroup; - children = ( - 13E9F2F819754DE6007591EC /* preprocessor.h */, - 13E9F2F919754DE6007591EC /* test.cpp_ */, - 13E9F2FA19754DE6007591EC /* test_for_c.c_ */, - 13E9F2FB19754DE6007591EC /* xlogger.h */, - 13E9F2FC19754DE6007591EC /* xloggerbase.c */, - 13E9F2FD19754DE6007591EC /* xloggerbase.h */, - ); - path = xlogger; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - 4FB8EE341A370BD400B3A99E /* verinfo.h */, - 4FCB62D91A30802600E57EE0 /* BasePacker.cpp */, - 4FCB62DA1A30802600E57EE0 /* BasePacker.h */, - 425BA57F1A14AD0600073A45 /* tickcount.cpp */, - 425BA5801A14AD0600073A45 /* tickcount.h */, - 4FC0D7D019A4898100E8CB6E /* anr.cpp */, - 4FC0D7D119A4898100E8CB6E /* anr.h */, - 13E9EA9419754DE1007591EC /* __assert.c */, - 13E9EA9519754DE1007591EC /* __assert.h */, - 13E9EA9619754DE1007591EC /* adler32.c */, - 13E9EA9719754DE1007591EC /* adler32.h */, - 13E9EA9819754DE1007591EC /* alarm.cpp */, - 13E9EA9919754DE1007591EC /* alarm.h */, - 13E9EA9A19754DE1007591EC /* Autobuffer.cpp */, - 13E9EA9B19754DE1007591EC /* Autobuffer.h */, - 13E9EA9C19754DE1007591EC /* boost */, - 13E9F28019754DE5007591EC /* bootregister.h */, - 13E9F28119754DE5007591EC /* bootrun.h */, - 13E9F28219754DE5007591EC /* CommFrequencyLimit.cpp */, - 13E9F28319754DE5007591EC /* CommFrequencyLimit.h */, - 13E9F28419754DE5007591EC /* compiler_util.h */, - 13E9F28519754DE5007591EC /* copy_wrapper.h */, - 13E9F28619754DE5007591EC /* corepattern */, - 13E9F29719754DE5007591EC /* crypt */, - 13E9F2A019754DE5007591EC /* cxxnamespacefix.h */, - 13E9F2A119754DE5007591EC /* debugger */, - 13E9F2AB19754DE5007591EC /* DNS.cpp */, - 13E9F2AC19754DE5007591EC /* DNS.h */, - 13E9F2AD19754DE5007591EC /* has_member.h */, - 13E9F2AE19754DE5007591EC /* http */, - 13E9F2B119754DE5007591EC /* INI.h */, - 13E9F2B219754DE5007591EC /* MarcoToolkit.h */, - 13E9F2B319754DE5007591EC /* md5.c */, - 13E9F2B419754DE5007591EC /* md5.h */, - 13E9F2B519754DE5007591EC /* memdbg.cpp */, - 13E9F2B619754DE5007591EC /* memdbg.h */, - 13E9F2B719754DE5007591EC /* messagequeue */, - 13E9F2BC19754DE5007591EC /* network */, - 13E9F2BF19754DE5007591EC /* objc */, - 13E9F2CC19754DE5007591EC /* platform_comm.h */, - 13E9F2CD19754DE5007591EC /* PtrBuffer.cpp */, - 13E9F2CE19754DE5007591EC /* PtrBuffer.h */, - 13E9F2CF19754DE5007591EC /* ScopeRecursionLimit.h */, - 13E9F2D019754DE5007591EC /* singleton.cpp */, - 13E9F2D119754DE5007591EC /* singleton.h */, - 13E9F2D219754DE5007591EC /* socket */, - 13E9F2DA19754DE5007591EC /* strutil.cpp */, - 13E9F2DB19754DE5007591EC /* strutil.h */, - 13E9F2DC19754DE5007591EC /* thread */, - 13E9F2E819754DE5007591EC /* tinyxml2.cpp */, - 13E9F2E919754DE6007591EC /* tinyxml2.h */, - 13E9F2EA19754DE6007591EC /* unix */, - 13E9F2F519754DE6007591EC /* utils.c */, - 13E9F2F619754DE6007591EC /* utils.h */, - 13E9F2F719754DE6007591EC /* xlogger */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libcomm-watch.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FB8EE351A370C0700B3A99E /* signals2 */ = { - isa = PBXGroup; - children = ( - 4FB8EE361A370C0700B3A99E /* connection.hpp */, - 4FB8EE371A370C0700B3A99E /* deconstruct.hpp */, - 4FB8EE381A370C0700B3A99E /* deconstruct_ptr.hpp */, - 4FB8EE391A370C0700B3A99E /* detail */, - 4FB8EE4E1A370C0700B3A99E /* dummy_mutex.hpp */, - 4FB8EE4F1A370C0700B3A99E /* expired_slot.hpp */, - 4FB8EE501A370C0700B3A99E /* last_value.hpp */, - 4FB8EE511A370C0700B3A99E /* mutex.hpp */, - 4FB8EE521A370C0700B3A99E /* optional_last_value.hpp */, - 4FB8EE531A370C0700B3A99E /* postconstructible.hpp */, - 4FB8EE541A370C0700B3A99E /* predestructible.hpp */, - 4FB8EE551A370C0700B3A99E /* preprocessed_signal.hpp */, - 4FB8EE561A370C0700B3A99E /* preprocessed_slot.hpp */, - 4FB8EE571A370C0700B3A99E /* shared_connection_block.hpp */, - 4FB8EE581A370C0700B3A99E /* signal.hpp */, - 4FB8EE591A370C0700B3A99E /* signal_base.hpp */, - 4FB8EE5A1A370C0700B3A99E /* signal_type.hpp */, - 4FB8EE5B1A370C0700B3A99E /* slot.hpp */, - 4FB8EE5C1A370C0700B3A99E /* slot_base.hpp */, - 4FB8EE5D1A370C0700B3A99E /* trackable.hpp */, - 4FB8EE5E1A370C0700B3A99E /* variadic_signal.hpp */, - 4FB8EE5F1A370C0700B3A99E /* variadic_slot.hpp */, - ); - path = signals2; - sourceTree = ""; - }; - 4FB8EE391A370C0700B3A99E /* detail */ = { - isa = PBXGroup; - children = ( - 4FB8EE3A1A370C0700B3A99E /* auto_buffer.hpp */, - 4FB8EE3B1A370C0700B3A99E /* foreign_ptr.hpp */, - 4FB8EE3C1A370C0700B3A99E /* lwm_nop.hpp */, - 4FB8EE3D1A370C0700B3A99E /* lwm_pthreads.hpp */, - 4FB8EE3E1A370C0700B3A99E /* lwm_win32_cs.hpp */, - 4FB8EE3F1A370C0700B3A99E /* null_output_iterator.hpp */, - 4FB8EE401A370C0700B3A99E /* preprocessed_arg_type.hpp */, - 4FB8EE411A370C0700B3A99E /* preprocessed_arg_type_template.hpp */, - 4FB8EE421A370C0700B3A99E /* replace_slot_function.hpp */, - 4FB8EE431A370C0700B3A99E /* result_type_wrapper.hpp */, - 4FB8EE441A370C0700B3A99E /* signal_template.hpp */, - 4FB8EE451A370C0700B3A99E /* signals_common.hpp */, - 4FB8EE461A370C0700B3A99E /* signals_common_macros.hpp */, - 4FB8EE471A370C0700B3A99E /* slot_call_iterator.hpp */, - 4FB8EE481A370C0700B3A99E /* slot_groups.hpp */, - 4FB8EE491A370C0700B3A99E /* slot_template.hpp */, - 4FB8EE4A1A370C0700B3A99E /* tracked_objects_visitor.hpp */, - 4FB8EE4B1A370C0700B3A99E /* unique_lock.hpp */, - 4FB8EE4C1A370C0700B3A99E /* variadic_arg_type.hpp */, - 4FB8EE4D1A370C0700B3A99E /* variadic_slot_invoker.hpp */, - ); - path = detail; - sourceTree = ""; - }; - F16A5FBA1ACD7EE50085FBDD /* iostreams */ = { - isa = PBXGroup; - children = ( - F16A5FBB1ACD7EE50085FBDD /* categories.hpp */, - F16A5FBC1ACD7EE50085FBDD /* char_traits.hpp */, - F16A5FBD1ACD7EE50085FBDD /* checked_operations.hpp */, - F16A5FBE1ACD7EE50085FBDD /* close.hpp */, - F16A5FBF1ACD7EE50085FBDD /* concepts.hpp */, - F16A5FC01ACD7EE50085FBDD /* constants.hpp */, - F16A5FC11ACD7EE50085FBDD /* detail */, - F16A60001ACD7EE50085FBDD /* device */, - F16A60061ACD7EE50085FBDD /* filter */, - F16A600B1ACD7EE50085FBDD /* flush.hpp */, - F16A600C1ACD7EE50085FBDD /* get.hpp */, - F16A600D1ACD7EE50085FBDD /* imbue.hpp */, - F16A600E1ACD7EE50085FBDD /* input_sequence.hpp */, - F16A600F1ACD7EE50085FBDD /* operations.hpp */, - F16A60101ACD7EE50085FBDD /* operations_fwd.hpp */, - F16A60111ACD7EE50085FBDD /* optimal_buffer_size.hpp */, - F16A60121ACD7EE50085FBDD /* output_sequence.hpp */, - F16A60131ACD7EE50085FBDD /* pipeline.hpp */, - F16A60141ACD7EE50085FBDD /* positioning.hpp */, - F16A60151ACD7EE50085FBDD /* put.hpp */, - F16A60161ACD7EE50085FBDD /* putback.hpp */, - F16A60171ACD7EE50085FBDD /* read.hpp */, - F16A60181ACD7EE50085FBDD /* seek.hpp */, - F16A60191ACD7EE50085FBDD /* stream.hpp */, - F16A601A1ACD7EE50085FBDD /* stream_buffer.hpp */, - F16A601B1ACD7EE50085FBDD /* traits.hpp */, - F16A601C1ACD7EE50085FBDD /* traits_fwd.hpp */, - F16A601D1ACD7EE50085FBDD /* write.hpp */, - ); - path = iostreams; - sourceTree = ""; - }; - F16A5FC11ACD7EE50085FBDD /* detail */ = { - isa = PBXGroup; - children = ( - F16A5FC21ACD7EE50085FBDD /* adapter */, - F16A5FC81ACD7EE50085FBDD /* bool_trait_def.hpp */, - F16A5FC91ACD7EE50085FBDD /* broken_overload_resolution */, - F16A5FCD1ACD7EE50085FBDD /* buffer.hpp */, - F16A5FCE1ACD7EE50085FBDD /* call_traits.hpp */, - F16A5FCF1ACD7EE50085FBDD /* char_traits.hpp */, - F16A5FD01ACD7EE50085FBDD /* config */, - F16A5FE01ACD7EE50085FBDD /* default_arg.hpp */, - F16A5FE11ACD7EE50085FBDD /* dispatch.hpp */, - F16A5FE21ACD7EE50085FBDD /* double_object.hpp */, - F16A5FE31ACD7EE50085FBDD /* enable_if_stream.hpp */, - F16A5FE41ACD7EE50085FBDD /* error.hpp */, - F16A5FE51ACD7EE50085FBDD /* execute.hpp */, - F16A5FE61ACD7EE50085FBDD /* file_handle.hpp */, - F16A5FE71ACD7EE50085FBDD /* forward.hpp */, - F16A5FE81ACD7EE50085FBDD /* functional.hpp */, - F16A5FE91ACD7EE50085FBDD /* ios.hpp */, - F16A5FEA1ACD7EE50085FBDD /* iostream.hpp */, - F16A5FEB1ACD7EE50085FBDD /* is_dereferenceable.hpp */, - F16A5FEC1ACD7EE50085FBDD /* is_iterator_range.hpp */, - F16A5FED1ACD7EE50085FBDD /* optional.hpp */, - F16A5FEE1ACD7EE50085FBDD /* path.hpp */, - F16A5FEF1ACD7EE50085FBDD /* push.hpp */, - F16A5FF01ACD7EE50085FBDD /* push_params.hpp */, - F16A5FF11ACD7EE50085FBDD /* resolve.hpp */, - F16A5FF21ACD7EE50085FBDD /* select.hpp */, - F16A5FF31ACD7EE50085FBDD /* select_by_size.hpp */, - F16A5FF41ACD7EE50085FBDD /* streambuf */, - F16A5FF81ACD7EE50085FBDD /* streambuf.hpp */, - F16A5FF91ACD7EE50085FBDD /* system_failure.hpp */, - F16A5FFA1ACD7EE50085FBDD /* template_params.hpp */, - F16A5FFB1ACD7EE50085FBDD /* vc6 */, - F16A5FFF1ACD7EE50085FBDD /* wrap_unwrap.hpp */, - ); - path = detail; - sourceTree = ""; - }; - F16A5FC21ACD7EE50085FBDD /* adapter */ = { - isa = PBXGroup; - children = ( - F16A5FC31ACD7EE50085FBDD /* concept_adapter.hpp */, - F16A5FC41ACD7EE50085FBDD /* mode_adapter.hpp */, - F16A5FC51ACD7EE50085FBDD /* non_blocking_adapter.hpp */, - F16A5FC61ACD7EE50085FBDD /* output_iterator_adapter.hpp */, - F16A5FC71ACD7EE50085FBDD /* range_adapter.hpp */, - ); - path = adapter; - sourceTree = ""; - }; - F16A5FC91ACD7EE50085FBDD /* broken_overload_resolution */ = { - isa = PBXGroup; - children = ( - F16A5FCA1ACD7EE50085FBDD /* forward.hpp */, - F16A5FCB1ACD7EE50085FBDD /* stream.hpp */, - F16A5FCC1ACD7EE50085FBDD /* stream_buffer.hpp */, - ); - path = broken_overload_resolution; - sourceTree = ""; - }; - F16A5FD01ACD7EE50085FBDD /* config */ = { - isa = PBXGroup; - children = ( - F16A5FD11ACD7EE50085FBDD /* auto_link.hpp */, - F16A5FD21ACD7EE50085FBDD /* bzip2.hpp */, - F16A5FD31ACD7EE50085FBDD /* codecvt.hpp */, - F16A5FD41ACD7EE50085FBDD /* disable_warnings.hpp */, - F16A5FD51ACD7EE50085FBDD /* dyn_link.hpp */, - F16A5FD61ACD7EE50085FBDD /* enable_warnings.hpp */, - F16A5FD71ACD7EE50085FBDD /* fpos.hpp */, - F16A5FD81ACD7EE50085FBDD /* gcc.hpp */, - F16A5FD91ACD7EE50085FBDD /* limits.hpp */, - F16A5FDA1ACD7EE50085FBDD /* overload_resolution.hpp */, - F16A5FDB1ACD7EE50085FBDD /* rtl.hpp */, - F16A5FDC1ACD7EE50085FBDD /* unreachable_return.hpp */, - F16A5FDD1ACD7EE50085FBDD /* wide_streams.hpp */, - F16A5FDE1ACD7EE50085FBDD /* windows_posix.hpp */, - F16A5FDF1ACD7EE50085FBDD /* zlib.hpp */, - ); - path = config; - sourceTree = ""; - }; - F16A5FF41ACD7EE50085FBDD /* streambuf */ = { - isa = PBXGroup; - children = ( - F16A5FF51ACD7EE50085FBDD /* direct_streambuf.hpp */, - F16A5FF61ACD7EE50085FBDD /* indirect_streambuf.hpp */, - F16A5FF71ACD7EE50085FBDD /* linked_streambuf.hpp */, - ); - path = streambuf; - sourceTree = ""; - }; - F16A5FFB1ACD7EE50085FBDD /* vc6 */ = { - isa = PBXGroup; - children = ( - F16A5FFC1ACD7EE50085FBDD /* close.hpp */, - F16A5FFD1ACD7EE50085FBDD /* read.hpp */, - F16A5FFE1ACD7EE50085FBDD /* write.hpp */, - ); - path = vc6; - sourceTree = ""; - }; - F16A60001ACD7EE50085FBDD /* device */ = { - isa = PBXGroup; - children = ( - F16A60011ACD7EE50085FBDD /* array.hpp */, - F16A60021ACD7EE50085FBDD /* back_inserter.hpp */, - F16A60031ACD7EE50085FBDD /* file_descriptor.hpp */, - F16A60041ACD7EE50085FBDD /* mapped_file.hpp */, - F16A60051ACD7EE50085FBDD /* null.hpp */, - ); - path = device; - sourceTree = ""; - }; - F16A60061ACD7EE50085FBDD /* filter */ = { - isa = PBXGroup; - children = ( - F16A60071ACD7EE50085FBDD /* bzip2.hpp */, - F16A60081ACD7EE50085FBDD /* gzip.hpp */, - F16A60091ACD7EE50085FBDD /* symmetric.hpp */, - F16A600A1ACD7EE50085FBDD /* zlib.hpp */, - ); - path = filter; - sourceTree = ""; - }; - F16A60291ACD7FEE0085FBDD /* iostreams */ = { - isa = PBXGroup; - children = ( - F16A602A1ACD7FEE0085FBDD /* src */, - ); - path = iostreams; - sourceTree = ""; - }; - F16A602A1ACD7FEE0085FBDD /* src */ = { - isa = PBXGroup; - children = ( - F16A602B1ACD7FEE0085FBDD /* file_descriptor.cpp */, - F16A602C1ACD7FEE0085FBDD /* gzip.cpp */, - F16A602D1ACD7FEE0085FBDD /* mapped_file.cpp */, - F16A602E1ACD7FEE0085FBDD /* zlib.cpp */, - ); - path = src; - sourceTree = ""; - }; - F16A60331ACD80140085FBDD /* range */ = { - isa = PBXGroup; - children = ( - F16A60341ACD80140085FBDD /* algorithm */, - F16A60361ACD80140085FBDD /* begin.hpp */, - F16A60371ACD80140085FBDD /* concepts.hpp */, - F16A60381ACD80140085FBDD /* config.hpp */, - F16A60391ACD80140085FBDD /* const_iterator.hpp */, - F16A603A1ACD80140085FBDD /* detail */, - F16A60491ACD80140085FBDD /* difference_type.hpp */, - F16A604A1ACD80140085FBDD /* distance.hpp */, - F16A604B1ACD80140085FBDD /* empty.hpp */, - F16A604C1ACD80140085FBDD /* end.hpp */, - F16A604D1ACD80140085FBDD /* functions.hpp */, - F16A604E1ACD80140085FBDD /* iterator.hpp */, - F16A604F1ACD80140085FBDD /* iterator_range.hpp */, - F16A60501ACD80140085FBDD /* iterator_range_core.hpp */, - F16A60511ACD80140085FBDD /* iterator_range_io.hpp */, - F16A60521ACD80140085FBDD /* mutable_iterator.hpp */, - F16A60531ACD80140085FBDD /* rbegin.hpp */, - F16A60541ACD80140085FBDD /* rend.hpp */, - F16A60551ACD80140085FBDD /* result_iterator.hpp */, - F16A60561ACD80140085FBDD /* reverse_iterator.hpp */, - F16A60571ACD80140085FBDD /* size.hpp */, - F16A60581ACD80140085FBDD /* size_type.hpp */, - F16A60591ACD80140085FBDD /* value_type.hpp */, - ); - path = range; - sourceTree = ""; - }; - F16A60341ACD80140085FBDD /* algorithm */ = { - isa = PBXGroup; - children = ( - F16A60351ACD80140085FBDD /* equal.hpp */, - ); - path = algorithm; - sourceTree = ""; - }; - F16A603A1ACD80140085FBDD /* detail */ = { - isa = PBXGroup; - children = ( - F16A603B1ACD80140085FBDD /* begin.hpp */, - F16A603C1ACD80140085FBDD /* common.hpp */, - F16A603D1ACD80140085FBDD /* const_iterator.hpp */, - F16A603E1ACD80140085FBDD /* end.hpp */, - F16A603F1ACD80140085FBDD /* extract_optional_type.hpp */, - F16A60401ACD80140085FBDD /* implementation_help.hpp */, - F16A60411ACD80140085FBDD /* iterator.hpp */, - F16A60421ACD80140085FBDD /* misc_concept.hpp */, - F16A60431ACD80140085FBDD /* remove_extent.hpp */, - F16A60441ACD80140085FBDD /* safe_bool.hpp */, - F16A60451ACD80140085FBDD /* sfinae.hpp */, - F16A60461ACD80140085FBDD /* size_type.hpp */, - F16A60471ACD80140085FBDD /* vc6 */, - ); - path = detail; - sourceTree = ""; - }; - F16A60471ACD80140085FBDD /* vc6 */ = { - isa = PBXGroup; - children = ( - F16A60481ACD80140085FBDD /* end.hpp */, - ); - path = vc6; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* comm-watch */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm-watch" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "comm-watch"; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libcomm-watch.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0460; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm-watch" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* comm-watch */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 13E9F32819754DE6007591EC /* DNS.cpp in Sources */, - 13E9F33219754DE6007591EC /* scope_autoreleasepool.mm in Sources */, - 13704D7D197E444C00ED4EF8 /* greg_weekday.cpp in Sources */, - 13E9F32B19754DE6007591EC /* memdbg.cpp in Sources */, - 13704D7F197E444C00ED4EF8 /* posix_time_types.cpp in Sources */, - 13E9F32919754DE6007591EC /* http.cpp in Sources */, - 4FCB62DB1A30802600E57EE0 /* BasePacker.cpp in Sources */, - 13704D7B197E444C00ED4EF8 /* date_generators.cpp in Sources */, - 13E9F33819754DE6007591EC /* TcpClient.cpp in Sources */, - 13E9F33D19754DE6007591EC /* utils.c in Sources */, - F16A60321ACD7FEE0085FBDD /* zlib.cpp in Sources */, - 13E9F32A19754DE6007591EC /* md5.c in Sources */, - 4FCB62C81A307EFA00E57EE0 /* TcpServerFSM.cpp in Sources */, - 1392E92B1A834D770093185B /* XorCrypt.cpp in Sources */, - 13E9F33B19754DE6007591EC /* tinyxml2.cpp in Sources */, - 4F516B751A19F3B20006EC9D /* getifaddrs.cpp in Sources */, - 13E9F31A19754DE6007591EC /* CoreServiceBase.cpp in Sources */, - 13E9F33119754DE6007591EC /* Reachability.mm in Sources */, - 13E9F33519754DE6007591EC /* PtrBuffer.cpp in Sources */, - 13E9F32C19754DE6007591EC /* MessageQueue.cpp in Sources */, - F1C0DAFD19C862DF0056DE44 /* UdpClient.cpp in Sources */, - F16A60311ACD7FEE0085FBDD /* mapped_file.cpp in Sources */, - 13E9F32219754DE6007591EC /* iBase64.cpp in Sources */, - 13E9F33619754DE6007591EC /* singleton.cpp in Sources */, - 4FC0D7CF19A3681B00E8CB6E /* TcpClientFSM.cpp in Sources */, - 13E9F32419754DE6007591EC /* rbdes.c in Sources */, - 13E9F32E19754DE6007591EC /* getgateway.c in Sources */, - 13E9F31919754DE6007591EC /* CommFrequencyLimit.cpp in Sources */, - 13E9F33E19754DE6007591EC /* xloggerbase.c in Sources */, - 4FCB62C71A307EFA00E57EE0 /* TcpServer.cpp in Sources */, - F16A60301ACD7FEE0085FBDD /* gzip.cpp in Sources */, - 13E9F2FE19754DE6007591EC /* __assert.c in Sources */, - 13E9F2FF19754DE6007591EC /* adler32.c in Sources */, - 13E9F32619754DE6007591EC /* test_spy_sample.cpp in Sources */, - 13E9F30119754DE6007591EC /* Autobuffer.cpp in Sources */, - 13E9F32D19754DE6007591EC /* MessageQueueUtils.cpp in Sources */, - 13E9F33A19754DE6007591EC /* strutil.cpp in Sources */, - 4FC0D7D219A4898100E8CB6E /* anr.cpp in Sources */, - 13E9F33719754DE6007591EC /* ComplexConnect.cpp in Sources */, - 13E9F30019754DE6007591EC /* alarm.cpp in Sources */, - 425BA5811A14AD0600073A45 /* tickcount.cpp in Sources */, - 13704D7E197E444C00ED4EF8 /* gregorian_types.cpp in Sources */, - 13E9F33C19754DE6007591EC /* SocketSelect.cpp in Sources */, - 13E9F32719754DE6007591EC /* testspy.cpp in Sources */, - 13E9F33919754DE6007591EC /* unix_socket.c in Sources */, - 13E9F32119754DE6007591EC /* crypt.c in Sources */, - F1C0DAFE19C862DF0056DE44 /* UdpServer.cpp in Sources */, - F16A602F1ACD7FEE0085FBDD /* file_descriptor.cpp in Sources */, - 13704D86197E444C00ED4EF8 /* sp_collector.cpp in Sources */, - 13E9F33419754DE6007591EC /* xlogger_threadinfo.mm in Sources */, - 13E9F32F19754DE6007591EC /* objc_timer.mm in Sources */, - 13704D87197E444C00ED4EF8 /* sp_debug_hooks.cpp in Sources */, - 13E9F33019754DE6007591EC /* platform_comm.mm in Sources */, - 13E9F33319754DE6007591EC /* ThreadOperationQueue.mm in Sources */, - 13E9F32519754DE6007591EC /* debugger_utils.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = watchos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = watchos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/comm.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = .; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/comm.dst; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"pubc_$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = .; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = watchos; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7k"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm-watch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/comm/comm-watch.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/mars/comm/comm-watch.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bd286a179..000000000 --- a/mars/comm/comm-watch.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/mars/comm/comm.xcodeproj/project.pbxproj b/mars/comm/comm.xcodeproj/project.pbxproj deleted file mode 100644 index 12ae5747c..000000000 --- a/mars/comm/comm.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1215 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1319C65D1BAC12EA00C4B07B /* data_protect_attr.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1319C65C1BAC12EA00C4B07B /* data_protect_attr.mm */; }; - 13E9F2FF19754DE6007591EC /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9619754DE1007591EC /* adler32.c */; }; - 13E9F30019754DE6007591EC /* alarm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9819754DE1007591EC /* alarm.cc */; }; - 13E9F30119754DE6007591EC /* autobuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9EA9A19754DE1007591EC /* autobuffer.cc */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F31919754DE6007591EC /* comm_frequency_limit.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F28219754DE5007591EC /* comm_frequency_limit.cc */; }; - 13E9F31A19754DE6007591EC /* coreservice_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F28719754DE5007591EC /* coreservice_base.cc */; }; - 13E9F32219754DE6007591EC /* ibase64.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F29A19754DE5007591EC /* ibase64.cc */; }; - 13E9F32519754DE6007591EC /* debugger_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A219754DE5007591EC /* debugger_utils.c */; }; - 13E9F32619754DE6007591EC /* test_spy_sample.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A719754DE5007591EC /* test_spy_sample.cc */; }; - 13E9F32719754DE6007591EC /* testspy.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2A919754DE5007591EC /* testspy.cc */; }; - 13E9F32A19754DE6007591EC /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B319754DE5007591EC /* md5.c */; }; - 13E9F32B19754DE6007591EC /* memdbg.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B519754DE5007591EC /* memdbg.cc */; }; - 13E9F32C19754DE6007591EC /* message_queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2B819754DE5007591EC /* message_queue.cc */; }; - 13E9F32D19754DE6007591EC /* message_queue_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2BA19754DE5007591EC /* message_queue_utils.cc */; }; - 13E9F32E19754DE6007591EC /* getgateway.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2BD19754DE5007591EC /* getgateway.c */; }; - 13E9F32F19754DE6007591EC /* objc_timer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C219754DE5007591EC /* objc_timer.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33019754DE6007591EC /* platform_comm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C319754DE5007591EC /* platform_comm.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33119754DE6007591EC /* Reachability.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C519754DE5007591EC /* Reachability.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33219754DE6007591EC /* scope_autoreleasepool.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33319754DE6007591EC /* ThreadOperationQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33419754DE6007591EC /* xlogger_threadinfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33519754DE6007591EC /* ptrbuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2CD19754DE5007591EC /* ptrbuffer.cc */; }; - 13E9F33619754DE6007591EC /* singleton.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D019754DE5007591EC /* singleton.cc */; }; - 13E9F33819754DE6007591EC /* tcpclient.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2D619754DE5007591EC /* tcpclient.cc */; }; - 13E9F33A19754DE6007591EC /* strutil.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2DA19754DE5007591EC /* strutil.cc */; }; - 13E9F33B19754DE6007591EC /* tinyxml2.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2E819754DE5007591EC /* tinyxml2.cc */; }; - 13E9F33C19754DE6007591EC /* socketselect.cc in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2EC19754DE6007591EC /* socketselect.cc */; }; - 13E9F33D19754DE6007591EC /* time_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2F519754DE6007591EC /* time_utils.c */; settings = {COMPILER_FLAGS = "-fvisibility=default"; }; }; - 13E9F33E19754DE6007591EC /* xloggerbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 13E9F2FC19754DE6007591EC /* xloggerbase.c */; }; - 1F14CAFD1D93EA33003FCE73 /* nat64_prefix_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F14CAFB1D93EA33003FCE73 /* nat64_prefix_util.cc */; }; - 1F1D04481D670EDB00EE6A2F /* unix_socket.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F1D04471D670EDB00EE6A2F /* unix_socket.cc */; }; - 1F25BF801CD3762400AC1003 /* lockpool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF501CD375D500AC1003 /* lockpool.cpp */; }; - 1F25BF811CD376F100AC1003 /* date_generators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF541CD375D500AC1003 /* date_generators.cpp */; }; - 1F25BF821CD376F100AC1003 /* greg_month.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF551CD375D500AC1003 /* greg_month.cpp */; }; - 1F25BF841CD376F100AC1003 /* greg_weekday.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF571CD375D500AC1003 /* greg_weekday.cpp */; }; - 1F25BF851CD376F100AC1003 /* gregorian_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF581CD375D500AC1003 /* gregorian_types.cpp */; }; - 1F25BF861CD376F100AC1003 /* posix_time_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF5A1CD375D500AC1003 /* posix_time_types.cpp */; }; - 1F25BF871CD376F100AC1003 /* codecvt_error_category.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF601CD375D500AC1003 /* codecvt_error_category.cpp */; }; - 1F25BF881CD376F100AC1003 /* operations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF611CD375D500AC1003 /* operations.cpp */; }; - 1F25BF891CD376F100AC1003 /* path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF621CD375D500AC1003 /* path.cpp */; }; - 1F25BF8A1CD376F100AC1003 /* path_traits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF631CD375D500AC1003 /* path_traits.cpp */; }; - 1F25BF8B1CD376F100AC1003 /* portability.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF641CD375D500AC1003 /* portability.cpp */; }; - 1F25BF8C1CD376F100AC1003 /* unique_path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF651CD375D500AC1003 /* unique_path.cpp */; }; - 1F25BF8D1CD376F100AC1003 /* utf8_codecvt_facet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF661CD375D500AC1003 /* utf8_codecvt_facet.cpp */; }; - 1F25BF901CD376F100AC1003 /* file_descriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF6B1CD375D500AC1003 /* file_descriptor.cpp */; }; - 1F25BF911CD376F100AC1003 /* mapped_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF6C1CD375D500AC1003 /* mapped_file.cpp */; }; - 1F25BF921CD376F100AC1003 /* sp_collector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF6F1CD375D500AC1003 /* sp_collector.cpp */; }; - 1F25BF931CD376F100AC1003 /* sp_debug_hooks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF701CD375D500AC1003 /* sp_debug_hooks.cpp */; }; - 1F25BF941CD376F100AC1003 /* error_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF731CD375D500AC1003 /* error_code.cpp */; }; - 1F25BF951CD376F100AC1003 /* future.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF761CD375D500AC1003 /* future.cpp */; }; - 1F25BF961CD376F100AC1003 /* tss_null.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF7B1CD375D500AC1003 /* tss_null.cpp */; }; - 1F5ADF571CA440370022E41D /* mmap_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1F5ADF561CA440370022E41D /* mmap_util.cc */; }; - 1FA3D5A71C86DFFB00B9BEFD /* local_ipstack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FA3D5A31C86DFFB00B9BEFD /* local_ipstack.cc */; }; - 1FA3D5AA1C86E00800B9BEFD /* getdnssvraddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FA3D5A81C86E00800B9BEFD /* getdnssvraddrs.cc */; }; - 1FA3D62C1C8970CF00B9BEFD /* dns.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FA3D62A1C8970CF00B9BEFD /* dns.cc */; }; - 1FA3D6331C89758400B9BEFD /* __assert.c in Sources */ = {isa = PBXBuildFile; fileRef = 1FA3D6311C89758400B9BEFD /* __assert.c */; }; - 1FDCDCA31DAA70B700ADAE56 /* http.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1FDCDCA11DAA70B700ADAE56 /* http.cc */; }; - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3170A02A177887B0004F5DDA /* Foundation.framework */; }; - 3D8AC2D31D5477DA007DE060 /* getsocktcpinfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3D8AC2D11D5477DA007DE060 /* getsocktcpinfo.cc */; }; - 425BA5811A14AD0600073A45 /* tickcount.cc in Sources */ = {isa = PBXBuildFile; fileRef = 425BA57F1A14AD0600073A45 /* tickcount.cc */; }; - 4B299BE21CEF063600E2315B /* boost_exception.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4B299BE01CEF063600E2315B /* boost_exception.cc */; }; - 4B56976B1DAF6B38001CB37C /* loginfo_extract.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B5697691DAF6B38001CB37C /* loginfo_extract.c */; }; - 4BDBD17A1E094FFE006C62F5 /* netinfo_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4BDBD1781E094FFE006C62F5 /* netinfo_util.cc */; }; - 4F516B751A19F3B20006EC9D /* getifaddrs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4F516B731A19F3B20006EC9D /* getifaddrs.cc */; }; - 4FC0D7CF19A3681B00E8CB6E /* tcpclient_fsm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FC0D7CD19A3681B00E8CB6E /* tcpclient_fsm.cc */; }; - 4FC0D7D219A4898100E8CB6E /* anr.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FC0D7D019A4898100E8CB6E /* anr.cc */; }; - 4FC6800F1CABC39D00A28E2A /* block_socket.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FC6800E1CABC39D00A28E2A /* block_socket.cc */; }; - 4FCB62C71A307EFA00E57EE0 /* tcpserver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62C31A307EFA00E57EE0 /* tcpserver.cc */; }; - 4FCB62C81A307EFA00E57EE0 /* tcpserver_fsm.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62C51A307EFA00E57EE0 /* tcpserver_fsm.cc */; }; - 4FCB62DB1A30802600E57EE0 /* basepacker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4FCB62D91A30802600E57EE0 /* basepacker.cc */; }; - 558C681E1C05C5AF00C06D77 /* socket_address.cc in Sources */ = {isa = PBXBuildFile; fileRef = 558C681D1C05C5AF00C06D77 /* socket_address.cc */; }; - F138F5F41DEEF0DA00546CBB /* complexconnect.cc in Sources */ = {isa = PBXBuildFile; fileRef = F138F5F31DEEF0DA00546CBB /* complexconnect.cc */; }; - F138F6971DF0109E00546CBB /* execution_context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F138F6441DF0109E00546CBB /* execution_context.cpp */; }; - F138F6981DF0109E00546CBB /* stack_traits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F138F6461DF0109E00546CBB /* stack_traits.cpp */; }; - F138F69A1DF0109E00546CBB /* coroutine_context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F138F64C1DF0109E00546CBB /* coroutine_context.cpp */; }; - F138F69B1DF0109E00546CBB /* exceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F138F64D1DF0109E00546CBB /* exceptions.cpp */; }; - F138F69C1DF0109E00546CBB /* stack_traits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F138F64F1DF0109E00546CBB /* stack_traits.cpp */; }; - F138F6A41DF0119A00546CBB /* jump_arm_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F69E1DF0119A00546CBB /* jump_arm_aapcs_macho_gas.S */; }; - F138F6A51DF0119A00546CBB /* jump_arm64_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F69F1DF0119A00546CBB /* jump_arm64_aapcs_macho_gas.S */; }; - F138F6A61DF0119A00546CBB /* make_arm_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6A01DF0119A00546CBB /* make_arm_aapcs_macho_gas.S */; }; - F138F6A71DF0119A00546CBB /* make_arm64_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6A11DF0119A00546CBB /* make_arm64_aapcs_macho_gas.S */; }; - F138F6B31DF014DA00546CBB /* ontop_arm_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6B11DF014DA00546CBB /* ontop_arm_aapcs_macho_gas.S */; }; - F138F6B41DF014DA00546CBB /* ontop_arm64_aapcs_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6B21DF014DA00546CBB /* ontop_arm64_aapcs_macho_gas.S */; }; - F138F6CC1DF016BD00546CBB /* jump_i386_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6C61DF016BD00546CBB /* jump_i386_sysv_macho_gas.S */; }; - F138F6CE1DF016BD00546CBB /* make_i386_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6C81DF016BD00546CBB /* make_i386_sysv_macho_gas.S */; }; - F138F6D01DF016BD00546CBB /* ontop_i386_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6CA1DF016BD00546CBB /* ontop_i386_sysv_macho_gas.S */; }; - F138F6DB1DF0195E00546CBB /* jump_x86_64_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6D81DF0195E00546CBB /* jump_x86_64_sysv_macho_gas.S */; }; - F138F6DC1DF0195E00546CBB /* make_x86_64_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6D91DF0195E00546CBB /* make_x86_64_sysv_macho_gas.S */; }; - F138F6DD1DF0195E00546CBB /* ontop_x86_64_sysv_macho_gas.S in Sources */ = {isa = PBXBuildFile; fileRef = F138F6DA1DF0195E00546CBB /* ontop_x86_64_sysv_macho_gas.S */; }; - F138F6DE1DF01B7800546CBB /* once.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F25BF781CD375D500AC1003 /* once.cpp */; }; - F1C0DAFD19C862DF0056DE44 /* udpclient.cc in Sources */ = {isa = PBXBuildFile; fileRef = F1C0DAF919C862DF0056DE44 /* udpclient.cc */; }; - F1C0DAFE19C862DF0056DE44 /* udpserver.cc in Sources */ = {isa = PBXBuildFile; fileRef = F1C0DAFB19C862DF0056DE44 /* udpserver.cc */; }; - F1F051011E08E56E007DB6DB /* coro_socket.cc in Sources */ = {isa = PBXBuildFile; fileRef = F1F050FE1E08E56E007DB6DB /* coro_socket.cc */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3170A025177887B0004F5DDA /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1319C65B1BAC12EA00C4B07B /* data_protect_attr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data_protect_attr.h; sourceTree = ""; }; - 1319C65C1BAC12EA00C4B07B /* data_protect_attr.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = data_protect_attr.mm; sourceTree = ""; }; - 13E9EA9619754DE1007591EC /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = ""; }; - 13E9EA9719754DE1007591EC /* adler32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adler32.h; sourceTree = ""; }; - 13E9EA9819754DE1007591EC /* alarm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = alarm.cc; sourceTree = ""; }; - 13E9EA9919754DE1007591EC /* alarm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = alarm.h; sourceTree = ""; }; - 13E9EA9A19754DE1007591EC /* autobuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = autobuffer.cc; sourceTree = ""; }; - 13E9EA9B19754DE1007591EC /* autobuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = autobuffer.h; sourceTree = ""; }; - 13E9F28019754DE5007591EC /* bootregister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootregister.h; sourceTree = ""; }; - 13E9F28119754DE5007591EC /* bootrun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bootrun.h; sourceTree = ""; }; - 13E9F28219754DE5007591EC /* comm_frequency_limit.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = comm_frequency_limit.cc; sourceTree = ""; }; - 13E9F28319754DE5007591EC /* comm_frequency_limit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = comm_frequency_limit.h; sourceTree = ""; }; - 13E9F28419754DE5007591EC /* compiler_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compiler_util.h; sourceTree = ""; }; - 13E9F28519754DE5007591EC /* copy_wrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = copy_wrapper.h; sourceTree = ""; }; - 13E9F28719754DE5007591EC /* coreservice_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coreservice_base.cc; sourceTree = ""; }; - 13E9F28819754DE5007591EC /* coreservice_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coreservice_base.h; sourceTree = ""; }; - 13E9F28919754DE5007591EC /* service_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = service_base.h; sourceTree = ""; }; - 13E9F28A19754DE5007591EC /* ServiceImpl.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ServiceImpl.inl; sourceTree = ""; }; - 13E9F29A19754DE5007591EC /* ibase64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ibase64.cc; sourceTree = ""; }; - 13E9F29B19754DE5007591EC /* ibase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ibase64.h; sourceTree = ""; }; - 13E9F2A219754DE5007591EC /* debugger_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debugger_utils.c; sourceTree = ""; }; - 13E9F2A319754DE5007591EC /* debugger_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debugger_utils.h; sourceTree = ""; }; - 13E9F2A419754DE5007591EC /* spy.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy.inl; sourceTree = ""; }; - 13E9F2A519754DE5007591EC /* spy_base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spy_base.h; sourceTree = ""; }; - 13E9F2A619754DE5007591EC /* spy_impl_helper.inl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = spy_impl_helper.inl; sourceTree = ""; }; - 13E9F2A719754DE5007591EC /* test_spy_sample.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_spy_sample.cc; sourceTree = ""; }; - 13E9F2A819754DE5007591EC /* test_spy_sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = test_spy_sample.h; sourceTree = ""; }; - 13E9F2A919754DE5007591EC /* testspy.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testspy.cc; sourceTree = ""; }; - 13E9F2AA19754DE5007591EC /* testspy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testspy.h; sourceTree = ""; }; - 13E9F2AD19754DE5007591EC /* has_member.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = has_member.h; sourceTree = ""; }; - 13E9F2B119754DE5007591EC /* ini.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ini.h; sourceTree = ""; }; - 13E9F2B219754DE5007591EC /* marcotoolkit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = marcotoolkit.h; sourceTree = ""; }; - 13E9F2B319754DE5007591EC /* md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = md5.c; sourceTree = ""; }; - 13E9F2B419754DE5007591EC /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; - 13E9F2B519754DE5007591EC /* memdbg.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memdbg.cc; sourceTree = ""; }; - 13E9F2B619754DE5007591EC /* memdbg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memdbg.h; sourceTree = ""; }; - 13E9F2B819754DE5007591EC /* message_queue.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message_queue.cc; sourceTree = ""; }; - 13E9F2B919754DE5007591EC /* message_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message_queue.h; sourceTree = ""; }; - 13E9F2BA19754DE5007591EC /* message_queue_utils.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = message_queue_utils.cc; sourceTree = ""; }; - 13E9F2BB19754DE5007591EC /* message_queue_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = message_queue_utils.h; sourceTree = ""; }; - 13E9F2BD19754DE5007591EC /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = getgateway.c; sourceTree = ""; }; - 13E9F2BE19754DE5007591EC /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getgateway.h; sourceTree = ""; }; - 13E9F2C019754DE5007591EC /* ip_icmp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ip_icmp.h; sourceTree = ""; }; - 13E9F2C119754DE5007591EC /* objc_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objc_timer.h; sourceTree = ""; }; - 13E9F2C219754DE5007591EC /* objc_timer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = objc_timer.mm; sourceTree = ""; }; - 13E9F2C319754DE5007591EC /* platform_comm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = platform_comm.mm; sourceTree = ""; }; - 13E9F2C419754DE5007591EC /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; - 13E9F2C519754DE5007591EC /* Reachability.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Reachability.mm; sourceTree = ""; }; - 13E9F2C619754DE5007591EC /* route.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = route.h; sourceTree = ""; }; - 13E9F2C719754DE5007591EC /* scope_autoreleasepool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_autoreleasepool.h; sourceTree = ""; }; - 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = scope_autoreleasepool.mm; sourceTree = ""; }; - 13E9F2C919754DE5007591EC /* ThreadOperationQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadOperationQueue.h; sourceTree = ""; }; - 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ThreadOperationQueue.mm; sourceTree = ""; }; - 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = xlogger_threadinfo.mm; sourceTree = ""; }; - 13E9F2CC19754DE5007591EC /* platform_comm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform_comm.h; sourceTree = ""; }; - 13E9F2CD19754DE5007591EC /* ptrbuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ptrbuffer.cc; sourceTree = ""; }; - 13E9F2CE19754DE5007591EC /* ptrbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ptrbuffer.h; sourceTree = ""; }; - 13E9F2CF19754DE5007591EC /* scope_recursion_limit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope_recursion_limit.h; sourceTree = ""; }; - 13E9F2D019754DE5007591EC /* singleton.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = singleton.cc; sourceTree = ""; }; - 13E9F2D119754DE5007591EC /* singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = singleton.h; sourceTree = ""; }; - 13E9F2D519754DE5007591EC /* socketselect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socketselect.h; sourceTree = ""; }; - 13E9F2D619754DE5007591EC /* tcpclient.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpclient.cc; sourceTree = ""; }; - 13E9F2D719754DE5007591EC /* tcpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpclient.h; sourceTree = ""; }; - 13E9F2D919754DE5007591EC /* unix_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unix_socket.h; sourceTree = ""; }; - 13E9F2DA19754DE5007591EC /* strutil.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = strutil.cc; sourceTree = ""; }; - 13E9F2DB19754DE5007591EC /* strutil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = strutil.h; sourceTree = ""; }; - 13E9F2DD19754DE5007591EC /* atomic_oper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = atomic_oper.h; sourceTree = ""; }; - 13E9F2DE19754DE5007591EC /* bind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bind.h; sourceTree = ""; }; - 13E9F2DF19754DE5007591EC /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 13E9F2E019754DE5007591EC /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 13E9F2E119754DE5007591EC /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 13E9F2E219754DE5007591EC /* mutexvector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutexvector.h; sourceTree = ""; }; - 13E9F2E319754DE5007591EC /* runnable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = runnable.h; sourceTree = ""; }; - 13E9F2E419754DE5007591EC /* spinlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spinlock.h; sourceTree = ""; }; - 13E9F2E519754DE5007591EC /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 13E9F2E619754DE5007591EC /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 13E9F2E719754DE5007591EC /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 13E9F2E819754DE5007591EC /* tinyxml2.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cc; sourceTree = ""; }; - 13E9F2E919754DE6007591EC /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = ""; }; - 13E9F2EC19754DE6007591EC /* socketselect.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = socketselect.cc; sourceTree = ""; }; - 13E9F2ED19754DE6007591EC /* socketselect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socketselect.h; sourceTree = ""; }; - 13E9F2EF19754DE6007591EC /* condition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = condition.h; sourceTree = ""; }; - 13E9F2F019754DE6007591EC /* lock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lock.h; sourceTree = ""; }; - 13E9F2F119754DE6007591EC /* mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mutex.h; sourceTree = ""; }; - 13E9F2F219754DE6007591EC /* test_case.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_case.cpp_; sourceTree = ""; }; - 13E9F2F319754DE6007591EC /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; - 13E9F2F419754DE6007591EC /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 13E9F2F519754DE6007591EC /* time_utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = time_utils.c; sourceTree = ""; }; - 13E9F2F619754DE6007591EC /* time_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = time_utils.h; sourceTree = ""; }; - 13E9F2F819754DE6007591EC /* preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = preprocessor.h; sourceTree = ""; }; - 13E9F2F919754DE6007591EC /* test.cpp_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test.cpp_; sourceTree = ""; }; - 13E9F2FA19754DE6007591EC /* test_for_c.c_ */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_for_c.c_; sourceTree = ""; }; - 13E9F2FB19754DE6007591EC /* xlogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xlogger.h; sourceTree = ""; }; - 13E9F2FC19754DE6007591EC /* xloggerbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = xloggerbase.c; sourceTree = ""; }; - 13E9F2FD19754DE6007591EC /* xloggerbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xloggerbase.h; sourceTree = ""; }; - 1F14CAFB1D93EA33003FCE73 /* nat64_prefix_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nat64_prefix_util.cc; sourceTree = ""; }; - 1F14CAFC1D93EA33003FCE73 /* nat64_prefix_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nat64_prefix_util.h; sourceTree = ""; }; - 1F1D04471D670EDB00EE6A2F /* unix_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unix_socket.cc; sourceTree = ""; }; - 1F25BF501CD375D500AC1003 /* lockpool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = lockpool.cpp; sourceTree = ""; }; - 1F25BF541CD375D500AC1003 /* date_generators.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = date_generators.cpp; sourceTree = ""; }; - 1F25BF551CD375D500AC1003 /* greg_month.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = greg_month.cpp; sourceTree = ""; }; - 1F25BF561CD375D500AC1003 /* greg_names.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = greg_names.hpp; sourceTree = ""; }; - 1F25BF571CD375D500AC1003 /* greg_weekday.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = greg_weekday.cpp; sourceTree = ""; }; - 1F25BF581CD375D500AC1003 /* gregorian_types.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = gregorian_types.cpp; sourceTree = ""; }; - 1F25BF5A1CD375D500AC1003 /* posix_time_types.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = posix_time_types.cpp; sourceTree = ""; }; - 1F25BF5D1CD375D500AC1003 /* clone_current_exception_non_intrusive.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = clone_current_exception_non_intrusive.cpp; sourceTree = ""; }; - 1F25BF601CD375D500AC1003 /* codecvt_error_category.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = codecvt_error_category.cpp; sourceTree = ""; }; - 1F25BF611CD375D500AC1003 /* operations.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = operations.cpp; sourceTree = ""; }; - 1F25BF621CD375D500AC1003 /* path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = path.cpp; sourceTree = ""; }; - 1F25BF631CD375D500AC1003 /* path_traits.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = path_traits.cpp; sourceTree = ""; }; - 1F25BF641CD375D500AC1003 /* portability.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = portability.cpp; sourceTree = ""; }; - 1F25BF651CD375D500AC1003 /* unique_path.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = unique_path.cpp; sourceTree = ""; }; - 1F25BF661CD375D500AC1003 /* utf8_codecvt_facet.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = utf8_codecvt_facet.cpp; sourceTree = ""; }; - 1F25BF671CD375D500AC1003 /* windows_file_codecvt.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = windows_file_codecvt.cpp; sourceTree = ""; }; - 1F25BF681CD375D500AC1003 /* windows_file_codecvt.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = windows_file_codecvt.hpp; sourceTree = ""; }; - 1F25BF6B1CD375D500AC1003 /* file_descriptor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = file_descriptor.cpp; sourceTree = ""; }; - 1F25BF6C1CD375D500AC1003 /* mapped_file.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = mapped_file.cpp; sourceTree = ""; }; - 1F25BF6F1CD375D500AC1003 /* sp_collector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sp_collector.cpp; sourceTree = ""; }; - 1F25BF701CD375D500AC1003 /* sp_debug_hooks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sp_debug_hooks.cpp; sourceTree = ""; }; - 1F25BF731CD375D500AC1003 /* error_code.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = error_code.cpp; sourceTree = ""; }; - 1F25BF761CD375D500AC1003 /* future.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = future.cpp; sourceTree = ""; }; - 1F25BF781CD375D500AC1003 /* once.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = once.cpp; sourceTree = ""; }; - 1F25BF791CD375D500AC1003 /* once_atomic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = once_atomic.cpp; sourceTree = ""; }; - 1F25BF7A1CD375D500AC1003 /* thread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = thread.cpp; sourceTree = ""; }; - 1F25BF7B1CD375D500AC1003 /* tss_null.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_null.cpp; sourceTree = ""; }; - 1F25BF7D1CD375D500AC1003 /* thread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = thread.cpp; sourceTree = ""; }; - 1F25BF7E1CD375D500AC1003 /* tss_dll.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_dll.cpp; sourceTree = ""; }; - 1F25BF7F1CD375D500AC1003 /* tss_pe.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = tss_pe.cpp; sourceTree = ""; }; - 1F5ADF561CA440370022E41D /* mmap_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mmap_util.cc; sourceTree = ""; }; - 1FA3D5A11C86DFFB00B9BEFD /* complexconnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = complexconnect.h; sourceTree = ""; }; - 1FA3D5A21C86DFFB00B9BEFD /* ipv6_address_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ipv6_address_utils.h; sourceTree = ""; }; - 1FA3D5A31C86DFFB00B9BEFD /* local_ipstack.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = local_ipstack.cc; sourceTree = ""; }; - 1FA3D5A41C86DFFB00B9BEFD /* local_ipstack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = local_ipstack.h; sourceTree = ""; }; - 1FA3D5A51C86DFFB00B9BEFD /* socket_address.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = socket_address.h; sourceTree = ""; }; - 1FA3D5A61C86DFFB00B9BEFD /* tcp_fsm_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcp_fsm_handler.h; sourceTree = ""; }; - 1FA3D5A81C86E00800B9BEFD /* getdnssvraddrs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getdnssvraddrs.cc; sourceTree = ""; }; - 1FA3D5A91C86E00800B9BEFD /* getdnssvraddrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getdnssvraddrs.h; sourceTree = ""; }; - 1FA3D62A1C8970CF00B9BEFD /* dns.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dns.cc; path = dns/dns.cc; sourceTree = ""; }; - 1FA3D62B1C8970CF00B9BEFD /* dns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dns.h; path = dns/dns.h; sourceTree = ""; }; - 1FA3D6311C89758400B9BEFD /* __assert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = __assert.c; path = assert/__assert.c; sourceTree = ""; }; - 1FA3D6321C89758400B9BEFD /* __assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = __assert.h; path = assert/__assert.h; sourceTree = ""; }; - 1FDCDCA11DAA70B700ADAE56 /* http.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = http.cc; sourceTree = ""; }; - 1FDCDCA21DAA70B700ADAE56 /* http.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = http.h; sourceTree = ""; }; - 3170A027177887B0004F5DDA /* libcomm.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libcomm.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 3170A02A177887B0004F5DDA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 3D8AC2D11D5477DA007DE060 /* getsocktcpinfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getsocktcpinfo.cc; sourceTree = ""; }; - 3D8AC2D21D5477DA007DE060 /* getsocktcpinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getsocktcpinfo.h; sourceTree = ""; }; - 425BA57F1A14AD0600073A45 /* tickcount.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tickcount.cc; sourceTree = ""; }; - 425BA5801A14AD0600073A45 /* tickcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tickcount.h; sourceTree = ""; }; - 4B299BE01CEF063600E2315B /* boost_exception.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = boost_exception.cc; sourceTree = ""; }; - 4B5697691DAF6B38001CB37C /* loginfo_extract.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = loginfo_extract.c; sourceTree = ""; }; - 4B56976A1DAF6B38001CB37C /* loginfo_extract.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loginfo_extract.h; sourceTree = ""; }; - 4BDBD1781E094FFE006C62F5 /* netinfo_util.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = netinfo_util.cc; sourceTree = ""; }; - 4BDBD1791E094FFE006C62F5 /* netinfo_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = netinfo_util.h; sourceTree = ""; }; - 4F516B731A19F3B20006EC9D /* getifaddrs.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = getifaddrs.cc; sourceTree = ""; }; - 4F516B741A19F3B20006EC9D /* getifaddrs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = getifaddrs.h; sourceTree = ""; }; - 4FC0D7CD19A3681B00E8CB6E /* tcpclient_fsm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpclient_fsm.cc; sourceTree = ""; }; - 4FC0D7CE19A3681B00E8CB6E /* tcpclient_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpclient_fsm.h; sourceTree = ""; }; - 4FC0D7D019A4898100E8CB6E /* anr.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = anr.cc; sourceTree = ""; }; - 4FC0D7D119A4898100E8CB6E /* anr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = anr.h; sourceTree = ""; }; - 4FC6800D1CABBDAA00A28E2A /* block_socket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = block_socket.h; sourceTree = ""; }; - 4FC6800E1CABC39D00A28E2A /* block_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = block_socket.cc; sourceTree = ""; }; - 4FCB62C31A307EFA00E57EE0 /* tcpserver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpserver.cc; sourceTree = ""; }; - 4FCB62C41A307EFA00E57EE0 /* tcpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpserver.h; sourceTree = ""; }; - 4FCB62C51A307EFA00E57EE0 /* tcpserver_fsm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tcpserver_fsm.cc; sourceTree = ""; }; - 4FCB62C61A307EFA00E57EE0 /* tcpserver_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tcpserver_fsm.h; sourceTree = ""; }; - 4FCB62D91A30802600E57EE0 /* basepacker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = basepacker.cc; sourceTree = ""; }; - 4FCB62DA1A30802600E57EE0 /* basepacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basepacker.h; sourceTree = ""; }; - 558C681D1C05C5AF00C06D77 /* socket_address.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = socket_address.cc; path = socket/socket_address.cc; sourceTree = ""; }; - F138F5F31DEEF0DA00546CBB /* complexconnect.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = complexconnect.cc; sourceTree = ""; }; - F138F6441DF0109E00546CBB /* execution_context.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = execution_context.cpp; sourceTree = ""; }; - F138F6461DF0109E00546CBB /* stack_traits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stack_traits.cpp; sourceTree = ""; }; - F138F64C1DF0109E00546CBB /* coroutine_context.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coroutine_context.cpp; sourceTree = ""; }; - F138F64D1DF0109E00546CBB /* exceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exceptions.cpp; sourceTree = ""; }; - F138F64F1DF0109E00546CBB /* stack_traits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stack_traits.cpp; sourceTree = ""; }; - F138F69E1DF0119A00546CBB /* jump_arm_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = jump_arm_aapcs_macho_gas.S; sourceTree = ""; }; - F138F69F1DF0119A00546CBB /* jump_arm64_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = jump_arm64_aapcs_macho_gas.S; sourceTree = ""; }; - F138F6A01DF0119A00546CBB /* make_arm_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = make_arm_aapcs_macho_gas.S; sourceTree = ""; }; - F138F6A11DF0119A00546CBB /* make_arm64_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = make_arm64_aapcs_macho_gas.S; sourceTree = ""; }; - F138F6B11DF014DA00546CBB /* ontop_arm_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = ontop_arm_aapcs_macho_gas.S; sourceTree = ""; }; - F138F6B21DF014DA00546CBB /* ontop_arm64_aapcs_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = ontop_arm64_aapcs_macho_gas.S; sourceTree = ""; }; - F138F6C61DF016BD00546CBB /* jump_i386_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = jump_i386_sysv_macho_gas.S; sourceTree = ""; }; - F138F6C81DF016BD00546CBB /* make_i386_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = make_i386_sysv_macho_gas.S; sourceTree = ""; }; - F138F6CA1DF016BD00546CBB /* ontop_i386_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = ontop_i386_sysv_macho_gas.S; sourceTree = ""; }; - F138F6D81DF0195E00546CBB /* jump_x86_64_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = jump_x86_64_sysv_macho_gas.S; sourceTree = ""; }; - F138F6D91DF0195E00546CBB /* make_x86_64_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = make_x86_64_sysv_macho_gas.S; sourceTree = ""; }; - F138F6DA1DF0195E00546CBB /* ontop_x86_64_sysv_macho_gas.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = ontop_x86_64_sysv_macho_gas.S; sourceTree = ""; }; - F1C0DAF919C862DF0056DE44 /* udpclient.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = udpclient.cc; sourceTree = ""; }; - F1C0DAFA19C862DF0056DE44 /* udpclient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udpclient.h; sourceTree = ""; }; - F1C0DAFB19C862DF0056DE44 /* udpserver.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = udpserver.cc; sourceTree = ""; }; - F1C0DAFC19C862DF0056DE44 /* udpserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = udpserver.h; sourceTree = ""; }; - F1F050FE1E08E56E007DB6DB /* coro_socket.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = coro_socket.cc; sourceTree = ""; }; - F1F050FF1E08E56E007DB6DB /* coro_socket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coro_socket.h; sourceTree = ""; }; - F1F051001E08E56E007DB6DB /* coroutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = coroutine.h; sourceTree = ""; }; - F1F0C31C1CA418BC00CA9995 /* mmap_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmap_util.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3170A024177887B0004F5DDA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3170A02B177887B0004F5DDA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 13E9F28619754DE5007591EC /* corepattern */ = { - isa = PBXGroup; - children = ( - 13E9F28719754DE5007591EC /* coreservice_base.cc */, - 13E9F28819754DE5007591EC /* coreservice_base.h */, - 13E9F28919754DE5007591EC /* service_base.h */, - 13E9F28A19754DE5007591EC /* ServiceImpl.inl */, - ); - path = corepattern; - sourceTree = ""; - }; - 13E9F29719754DE5007591EC /* crypt */ = { - isa = PBXGroup; - children = ( - 13E9F29A19754DE5007591EC /* ibase64.cc */, - 13E9F29B19754DE5007591EC /* ibase64.h */, - ); - path = crypt; - sourceTree = ""; - }; - 13E9F2A119754DE5007591EC /* debugger */ = { - isa = PBXGroup; - children = ( - 13E9F2A219754DE5007591EC /* debugger_utils.c */, - 13E9F2A319754DE5007591EC /* debugger_utils.h */, - 13E9F2A419754DE5007591EC /* spy.inl */, - 13E9F2A519754DE5007591EC /* spy_base.h */, - 13E9F2A619754DE5007591EC /* spy_impl_helper.inl */, - 13E9F2A719754DE5007591EC /* test_spy_sample.cc */, - 13E9F2A819754DE5007591EC /* test_spy_sample.h */, - 13E9F2A919754DE5007591EC /* testspy.cc */, - 13E9F2AA19754DE5007591EC /* testspy.h */, - ); - path = debugger; - sourceTree = ""; - }; - 13E9F2B719754DE5007591EC /* messagequeue */ = { - isa = PBXGroup; - children = ( - 13E9F2B819754DE5007591EC /* message_queue.cc */, - 13E9F2B919754DE5007591EC /* message_queue.h */, - 13E9F2BA19754DE5007591EC /* message_queue_utils.cc */, - 13E9F2BB19754DE5007591EC /* message_queue_utils.h */, - ); - path = messagequeue; - sourceTree = ""; - }; - 13E9F2BC19754DE5007591EC /* network */ = { - isa = PBXGroup; - children = ( - 4BDBD1781E094FFE006C62F5 /* netinfo_util.cc */, - 4BDBD1791E094FFE006C62F5 /* netinfo_util.h */, - 1FA3D5A81C86E00800B9BEFD /* getdnssvraddrs.cc */, - 1FA3D5A91C86E00800B9BEFD /* getdnssvraddrs.h */, - 4F516B731A19F3B20006EC9D /* getifaddrs.cc */, - 4F516B741A19F3B20006EC9D /* getifaddrs.h */, - 13E9F2BD19754DE5007591EC /* getgateway.c */, - 13E9F2BE19754DE5007591EC /* getgateway.h */, - ); - path = network; - sourceTree = ""; - }; - 13E9F2BF19754DE5007591EC /* objc */ = { - isa = PBXGroup; - children = ( - 1319C65B1BAC12EA00C4B07B /* data_protect_attr.h */, - 1319C65C1BAC12EA00C4B07B /* data_protect_attr.mm */, - 13E9F2C019754DE5007591EC /* ip_icmp.h */, - 13E9F2C119754DE5007591EC /* objc_timer.h */, - 13E9F2C219754DE5007591EC /* objc_timer.mm */, - 13E9F2C319754DE5007591EC /* platform_comm.mm */, - 13E9F2C419754DE5007591EC /* Reachability.h */, - 13E9F2C519754DE5007591EC /* Reachability.mm */, - 13E9F2C619754DE5007591EC /* route.h */, - 13E9F2C719754DE5007591EC /* scope_autoreleasepool.h */, - 13E9F2C819754DE5007591EC /* scope_autoreleasepool.mm */, - 13E9F2C919754DE5007591EC /* ThreadOperationQueue.h */, - 13E9F2CA19754DE5007591EC /* ThreadOperationQueue.mm */, - 13E9F2CB19754DE5007591EC /* xlogger_threadinfo.mm */, - ); - path = objc; - sourceTree = ""; - }; - 13E9F2D219754DE5007591EC /* socket */ = { - isa = PBXGroup; - children = ( - F138F5F31DEEF0DA00546CBB /* complexconnect.cc */, - 1F14CAFB1D93EA33003FCE73 /* nat64_prefix_util.cc */, - 1F14CAFC1D93EA33003FCE73 /* nat64_prefix_util.h */, - 1F1D04471D670EDB00EE6A2F /* unix_socket.cc */, - 3D8AC2D11D5477DA007DE060 /* getsocktcpinfo.cc */, - 3D8AC2D21D5477DA007DE060 /* getsocktcpinfo.h */, - 1FA3D5A11C86DFFB00B9BEFD /* complexconnect.h */, - 1FA3D5A21C86DFFB00B9BEFD /* ipv6_address_utils.h */, - 1FA3D5A31C86DFFB00B9BEFD /* local_ipstack.cc */, - 1FA3D5A41C86DFFB00B9BEFD /* local_ipstack.h */, - 1FA3D5A51C86DFFB00B9BEFD /* socket_address.h */, - 1FA3D5A61C86DFFB00B9BEFD /* tcp_fsm_handler.h */, - 4FCB62C31A307EFA00E57EE0 /* tcpserver.cc */, - 4FCB62C41A307EFA00E57EE0 /* tcpserver.h */, - 4FCB62C51A307EFA00E57EE0 /* tcpserver_fsm.cc */, - 4FCB62C61A307EFA00E57EE0 /* tcpserver_fsm.h */, - F1C0DAF919C862DF0056DE44 /* udpclient.cc */, - F1C0DAFA19C862DF0056DE44 /* udpclient.h */, - F1C0DAFB19C862DF0056DE44 /* udpserver.cc */, - F1C0DAFC19C862DF0056DE44 /* udpserver.h */, - 4FC0D7CD19A3681B00E8CB6E /* tcpclient_fsm.cc */, - 4FC0D7CE19A3681B00E8CB6E /* tcpclient_fsm.h */, - 13E9F2D519754DE5007591EC /* socketselect.h */, - 13E9F2D619754DE5007591EC /* tcpclient.cc */, - 13E9F2D719754DE5007591EC /* tcpclient.h */, - 13E9F2D919754DE5007591EC /* unix_socket.h */, - 4FC6800D1CABBDAA00A28E2A /* block_socket.h */, - 4FC6800E1CABC39D00A28E2A /* block_socket.cc */, - ); - path = socket; - sourceTree = ""; - }; - 13E9F2DC19754DE5007591EC /* thread */ = { - isa = PBXGroup; - children = ( - 13E9F2DD19754DE5007591EC /* atomic_oper.h */, - 13E9F2DE19754DE5007591EC /* bind.h */, - 13E9F2DF19754DE5007591EC /* condition.h */, - 13E9F2E019754DE5007591EC /* lock.h */, - 13E9F2E119754DE5007591EC /* mutex.h */, - 13E9F2E219754DE5007591EC /* mutexvector.h */, - 13E9F2E319754DE5007591EC /* runnable.h */, - 13E9F2E419754DE5007591EC /* spinlock.h */, - 13E9F2E519754DE5007591EC /* test_case.cpp_ */, - 13E9F2E619754DE5007591EC /* thread.h */, - 13E9F2E719754DE5007591EC /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - 13E9F2EA19754DE6007591EC /* unix */ = { - isa = PBXGroup; - children = ( - 13E9F2EB19754DE6007591EC /* SocketSelect */, - 13E9F2EE19754DE6007591EC /* thread */, - ); - path = unix; - sourceTree = ""; - }; - 13E9F2EB19754DE6007591EC /* SocketSelect */ = { - isa = PBXGroup; - children = ( - 13E9F2EC19754DE6007591EC /* socketselect.cc */, - 13E9F2ED19754DE6007591EC /* socketselect.h */, - ); - path = SocketSelect; - sourceTree = ""; - }; - 13E9F2EE19754DE6007591EC /* thread */ = { - isa = PBXGroup; - children = ( - 13E9F2EF19754DE6007591EC /* condition.h */, - 13E9F2F019754DE6007591EC /* lock.h */, - 13E9F2F119754DE6007591EC /* mutex.h */, - 13E9F2F219754DE6007591EC /* test_case.cpp_ */, - 13E9F2F319754DE6007591EC /* thread.h */, - 13E9F2F419754DE6007591EC /* tss.h */, - ); - path = thread; - sourceTree = ""; - }; - 13E9F2F719754DE6007591EC /* xlogger */ = { - isa = PBXGroup; - children = ( - 4B5697691DAF6B38001CB37C /* loginfo_extract.c */, - 4B56976A1DAF6B38001CB37C /* loginfo_extract.h */, - 13E9F2F819754DE6007591EC /* preprocessor.h */, - 13E9F2F919754DE6007591EC /* test.cpp_ */, - 13E9F2FA19754DE6007591EC /* test_for_c.c_ */, - 13E9F2FB19754DE6007591EC /* xlogger.h */, - 13E9F2FC19754DE6007591EC /* xloggerbase.c */, - 13E9F2FD19754DE6007591EC /* xloggerbase.h */, - ); - path = xlogger; - sourceTree = ""; - }; - 1F25BF4D1CD375D500AC1003 /* libs */ = { - isa = PBXGroup; - children = ( - F138F5FC1DF0109E00546CBB /* context */, - F138F6491DF0109E00546CBB /* coroutine */, - 1F25BF4E1CD375D500AC1003 /* atomic */, - 1F25BF511CD375D500AC1003 /* date_time */, - 1F25BF5B1CD375D500AC1003 /* exception */, - 1F25BF5E1CD375D500AC1003 /* filesystem */, - 1F25BF691CD375D500AC1003 /* iostreams */, - 1F25BF6D1CD375D500AC1003 /* smart_ptr */, - 1F25BF711CD375D500AC1003 /* system */, - 1F25BF741CD375D500AC1003 /* thread */, - ); - name = libs; - path = ../boost/libs; - sourceTree = ""; - }; - 1F25BF4E1CD375D500AC1003 /* atomic */ = { - isa = PBXGroup; - children = ( - 1F25BF4F1CD375D500AC1003 /* src */, - ); - path = atomic; - sourceTree = ""; - }; - 1F25BF4F1CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF501CD375D500AC1003 /* lockpool.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF511CD375D500AC1003 /* date_time */ = { - isa = PBXGroup; - children = ( - 1F25BF521CD375D500AC1003 /* src */, - ); - path = date_time; - sourceTree = ""; - }; - 1F25BF521CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF531CD375D500AC1003 /* gregorian */, - 1F25BF591CD375D500AC1003 /* posix_time */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF531CD375D500AC1003 /* gregorian */ = { - isa = PBXGroup; - children = ( - 1F25BF541CD375D500AC1003 /* date_generators.cpp */, - 1F25BF551CD375D500AC1003 /* greg_month.cpp */, - 1F25BF561CD375D500AC1003 /* greg_names.hpp */, - 1F25BF571CD375D500AC1003 /* greg_weekday.cpp */, - 1F25BF581CD375D500AC1003 /* gregorian_types.cpp */, - ); - path = gregorian; - sourceTree = ""; - }; - 1F25BF591CD375D500AC1003 /* posix_time */ = { - isa = PBXGroup; - children = ( - 1F25BF5A1CD375D500AC1003 /* posix_time_types.cpp */, - ); - path = posix_time; - sourceTree = ""; - }; - 1F25BF5B1CD375D500AC1003 /* exception */ = { - isa = PBXGroup; - children = ( - 1F25BF5C1CD375D500AC1003 /* src */, - ); - path = exception; - sourceTree = ""; - }; - 1F25BF5C1CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF5D1CD375D500AC1003 /* clone_current_exception_non_intrusive.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF5E1CD375D500AC1003 /* filesystem */ = { - isa = PBXGroup; - children = ( - 1F25BF5F1CD375D500AC1003 /* src */, - ); - path = filesystem; - sourceTree = ""; - }; - 1F25BF5F1CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF601CD375D500AC1003 /* codecvt_error_category.cpp */, - 1F25BF611CD375D500AC1003 /* operations.cpp */, - 1F25BF621CD375D500AC1003 /* path.cpp */, - 1F25BF631CD375D500AC1003 /* path_traits.cpp */, - 1F25BF641CD375D500AC1003 /* portability.cpp */, - 1F25BF651CD375D500AC1003 /* unique_path.cpp */, - 1F25BF661CD375D500AC1003 /* utf8_codecvt_facet.cpp */, - 1F25BF671CD375D500AC1003 /* windows_file_codecvt.cpp */, - 1F25BF681CD375D500AC1003 /* windows_file_codecvt.hpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF691CD375D500AC1003 /* iostreams */ = { - isa = PBXGroup; - children = ( - 1F25BF6A1CD375D500AC1003 /* src */, - ); - path = iostreams; - sourceTree = ""; - }; - 1F25BF6A1CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF6B1CD375D500AC1003 /* file_descriptor.cpp */, - 1F25BF6C1CD375D500AC1003 /* mapped_file.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF6D1CD375D500AC1003 /* smart_ptr */ = { - isa = PBXGroup; - children = ( - 1F25BF6E1CD375D500AC1003 /* src */, - ); - path = smart_ptr; - sourceTree = ""; - }; - 1F25BF6E1CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF6F1CD375D500AC1003 /* sp_collector.cpp */, - 1F25BF701CD375D500AC1003 /* sp_debug_hooks.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF711CD375D500AC1003 /* system */ = { - isa = PBXGroup; - children = ( - 1F25BF721CD375D500AC1003 /* src */, - ); - path = system; - sourceTree = ""; - }; - 1F25BF721CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF731CD375D500AC1003 /* error_code.cpp */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF741CD375D500AC1003 /* thread */ = { - isa = PBXGroup; - children = ( - 1F25BF751CD375D500AC1003 /* src */, - ); - path = thread; - sourceTree = ""; - }; - 1F25BF751CD375D500AC1003 /* src */ = { - isa = PBXGroup; - children = ( - 1F25BF761CD375D500AC1003 /* future.cpp */, - 1F25BF771CD375D500AC1003 /* pthread */, - 1F25BF7B1CD375D500AC1003 /* tss_null.cpp */, - 1F25BF7C1CD375D500AC1003 /* win32 */, - ); - path = src; - sourceTree = ""; - }; - 1F25BF771CD375D500AC1003 /* pthread */ = { - isa = PBXGroup; - children = ( - 1F25BF781CD375D500AC1003 /* once.cpp */, - 1F25BF791CD375D500AC1003 /* once_atomic.cpp */, - 1F25BF7A1CD375D500AC1003 /* thread.cpp */, - ); - path = pthread; - sourceTree = ""; - }; - 1F25BF7C1CD375D500AC1003 /* win32 */ = { - isa = PBXGroup; - children = ( - 1F25BF7D1CD375D500AC1003 /* thread.cpp */, - 1F25BF7E1CD375D500AC1003 /* tss_dll.cpp */, - 1F25BF7F1CD375D500AC1003 /* tss_pe.cpp */, - ); - path = win32; - sourceTree = ""; - }; - 1FA3D6291C8970B900B9BEFD /* dns */ = { - isa = PBXGroup; - children = ( - 1FA3D62A1C8970CF00B9BEFD /* dns.cc */, - 1FA3D62B1C8970CF00B9BEFD /* dns.h */, - ); - name = dns; - sourceTree = ""; - }; - 1FA3D62D1C8971ED00B9BEFD /* assert */ = { - isa = PBXGroup; - children = ( - 1FA3D6311C89758400B9BEFD /* __assert.c */, - 1FA3D6321C89758400B9BEFD /* __assert.h */, - ); - name = assert; - sourceTree = ""; - }; - 3170A01E177887B0004F5DDA = { - isa = PBXGroup; - children = ( - F1F050FD1E08E56E007DB6DB /* coroutine */, - 1FDCDCA11DAA70B700ADAE56 /* http.cc */, - 1FDCDCA21DAA70B700ADAE56 /* http.h */, - 4B299BE01CEF063600E2315B /* boost_exception.cc */, - 1F25BF4D1CD375D500AC1003 /* libs */, - 1F5ADF561CA440370022E41D /* mmap_util.cc */, - F1F0C31C1CA418BC00CA9995 /* mmap_util.h */, - 1FA3D62D1C8971ED00B9BEFD /* assert */, - 1FA3D6291C8970B900B9BEFD /* dns */, - 558C681D1C05C5AF00C06D77 /* socket_address.cc */, - 4FCB62D91A30802600E57EE0 /* basepacker.cc */, - 4FCB62DA1A30802600E57EE0 /* basepacker.h */, - 425BA57F1A14AD0600073A45 /* tickcount.cc */, - 425BA5801A14AD0600073A45 /* tickcount.h */, - 4FC0D7D019A4898100E8CB6E /* anr.cc */, - 4FC0D7D119A4898100E8CB6E /* anr.h */, - 13E9EA9619754DE1007591EC /* adler32.c */, - 13E9EA9719754DE1007591EC /* adler32.h */, - 13E9EA9819754DE1007591EC /* alarm.cc */, - 13E9EA9919754DE1007591EC /* alarm.h */, - 13E9EA9A19754DE1007591EC /* autobuffer.cc */, - 13E9EA9B19754DE1007591EC /* autobuffer.h */, - 13E9F28019754DE5007591EC /* bootregister.h */, - 13E9F28119754DE5007591EC /* bootrun.h */, - 13E9F28219754DE5007591EC /* comm_frequency_limit.cc */, - 13E9F28319754DE5007591EC /* comm_frequency_limit.h */, - 13E9F28419754DE5007591EC /* compiler_util.h */, - 13E9F28519754DE5007591EC /* copy_wrapper.h */, - 13E9F28619754DE5007591EC /* corepattern */, - 13E9F29719754DE5007591EC /* crypt */, - 13E9F2A119754DE5007591EC /* debugger */, - 13E9F2AD19754DE5007591EC /* has_member.h */, - 13E9F2B119754DE5007591EC /* ini.h */, - 13E9F2B219754DE5007591EC /* marcotoolkit.h */, - 13E9F2B319754DE5007591EC /* md5.c */, - 13E9F2B419754DE5007591EC /* md5.h */, - 13E9F2B519754DE5007591EC /* memdbg.cc */, - 13E9F2B619754DE5007591EC /* memdbg.h */, - 13E9F2B719754DE5007591EC /* messagequeue */, - 13E9F2BC19754DE5007591EC /* network */, - 13E9F2BF19754DE5007591EC /* objc */, - 13E9F2CC19754DE5007591EC /* platform_comm.h */, - 13E9F2CD19754DE5007591EC /* ptrbuffer.cc */, - 13E9F2CE19754DE5007591EC /* ptrbuffer.h */, - 13E9F2CF19754DE5007591EC /* scope_recursion_limit.h */, - 13E9F2D019754DE5007591EC /* singleton.cc */, - 13E9F2D119754DE5007591EC /* singleton.h */, - 13E9F2D219754DE5007591EC /* socket */, - 13E9F2DA19754DE5007591EC /* strutil.cc */, - 13E9F2DB19754DE5007591EC /* strutil.h */, - 13E9F2DC19754DE5007591EC /* thread */, - 13E9F2E819754DE5007591EC /* tinyxml2.cc */, - 13E9F2E919754DE6007591EC /* tinyxml2.h */, - 13E9F2EA19754DE6007591EC /* unix */, - 13E9F2F519754DE6007591EC /* time_utils.c */, - 13E9F2F619754DE6007591EC /* time_utils.h */, - 13E9F2F719754DE6007591EC /* xlogger */, - 3170A029177887B0004F5DDA /* Frameworks */, - 3170A028177887B0004F5DDA /* Products */, - ); - sourceTree = ""; - }; - 3170A028177887B0004F5DDA /* Products */ = { - isa = PBXGroup; - children = ( - 3170A027177887B0004F5DDA /* libcomm.a */, - ); - name = Products; - sourceTree = ""; - }; - 3170A029177887B0004F5DDA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3170A02A177887B0004F5DDA /* Foundation.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - F138F5FC1DF0109E00546CBB /* context */ = { - isa = PBXGroup; - children = ( - F138F5FD1DF0109E00546CBB /* src */, - ); - path = context; - sourceTree = ""; - }; - F138F5FD1DF0109E00546CBB /* src */ = { - isa = PBXGroup; - children = ( - F138F5FE1DF0109E00546CBB /* asm */, - F138F6441DF0109E00546CBB /* execution_context.cpp */, - F138F6451DF0109E00546CBB /* posix */, - ); - path = src; - sourceTree = ""; - }; - F138F5FE1DF0109E00546CBB /* asm */ = { - isa = PBXGroup; - children = ( - F138F6D81DF0195E00546CBB /* jump_x86_64_sysv_macho_gas.S */, - F138F6D91DF0195E00546CBB /* make_x86_64_sysv_macho_gas.S */, - F138F6DA1DF0195E00546CBB /* ontop_x86_64_sysv_macho_gas.S */, - F138F6C61DF016BD00546CBB /* jump_i386_sysv_macho_gas.S */, - F138F6C81DF016BD00546CBB /* make_i386_sysv_macho_gas.S */, - F138F6CA1DF016BD00546CBB /* ontop_i386_sysv_macho_gas.S */, - F138F6B11DF014DA00546CBB /* ontop_arm_aapcs_macho_gas.S */, - F138F6B21DF014DA00546CBB /* ontop_arm64_aapcs_macho_gas.S */, - F138F69E1DF0119A00546CBB /* jump_arm_aapcs_macho_gas.S */, - F138F69F1DF0119A00546CBB /* jump_arm64_aapcs_macho_gas.S */, - F138F6A01DF0119A00546CBB /* make_arm_aapcs_macho_gas.S */, - F138F6A11DF0119A00546CBB /* make_arm64_aapcs_macho_gas.S */, - ); - path = asm; - sourceTree = ""; - }; - F138F6451DF0109E00546CBB /* posix */ = { - isa = PBXGroup; - children = ( - F138F6461DF0109E00546CBB /* stack_traits.cpp */, - ); - path = posix; - sourceTree = ""; - }; - F138F6491DF0109E00546CBB /* coroutine */ = { - isa = PBXGroup; - children = ( - F138F64A1DF0109E00546CBB /* src */, - ); - path = coroutine; - sourceTree = ""; - }; - F138F64A1DF0109E00546CBB /* src */ = { - isa = PBXGroup; - children = ( - F138F64B1DF0109E00546CBB /* detail */, - F138F64D1DF0109E00546CBB /* exceptions.cpp */, - F138F64E1DF0109E00546CBB /* posix */, - ); - path = src; - sourceTree = ""; - }; - F138F64B1DF0109E00546CBB /* detail */ = { - isa = PBXGroup; - children = ( - F138F64C1DF0109E00546CBB /* coroutine_context.cpp */, - ); - path = detail; - sourceTree = ""; - }; - F138F64E1DF0109E00546CBB /* posix */ = { - isa = PBXGroup; - children = ( - F138F64F1DF0109E00546CBB /* stack_traits.cpp */, - ); - path = posix; - sourceTree = ""; - }; - F1F050FD1E08E56E007DB6DB /* coroutine */ = { - isa = PBXGroup; - children = ( - F1F050FE1E08E56E007DB6DB /* coro_socket.cc */, - F1F050FF1E08E56E007DB6DB /* coro_socket.h */, - F1F051001E08E56E007DB6DB /* coroutine.h */, - ); - path = coroutine; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 3170A026177887B0004F5DDA /* comm */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm" */; - buildPhases = ( - 3170A023177887B0004F5DDA /* Sources */, - 3170A024177887B0004F5DDA /* Frameworks */, - 3170A025177887B0004F5DDA /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = comm; - productName = PublicComponent; - productReference = 3170A027177887B0004F5DDA /* libcomm.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 3170A01F177887B0004F5DDA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Tencent; - }; - buildConfigurationList = 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 3170A01E177887B0004F5DDA; - productRefGroup = 3170A028177887B0004F5DDA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 3170A026177887B0004F5DDA /* comm */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3170A023177887B0004F5DDA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F138F6DE1DF01B7800546CBB /* once.cpp in Sources */, - 1F25BF811CD376F100AC1003 /* date_generators.cpp in Sources */, - 4B299BE21CEF063600E2315B /* boost_exception.cc in Sources */, - 1F25BF821CD376F100AC1003 /* greg_month.cpp in Sources */, - 1F25BF841CD376F100AC1003 /* greg_weekday.cpp in Sources */, - 1F25BF851CD376F100AC1003 /* gregorian_types.cpp in Sources */, - 1F25BF861CD376F100AC1003 /* posix_time_types.cpp in Sources */, - 1F25BF871CD376F100AC1003 /* codecvt_error_category.cpp in Sources */, - 1F25BF881CD376F100AC1003 /* operations.cpp in Sources */, - 1F25BF891CD376F100AC1003 /* path.cpp in Sources */, - 1F25BF8A1CD376F100AC1003 /* path_traits.cpp in Sources */, - F138F6B31DF014DA00546CBB /* ontop_arm_aapcs_macho_gas.S in Sources */, - 1F25BF8B1CD376F100AC1003 /* portability.cpp in Sources */, - 1F25BF8C1CD376F100AC1003 /* unique_path.cpp in Sources */, - F138F6A71DF0119A00546CBB /* make_arm64_aapcs_macho_gas.S in Sources */, - 1F25BF8D1CD376F100AC1003 /* utf8_codecvt_facet.cpp in Sources */, - F138F6971DF0109E00546CBB /* execution_context.cpp in Sources */, - 1F25BF901CD376F100AC1003 /* file_descriptor.cpp in Sources */, - F138F6CE1DF016BD00546CBB /* make_i386_sysv_macho_gas.S in Sources */, - 1F25BF911CD376F100AC1003 /* mapped_file.cpp in Sources */, - F138F69B1DF0109E00546CBB /* exceptions.cpp in Sources */, - 1F25BF921CD376F100AC1003 /* sp_collector.cpp in Sources */, - 1F25BF931CD376F100AC1003 /* sp_debug_hooks.cpp in Sources */, - 1F14CAFD1D93EA33003FCE73 /* nat64_prefix_util.cc in Sources */, - F138F6DD1DF0195E00546CBB /* ontop_x86_64_sysv_macho_gas.S in Sources */, - 4B56976B1DAF6B38001CB37C /* loginfo_extract.c in Sources */, - 1F25BF941CD376F100AC1003 /* error_code.cpp in Sources */, - 1F25BF951CD376F100AC1003 /* future.cpp in Sources */, - 1F25BF961CD376F100AC1003 /* tss_null.cpp in Sources */, - 1F25BF801CD3762400AC1003 /* lockpool.cpp in Sources */, - 558C681E1C05C5AF00C06D77 /* socket_address.cc in Sources */, - F138F5F41DEEF0DA00546CBB /* complexconnect.cc in Sources */, - 1FA3D5AA1C86E00800B9BEFD /* getdnssvraddrs.cc in Sources */, - 13E9F33219754DE6007591EC /* scope_autoreleasepool.mm in Sources */, - 1F1D04481D670EDB00EE6A2F /* unix_socket.cc in Sources */, - 13E9F32B19754DE6007591EC /* memdbg.cc in Sources */, - 1FA3D5A71C86DFFB00B9BEFD /* local_ipstack.cc in Sources */, - 1FDCDCA31DAA70B700ADAE56 /* http.cc in Sources */, - 4FCB62DB1A30802600E57EE0 /* basepacker.cc in Sources */, - 13E9F33819754DE6007591EC /* tcpclient.cc in Sources */, - 13E9F33D19754DE6007591EC /* time_utils.c in Sources */, - 4FC6800F1CABC39D00A28E2A /* block_socket.cc in Sources */, - 13E9F32A19754DE6007591EC /* md5.c in Sources */, - 4FCB62C81A307EFA00E57EE0 /* tcpserver_fsm.cc in Sources */, - 13E9F33B19754DE6007591EC /* tinyxml2.cc in Sources */, - 4F516B751A19F3B20006EC9D /* getifaddrs.cc in Sources */, - 13E9F31A19754DE6007591EC /* coreservice_base.cc in Sources */, - F138F6A51DF0119A00546CBB /* jump_arm64_aapcs_macho_gas.S in Sources */, - 13E9F33119754DE6007591EC /* Reachability.mm in Sources */, - 1FA3D6331C89758400B9BEFD /* __assert.c in Sources */, - 13E9F33519754DE6007591EC /* ptrbuffer.cc in Sources */, - F138F69A1DF0109E00546CBB /* coroutine_context.cpp in Sources */, - 13E9F32C19754DE6007591EC /* message_queue.cc in Sources */, - F1C0DAFD19C862DF0056DE44 /* udpclient.cc in Sources */, - 13E9F32219754DE6007591EC /* ibase64.cc in Sources */, - 4BDBD17A1E094FFE006C62F5 /* netinfo_util.cc in Sources */, - 13E9F33619754DE6007591EC /* singleton.cc in Sources */, - 4FC0D7CF19A3681B00E8CB6E /* tcpclient_fsm.cc in Sources */, - 13E9F32E19754DE6007591EC /* getgateway.c in Sources */, - 13E9F31919754DE6007591EC /* comm_frequency_limit.cc in Sources */, - 13E9F33E19754DE6007591EC /* xloggerbase.c in Sources */, - 4FCB62C71A307EFA00E57EE0 /* tcpserver.cc in Sources */, - 13E9F2FF19754DE6007591EC /* adler32.c in Sources */, - F138F6B41DF014DA00546CBB /* ontop_arm64_aapcs_macho_gas.S in Sources */, - F138F6CC1DF016BD00546CBB /* jump_i386_sysv_macho_gas.S in Sources */, - 13E9F32619754DE6007591EC /* test_spy_sample.cc in Sources */, - 1F5ADF571CA440370022E41D /* mmap_util.cc in Sources */, - F138F6D01DF016BD00546CBB /* ontop_i386_sysv_macho_gas.S in Sources */, - 13E9F30119754DE6007591EC /* autobuffer.cc in Sources */, - 13E9F32D19754DE6007591EC /* message_queue_utils.cc in Sources */, - 13E9F33A19754DE6007591EC /* strutil.cc in Sources */, - 4FC0D7D219A4898100E8CB6E /* anr.cc in Sources */, - F138F6A41DF0119A00546CBB /* jump_arm_aapcs_macho_gas.S in Sources */, - 13E9F30019754DE6007591EC /* alarm.cc in Sources */, - 425BA5811A14AD0600073A45 /* tickcount.cc in Sources */, - 13E9F33C19754DE6007591EC /* socketselect.cc in Sources */, - 13E9F32719754DE6007591EC /* testspy.cc in Sources */, - F138F69C1DF0109E00546CBB /* stack_traits.cpp in Sources */, - F1C0DAFE19C862DF0056DE44 /* udpserver.cc in Sources */, - F1F051011E08E56E007DB6DB /* coro_socket.cc in Sources */, - 1319C65D1BAC12EA00C4B07B /* data_protect_attr.mm in Sources */, - 1FA3D62C1C8970CF00B9BEFD /* dns.cc in Sources */, - F138F6A61DF0119A00546CBB /* make_arm_aapcs_macho_gas.S in Sources */, - 13E9F33419754DE6007591EC /* xlogger_threadinfo.mm in Sources */, - 13E9F32F19754DE6007591EC /* objc_timer.mm in Sources */, - F138F6DC1DF0195E00546CBB /* make_x86_64_sysv_macho_gas.S in Sources */, - 13E9F33019754DE6007591EC /* platform_comm.mm in Sources */, - 3D8AC2D31D5477DA007DE060 /* getsocktcpinfo.cc in Sources */, - F138F6DB1DF0195E00546CBB /* jump_x86_64_sysv_macho_gas.S in Sources */, - 13E9F33319754DE6007591EC /* ThreadOperationQueue.mm in Sources */, - F138F6981DF0109E00546CBB /* stack_traits.cpp in Sources */, - 13E9F32519754DE6007591EC /* debugger_utils.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3170A033177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 3170A034177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 3170A036177887B0004F5DDA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = default; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/comm.dst; - ENABLE_BITCODE = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Debug; - }; - 3170A037177887B0004F5DDA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_DEBUG_INFORMATION_LEVEL = "line-tables-only"; - DEAD_CODE_STRIPPING = YES; - DEPLOYMENT_POSTPROCESSING = NO; - DSTROOT = /tmp/comm.dst; - ENABLE_BITCODE = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = NO; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = ""; - GCC_PREPROCESSOR_DEFINITIONS = ( - "NDEBUG=1", - MACOS, - "XLOGGER_TAG='\"mars::$(PROJECT_NAME)\"'", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_VERSION = ""; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; - GCC_WARN_UNUSED_FUNCTION = YES; - HEADER_SEARCH_PATHS = ( - $SOURCE_ROOT/, - $SOURCE_ROOT/../, - $SOURCE_ROOT/../../, - ); - IPHONEOS_DEPLOYMENT_TARGET = 7.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = NO; - OTHER_CPLUSPLUSFLAGS = ( - "$(OTHER_CFLAGS)", - "-fno-exceptions", - ); - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - STRIP_STYLE = all; - VALID_ARCHS = "i386 armv7 arm64 x86_64"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3170A022177887B0004F5DDA /* Build configuration list for PBXProject "comm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A033177887B0004F5DDA /* Debug */, - 3170A034177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3170A035177887B0004F5DDA /* Build configuration list for PBXNativeTarget "comm" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3170A036177887B0004F5DDA /* Debug */, - 3170A037177887B0004F5DDA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 3170A01F177887B0004F5DDA /* Project object */; -} diff --git a/mars/comm/comm.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/mars/comm/comm.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bd286a179..000000000 --- a/mars/comm/comm.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/mars/comm/comm_data.h b/mars/comm/comm_data.h new file mode 100644 index 000000000..355e2c22d --- /dev/null +++ b/mars/comm/comm_data.h @@ -0,0 +1,124 @@ + +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +// +// comm_data.h +// comm +// +// Created by garry on 2017/2/17. +// + +#ifndef mars_comm_data_h +#define mars_comm_data_h + +#include +#include + +namespace mars { +namespace comm { + +// proxy +enum ProxyType { + kProxyNone = 0, + kProxyHttpTunel, + kProxySocks5, + kProxyHttp, +}; + +class ProxyInfo { + public: + ProxyInfo() : ProxyInfo(kProxyNone, "", "", 0, "", "") { + } + ProxyInfo(ProxyType _type, + const std::string& _host, + const std::string& _ip, + uint16_t _port, + const std::string& _username, + const std::string& _password) + : type(_type), host(_host), ip(_ip), port(_port), username(_username), password(_password) { + } + + bool operator==(const ProxyInfo& _rh) { + if (type != _rh.type) { + return false; + } + if (kProxyNone == type) { + return true; + } + return host == _rh.host && ip == _rh.ip && port == _rh.port && username == _rh.username + && password == _rh.password; + } + + bool IsValid() const { + return kProxyNone == type || ((!ip.empty() || !host.empty()) && port > 0); + } + bool IsAddressValid() const { + return type != kProxyNone && ((!ip.empty() || !host.empty()) && port > 0); + } + + public: + ProxyType type; + std::string host; + std::string ip; + uint16_t port; + std::string username; + std::string password; +}; + +// connect records +enum class BizType { CGI = 0, CDN, COUNT }; +enum class ProtoType { TCP = 0, QUIC, COUNT }; + +struct ConnRecord { + BizType biz = BizType::CGI; + ProtoType proto = ProtoType::TCP; + bool succeed = false; //.是否连接成功. + uint64_t begin_timestamp_ms = 0; + unsigned cost_ms = 0; + int nettype = 0; // see NEW_NETTYPE_UNKNOW +}; +inline bool operator<(const ConnRecord& lhs, const ConnRecord& rhs) { + return lhs.begin_timestamp_ms < rhs.begin_timestamp_ms; +} + +// host resolve +enum EResolveHostPriority { + PRIORITY_NEWDNS_FIRST = 0, // newdns 优先. + PRIORITY_SIMPLEDNS_FIRST, // simpledns优先 +}; + +enum EResolveHostFlag { + FLAG_TRY_NEWDNS = 1, + FLAG_TRY_SIMPLEDNS = 1 << 1, + FLAG_TRY_LOCALDNS = 1 << 2, + + FLAGS_NEWDNS_DEFAULT = FLAG_TRY_NEWDNS | FLAG_TRY_LOCALDNS, + FLAGS_SIMPLEDNS_DEFAULT = FLAG_TRY_SIMPLEDNS | FLAG_TRY_LOCALDNS, + FLAGS_ALLINONE = FLAG_TRY_NEWDNS | FLAG_TRY_SIMPLEDNS | FLAG_TRY_LOCALDNS, + FLAGS_ALL_WITHOUT_LOCALDNS = FLAG_TRY_NEWDNS | FLAG_TRY_SIMPLEDNS, +}; + +enum EHostType { + kHostNone = 0, + kHostFromNewDNS = 1, + kHostFromSysDNS = 2, + kHostFromDebugIP = 3, + kHostFromSimpleDNS = 4, + kHostFromLiteral = 5, + kHostFromCdnRoute = 6, //.从cdn路由表中获取到ip. +}; + +} // namespace comm +} // namespace mars + +#endif /* mars_comm_data_h */ diff --git a/mars/comm/comm_frequency_limit.cc b/mars/comm/comm_frequency_limit.cc index 2480a14d2..ab3202b3a 100644 --- a/mars/comm/comm_frequency_limit.cc +++ b/mars/comm/comm_frequency_limit.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -18,30 +18,28 @@ // #include "comm/comm_frequency_limit.h" -#include "comm/xlogger/xlogger.h" -#include "comm/time_utils.h" +#include "comm/time_utils.h" +#include "comm/xlogger/xlogger.h" -CommFrequencyLimit::CommFrequencyLimit(size_t _count, uint64_t _time_span) - : count_(_count) - , time_span_(_time_span) { +CommFrequencyLimit::CommFrequencyLimit(size_t _count, uint64_t _time_span) : count_(_count), time_span_(_time_span) { xassert2(count_ > 0); xassert2(time_span_ > 0); } -CommFrequencyLimit::~CommFrequencyLimit() -{} +CommFrequencyLimit::~CommFrequencyLimit() { +} // true pass, false limit bool CommFrequencyLimit::Check() { uint64_t now = ::gettickcount(); - if (!touch_times_.empty() && (now touch_times_.front()); if ((now - touch_times_.front()) <= time_span_) { - xwarn2(TSF"Freq Limit, count:%0 in %1 milsec", count_, time_span_); + xwarn2(TSF "Freq Limit, count:%0 in %1 milsec", count_, time_span_); return false; } @@ -71,7 +69,3 @@ void CommFrequencyLimit::__DelOlderTouchTime(uint64_t _time) { break; } } - - - - diff --git a/mars/comm/comm_frequency_limit.h b/mars/comm/comm_frequency_limit.h index 5a62f8fe1..e767ba110 100644 --- a/mars/comm/comm_frequency_limit.h +++ b/mars/comm/comm_frequency_limit.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -21,28 +21,27 @@ #define COMM_COMM_FREQUENCY_LIMIT_H_ #include + #include #include class CommFrequencyLimit { - public: + public: CommFrequencyLimit(size_t _count, uint64_t _time_span); ~CommFrequencyLimit(); bool Check(); // true pass, false limit - private: + private: CommFrequencyLimit(CommFrequencyLimit&); CommFrequencyLimit& operator=(CommFrequencyLimit&); void __DelOlderTouchTime(uint64_t _time); - private: + private: size_t count_; uint64_t time_span_; std::list touch_times_; }; - - #endif /* defined(COMM_COMM_FREQUENCY_LIMIT_H_) */ diff --git a/mars/comm/compiler_util.h b/mars/comm/compiler_util.h index 4c5e5cbe6..aded54ea9 100644 --- a/mars/comm/compiler_util.h +++ b/mars/comm/compiler_util.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * compiler_util.h * @@ -22,7 +21,7 @@ #define COMM_COMPILER_UTIL_H_ #if defined(__GNUC__) -#define WEAK_FUNC __attribute__((weak)) +#define WEAK_FUNC __attribute__((weak)) #elif defined(_MSC_VER) && !defined(_LIB) #define WEAK_FUNC __declspec(selectany) #else @@ -30,16 +29,26 @@ #endif #if defined(__GNUC__) -#define EXPORT_FUNC __attribute__ ((visibility ("default"))) +#define EXPORT_FUNC __attribute__((visibility("default"))) #elif defined(_MSC_VER) #define EXPORT_FUNC __declspec(dllexport) #else #error "export" #endif +#if defined(_MSC_VER) && defined(MARS_USE_DLLS) +#ifdef MARS_COMMON_EXPORTS +#define MARS_COMMON_EXPORT __declspec(dllexport) +#else +#define MARS_COMMON_EXPORT __declspec(dllimport) +#endif +#else +#define MARS_COMMON_EXPORT +#endif + #ifndef VARIABLE_IS_NOT_USED #ifdef __GNUC__ -#define VARIABLE_IS_NOT_USED __attribute__ ((unused)) +#define VARIABLE_IS_NOT_USED __attribute__((unused)) #else #define VARIABLE_IS_NOT_USED #endif diff --git a/mars/comm/copy_wrapper.h b/mars/comm/copy_wrapper.h deleted file mode 100644 index beed775f3..000000000 --- a/mars/comm/copy_wrapper.h +++ /dev/null @@ -1,91 +0,0 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - -// -// copy_wrapper.h -// comm -// -// Created by Ray on 13-10-17. -// Copyright (c) 2013 zhoushaotao. All rights reserved. -// - -#ifndef COMM_COPY_WRAPPER_H_ -#define COMM_COPY_WRAPPER_H_ - -template -class copy_wrapper_helper { - public: - static void copy_constructor(S& _lhs, S& _rhs) - { _lhs = _rhs; } - - static void copy_constructor(S& _lhs, const S& _rhs) - { _lhs = _rhs; } - - static void destructor(S& _delobj) {} -}; - -template -class copy_wrapper_helper_ref { - public: - static const D& ref(const S& _ref) { return _ref; } - static D& ref(S& _ref) { return _ref; } -}; - -template -class copy_wrapper { - public: - typedef S SRC; - typedef D DST; - - copy_wrapper(S& t) - { copy_wrapper_helper::copy_constructor(m_t, t); } - - copy_wrapper(const S& t) - { copy_wrapper_helper::copy_constructor(m_t, t); } - - ~copy_wrapper() - { copy_wrapper_helper::destructor(m_t);} - - copy_wrapper& operator=(copy_wrapper& _ref) { - copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); - return *this; - } - - copy_wrapper& operator=(const copy_wrapper& _ref) { - copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); - return *this; - } - - copy_wrapper(copy_wrapper& _ref) - { copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); } - - copy_wrapper(const copy_wrapper& _ref) - { copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); } - - operator D& () { return copy_wrapper_helper_ref::ref(m_t); } - operator const D& () const { return copy_wrapper_helper_ref::ref(m_t); } - - D* operator->() { return ©_wrapper_helper_ref::ref(m_t); } - const D* operator->() const { return ©_wrapper_helper_ref::ref(m_t); } - - D& get() { return copy_wrapper_helper_ref::ref(m_t); } - const D& get() const { return copy_wrapper_helper_ref::ref(m_t); } - - D* get_pointer() { return ©_wrapper_helper_ref::ref(m_t); } - const D* get_pointer() const { return ©_wrapper_helper_ref::ref(m_t); } - - private: - S m_t; -}; - - -#endif // COMM_COPY_WRAPPER_H_ diff --git a/mars/comm/corepattern/ServiceImpl.inl b/mars/comm/corepattern/ServiceImpl.inl index 5db7a7065..aa6bba3e5 100644 --- a/mars/comm/corepattern/ServiceImpl.inl +++ b/mars/comm/corepattern/ServiceImpl.inl @@ -103,7 +103,7 @@ struct __ServicesNameSet inline std::set _ComputeCoreServiceDepend(const std::string& _servicename) { - std::vector& svrreg = BootRegister_Container(); + std::vector& svrreg = BOOT_REGISTER_CONTAINER(); std::set servicedepend; for (std::vector::iterator it=svrreg.begin(); it!=svrreg.end(); ++it) { diff --git a/mars/comm/corepattern/coreservice_base.cc b/mars/comm/corepattern/coreservice_base.cc index 4298bf257..8ddc2cb8c 100644 --- a/mars/comm/corepattern/coreservice_base.cc +++ b/mars/comm/corepattern/coreservice_base.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * CoreServiceBase.cpp * @@ -18,30 +17,28 @@ * Author: yerungui */ +#include "comm/corepattern/coreservice_base.h" + #include -#include "comm/corepattern/ServiceImpl.inl" #include "comm/bootregister.h" -#include "comm/corepattern/coreservice_base.h" +#include "comm/corepattern/ServiceImpl.inl" #include "comm/xlogger/xlogger.h" namespace design_patterns { - -CoreServiceBase::CoreServiceBase(const char* _servicename) - : ServiceBase(_servicename) { +CoreServiceBase::CoreServiceBase(const char* _servicename) : ServiceBase(_servicename) { __StartupCreater(); } - CoreServiceBase::~CoreServiceBase() { for (std::vector::reverse_iterator it = m_releasevec.rbegin(); it != m_releasevec.rend(); ++it) { - delete(*it); + delete (*it); } } void CoreServiceBase::__StartupCreater() { - std::vector& svrreg = BootRegister_Container(); + std::vector& svrreg = BOOT_REGISTER_CONTAINER(); std::vector veccreater; for (std::vector::iterator it = svrreg.begin(); it != svrreg.end(); ++it) { @@ -53,11 +50,11 @@ void CoreServiceBase::__StartupCreater() { __Creater(veccreater); } - void CoreServiceBase::__FirstGetCreater(const std::string& _servicename) { - if (m_services.end() != m_services.find(_servicename)) return; + if (m_services.end() != m_services.find(_servicename)) + return; - std::vector& svrreg = BootRegister_Container(); + std::vector& svrreg = BOOT_REGISTER_CONTAINER(); std::vector veccreater; for (std::vector::iterator it = svrreg.begin(); it != svrreg.end(); ++it) { @@ -70,9 +67,8 @@ void CoreServiceBase::__FirstGetCreater(const std::string& _servicename) { __Creater(veccreater); } - void CoreServiceBase::__Creater(std::vector& _vec) { - std::vector& svrreg = BootRegister_Container(); + std::vector& svrreg = BOOT_REGISTER_CONTAINER(); std::set servicedepend; for (std::vector::iterator it = _vec.begin(); it != _vec.end(); ++it) { @@ -83,7 +79,7 @@ void CoreServiceBase::__Creater(std::vector& _vec) { size_t count = servicedepend.size(); for (std::vector::iterator it = svrreg.begin(); it != svrreg.end(); ++it) { - if (it->coreservice == ServiceName() && servicedepend.end() != servicedepend.find(it->ServiceName())) { + if (it->coreservice == ServiceName() && servicedepend.end() != servicedepend.find(it->ServiceName())) { servicedepend.insert(it->DependServicesName().begin(), it->DependServicesName().end()); } } @@ -93,9 +89,8 @@ void CoreServiceBase::__Creater(std::vector& _vec) { } } while (true); - for (std::vector::iterator it = svrreg.begin(); it != svrreg.end(); ++it) { - if (it->coreservice == ServiceName() && servicedepend.end() != servicedepend.find(it->ServiceName())) { + if (it->coreservice == ServiceName() && servicedepend.end() != servicedepend.find(it->ServiceName())) { servicedepend.insert(it->DependServicesName().begin(), it->DependServicesName().end()); _vec.push_back(*it); } @@ -116,7 +111,8 @@ void CoreServiceBase::__Creater(std::vector& _vec) { m_releasevec.push_back(p); m_services[it->ServiceName()] = p; - if (EPublic == it->servicevisible) m_publicservices[it->ServiceName()] = p; + if (EPublic == it->servicevisible) + m_publicservices[it->ServiceName()] = p; it = _vec.erase(it); } else { @@ -124,7 +120,8 @@ void CoreServiceBase::__Creater(std::vector& _vec) { } } - if (0 == _vec.size()) break; + if (0 == _vec.size()) + break; if (count <= _vec.size()) { xassert2(false); diff --git a/mars/comm/corepattern/coreservice_base.h b/mars/comm/corepattern/coreservice_base.h index 8e66534d3..9347739e2 100644 --- a/mars/comm/corepattern/coreservice_base.h +++ b/mars/comm/corepattern/coreservice_base.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * CoreServiceBase.h * @@ -29,13 +28,13 @@ namespace design_patterns { struct ServiceRegister; -class CoreServiceBase: public ServiceBase { - protected: +class CoreServiceBase : public ServiceBase { + protected: CoreServiceBase(const char* _servicename); virtual ~CoreServiceBase(); - public: - template + public: + template T* Service() { if (m_publicservices.end() != m_publicservices.find(T::ServiceName())) return (T*)m_publicservices[T::ServiceName()]; @@ -48,16 +47,16 @@ class CoreServiceBase: public ServiceBase { return NULL; } - private: + private: void __StartupCreater(); void __FirstGetCreater(const std::string& _servicename); void __Creater(std::vector& _vec); - private: + private: TServicesMap m_services; TServicesMap m_publicservices; std::vector m_releasevec; }; -} +} // namespace design_patterns #endif diff --git a/mars/comm/corepattern/service_base.h b/mars/comm/corepattern/service_base.h index ec59eec56..39d929f1f 100644 --- a/mars/comm/corepattern/service_base.h +++ b/mars/comm/corepattern/service_base.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * ServiceBase.h * @@ -21,26 +20,31 @@ #ifndef SERVICEBASE_H_ #define SERVICEBASE_H_ -#include -#include #include +#include +#include namespace design_patterns { - class ServiceBase; typedef std::map TServicesMap; class ServiceBase { - public: - virtual ~ServiceBase() {} - void DependServices(const TServicesMap& _dependservices) { m_dependservices = _dependservices;} - const char* ServiceName() const { return m_servicename.c_str();} + public: + virtual ~ServiceBase() { + } + void DependServices(const TServicesMap& _dependservices) { + m_dependservices = _dependservices; + } + const char* ServiceName() const { + return m_servicename.c_str(); + } - protected: - ServiceBase(const char* _servicename) : m_servicename(_servicename) {} + protected: + ServiceBase(const char* _servicename) : m_servicename(_servicename) { + } - template + template T* _Service() { if (m_dependservices.end() != m_dependservices.find(T::ServiceName())) return (T*)m_dependservices[T::ServiceName()]; @@ -48,14 +52,14 @@ class ServiceBase { return NULL; } - protected: - std::string m_servicename; + protected: + std::string m_servicename; TServicesMap m_dependservices; }; -} +} // namespace design_patterns -#define DEFINE_SERVICE() \ - static const char* ServiceName();\ +#define DEFINE_SERVICE() \ + static const char* ServiceName(); \ static const std::set& DependServicesName(); #endif diff --git a/mars/comm/corepattern/test/TestCoreService.cpp b/mars/comm/corepattern/test/TestCoreService.cpp index ce54874b0..14eeaffb2 100644 --- a/mars/comm/corepattern/test/TestCoreService.cpp +++ b/mars/comm/corepattern/test/TestCoreService.cpp @@ -6,18 +6,16 @@ */ #include "TestCoreService.h" + #include "ServiceUtil.h" namespace design_patterns { -//SERVICE_REGISTER(TestCoreService, "", EPublic, EStartup); +// SERVICE_REGISTER(TestCoreService, "", EPublic, EStartup); IMPLEMENT_CORE_SERVICE(TestCoreService); -TestCoreService::TestCoreService() -:CoreServiceBase(ServiceName()) -{ - +TestCoreService::TestCoreService() : CoreServiceBase(ServiceName()) { } TestCoreService::~TestCoreService() { diff --git a/mars/comm/corepattern/test/TestCoreService.h b/mars/comm/corepattern/test/TestCoreService.h index d8b302ac5..d41684b7f 100644 --- a/mars/comm/corepattern/test/TestCoreService.h +++ b/mars/comm/corepattern/test/TestCoreService.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * TestCoreService.h * @@ -24,12 +24,12 @@ namespace design_patterns { -class TestCoreService: public design_patterns::CoreServiceBase { -public: - TestCoreService(); - virtual ~TestCoreService(); +class TestCoreService : public design_patterns::CoreServiceBase { + public: + TestCoreService(); + virtual ~TestCoreService(); - DEFINE_SERVICE(); + DEFINE_SERVICE(); }; } /* namespace design_patterns */ diff --git a/mars/comm/corepattern/test/TestCoreService2.cpp b/mars/comm/corepattern/test/TestCoreService2.cpp index f2d517ace..f35164317 100644 --- a/mars/comm/corepattern/test/TestCoreService2.cpp +++ b/mars/comm/corepattern/test/TestCoreService2.cpp @@ -6,8 +6,9 @@ */ #include "TestCoreService2.h" -#include "TestCoreService.h" + #include "ServiceUtil.h" +#include "TestCoreService.h" namespace design_patterns { diff --git a/mars/comm/corepattern/test/TestCoreService2.h b/mars/comm/corepattern/test/TestCoreService2.h index 49ace5662..9d34e3a3c 100644 --- a/mars/comm/corepattern/test/TestCoreService2.h +++ b/mars/comm/corepattern/test/TestCoreService2.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * TestCoreService2.h * @@ -22,19 +22,15 @@ #include "../coreservice_base.h" - namespace design_patterns { -class TestCoreService2: public design_patterns::CoreServiceBase { -public: - TestCoreService2(TServicesMap& _parentsservices) - :CoreServiceBase( ServiceName(), _parentsservices) - { - - } - virtual ~TestCoreService2(); +class TestCoreService2 : public design_patterns::CoreServiceBase { + public: + TestCoreService2(TServicesMap& _parentsservices) : CoreServiceBase(ServiceName(), _parentsservices) { + } + virtual ~TestCoreService2(); - DEFINE_SERVICE(); + DEFINE_SERVICE(); }; } /* namespace design_patterns */ diff --git a/mars/comm/corepattern/test/TestService.cpp b/mars/comm/corepattern/test/TestService.cpp index 627748f32..6bb8c2e48 100644 --- a/mars/comm/corepattern/test/TestService.cpp +++ b/mars/comm/corepattern/test/TestService.cpp @@ -6,9 +6,9 @@ */ #include "TestService.h" -#include "TestCoreService.h" -#include "ServiceUtil.h" +#include "ServiceUtil.h" +#include "TestCoreService.h" namespace design_patterns { diff --git a/mars/comm/corepattern/test/TestService.h b/mars/comm/corepattern/test/TestService.h index d596b2ab1..d82d21d0f 100644 --- a/mars/comm/corepattern/test/TestService.h +++ b/mars/comm/corepattern/test/TestService.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * TestService.h * @@ -24,17 +24,16 @@ namespace design_patterns { -class TestService: public design_patterns::ServiceBase { -public: - TestService(TServicesMap& _services):ServiceBase(ServiceName(), _services) - { - - } - virtual ~TestService(); - +class TestService : public design_patterns::ServiceBase { + public: + TestService(TServicesMap& _services) : ServiceBase(ServiceName(), _services) { + } + virtual ~TestService(); - DEFINE_SERVICE(); - int test(int a, int b) {return a+b;} + DEFINE_SERVICE(); + int test(int a, int b) { + return a + b; + } }; } /* namespace design_patterns */ diff --git a/mars/comm/corepattern/test/TestService2.cpp b/mars/comm/corepattern/test/TestService2.cpp index b327acedb..4c1555338 100644 --- a/mars/comm/corepattern/test/TestService2.cpp +++ b/mars/comm/corepattern/test/TestService2.cpp @@ -6,17 +6,16 @@ */ #include "TestService2.h" -#include "TestService.h" -#include "TestCoreService2.h" -#include "ServiceUtil.h" +#include "ServiceUtil.h" +#include "TestCoreService2.h" +#include "TestService.h" namespace design_patterns { SERVICE_REGISTER(TestService2, TestCoreService2::ServiceName(), EPublic, EFirstGet); IMPLEMENT_SERVICE(TestService2); - TestService2::~TestService2() { } diff --git a/mars/comm/corepattern/test/TestService2.h b/mars/comm/corepattern/test/TestService2.h index f32dcf821..e8a2c0cd9 100644 --- a/mars/comm/corepattern/test/TestService2.h +++ b/mars/comm/corepattern/test/TestService2.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * TestService2.h * @@ -24,16 +24,16 @@ namespace design_patterns { -class TestService2: public design_patterns::ServiceBase { -public: - TestService2(TServicesMap& _services):ServiceBase(ServiceName(), _services) - { - - } - virtual ~TestService2(); +class TestService2 : public design_patterns::ServiceBase { + public: + TestService2(TServicesMap& _services) : ServiceBase(ServiceName(), _services) { + } + virtual ~TestService2(); - DEFINE_SERVICE(); - int test2(int a, int b) {return a+b;} + DEFINE_SERVICE(); + int test2(int a, int b) { + return a + b; + } }; } /* namespace design_patterns */ diff --git a/mars/comm/corepattern/test/TestService3.cpp b/mars/comm/corepattern/test/TestService3.cpp index abffa701a..a02dcc843 100644 --- a/mars/comm/corepattern/test/TestService3.cpp +++ b/mars/comm/corepattern/test/TestService3.cpp @@ -6,11 +6,11 @@ */ #include "TestService3.h" + +#include "ServiceUtil.h" #include "TestCoreService2.h" -#include "TestService2.h" #include "TestService.h" -#include "ServiceUtil.h" - +#include "TestService2.h" namespace design_patterns { diff --git a/mars/comm/corepattern/test/TestService3.h b/mars/comm/corepattern/test/TestService3.h index 33fed7e1e..df9357fe8 100644 --- a/mars/comm/corepattern/test/TestService3.h +++ b/mars/comm/corepattern/test/TestService3.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * TestService3.h * @@ -24,16 +24,16 @@ namespace design_patterns { -class TestService3: public design_patterns::ServiceBase { -public: - TestService3(TServicesMap& _services):ServiceBase(ServiceName(), _services) - { - - } - virtual ~TestService3(); +class TestService3 : public design_patterns::ServiceBase { + public: + TestService3(TServicesMap& _services) : ServiceBase(ServiceName(), _services) { + } + virtual ~TestService3(); - DEFINE_SERVICE(); - int test2(int a, int b) {return a+b;} + DEFINE_SERVICE(); + int test2(int a, int b) { + return a + b; + } }; } /* namespace design_patterns */ diff --git a/mars/comm/corepattern/test/hello-jni.cpp b/mars/comm/corepattern/test/hello-jni.cpp index 31a111ec3..845e6cbc5 100644 --- a/mars/comm/corepattern/test/hello-jni.cpp +++ b/mars/comm/corepattern/test/hello-jni.cpp @@ -14,8 +14,9 @@ * limitations under the License. * */ -#include #include +#include + #include "TestCoreService.h" #include "TestCoreService2.h" #include "TestService.h" @@ -28,14 +29,12 @@ * * apps/samples/hello-jni/project/com/example/hellojni/HelloJni.java */ -extern "C" JNIEXPORT jstring -Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env, - jobject thiz ) -{ - - design_patterns::TestCoreService t; -// int i = t.GetPublicService()->test(1, 2); -// int i3 = t.GetPublicService()->test2(3, 4); - int i3 = t.GetPublicService()->GetPublicService()->test2(3, 4); +extern "C" JNIEXPORT jstring Java_com_example_hellojni_HelloJni_stringFromJNI(JNIEnv* env, jobject thiz) { + design_patterns::TestCoreService t; + // int i = t.GetPublicService()->test(1, 2); + // int i3 = t.GetPublicService()->test2(3, 4); + int i3 = t.GetPublicService() + ->GetPublicService() + ->test2(3, 4); return env->NewStringUTF("Hello from JNI !"); } diff --git a/mars/comm/coroutine/coro_async.h b/mars/comm/coroutine/coro_async.h new file mode 100644 index 000000000..851eb57e7 --- /dev/null +++ b/mars/comm/coroutine/coro_async.h @@ -0,0 +1,170 @@ +/* + * coro_async.h + * + * Created on: 2016-12-28 + * Author: yerungui + */ + +#ifndef CORO_ASYNC_H_ +#define CORO_ASYNC_H_ + +#include "coroutine.h" +#include "mars/boost/intrusive_ptr.hpp" +#include "mars/comm/thread/thread.h" + +namespace coroutine { + +/////////////////running in coroutine utils/////////////////////////////// +class WaitThread { + private: + struct Wrapper_ { + mars::comm::Mutex mutex; + mars::comm::mq::MessagePost_t message_timeout; + mars::comm::mq::MessagePost_t message_running; + boost::intrusive_ptr wrapper; + int status; + }; + + public: + enum { + kTimeout = 0, + kFinish, + kCancel, + }; + + public: + WaitThread(const char* _name = NULL) : thread_(_name), wrapper_(new Wrapper_) { + wrapper_->status = kTimeout; + } + ~WaitThread() { + } + + template + typename boost::disable_if::type>, + typename boost::result_of::type>::type + operator()(const F& _block_func, int64_t _timeout = -1, int* _status = NULL) { + std::shared_ptr wrapper = wrapper_; + mars::comm::ScopedLock lock(wrapper_->mutex); + wrapper->wrapper = RunningCoroutine(); + + if (0 <= _timeout) { + wrapper->message_timeout = Resume(wrapper->wrapper, _timeout); + } + + typedef typename boost::result_of::type R; + std::shared_ptr result(new R); + + mars::comm::mq::AsyncResult async_result( + _block_func, + [wrapper, result](const R& _result, bool _valid) { + ASSERT(_valid); + + mars::comm::ScopedLock lock(wrapper->mutex); + *result = _result; + if (!wrapper->wrapper) + return; + if (mars::comm::mq::KNullPost != wrapper->message_running) { + return; + } + if (mars::comm::mq::KNullPost == wrapper->message_timeout + || mars::comm::mq::CancelMessage(wrapper->message_timeout)) { + wrapper->status = kFinish; + wrapper->message_running = Resume(wrapper->wrapper); + return; + } + }, + NULL); + + thread_.start(async_result); + lock.unlock(); + Yield(); + + lock.lock(); + if (_status) + *_status = wrapper->status; + return *result; + } + + template + typename boost::enable_if::type>>::type + operator()(const F& _block_func, int64_t _timeout = -1, int* _status = NULL) { + std::shared_ptr wrapper = wrapper_; + mars::comm::ScopedLock lock(wrapper_->mutex); + wrapper->wrapper = RunningCoroutine(); + + if (0 <= _timeout) { + wrapper->message_timeout = Resume(wrapper->wrapper, _timeout); + } + + mars::comm::mq::AsyncResult async_result(_block_func, [wrapper](bool _valid) { + ASSERT(_valid); + + mars::comm::ScopedLock lock(wrapper->mutex); + if (!wrapper->wrapper) + return; + if (mars::comm::mq::KNullPost != wrapper->message_running) { + return; + } + if (mars::comm::mq::KNullPost == wrapper->message_timeout + || mars::comm::mq::CancelMessage(wrapper->message_timeout)) { + wrapper->status = kFinish; + wrapper->message_running = Resume(wrapper->wrapper); + return; + } + }); + + thread_.start(async_result); + lock.unlock(); + Yield(); + + if (_status) + *_status = wrapper->status; + return; + } + + void Cancel() const { + mars::comm::ScopedLock lock(wrapper_->mutex); + if (!wrapper_->wrapper) + return; + if (mars::comm::mq::KNullPost != wrapper_->message_running) { + return; + } + if (mars::comm::mq::KNullPost == wrapper_->message_timeout + || mars::comm::mq::CancelMessage(wrapper_->message_timeout)) { + wrapper_->status = kCancel; + wrapper_->message_running = Resume(wrapper_->wrapper); + return; + } + } + + const boost::intrusive_ptr& wrapper() const { + return wrapper_->wrapper; + } + + private: + WaitThread(const WaitThread&); + void operator=(const WaitThread&); + + private: + mars::comm::Thread thread_; + std::shared_ptr wrapper_; +}; + +template +typename boost::result_of::type MessageInvoke(const F& _func) { + boost::intrusive_ptr wrapper = RunningCoroutine(); + + typedef typename boost::result_of::type R; + mars::comm::mq::AsyncResult result([_func, wrapper]() { + Resume(wrapper); + return _func(); + }); + + mars::comm::mq::AsyncInvoke(result, mars::comm::mq::Post2Handler(mars::comm::mq::RunningMessageID())); + Yield(); + return result.Result(); +} + +} // namespace coroutine + +#endif diff --git a/mars/comm/coroutine/coro_socket.cc b/mars/comm/coroutine/coro_socket.cc old mode 100755 new mode 100644 index 989dbe8cb..9fdd72004 --- a/mars/comm/coroutine/coro_socket.cc +++ b/mars/comm/coroutine/coro_socket.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -15,197 +15,197 @@ #include "coro_socket.h" -#include #include +#include -#include "coroutine.h" +#include "mars/boost/intrusive_ptr.hpp" + +#include "comm/autobuffer.h" +#include "comm/platform_comm.h" #include "comm/socket/socket_address.h" -#include "comm/xlogger/xlogger.h" #include "comm/thread/lock.h" #include "comm/time_utils.h" -#include "comm/autobuffer.h" -#include "comm/platform_comm.h" +#include "comm/xlogger/xlogger.h" +#include "coroutine.h" namespace coroutine { /* SocketSelect Start */ - + struct TaskInfo { -public: - TaskInfo(boost::intrusive_ptr _wrapper, SocketSelect& _sel) - :wrapper_(_wrapper), sel_(_sel) { + public: + TaskInfo(boost::intrusive_ptr _wrapper, ::SocketPoll& _poll) : wrapper_(_wrapper), poll_(_poll) { } -public: + public: boost::intrusive_ptr wrapper_; - SocketSelect& sel_; + ::SocketPoll& poll_; + tickcount_t abs_timeout_; }; -class CoroutineSelect { -public: - CoroutineSelect() - : selector_(breaker_, true) - {} - -public: - void Select(TaskInfo& _task) { +class Multiplexing { + public: + Multiplexing() : poll_(breaker_, true) { + } + + public: + void Add(TaskInfo& _task) { ScopedLock lock(mutex_); tasks_.push_back(&_task); - selector_.Breaker().Break(); + poll_.Breaker().Break(); } - - SocketSelectBreaker& Breaeker() { - return selector_.Breaker(); + + ::SocketBreaker& Breaeker() { + return poll_.Breaker(); } - + void Run(int32_t _timeout) { - int32_t timeout = _timeout; - + __Before(timeout); - if (timeout != INT_MAX) { - selector_.Select(timeout); - } else { - selector_.Select(); - } + poll_.Poll(timeout); __After(); } - -private: - CoroutineSelect(const CoroutineSelect&); - void operator=(const CoroutineSelect&); - -private: - - void __Before(int32_t &_timeout) { - - selector_.PreSelect(); + + private: + Multiplexing(const Multiplexing&); + void operator=(const Multiplexing&); + + private: + void __Before(int32_t& _timeout) { + poll_.ClearEvent(); ScopedLock lock(mutex_); - - for (auto& i: tasks_) { + + for (auto& i : tasks_) { TaskInfo& task = *i; - xverbose2(TSF"task in, id:%_", &task); - selector_.Consign(task.sel_); - - if (!task.sel_.abs_timeout_.isValid()) continue; - - tickcountdiff_t diff = -task.sel_.abs_timeout_.gettickspan(); + xverbose2(TSF "task in, id:%_", &task); + poll_.Consign(task.poll_); + + if (!task.abs_timeout_.isValid()) + continue; + + tickcountdiff_t diff = -task.abs_timeout_.gettickspan(); if (diff <= 0) { _timeout = 0; continue; } - + if (_timeout < 0) { _timeout = (int32_t)diff; continue; } - + _timeout = std::min(_timeout, (int32_t)diff); } } - + void __After() { - ScopedLock lock(mutex_); std::list::iterator iter = tasks_.begin(); while (iter != tasks_.end()) { TaskInfo& task = **iter; - - if (selector_.Report(task.sel_, task.sel_.abs_timeout_.isValid()? -task.sel_.abs_timeout_.gettickspan():1)) { + + if (poll_.ConsignReport(task.poll_, task.abs_timeout_.isValid() ? -task.abs_timeout_.gettickspan() : 1)) { iter = tasks_.erase(iter); coroutine::Resume(task.wrapper_); } else { ++iter; } - } } - -private: - Mutex mutex_; - SocketSelectBreaker breaker_; - ::SocketSelect selector_; - std::list tasks_; + + private: + Mutex mutex_; + ::SocketBreaker breaker_; + ::SocketPoll poll_; + std::list tasks_; }; -SocketSelect::SocketSelect(SocketSelectBreaker& _breaker) - : ::SocketSelect(_breaker, false) {} - -int SocketSelect::Select(int _msec) { - - if (0 < _msec) { - abs_timeout_.gettickcount(); - abs_timeout_ += _msec; - } - - SocketSelectBreaker breaker; - ::SocketSelect selector(breaker); - selector.PreSelect(); - selector.Consign(*this); - int ret = selector.Select(0); - +static void __Coro_Poll(int _msec, ::SocketPoll& _socket_poll) { + ::SocketBreaker breaker; + ::SocketPoll selector(breaker); + selector.Consign(_socket_poll); + int ret = selector.Poll(0); + if (0 != ret) { - selector.Report(*this, 1); - return ret_; + selector.ConsignReport(_socket_poll, 1); + return; } - - boost::shared_ptr cond = mq::RunloopCond::CurrentCond(); - TaskInfo task(coroutine::RunningCoroutine(), *this); - - //messagequeue for coro select - if (cond && cond->type() == boost::typeindex::type_id()) { - static_cast(cond.get())->Select(task); + + std::shared_ptr cond = mq::RunloopCond::CurrentCond(); + TaskInfo task(coroutine::RunningCoroutine(), _socket_poll); + if (0 <= _msec) { + task.abs_timeout_.gettickcount() += _msec; + }; + + // messagequeue for coro select + if (cond && cond->type() == boost::typeindex::type_id()) { + static_cast(cond.get())->Add(task); coroutine::Yield(); - return ret_; + return; } - - //new thread for coro select - static CoroutineSelect s_corotine_select; - static Thread s_thread([&](){ - while (true) { - s_corotine_select.Run(10*60*1000); - } - }, XLOGGER_TAG"::coro_select"); + + // new thread for coro select + static Multiplexing s_multiplexing; + static Thread s_thread( + [&]() { + while (true) { + s_multiplexing.Run(10 * 60 * 1000); + } + }, + XLOGGER_TAG "::coro_multiplexing"); s_thread.start(); - s_corotine_select.Select(task); + s_multiplexing.Add(task); coroutine::Yield(); - return ret_; + return; +} + +int SocketSelect::Select(int _msec) { + __Coro_Poll(_msec, Poll()); + return Ret(); +} + +int SocketPoll::Poll(int _msec) { + __Coro_Poll(_msec, *this); + return Ret(); } /* SocketSelect End */ -RunloopCond::RunloopCond():coroutine_select(new CoroutineSelect) {} -RunloopCond::~RunloopCond() { delete coroutine_select;} - -void RunloopCond::Select(TaskInfo& _task) { - coroutine_select->Select(_task); +RunloopCond::RunloopCond() : multiplexing_(new Multiplexing) { +} +RunloopCond::~RunloopCond() { + delete multiplexing_; +} + +void RunloopCond::Add(TaskInfo& _task) { + multiplexing_->Add(_task); } - + const boost::typeindex::type_info& RunloopCond::type() const { - return boost::typeindex::type_id().type_info(); + return boost::typeindex::type_id().type_info(); } - + void RunloopCond::Wait(ScopedLock& _lock, long _millisecond) { ASSERT(_lock.islocked()); - coroutine_select->Breaeker().Clear(); + multiplexing_->Breaeker().Clear(); _lock.unlock(); - coroutine_select->Run(int32_t(_millisecond)); + multiplexing_->Run(int32_t(_millisecond)); _lock.lock(); } - + void RunloopCond::Notify(ScopedLock& _lock) { ASSERT(_lock.islocked()); - coroutine_select->Breaeker().Break(); + multiplexing_->Breaeker().Break(); } - + #define SocketSelect coroutine::SocketSelect #include "comm/socket/block_socket.cc" #undef SocketSelect -} +} // namespace coroutine #include "comm/socket/tcpclient_fsm.h" #define SocketSelect coroutine::SocketSelect #define COMPLEX_CONNECT_NAMESPACE coroutine #include "comm/socket/complexconnect.cc" #undef SocketSelect - diff --git a/mars/comm/coroutine/coro_socket.h b/mars/comm/coroutine/coro_socket.h old mode 100755 new mode 100644 index c9b236de7..dd7ceda7d --- a/mars/comm/coroutine/coro_socket.h +++ b/mars/comm/coroutine/coro_socket.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -16,63 +16,98 @@ #ifndef MMNET_ASYNC_SOCKET_H_H #define MMNET_ASYNC_SOCKET_H_H -#include "comm/tickcount.h" -#include "comm/socket/unix_socket.h" -#include "comm/socket/socketselect.h" -#include "comm/messagequeue/message_queue.h" +#include "mars/comm/messagequeue/message_queue.h" +#include "mars/comm/socket/socketpoll.h" +#include "mars/comm/socket/socketselect.h" +#include "mars/comm/socket/unix_socket.h" +#include "mars/comm/tickcount.h" class socket_address; class AutoBuffer; namespace coroutine { -SOCKET block_socket_connect(const socket_address& _address, SocketSelectBreaker& _breaker, int& _errcode, int32_t _timeout=-1/*ms*/); -int block_socket_send(SOCKET _sock, const void* _buffer, size_t _len, SocketSelectBreaker& _breaker, int &_errcode, int _timeout=-1); -int block_socket_recv(SOCKET _sock, AutoBuffer& _buffer, size_t _max_size, SocketSelectBreaker& _breaker, int &_errcode, int _timeout=-1, bool _wait_full_size=false); +SOCKET block_socket_connect(const socket_address& _address, + SocketBreaker& _breaker, + int& _errcode, + int32_t _timeout = -1 /*ms*/); +int block_socket_send(SOCKET _sock, + const void* _buffer, + size_t _len, + SocketBreaker& _breaker, + int& _errcode, + int _timeout = -1); +int block_socket_recv(SOCKET _sock, + AutoBuffer& _buffer, + size_t _max_size, + SocketBreaker& _breaker, + int& _errcode, + int _timeout = -1, + bool _wait_full_size = false); - class SocketSelect : public ::SocketSelect { -public: - SocketSelect(SocketSelectBreaker& _breaker); - ~SocketSelect() {} - + public: + SocketSelect(SocketBreaker& _breaker) : ::SocketSelect(_breaker, false) { + } + virtual ~SocketSelect() { + } + virtual int Select(int _msec); - virtual int Select() { return Select(-1);} - -private: + virtual int Select() { + return Select(-1); + } + + private: SocketSelect(const SocketSelect&); SocketSelect& operator=(const SocketSelect&); - -public: - tickcount_t abs_timeout_; }; - -class CoroutineSelect; -class TaskInfo; + +class SocketPoll : public ::SocketPoll { + public: + SocketPoll(SocketBreaker& _breaker) : ::SocketPoll(_breaker, false) { + } + virtual ~SocketPoll() { + } + + virtual int Poll(int _msec); + virtual int Poll() { + return Poll(-1); + } + + private: + SocketPoll(const SocketPoll&); + SocketPoll& operator=(const SocketPoll&); +}; + +class Multiplexing; +struct TaskInfo; class RunloopCond : public mq::RunloopCond { -public: + public: RunloopCond(); virtual ~RunloopCond(); - -public: - void Select(TaskInfo& _task); - -public: + + public: + void Add(TaskInfo& _task); + + public: virtual const boost::typeindex::type_info& type() const; - virtual void Wait(ScopedLock& _lock, long _millisecond); - virtual void Notify(ScopedLock& _lock); - -private: + virtual void Wait(ScopedLock& _lock, long _millisecond); + virtual void Notify(ScopedLock& _lock); + + private: RunloopCond(const RunloopCond&); void operator=(const RunloopCond&); - -private: - CoroutineSelect* coroutine_select; + + private: + Multiplexing* multiplexing_; }; - -} + +} // namespace coroutine #define COMPLEX_CONNECT_NAMESPACE coroutine -#include "comm/socket/complexconnect.h" +#include "mars/comm/socket/complexconnect.h" +#undef COMPLEX_CONNECT_NAMESPACE + +#include "./dns.h" -#endif //MMNET_ASYNC_SOCKET_H_H +#endif // MMNET_ASYNC_SOCKET_H_H diff --git a/mars/comm/coroutine/coroutine.h b/mars/comm/coroutine/coroutine.h old mode 100755 new mode 100644 index 43768eac4..29ca1f467 --- a/mars/comm/coroutine/coroutine.h +++ b/mars/comm/coroutine/coroutine.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -13,132 +13,154 @@ #ifndef COROUTINE_H_ #define COROUTINE_H_ -#include -#include -#include +#include "mars/boost/intrusive_ptr.hpp" #include +#include -#include "comm/messagequeue/message_queue.h" -#include "../thread/thread.h" +#include "mars/comm/assert/__assert.h" +#include "mars/comm/messagequeue/message_queue.h" namespace coroutine { -class Wrapper: public boost::intrusive_ref_counter { - -friend class Coroutine; -friend void Yield(); -friend void Resume(const boost::intrusive_ptr&, int64_t); - -typedef boost::coroutines::asymmetric_coroutine::pull_type pull_coro_t; -typedef boost::coroutines::asymmetric_coroutine::push_type push_coro_t; - -public: +class Wrapper : public boost::intrusive_ref_counter { + friend class Coroutine; + friend void Yield(); + friend mars::comm::mq::MessagePost_t Resume(const boost::intrusive_ptr&, int64_t); + + typedef boost::coroutines::asymmetric_coroutine::pull_type pull_coro_t; + typedef boost::coroutines::asymmetric_coroutine::push_type push_coro_t; + + public: template - Wrapper(const F& _func, const MessageQueue::MessageHandler_t& _handler) - :handler_(_handler) - , pull_obj_ptr_(NULL) - , push_obj_([_func, this](pull_coro_t& sink){ + Wrapper(const F& _func, const mars::comm::mq::MessageHandler_t& _handler) + : handler_(_handler), pull_obj_ptr_(NULL), push_obj_([_func, this](pull_coro_t& sink) { this->pull_obj_ptr_ = &sink; _func(); - }) - {} + }) { + } -private: + private: void _Yield() { - if (pull_obj_ptr_ == NULL || !(*pull_obj_ptr_)) return; - + if (pull_obj_ptr_ == NULL || !(*pull_obj_ptr_)) + return; + (*pull_obj_ptr_)(); } -private: + private: Wrapper& operator=(const Wrapper& rhs); Wrapper(const Wrapper& rhs); -private: - MessageQueue::MessageHandler_t handler_; - pull_coro_t* pull_obj_ptr_; - push_coro_t push_obj_; + private: + mars::comm::mq::MessageHandler_t handler_; + pull_coro_t* pull_obj_ptr_; + push_coro_t push_obj_; }; - + /////////static function////////////// inline boost::intrusive_ptr RunningCoroutine() { - const MessageQueue::Message& running_msg = MessageQueue::RuningMessage(); + const mars::comm::mq::Message& running_msg = mars::comm::mq::RunningMessage(); ASSERT(running_msg.body2.type() == boost::typeindex::type_id >()); return (boost::any_cast >(running_msg.body2)); } - + +inline bool isCoroutine() { + const mars::comm::mq::Message& running_msg = mars::comm::mq::RunningMessage(); + if (running_msg == mars::comm::mq::KNullMessage) + return false; + return running_msg.body2.type() == boost::typeindex::type_id >(); +} + inline void Yield() { RunningCoroutine()->_Yield(); } -inline void Resume(const boost::intrusive_ptr& _wrapper, int64_t _after=0) { - - MessageQueue::Message message; - message.body1 = boost::make_shared([_wrapper](){ _wrapper->push_obj_(); }); +inline mars::comm::mq::MessagePost_t Resume(const boost::intrusive_ptr& _wrapper, int64_t _after = 0) { + mars::comm::mq::Message message; + message.body1 = std::make_shared([_wrapper]() { + _wrapper->push_obj_(); + }); message.body2 = _wrapper; message.title = _wrapper.get(); - - MessageQueue::PostMessage(_wrapper->handler_, message, _after); + + return mars::comm::mq::PostMessage(_wrapper->handler_, message, _after); } - + inline void Wait(int64_t _after = std::numeric_limits::max()) { - if (0 > _after) { return; } + if (0 > _after) { + return; + } Resume(RunningCoroutine(), _after); Yield(); } class Coroutine { -public: + public: template - Coroutine(const F& _func, const MessageQueue::MessageHandler_t& _handler):wrapper_(new Wrapper(_func, _handler)) {} - - void Start() { Resume(wrapper_); } - + Coroutine(const F& _func, const mars::comm::mq::MessageHandler_t& _handler) + : wrapper_(new Wrapper(_func, _handler)) { + } + + void Start() { + Resume(wrapper_); + } + void Join() { - MessageQueue::WaitInvoke([this](){ - MessageQueue::RunLoop([this](){ return !this->wrapper_->push_obj_;}).Run(); - ASSERT(!(this->wrapper_->push_obj_)); - MessageQueue::CancelMessage(this->wrapper_->handler_, this->wrapper_.get()); - }, wrapper_->handler_); + mars::comm::mq::WaitInvoke( + [this]() { + mars::comm::mq::RunLoop([this]() { + return !this->wrapper_->push_obj_; + }).Run(); + ASSERT(!(this->wrapper_->push_obj_)); + mars::comm::mq::CancelMessage(this->wrapper_->handler_, this->wrapper_.get()); + }, + wrapper_->handler_); } void Notify() { - MessageQueue::CancelMessage(wrapper_->handler_, wrapper_.get()); + mars::comm::mq::CancelMessage(wrapper_->handler_, wrapper_.get()); Resume(wrapper_); } - + void Wait(int64_t _after = 0) { - if (0 > _after) { return; } - if (RunningCoroutine().get() != wrapper_.get()) { return; } + if (0 > _after) { + return; + } + if (RunningCoroutine().get() != wrapper_.get()) { + return; + } Resume(wrapper_, _after); Yield(); } - -private: + + private: Coroutine& operator=(const Coroutine& rhs); Coroutine(const Coroutine& rhs); - -private: + + private: boost::intrusive_ptr wrapper_; }; - + template -void AsyncFunc(const F& _block_func) { - - boost::intrusive_ptr wrapper = RunningCoroutine(); - - Thread thread([_block_func, wrapper]() - { - _block_func(); - Resume(wrapper); - }); - - thread.start(); - Yield(); +typename boost::result_of::type WaitInvoke(const F& _func, const mars::comm::mq::MessageHandler_t& _handler) { + typedef typename boost::result_of::type R; + mars::comm::mq::AsyncResult result(_func); + Coroutine coro(result, _handler); + coro.Start(); + coro.Join(); + return result.Result(); } +template +R& WaitInvoke(mars::comm::mq::AsyncResult& _func, const mars::comm::mq::MessageHandler_t& _handler) { + Coroutine coro(_func, _handler); + coro.Start(); + coro.Join(); + return _func.Result(); } +} // namespace coroutine + #endif diff --git a/mars/comm/coroutine/dns.cc b/mars/comm/coroutine/dns.cc new file mode 100644 index 000000000..ce920590a --- /dev/null +++ b/mars/comm/coroutine/dns.cc @@ -0,0 +1,161 @@ +/* Copyright (c) 2013-2015 Tencent. All rights reserved. */ +/* + * dns.cc + * + * Created on: 2016-12-25 + * Author: yerungui + */ + +#include "./dns.h" + +#include "./coro_async.h" +#include "network/getdnssvraddrs.h" +#include "socket/socket_address.h" +#include "socket/unix_socket.h" +#include "thread/lock.h" +#include "xlogger/xlogger.h" + +using namespace coroutine; + +static void __GetIP(const std::string& host_name, DNS::DNSFunc dnsfunc, std::vector& _result) { + xverbose_function(); + + if (NULL == dnsfunc) { + struct addrinfo hints, *single, *result; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_INET; + hints.ai_socktype = SOCK_STREAM; + // in iOS work fine, in Android ipv6 stack get ipv4-ip fail + // and in ipv6 stack AI_ADDRCONFIGd will filter ipv4-ip but we ipv4-ip can use by nat64 + // hints.ai_flags = AI_V4MAPPED|AI_ADDRCONFIG; + int error = getaddrinfo(host_name.c_str(), NULL, &hints, &result); + + if (error != 0) { + xwarn2(TSF "error, error:%0, hostname:%1", error, host_name.c_str()); + } else { + for (single = result; single; single = single->ai_next) { + if (PF_INET != single->ai_family) { + xassert2(false); + continue; + } + + sockaddr_in* addr_in = (sockaddr_in*)single->ai_addr; + struct in_addr convertAddr; + + // In Indonesia, if there is no ipv6's ip, operators return 0.0.0.0. + if (INADDR_ANY == addr_in->sin_addr.s_addr || INADDR_NONE == addr_in->sin_addr.s_addr) { + xwarn2(TSF "hehe, addr_in->sin_addr.s_addr:%0", addr_in->sin_addr.s_addr); + continue; + } + + convertAddr.s_addr = addr_in->sin_addr.s_addr; + const char* ip = socket_address(convertAddr).ip(); + + if (!socket_address(ip, 0).valid()) { + xerror2(TSF "ip is invalid, ip:%0", ip); + continue; + } + + _result.push_back(ip); + } + + if (_result.empty()) { + xgroup2_define(log_group); + std::vector dnssvraddrs; + mars::comm::getdnssvraddrs(dnssvraddrs); + + xinfo2("dns server:") >> log_group; + for (std::vector::iterator iter = dnssvraddrs.begin(); iter != dnssvraddrs.end(); + ++iter) { + xinfo2(TSF "%_:%_ ", iter->ip(), iter->port()) >> log_group; + } + } + + freeaddrinfo(result); + } + } else { + _result = dnsfunc(host_name); + } +} + +/////////////////////////////////////////////////////////////////// + +namespace coroutine { +struct dnsinfo { + std::string host_name; + DNSBreaker* breaker; + WaitThread* async_func; +}; +} // namespace coroutine + +static Mutex gs_mutex; + +DNS::DNS(DNSFunc _dnsfunc) : dnsfunc_(_dnsfunc) { +} + +DNS::~DNS() { + Cancel(); +} + +bool DNS::GetHostByName(const std::string& _host_name, + std::vector& ips, + long millsec, + DNSBreaker* _breaker) { + xassert2(!_host_name.empty()); + if (_host_name.empty()) { + return false; + } + if (_breaker && _breaker->isbreak) + return false; + + DNSFunc dnsfunc = dnsfunc_; + WaitThread* async_func = new WaitThread; + + ScopedLock lock(gs_mutex); + dnsinfo_vec_.resize(dnsinfo_vec_.size() + 1); + dnsinfo_vec_.back().host_name = _host_name; + dnsinfo_vec_.back().breaker = _breaker; + dnsinfo_vec_.back().async_func = async_func; + lock.unlock(); + ips = (*async_func)( + [_host_name, dnsfunc]() { + std::vector temp_result; + ::__GetIP(_host_name, dnsfunc, temp_result); + return temp_result; + }, + millsec); + + lock.lock(); + dnsinfo_vec_.erase(std::remove_if(dnsinfo_vec_.begin(), + dnsinfo_vec_.end(), + [](const dnsinfo& _v) { + if (RunningCoroutine() == _v.async_func->wrapper()) { + return true; + } + return false; + }), + dnsinfo_vec_.end()); + + delete async_func; + return !ips.empty(); +} + +void DNS::Cancel(const std::string& _host_name) { + ScopedLock lock(gs_mutex); + for (auto& i : dnsinfo_vec_) { + if (_host_name.empty() || i.host_name == _host_name) { + i.async_func->Cancel(); + } + } +} + +void DNS::Cancel(DNSBreaker& _breaker) { + ScopedLock lock(gs_mutex); + _breaker.isbreak = true; + for (auto& i : dnsinfo_vec_) { + if (i.breaker == &_breaker) { + i.async_func->Cancel(); + } + } +} diff --git a/mars/comm/coroutine/dns.h b/mars/comm/coroutine/dns.h new file mode 100644 index 000000000..dda543f0b --- /dev/null +++ b/mars/comm/coroutine/dns.h @@ -0,0 +1,46 @@ +/* + * dns.h + * + * Created on: 2016-12-25 + * Author: yerungui + */ + +#ifndef COMM_COMM_DNS_H_ +#define COMM_COMM_DNS_H_ + +#include +#include + +namespace coroutine { + +struct DNSBreaker { + DNSBreaker() : isbreak(false) { + } + bool isbreak; +}; + +struct dnsinfo; + +class DNS { + public: + typedef std::vector (*DNSFunc)(const std::string& host); + + public: + DNS(DNSFunc _dnsfunc = NULL); + ~DNS(); + + public: + bool GetHostByName(const std::string& _host_name, + std::vector& ips, + long millsec = 3 * 1000, + DNSBreaker* _breaker = NULL); + void Cancel(const std::string& _host_name = std::string()); + void Cancel(DNSBreaker& _breaker); + + private: + DNSFunc dnsfunc_; + std::vector dnsinfo_vec_; +}; +} // namespace coroutine + +#endif /* COMM_COMM_DNS_H_ */ diff --git a/mars/comm/crypt/ibase64.cc b/mars/comm/crypt/ibase64.cc index 3add9c2e8..6d2f6dc8b 100644 --- a/mars/comm/crypt/ibase64.cc +++ b/mars/comm/crypt/ibase64.cc @@ -1,10 +1,11 @@ +#include "comm/crypt/ibase64.h" + #include #include -#include "comm/crypt/ibase64.h" - -namespace Comm { +namespace mars { +namespace comm { static void init_conversion_tables(void); @@ -14,12 +15,11 @@ static char base64_to_char[64]; static int tables_initialised = 0; int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nSize) { - int target_size = 0; /* Length of target buffer */ - int nb_block; /* Total number of blocks */ - unsigned char - *p_source, /* Pointer to source buffer */ - *p_target, /* Pointer to target buffer */ - value; /* Value of Base64 byte */ + int target_size = 0; /* Length of target buffer */ + int nb_block; /* Total number of blocks */ + unsigned char *p_source, /* Pointer to source buffer */ + *p_target, /* Pointer to target buffer */ + value; /* Value of Base64 byte */ if (nSize == 0) return (0); @@ -38,19 +38,19 @@ int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS nb_block = (int)(nSize / 3); /* Check if we have a partially-filled block */ - if (nb_block * 3 != (int) nSize) + if (nb_block * 3 != (int)nSize) nb_block++; - target_size = (int) nb_block * 4; - sTarget [target_size] = '\0'; + target_size = (int)nb_block * 4; + sTarget[target_size] = '\0'; - p_source = (unsigned char*)sSrc; /* Point to start of buffers */ + p_source = (unsigned char*)sSrc; /* Point to start of buffers */ p_target = sTarget; while (nb_block--) { /* Byte 1 */ - value = *p_source >> 2; - *p_target++ = base64_to_char [value]; + value = *p_source >> 2; + *p_target++ = base64_to_char[value]; /* Byte 2 */ value = (*p_source++ & 0x03) << 4; @@ -58,7 +58,7 @@ int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS if ((int)(p_source - sSrc) < nSize) value |= (*p_source & 0xF0) >> 4; - *p_target++ = base64_to_char [value]; + *p_target++ = base64_to_char[value]; /* Byte 3 - pad the buffer with '=' if block not completed */ if ((int)(p_source - sSrc) < nSize) { @@ -67,14 +67,14 @@ int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS if ((int)(p_source - sSrc) < nSize) value |= (*p_source & 0xC0) >> 6; - *p_target++ = base64_to_char [value]; + *p_target++ = base64_to_char[value]; } else *p_target++ = '='; /* Byte 4 - pad the buffer with '=' if block not completed */ if ((int)(p_source - sSrc) < nSize) { - value = *p_source++ & 0x3F; - *p_target++ = base64_to_char [value]; + value = *p_source++ & 0x3F; + *p_target++ = base64_to_char[value]; } else *p_target++ = '='; } @@ -83,16 +83,13 @@ int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS } int DecodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nSize) { - int - target_size = 0; /* Length of target buffer */ - int - nb_block; /* Total number of block */ - unsigned char - value, /* Value of Base64 byte */ - *p_source, /* Pointer in source buffer */ - *p_target; /* Pointer in target buffer */ + int target_size = 0; /* Length of target buffer */ + int nb_block; /* Total number of block */ + unsigned char value, /* Value of Base64 byte */ + *p_source, /* Pointer in source buffer */ + *p_target; /* Pointer in target buffer */ - int n; + int n; if (nSize == 0) return (0); @@ -107,27 +104,27 @@ int DecodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS Decoded block 65432165 43216543 21654321 -> 3 bytes of 8 bits */ - nb_block = nSize / 4; - target_size = (int) nb_block * 3; - sTarget [target_size] = '\0'; + nb_block = nSize / 4; + target_size = (int)nb_block * 3; + sTarget[target_size] = '\0'; - p_source = (unsigned char*) sSrc; /* Point to start of buffers */ + p_source = (unsigned char*)sSrc; /* Point to start of buffers */ p_target = sTarget; while (nb_block--) { /* Byte 1 */ - *p_target = char_to_base64 [(unsigned char) * p_source++] << 2; - value = char_to_base64 [(unsigned char) * p_source++]; + *p_target = char_to_base64[(unsigned char)*p_source++] << 2; + value = char_to_base64[(unsigned char)*p_source++]; *p_target++ += ((value & 0x30) >> 4); /* Byte 2 */ - *p_target = ((value & 0x0F) << 4); - value = char_to_base64 [(unsigned char) * p_source++]; + *p_target = ((value & 0x0F) << 4); + value = char_to_base64[(unsigned char)*p_source++]; *p_target++ += ((value & 0x3C) >> 2); /* Byte 3 */ - *p_target = (value & 0x03) << 6; - value = char_to_base64 [(unsigned char) * p_source++]; + *p_target = (value & 0x03) << 6; + value = char_to_base64[(unsigned char)*p_source++]; *p_target++ += value; } @@ -143,36 +140,36 @@ int DecodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS } static void init_conversion_tables(void) { - unsigned char - value, /* Value to store in table */ - offset, - index; /* Index in table */ + unsigned char value, /* Value to store in table */ + offset, index; /* Index in table */ /* Reset the tables */ memset(char_to_base64, 0, sizeof(char_to_base64)); memset(base64_to_char, 0, sizeof(base64_to_char)); - value = 'A'; + value = 'A'; offset = 0; for (index = 0; index < 62; index++) { if (index == 26) { - value = 'a'; + value = 'a'; offset = 26; } else if (index == 52) { - value = '0'; + value = '0'; offset = 52; } - base64_to_char [index] = value + index - offset; - char_to_base64 [value + index - offset] = index; + base64_to_char[index] = value + index - offset; + char_to_base64[value + index - offset] = index; } - base64_to_char [62] = '+'; - base64_to_char [63] = '/'; - char_to_base64 ['+'] = 62; - char_to_base64 ['/'] = 63; + base64_to_char[62] = '+'; + base64_to_char[63] = '/'; + char_to_base64['+'] = 62; + char_to_base64['/'] = 63; tables_initialised = 1; } -} + +} // namespace mars +} // namespace comm diff --git a/mars/comm/crypt/ibase64.h b/mars/comm/crypt/ibase64.h index 3524c74ee..9d051cc4c 100644 --- a/mars/comm/crypt/ibase64.h +++ b/mars/comm/crypt/ibase64.h @@ -1,7 +1,7 @@ /** @file -@brief Base64ܽܺ +@brief base64 encode/decode $Id$ @author $Author$ @date $Date$ @@ -12,30 +12,31 @@ #pragma once -namespace Comm { - /** - * Given a source string of length len, this returns the amount of - * memory the destination string should have. - * - * remember, this is integer math - * 3 bytes turn into 4 chars - * ceiling[len / 3] * 4 + 1 - * - * +1 is for any extra null. - */ -#define modp_b64_encode_len(A) ((A+2)/3 * 4 + 1) - - /** - * Given a base64 string of length len, - * this returns the amount of memory required for output string - * It maybe be more than the actual number of bytes written. - * NOTE: remember this is integer math - * this allocates a bit more memory than traditional versions of b64 - * decode 4 chars turn into 3 bytes - * floor[len * 3/4] + 2 - */ +namespace mars { +namespace comm { +/** + * Given a source string of length len, this returns the amount of + * memory the destination string should have. + * + * remember, this is integer math + * 3 bytes turn into 4 chars + * ceiling[len / 3] * 4 + 1 + * + * +1 is for any extra null. + */ +#define modp_b64_encode_len(A) ((A + 2) / 3 * 4 + 1) + +/** + * Given a base64 string of length len, + * this returns the amount of memory required for output string + * It maybe be more than the actual number of bytes written. + * NOTE: remember this is integer math + * this allocates a bit more memory than traditional versions of b64 + * decode 4 chars turn into 3 bytes + * floor[len * 3/4] + 2 + */ #define modp_b64_decode_len(A) (A / 4 * 3 + 2) - + /** @brief Encode data buffer to base64 string. @param sSrc: Source data buffer. @@ -54,5 +55,5 @@ int EncodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nS */ int DecodeBase64(const unsigned char* sSrc, unsigned char* sTarget, const int nSize); -} - +} // namespace mars +} // namespace comm diff --git a/mars/comm/crypt/pkcs7_padding.c b/mars/comm/crypt/pkcs7_padding.c index d092d5cf9..67fc8413c 100644 --- a/mars/comm/crypt/pkcs7_padding.c +++ b/mars/comm/crypt/pkcs7_padding.c @@ -9,67 +9,72 @@ #include "comm/assert/__assert.h" -unsigned char pkcs7_padding_plus_len(unsigned int _datalen, unsigned char _blocksize) -{ - ASSERT2(0<_blocksize && 0<_datalen, "datalen=%u, blocksize=%u", _datalen, _blocksize); - if (!(0<_blocksize && 0<_datalen)) return 0; - return (unsigned char)(_blocksize - _datalen%_blocksize); +unsigned char pkcs7_padding_plus_len(unsigned int _datalen, unsigned char _blocksize) { + ASSERT2(0 < _blocksize && 0 < _datalen, "datalen=%u, blocksize=%u", _datalen, _blocksize); + if (!(0 < _blocksize && 0 < _datalen)) + return 0; + return (unsigned char)(_blocksize - _datalen % _blocksize); } -unsigned int pkcs7_padding_len(unsigned int _datalen, unsigned char _blocksize) -{ - unsigned char plus_len = 0; +unsigned int pkcs7_padding_len(unsigned int _datalen, unsigned char _blocksize) { + unsigned char plus_len = 0; plus_len = pkcs7_padding_plus_len(_datalen, _blocksize); - if (0==plus_len) return 0; + if (0 == plus_len) + return 0; return _datalen + plus_len; } -unsigned int pkcs7_padding(void* _data, unsigned int _datalen, unsigned char _blocksize) -{ +unsigned int pkcs7_padding(void* _data, unsigned int _datalen, unsigned char _blocksize) { unsigned char plus_len = 0; - ASSERT(NULL!=_data); - if (NULL==_data) return 0; + ASSERT(NULL != _data); + if (NULL == _data) + return 0; plus_len = pkcs7_padding_plus_len(_datalen, _blocksize); - if (0==plus_len) return 0; - memset((unsigned char*)_data+_datalen, plus_len, plus_len); + if (0 == plus_len) + return 0; + memset((unsigned char*)_data + _datalen, plus_len, plus_len); return _datalen + plus_len; } -unsigned int pkcs7_depadding(const void* _data, unsigned int _datapaddinglen) -{ +unsigned int pkcs7_depadding(const void* _data, unsigned int _datapaddinglen) { unsigned char plus_len = 0; unsigned int offset = 0; - ASSERT2(NULL!=_data && 0<_datapaddinglen, "_data=%p, _datapaddinglen=%u", _data, _datapaddinglen); - if (!(NULL!=_data && 0<_datapaddinglen)) return 0; + ASSERT2(NULL != _data && 0 < _datapaddinglen, "_data=%p, _datapaddinglen=%u", _data, _datapaddinglen); + if (!(NULL != _data && 0 < _datapaddinglen)) + return 0; - plus_len = ((const unsigned char*)_data)[_datapaddinglen-1]; - if (_datapaddinglen < plus_len) return 0; + plus_len = ((const unsigned char*)_data)[_datapaddinglen - 1]; + if (_datapaddinglen < plus_len) + return 0; - for (; offset #include - +#include int isDebuggerPerforming() { struct kinfo_proc infos_process; size_t size_info_proc = sizeof(infos_process); - pid_t pid_process = getpid(); // pid of the current process + pid_t pid_process = getpid(); // pid of the current process // - int mib[] = {CTL_KERN, // Kernel infos - KERN_PROC, // Search in process table - KERN_PROC_PID, // the process with pid = - pid_process}; // pid_process + int mib[] = {CTL_KERN, // Kernel infos + KERN_PROC, // Search in process table + KERN_PROC_PID, // the process with pid = + pid_process}; // pid_process // - //Retrieve infos for current process in infos_process + // Retrieve infos for current process in infos_process int ret = sysctl(mib, 4, &infos_process, &size_info_proc, NULL, 0); - if (ret) return 0; // sysctl failed + if (ret) + return 0; // sysctl failed // struct extern_proc process = infos_process.kp_proc; int flags = process.p_flag; - return flags & P_TRACED; // value of the debug flag + return flags & P_TRACED; // value of the debug flag } diff --git a/mars/comm/debugger/debugger_utils.h b/mars/comm/debugger/debugger_utils.h index e81a4e078..882b63554 100644 --- a/mars/comm/debugger/debugger_utils.h +++ b/mars/comm/debugger/debugger_utils.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -20,19 +20,14 @@ #ifndef PublicComponent_debug_h #define PublicComponent_debug_h - - #ifdef __cplusplus extern "C" { #endif int isDebuggerPerforming(); - #ifdef __cplusplus } #endif - - #endif diff --git a/mars/comm/debugger/spy_base.h b/mars/comm/debugger/spy_base.h index b073d4d43..9d5b0450a 100644 --- a/mars/comm/debugger/spy_base.h +++ b/mars/comm/debugger/spy_base.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -24,15 +24,17 @@ #include #include "boost/any.hpp" - #include "singleton.h" class Spy { - public: - Spy(void* _this): m_this(_this) {} - virtual ~Spy() {} + public: + Spy(void* _this) : m_this(_this) { + } + virtual ~Spy() { + } - template void Attach(const char* _key, var _var) { + template + void Attach(const char* _key, var _var) { m_variablemap[_key] = _var; __OnAttach(_key); } @@ -42,28 +44,33 @@ class Spy { m_variablemap.erase(_key); } - template var* Variable(const char* _key) const - { return boost::any_cast(m_variablemap.find(_key)->second); } + template + var* Variable(const char* _key) const { + return boost::any_cast(m_variablemap.find(_key)->second); + } - void* This() const {return m_this;} + void* This() const { + return m_this; + } - private: + private: virtual void __OnAttach(const char* _key) = 0; virtual void __OnDetach(const char* _key) = 0; - private: + private: void* m_this; std::map m_variablemap; }; class SpyCore { - public: + public: SINGLETON_INTRUSIVE(SpyCore, new SpyCore, delete); void AddSpy(void* _this, const char* _name, Spy* _spy) { m_thismap[_this] = _spy; - if (_name) m_strmap[_name] = _spy; + if (_name) + m_strmap[_name] = _spy; } void RemoveSpy(void* _this) { @@ -79,17 +86,21 @@ class SpyCore { } } - Spy* GetSpy(const void* _this) const - { return m_thismap.find(_this)->second; } + Spy* GetSpy(const void* _this) const { + return m_thismap.find(_this)->second; + } - Spy* GetSpy(const char* _name) const - { return m_strmap.find(_name)->second; } + Spy* GetSpy(const char* _name) const { + return m_strmap.find(_name)->second; + } - private: - SpyCore() {} - ~SpyCore() {} + private: + SpyCore() { + } + ~SpyCore() { + } - private: + private: std::map m_thismap; std::map m_strmap; }; diff --git a/mars/comm/debugger/test_spy_sample.cc b/mars/comm/debugger/test_spy_sample.cc index b2b97e3a6..32483e1cb 100644 --- a/mars/comm/debugger/test_spy_sample.cc +++ b/mars/comm/debugger/test_spy_sample.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -18,35 +18,30 @@ // #include "comm/debugger/test_spy_sample.h" -#include "comm/xlogger/xlogger.h" #include "comm/debugger/testspy.h" +#include "comm/xlogger/xlogger.h" - -Test_Spy_Sample::Test_Spy_Sample() -{ +Test_Spy_Sample::Test_Spy_Sample() { SPY_ATTACH_CLASS(NULL); } -Test_Spy_Sample::~Test_Spy_Sample() -{ +Test_Spy_Sample::~Test_Spy_Sample() { SPY_DETACH_CLASS(); } -void Test_Spy_Sample::TestFun0() -{ +void Test_Spy_Sample::TestFun0() { SPY_HOOK_THIS_API(TestFun0); int i = 0; SPY_ATTACH_VARIABLE("TestFun0 i", i); i++; - xinfo2(TSF"Test"); + xinfo2(TSF "Test"); SPY_DETACH_VARIABLE("TestFun0 i"); } -int Test_Spy_Sample::__TestFun1(int i) -{ +int Test_Spy_Sample::__TestFun1(int i) { SPY_HOOK_THIS_API(__TestFun1, i); - xinfo2(TSF"Test"); - return i+1; + xinfo2(TSF "Test"); + return i + 1; } diff --git a/mars/comm/debugger/test_spy_sample.h b/mars/comm/debugger/test_spy_sample.h index 1931954d8..093062e51 100644 --- a/mars/comm/debugger/test_spy_sample.h +++ b/mars/comm/debugger/test_spy_sample.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -20,22 +20,21 @@ #ifndef __PublicComponent__testspy__ #define __PublicComponent__testspy__ - - class Test_Spy_Sample { - public: + public: Test_Spy_Sample(); ~Test_Spy_Sample(); void TestFun0(); - void TestFun2() {__TestFun1(1);} + void TestFun2() { + __TestFun1(1); + } - private: + private: int __TestFun1(int i); - private: -// int m_t; + private: + // int m_t; }; - #endif /* defined(__PublicComponent__testspy__) */ diff --git a/mars/comm/debugger/testspy.cc b/mars/comm/debugger/testspy.cc index 846ed46f4..1978edbd2 100644 --- a/mars/comm/debugger/testspy.cc +++ b/mars/comm/debugger/testspy.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -22,20 +22,15 @@ #include "comm/debugger/spy_impl_helper.inl" #include "comm/debugger/test_spy_sample.h" - -bool TSpy::SpyHookLogFunc(XLoggerInfo_t& _info, std::string& _log) -{ +bool TSpy::SpyHookLogFunc(XLoggerInfo_t& _info, std::string& _log) { __attribute__((unused)) int i = 0; return true; } -void TSpy::TestFun0() -{ +void TSpy::TestFun0() { return reinterpret_cast(This())->TestFun0(); } -int TSpy::__TestFun1(int i) -{ +int TSpy::__TestFun1(int i) { return reinterpret_cast(This())->__TestFun1(i); } - diff --git a/mars/comm/debugger/testspy.h b/mars/comm/debugger/testspy.h index c65c44f03..f19aee324 100644 --- a/mars/comm/debugger/testspy.h +++ b/mars/comm/debugger/testspy.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -17,22 +17,23 @@ // Created by yerungui on 14-5-13. // - #define SPY_DEF_CLASS_NAME TSpy #define SPY_DEF_XLOGGER_HOOK TSpy::SpyHookLogFunc #include "comm/debugger/spy.inl" -class TSpy : public Spy { - public: - TSpy(void* _this): Spy(_this) {} - +class TSpy : public Spy { + public: + TSpy(void* _this) : Spy(_this) { + } static bool SpyHookLogFunc(struct XLoggerInfo_t& _info, std::string& _log); void TestFun0(); int __TestFun1(int i); - private: - virtual void __OnAttach(const char* _key) {} - virtual void __OnDetach(const char* _key) {} + private: + virtual void __OnAttach(const char* _key) { + } + virtual void __OnDetach(const char* _key) { + } }; diff --git a/mars/comm/dns/dns.cc b/mars/comm/dns/dns.cc index 254a1d402..da8c9c2de 100644 --- a/mars/comm/dns/dns.cc +++ b/mars/comm/dns/dns.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * comm_dns.cc * @@ -19,15 +18,21 @@ */ #include "dns/dns.h" -#include "socket/unix_socket.h" -#include "xlogger/xlogger.h" -#include "time_utils.h" + +#include "mars/comm/macro.h" +#include "mars/comm/network/getaddrinfo_with_timeout.h" +#include "network/getdnssvraddrs.h" +#include "socket/local_ipstack.h" #include "socket/socket_address.h" +#include "socket/unix_socket.h" #include "thread/condition.h" -#include "thread/thread.h" #include "thread/lock.h" +#include "thread/thread.h" +#include "time_utils.h" +#include "xlogger/xlogger.h" -#include "network/getdnssvraddrs.h" +namespace mars { +namespace comm { enum { kGetIPDoing, @@ -38,24 +43,43 @@ enum { }; struct dnsinfo { - thread_tid threadid; - DNS* dns; - DNS::DNSFunc dns_func; - std::string host_name; + thread_tid threadid; + DNS* dns; + // DNS::DNSFunc dns_func; + std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)> dns_func; + std::string host_name; std::vector result; int status; + bool longlink_host = false; + std::map extra_info; }; +/* + */ -static std::vector sg_dnsinfo_vec; -static Condition sg_condition; -static Mutex sg_mutex; - -static void __GetIP() { +std::string DNSInfoToString(const struct dnsinfo& _info) { + XMessage msg; + msg(TSF "info:%_, threadid:%_, dns:%_, host_name:%_, status:%_", + &_info, + _info.threadid, + _info.dns, + _info.host_name, + _info.status); + return msg.Message(); +} +NO_DESTROY static std::vector sg_dnsinfo_vec; +NO_DESTROY static Condition sg_condition; +NO_DESTROY static Mutex sg_mutex; +void DNS::__GetIP() { xverbose_function(); + auto start_time = ::gettickcount(); std::string host_name; - DNS::DNSFunc dnsfunc = NULL; + // DNS::DNSFunc dnsfunc = NULL; + std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)> dnsfunc; + bool longlink_host = false; + int status = kGetIPDoing; + std::map extra_info; ScopedLock lock(sg_mutex); std::vector::iterator iter = sg_dnsinfo_vec.begin(); @@ -64,23 +88,44 @@ static void __GetIP() { if (iter->threadid == ThreadUtil::currentthreadid()) { host_name = iter->host_name; dnsfunc = iter->dns_func; + longlink_host = iter->longlink_host; + status = iter->status; + extra_info = iter->extra_info; break; } } lock.unlock(); - + xdebug2(TSF "dnsfunc is null: %_, %_", host_name, (dnsfunc == NULL)); if (NULL == dnsfunc) { - - struct addrinfo hints, *single, *result; + // + xgroup2_define(log_group); + std::vector dnssvraddrs; + mars::comm::getdnssvraddrs(dnssvraddrs); + xinfo2("dns server:") >> log_group; + for (std::vector::iterator iter = dnssvraddrs.begin(); iter != dnssvraddrs.end(); ++iter) { + xinfo2(TSF "%_:%_ ", iter->ip(), iter->port()) >> log_group; + } + // + struct addrinfo hints, *single, *result; memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET; hints.ai_socktype = SOCK_STREAM; - //in iOS work fine, in Android ipv6 stack get ipv4-ip fail - //and in ipv6 stack AI_ADDRCONFIGd will filter ipv4-ip but we ipv4-ip can use by nat64 - // hints.ai_flags = AI_V4MAPPED|AI_ADDRCONFIG; - int error = getaddrinfo(host_name.c_str(), NULL, &hints, &result); + // in iOS work fine, in Android ipv6 stack get ipv4-ip fail + // and in ipv6 stack AI_ADDRCONFIGd will filter ipv4-ip but we ipv4-ip can use by nat64 + // hints.ai_flags = AI_V4MAPPED|AI_ADDRCONFIG; + int error = 0; + TLocalIPStack ipstack = local_ipstack_detect(); + // when getaddrinfo fail will cost most than 30s + bool is_timeout = false; + if (ELocalIPStack_IPv4 == ipstack) { + // error = getaddrinfo(host_name.c_str(), NULL, &hints, &result); + error = getaddrinfo_with_timeout(host_name.c_str(), NULL, &hints, &result, is_timeout, 1000); + } else { + // error = getaddrinfo(host_name.c_str(), NULL, /*&hints*/ NULL, &result); + error = getaddrinfo_with_timeout(host_name.c_str(), NULL, NULL, &result, is_timeout, 1000); + } lock.lock(); @@ -92,9 +137,15 @@ static void __GetIP() { } if (error != 0) { - xwarn2(TSF"error, error:%0, hostname:%1", error, host_name.c_str()); + xwarn2(TSF "error, error:%_/%_, hostname:%_, ipstack:%_ is_timeout:%_", + error, + strerror(error), + host_name.c_str(), + ipstack, + is_timeout); - if (iter != sg_dnsinfo_vec.end()) iter->status = kGetIPFail; + if (iter != sg_dnsinfo_vec.end()) + iter->status = kGetIPFail; sg_condition.notifyAll(); return; @@ -105,75 +156,82 @@ static void __GetIP() { } for (single = result; single; single = single->ai_next) { - if (PF_INET != single->ai_family) { - xassert2(false); - continue; - } - - sockaddr_in* addr_in = (sockaddr_in*)single->ai_addr; - struct in_addr convertAddr; - // In Indonesia, if there is no ipv6's ip, operators return 0.0.0.0. - if (INADDR_ANY == addr_in->sin_addr.s_addr || INADDR_NONE == addr_in->sin_addr.s_addr) { - xwarn2(TSF"hehe, addr_in->sin_addr.s_addr:%0", addr_in->sin_addr.s_addr); - continue; + if (PF_INET == single->ai_family) { + sockaddr_in* addr_in = (sockaddr_in*)single->ai_addr; + // struct in_addr convertAddr; + if (INADDR_ANY == addr_in->sin_addr.s_addr || INADDR_NONE == addr_in->sin_addr.s_addr) { + xwarn2(TSF "hehe, addr_in->sin_addr.s_addr:%0", addr_in->sin_addr.s_addr); + continue; + } } - convertAddr.s_addr = addr_in->sin_addr.s_addr; - const char* ip = socket_address(convertAddr).ip(); + // convertAddr.s_addr = addr_in->sin_addr.s_addr; + socket_address sock_addr(single->ai_addr); + const char* ip = sock_addr.ip(); - if (!socket_address(ip, 0).valid()) { - xerror2(TSF"ip is invalid, ip:%0", ip); + if (!socket_address(ip, 0).valid_server_address(false, true)) { + xerror2(TSF "ip is invalid, ip:%0", ip); continue; } iter->result.push_back(ip); } - if (iter->result.empty()) { - xgroup2_define(log_group); - std::vector dnssvraddrs; - getdnssvraddrs(dnssvraddrs); - - xinfo2("dns server:") >> log_group; - for (std::vector::iterator iter = dnssvraddrs.begin(); iter != dnssvraddrs.end(); ++iter) { - xinfo2(TSF"%_:%_ ", iter->ip(), iter->port()) >> log_group; - } + // + xgroup2_define(ip_group); + xinfo2(TSF "host %_ resolved iplist: ", host_name) >> ip_group; + for (auto ip : iter->result) { + xinfo2(TSF "%_,", ip) >> ip_group; } - + freeaddrinfo(result); iter->status = kGetIPSuc; + xinfo2(TSF "cost time dns: %_", (::gettickcount() - start_time)) >> ip_group; sg_condition.notifyAll(); } } else { - std::vector ips = dnsfunc(host_name); + auto start_time = ::gettickcount(); + std::vector ips; + if (status != kGetIPCancel) { // 此时iter可能已经失效了 + ips = dnsfunc(host_name, longlink_host, extra_info); + } + lock.lock(); - + iter = sg_dnsinfo_vec.begin(); for (; iter != sg_dnsinfo_vec.end(); ++iter) { if (iter->threadid == ThreadUtil::currentthreadid()) { break; } } - + if (iter != sg_dnsinfo_vec.end()) { - iter->status = ips.empty()? kGetIPFail:kGetIPSuc; + iter->status = ips.empty() ? kGetIPFail : kGetIPSuc; iter->result = ips; } + + xinfo2(TSF "cost time newdns: %_ host:%_", (::gettickcount() - start_time), host_name); sg_condition.notifyAll(); } } /////////////////////////////////////////////////////////////////// -DNS::DNS(DNSFunc _dnsfunc):dnsfunc_(_dnsfunc) { +DNS::DNS(const std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)>& _dnsfunc) +: dnsfunc_(_dnsfunc) { } DNS::~DNS() { Cancel(); } -bool DNS::GetHostByName(const std::string& _host_name, std::vector& ips, long millsec, DNSBreaker* _breaker) { - xverbose_function(); +bool DNS::GetHostByName(const std::string& _host_name, + std::vector& ips, + long millsec, + DNSBreaker* _breaker, + bool _longlink_host, + const std::map& _extra_info) { + xverbose_function("host: %s, longlink: %d", _host_name.c_str(), _longlink_host); xassert2(!_host_name.empty()); @@ -183,13 +241,14 @@ bool DNS::GetHostByName(const std::string& _host_name, std::vector& ScopedLock lock(sg_mutex); - if (_breaker && _breaker->isbreak) return false; + if (_breaker && _breaker->isbreak) + return false; - Thread thread(&__GetIP, _host_name.c_str()); + Thread thread(std::bind(&DNS::__GetIP, this), _host_name.c_str()); int startRet = thread.start(); if (startRet != 0) { - xerror2(TSF"start the thread fail"); + xerror2(TSF "start the thread fail"); return false; } @@ -199,9 +258,12 @@ bool DNS::GetHostByName(const std::string& _host_name, std::vector& info.dns_func = dnsfunc_; info.dns = this; info.status = kGetIPDoing; + info.longlink_host = _longlink_host; + info.extra_info = _extra_info; sg_dnsinfo_vec.push_back(info); - if (_breaker) _breaker->dnsstatus = &(sg_dnsinfo_vec.back().status); + if (_breaker) + _breaker->dnsstatus = &(sg_dnsinfo_vec.back().status); uint64_t time_end = gettickcount() + (uint64_t)millsec; @@ -219,9 +281,8 @@ bool DNS::GetHostByName(const std::string& _host_name, std::vector& } xassert2(it != sg_dnsinfo_vec.end()); - - if (it != sg_dnsinfo_vec.end()){ + if (it != sg_dnsinfo_vec.end()) { if (ETIMEDOUT == wait_ret) { it->status = kGetIPTimeout; } @@ -231,25 +292,41 @@ bool DNS::GetHostByName(const std::string& _host_name, std::vector& } if (kGetIPSuc == it->status) { - ips = it->result; - - if (_breaker) _breaker->dnsstatus = NULL; - - sg_dnsinfo_vec.erase(it); - return true; + if (_host_name == it->host_name) { + ips = it->result; + + if (_breaker) + _breaker->dnsstatus = NULL; + + sg_dnsinfo_vec.erase(it); + return true; + } else { + std::vector::iterator iter = sg_dnsinfo_vec.begin(); + int i = 0; + for (; iter != sg_dnsinfo_vec.end(); ++iter) { + xerror2(TSF "sg_info_vec[%_]:%_", i++, DNSInfoToString(*iter)); + } + if (monitor_func_) + monitor_func_(kDNSThreadIDError); + xassert2(false, TSF "_host_name:%_, it->host_name:%_", _host_name, it->host_name); + return false; + } } if (kGetIPTimeout == it->status || kGetIPCancel == it->status || kGetIPFail == it->status) { - if (_breaker) _breaker->dnsstatus = NULL; + if (_breaker) + _breaker->dnsstatus = NULL; - xinfo2(TSF "dns get ip status:%_", it->status); + // xinfo2(TSF "dns get ip status:%_ host:%_, func:%_", it->status, it->host_name, it->dns_func); + xinfo2(TSF "dns get ip status:%_ host:%_", it->status, it->host_name); sg_dnsinfo_vec.erase(it); return false; } xassert2(false, "%d", it->status); - if (_breaker) _breaker->dnsstatus = NULL; + if (_breaker) + _breaker->dnsstatus = NULL; sg_dnsinfo_vec.erase(it); } @@ -268,11 +345,12 @@ void DNS::Cancel(const std::string& _host_name) { if (_host_name.empty() && info.dns == this) { info.status = kGetIPCancel; + info.dns_func = NULL; } if (info.host_name.compare(_host_name) == 0 && info.dns == this) { info.status = kGetIPCancel; - break; + info.dns_func = NULL; } } @@ -283,7 +361,11 @@ void DNS::Cancel(DNSBreaker& _breaker) { ScopedLock lock(sg_mutex); _breaker.isbreak = true; - if (_breaker.dnsstatus) *(_breaker.dnsstatus) = kGetIPCancel; + if (_breaker.dnsstatus) + *(_breaker.dnsstatus) = kGetIPCancel; sg_condition.notifyAll(); } + +} // namespace comm +} // namespace mars diff --git a/mars/comm/dns/dns.h b/mars/comm/dns/dns.h index 05df38075..2d69fed21 100644 --- a/mars/comm/dns/dns.h +++ b/mars/comm/dns/dns.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * dns.h * @@ -23,29 +22,64 @@ #include #include +#include + +#include "boost/function.hpp" + +namespace mars { +namespace comm { + +struct dnsinfo; struct DNSBreaker { - DNSBreaker(): isbreak(false), dnsstatus(NULL) {} - bool isbreak; - int* dnsstatus; + DNSBreaker() : isbreak(false), dnsstatus(NULL) { + } + bool isbreak; + int* dnsstatus; + + void Clear() { + isbreak = false; + dnsstatus = NULL; + } }; class DNS { - public: - typedef std::vector (*DNSFunc)(const std::string& host); + public: + // typedef std::vector (*DNSFunc)(const std::string& _host, bool _longlink_host); - public: - DNS(DNSFunc _dnsfunc=NULL); + public: + DNS(const std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)>& _dnsfunc = NULL); ~DNS(); - - public: - bool GetHostByName(const std::string& _host_name, std::vector& ips, long millsec = 2 * 1000, DNSBreaker* _breaker = NULL); + + public: + bool GetHostByName(const std::string& _host_name, + std::vector& ips, + long millsec = 2000, + DNSBreaker* _breaker = NULL, + bool _longlink_host = false, + const std::map& _extra_info = {}); void Cancel(const std::string& _host_name = std::string()); void Cancel(DNSBreaker& _breaker); - - private: - DNSFunc dnsfunc_; -}; + void SetMonitorFunc(const boost::function& _monitor_func) { + monitor_func_ = _monitor_func; + } + + void SetDnsFunc( + const std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)>& _dnsfunc) { + dnsfunc_ = _dnsfunc; + } + + private: + void __GetIP(); + + private: + // DNSFunc dnsfunc_; + std::function(const std::string& _host, bool _longlink_host, const std::map& _extra_info)> dnsfunc_; + boost::function monitor_func_; + static const int kDNSThreadIDError = 0; +}; +} // namespace comm +} // namespace mars #endif /* COMM_COMM_DNS_H_ */ diff --git a/mars/comm/fd_info.cc b/mars/comm/fd_info.cc new file mode 100644 index 000000000..57d693211 --- /dev/null +++ b/mars/comm/fd_info.cc @@ -0,0 +1,154 @@ +// +// fd_info.cpp +// cdn +// +// Created by perryzhou on 2019/1/4. +// + +#include "fd_info.h" +#include + +#ifndef WIN32 +#include +#include +#include +#include +#include +#include +#include +#endif + +static bool get_fd_path(int fd, char szbuf[1024]) { +#ifdef __APPLE__ + return -1 != fcntl(fd, F_GETPATH, szbuf); +#endif + +#ifdef __ANDROID__ + char path[64]; + snprintf(path, sizeof(path), "/proc/self/fd/%d", fd); + ssize_t length = ::readlink(path, szbuf, 1023); + if (length > 0) { + szbuf[length] = '\0'; + return true; + } +#endif + + return false; +} + +namespace mars { +namespace comm { + +bool FDI::IsSocket() const { +#ifndef WIN32 + return type == S_IFSOCK; +#else + return true; +#endif +} +bool FDI::IsFile() const { +#ifndef WIN32 + return type == S_IFREG; +#else + return true; +#endif +} +bool FDI::IsPipe() const { +#ifndef WIN32 + return type == S_IFIFO; +#else + return true; +#endif +} + +FDI FDInfo::QueryFD(int fd) { + FDI item; + item.fd = fd; + +#ifndef WIN32 + int flags = fcntl(fd, F_GETFD, 0); + if (-1 == flags) { + item.error = errno; + item.path_or_name = ""; + } else { + struct stat statbuf; + if (fstat(fd, &statbuf) == 0) { + item.type = (S_IFMT & statbuf.st_mode); + item.path_or_name = ""; + + char szbuf[1024] = {0}; + if (get_fd_path(fd, szbuf)) { + const char* path = strrchr(szbuf, '/'); + if (path != nullptr) { + item.path_or_name = path; + } else { + item.path_or_name = szbuf; + } + } + } + } +#endif + return item; +} + +std::list FDInfo::QueryFDInfo(int maxfd) { + std::list result; + for (int fd = 0; fd < maxfd; fd++) { + result.push_back(QueryFD(fd)); + } + return result; +} + +static const char* type2name(int type) { +#ifndef WIN32 + switch (type) { + case S_IFIFO: + return "named pipe"; + case S_IFCHR: + return "character special"; + case S_IFDIR: + return "directory"; + case S_IFBLK: + return "block special"; + case S_IFREG: + return "regular"; + case S_IFLNK: + return "symbolic link"; + case S_IFSOCK: + return "socket"; + default: + return ""; + } +#else + return ""; +#endif +} + +std::list FDInfo::PrettyFDInfo(const std::list& fdi) { + std::list result; +#ifndef WIN32 + char szline[1024]; + std::string part; + for (auto item : fdi) { + if (part.length() >= 8192) { + result.push_back(part); + part.clear(); + } + size_t rv = snprintf(szline, + 1024, + "\r\n%d|%d|%d(%s)|%s", + item.fd, + item.error, + item.type, + type2name(item.type), + item.path_or_name.c_str()); + part.append(szline, rv); + } + result.push_back(part); +#endif + + return result; +} + +} // namespace comm +}; // namespace mars diff --git a/mars/comm/fd_info.h b/mars/comm/fd_info.h new file mode 100644 index 000000000..9a36cef4e --- /dev/null +++ b/mars/comm/fd_info.h @@ -0,0 +1,34 @@ +// +// fd_info.hpp +// cdn +// +// Created by perryzhou on 2019/1/4. +// + +#pragma once + +#include +#include + +namespace mars { +namespace comm { +struct FDI { + int fd = 0; + int type = 0; + int error = 0; + std::string path_or_name; + + bool IsSocket() const; + bool IsFile() const; + bool IsPipe() const; +}; + +class FDInfo { + public: + static FDI QueryFD(int fd); + static std::list QueryFDInfo(int maxfd); + static std::list PrettyFDInfo(const std::list& fdi); +}; + +} // namespace comm +}; // namespace mars diff --git a/mars/comm/has_member.h b/mars/comm/has_member.h index 8db6cbbb7..3628519c4 100644 --- a/mars/comm/has_member.h +++ b/mars/comm/has_member.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -22,34 +22,48 @@ #define COMM_HAS_MEMBER_H_ template -struct bool_type { -}; - - -#define DEFINE_HAS_MEMBER_WITH_TYPE(member_name, member_type) \ - template \ - class has_##member_name {\ - private:\ - struct yes_type { char x[1]; };\ - struct no_type { char x[2]; };\ - template struct tester;\ - template static yes_type test(tester<&U::member_name>*);\ - template static no_type test(...);\ - public:\ - static const bool value = (sizeof(test(0)) == sizeof(yes_type));\ +struct bool_type {}; + +#define DEFINE_HAS_MEMBER_WITH_TYPE(member_name, member_type) \ + template \ + class has_##member_name { \ + private: \ + struct yes_type { \ + char x[1]; \ + }; \ + struct no_type { \ + char x[2]; \ + }; \ + template \ + struct tester; \ + template \ + static yes_type test(tester<&U::member_name>*); \ + template \ + static no_type test(...); \ + \ + public: \ + static const bool value = (sizeof(test(0)) == sizeof(yes_type)); \ }; -#define DEFINE_HAS_MEMBER(member_name) \ - template \ - class has_##member_name {\ - private:\ - struct yes_type { char x[1]; };\ - struct no_type { char x[2]; };\ - template struct tester;\ - template static yes_type test(tester*);\ - template static no_type test(...);\ - public:\ - static const bool value = (sizeof(test(0)) == sizeof(yes_type));\ +#define DEFINE_HAS_MEMBER(member_name) \ + template \ + class has_##member_name { \ + private: \ + struct yes_type { \ + char x[1]; \ + }; \ + struct no_type { \ + char x[2]; \ + }; \ + template \ + struct tester; \ + template \ + static yes_type test(tester*); \ + template \ + static no_type test(...); \ + \ + public: \ + static const bool value = (sizeof(test(0)) == sizeof(yes_type)); \ }; #endif diff --git a/mars/comm/http.cc b/mars/comm/http.cc index e1e9c7e20..aa90622af 100644 --- a/mars/comm/http.cc +++ b/mars/comm/http.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -19,11 +19,16 @@ #include "http.h" -#include +#include #include +#include +#ifdef WIN32 +#include +#endif // WIN32 #include "comm/strutil.h" #include "comm/xlogger/xlogger.h" +#include "comm/xlogger/xloggerbase.h" namespace http { @@ -31,6 +36,10 @@ static const char* const KStringSpace = " "; static const char* const KStringCRLF = "\r\n"; static const char* const KStringColon = ":"; +bool less::operator()(const std::string& __x, const std::string& __y) const { + return 0 > strcasecmp(__x.c_str(), __y.c_str()); +} + inline char* string_strnstr(const char* src, const char* sfind, int pos1) { xassert2(src != NULL && sfind != NULL); @@ -65,61 +74,49 @@ static THttpVersion __GetHttpVersion(const std::string& _strVersion) { } } - xerror2(TSF"invalid httpversion:%_", _strVersion); + xerror2(TSF "invalid httpversion:%_", _strVersion); return kVersion_Unknow; } static bool __ParserHeaders(const std::string& _strHeaders, HeaderFields& _headers) { - std::string::size_type linebegin = 0; std::string::size_type lineend = 0; - - while ((lineend = _strHeaders.find(KStringCRLF, lineend, strlen(KStringCRLF))) != std::string::npos){ - + + while ((lineend = _strHeaders.find(KStringCRLF, lineend, strlen(KStringCRLF))) != std::string::npos) { std::string line = _strHeaders.substr(linebegin, lineend - linebegin); - + std::string::size_type namebegin = line.find_first_not_of(KStringColon, 0, strlen(KStringColon)); - if (namebegin != std::string::npos){ + if (namebegin != std::string::npos) { std::string::size_type nameend = line.find_first_of(KStringColon, 0, strlen(KStringColon)); std::string name = line.substr(0, nameend); - if (line.length() > nameend + strlen(KStringColon)){ + if (line.length() > nameend + strlen(KStringColon)) { std::string value = line.substr(nameend + strlen(KStringColon)); - + strutil::Trim(name); strutil::Trim(value); - + _headers.HeaderFiled(name.c_str(), value.c_str()); } } - + lineend += strlen(KStringCRLF); linebegin = lineend; } - + return true; } // implement of RequestLine -const char* const RequestLine::kHttpMethodString[kMax] = { - "UNKNOWN", - "GET", - "POST", - "OPTIONS", - "HEAD", - "PUT", - "DELETE", - "TRACE", - "CONNECT" -}; +const char* const RequestLine::kHttpMethodString[kMax] = + {"UNKNOWN", "GET", "POST", "OPTIONS", "HEAD", "PUT", "DELETE", "TRACE", "CONNECT"}; -RequestLine::RequestLine(): http_method_(kGet), http_version_(kVersion_1_0) { } +RequestLine::RequestLine() : http_method_(kGet), http_version_(kVersion_1_0) { +} RequestLine::RequestLine(THttpMethod _httpMethod, const char* _url, THttpVersion _httpVersion) - : http_method_(_httpMethod) - , req_url_(_url) - , http_version_(_httpVersion) -{ } +: http_method_(_httpMethod), req_url_(_url), http_version_(_httpVersion) { +} void RequestLine::Method(RequestLine::THttpMethod _method) { http_method_ = _method; @@ -129,7 +126,6 @@ RequestLine::THttpMethod RequestLine::Method() const { return http_method_; } - void RequestLine::Version(THttpVersion _version) { http_version_ = _version; } @@ -161,7 +157,8 @@ std::string RequestLine::ToString() const { bool RequestLine::FromString(const std::string& _requestline) { std::string::size_type pos = _requestline.find(KStringCRLF); - if (pos == std::string::npos) return false; + if (pos == std::string::npos) + return false; std::string str = _requestline.substr(0, pos); std::vector strVer; @@ -170,8 +167,8 @@ bool RequestLine::FromString(const std::string& _requestline) { xassert2(strVer.size() >= 3); if (strVer.size() < 3) { -// xerror2(TSF"requestline:%_, strver:%_", _requestline.c_str(), str.c_str()); - xassert2(false, "requestline:%s, strver:%s", _requestline.c_str(), str.c_str()); + // xerror2(TSF"requestline:%_, strver:%_", _requestline.c_str(), str.c_str()); + xassert2(false, TSF "requestline:%_, strver:%_", _requestline.c_str(), str.c_str()); return false; } @@ -185,7 +182,7 @@ bool RequestLine::FromString(const std::string& _requestline) { } if (kUnknown == httpmethod) { - xerror2(TSF"invalid http method:%_", strVer[0].c_str()); + xerror2(TSF "invalid http method:%_", strVer[0].c_str()); return false; } @@ -193,18 +190,16 @@ bool RequestLine::FromString(const std::string& _requestline) { req_url_ = strVer[1]; http_version_ = __GetHttpVersion(strVer[2]); - if (http_version_ == kVersion_Unknow) return false; + if (http_version_ == kVersion_Unknow) + return false; return true; } - // implement of StatusLine -StatusLine::StatusLine() - : http_version_(kVersion_1_0) - , statuscode_(0) -{} +StatusLine::StatusLine() : http_version_(kVersion_1_0), statuscode_(0) { +} StatusLine::StatusLine(THttpVersion _httpversion, int _statuscode, const std::string& _reasonphrase) { http_version_ = _httpversion; @@ -254,7 +249,8 @@ std::string StatusLine::ToString() const { bool StatusLine::FromString(const std::string& _statusline) { std::string::size_type pos = _statusline.find(KStringCRLF); - if (pos == std::string::npos) return false; + if (pos == std::string::npos) + return false; std::string str = _statusline.substr(0, pos); std::vector strVer; @@ -263,13 +259,14 @@ bool StatusLine::FromString(const std::string& _statusline) { xassert2(strVer.size() >= 2); if (strVer.size() < 2) { - xerror2(TSF"strVer.size() < 2, _statusline=%0", _statusline.c_str()); + xerror2(TSF "strVer.size() < 2, _statusline=%0", _statusline.c_str()); return false; } http_version_ = __GetHttpVersion(strVer[0]); - if (http_version_ == kVersion_Unknow) return false; + if (http_version_ == kVersion_Unknow) + return false; statuscode_ = (int)strtol(strVer[1].c_str(), NULL, 10); @@ -280,16 +277,15 @@ bool StatusLine::FromString(const std::string& _statusline) { return true; } - - // implement of HeaderFields - const char* const HeaderFields::KStringHost = "Host"; const char* const HeaderFields::KStringAccept = "Accept"; const char* const HeaderFields::KStringUserAgent = "User-Agent"; const char* const HeaderFields::KStringCacheControl = "Cache-Control"; const char* const HeaderFields::KStringConnection = "Connection"; +const char* const HeaderFields::kStringProxyConnection = "Proxy-Connection"; +const char* const HeaderFields::kStringProxyAuthorization = "Proxy-Authorization"; const char* const HeaderFields::KStringContentType = "Content-Type"; const char* const HeaderFields::KStringContentLength = "Content-Length"; const char* const HeaderFields::KStringTransferEncoding = "Transfer-Encoding"; @@ -300,20 +296,21 @@ const char* const HeaderFields::KStringMicroMessenger = "MicroMessenger Client"; const char* const HeaderFields::KStringRange = "Range"; const char* const HeaderFields::KStringLocation = "Location"; const char* const HeaderFields::KStringReferer = "Referer"; +const char* const HeaderFields::kStringServer = "Server"; +const char* const HeaderFields::KStringKeepalive = "Keep-Alive"; const char* const KStringChunked = "chunked"; const char* const KStringClose = "close"; -const char* const KStringKeepalive = "Keep-Alive"; const char* const KStringAcceptAll = "*/*"; -const char* const KStringAcceptEncodingDefalte = "defalte"; +const char* const KStringAcceptEncodingDeflate = "deflate"; +const char* const KStringAcceptEncodingGzip = "gzip"; const char* const KStringNoCache = "no-cache"; const char* const KStringOctetType = "application/octet-stream"; +const char* const KStringKeepAliveTimeout = "timeout="; +const uint32_t KDefaultKeepAliveTimeout = 5; - -std::pair HeaderFields::MakeContentLength(int _len) { - char strLength[16] = {0}; - snprintf(strLength, sizeof(strLength), "%d", _len); - return std::make_pair(KStringContentLength, strLength); +std::pair HeaderFields::MakeContentLength(uint64_t _len) { + return std::make_pair(KStringContentLength, std::to_string(_len)); } std::pair HeaderFields::MakeTransferEncodingChunked() { @@ -332,9 +329,11 @@ std::pair HeaderFields::MakeAcceptAll() { } std::pair HeaderFields::MakeAcceptEncodingDefalte() { - return std::make_pair(KStringAcceptEncoding, KStringAcceptEncodingDefalte); + return std::make_pair(KStringAcceptEncoding, KStringAcceptEncodingDeflate); +} +std::pair HeaderFields::MakeAcceptEncodingGzip() { + return std::make_pair(KStringAcceptEncoding, KStringAcceptEncodingGzip); } - std::pair HeaderFields::MakeCacheControlNoCache() { return std::make_pair(KStringCacheControl, KStringNoCache); } @@ -343,57 +342,131 @@ std::pair HeaderFields::MakeContentTypeOctetStre return std::make_pair(KStringContentType, KStringOctetType); } +std::pair HeaderFields::MakeUserAgentMicroMessage() { + return std::make_pair(KStringUserAgent, KStringMicroMessenger); +} + +void HeaderFields::CopyFrom(const HeaderFields& rhs) { + headers_.clear(); + headers_.insert(rhs.headers_.begin(), rhs.headers_.end()); +} void HeaderFields::HeaderFiled(const char* _name, const char* _value) { - headers_.insert(std::pair(_name, _value)); + InsertOrUpdate(std::make_pair(_name, _value)); } void HeaderFields::HeaderFiled(const std::pair& _headerfield) { - headers_.insert(_headerfield); + InsertOrUpdate(_headerfield); } -void HeaderFields::HeaderFiled(const http::HeaderFields& _headerfields) { - headers_.insert(_headerfields.headers_.begin(), _headerfields.headers_.end()); +void HeaderFields::InsertOrUpdate(const std::pair& _headerfield) { + headers_[_headerfield.first] = _headerfield.second; } -const char* HeaderFields::HeaderField(const char* _key) const { - std::map::const_iterator iter = headers_.find(_key); +void HeaderFields::Manipulate(const std::pair& _headerfield) { + std::string v = _headerfield.second; + if (strutil::Trim(v).empty()) { + // empty value means remove header + xwarn2(TSF "remove field %_ from request.", _headerfield.first); + headers_.erase(_headerfield.first); + } else { + InsertOrUpdate(_headerfield); + } +} +const char* HeaderFields::HeaderField(const char* _key) const { + auto iter = headers_.find(_key); if (iter != headers_.end()) { return iter->second.c_str(); } - - return NULL; + return nullptr; } -bool HeaderFields::IsTransferEncodingChunked() { +bool HeaderFields::IsTransferEncodingChunked() const { const char* transferEncoding = HeaderField(HeaderFields::KStringTransferEncoding); + return (transferEncoding != nullptr) && 0 == strcasecmp(transferEncoding, KStringChunked); +} - if (transferEncoding && 0 == strcasecmp(transferEncoding, KStringChunked)) return true; +bool HeaderFields::IsConnectionClose() const { + const char* conn = HeaderField(HeaderFields::KStringConnection); + return (conn != nullptr) && 0 == strcasecmp(conn, KStringClose); +} - return false; +bool HeaderFields::IsConnectionKeepAlive() const { + const char* conn = HeaderField(HeaderFields::KStringConnection); + return (conn != nullptr) && 0 == strcasecmp(conn, KStringKeepalive); +} + +uint32_t HeaderFields::KeepAliveTimeout() const { + if (NULL == HeaderField(HeaderFields::KStringConnection)) { + return KDefaultKeepAliveTimeout; + } + std::string aliveConfig = strutil::CStr2StringSafe(HeaderField(HeaderFields::KStringKeepalive)); + if (aliveConfig.length() <= 0 || aliveConfig.find(KStringKeepAliveTimeout) == std::string::npos) { + return KDefaultKeepAliveTimeout; + } + + std::vector tokens; + strutil::SplitToken(aliveConfig, ",", tokens); + auto iter = tokens.begin(); + while (iter != tokens.end()) { + size_t pos = iter->find(KStringKeepAliveTimeout); + if (pos != std::string::npos) { + const char* value = iter->c_str() + sizeof(KStringKeepAliveTimeout); + int timeout = (int)strtol(value, NULL, 10); + if (timeout > 0 && timeout < 60) + return (uint32_t)timeout; + return KDefaultKeepAliveTimeout; + } + iter++; + } + return KDefaultKeepAliveTimeout; } -int HeaderFields::ContentLength() { +uint64_t HeaderFields::ContentLength() const { const char* strContentLength = HeaderField(HeaderFields::KStringContentLength); - int contentLength = 0; + uint64_t contentLength = 0; if (strContentLength) { - contentLength = (int)strtol(strContentLength, NULL, 10); + contentLength = strtoull(strContentLength, NULL, 10); } return contentLength; } +bool HeaderFields::Range(long& _start, long& _end) const { + const char* strRange = HeaderField(HeaderFields::KStringRange); + if (NULL == strRange) { + return false; + } + + std::string range(strRange); + if (!strutil::StartsWith(range, std::string("bytes="))) { + return false; + } + std::string bytes = range.substr(6); + strutil::Trim(bytes); -bool HeaderFields::ContentRange(int* start, int* end, int* total) { + size_t range_start = bytes.find('-'); + if (std::string::npos == range_start) { + return false; + } + + std::string startstr = bytes.substr(0, range_start); + _start = strtol(startstr.c_str(), NULL, 10); + std::string endstr = bytes.substr(range_start + 1); + _end = strtol(endstr.c_str(), NULL, 10); + return true; +} + +bool HeaderFields::ContentRange(const std::string& line, uint64_t* start, uint64_t* end, uint64_t* total) { // Content-Range: bytes 0-102400/102399 *start = 0; *end = 0; *total = 0; - const char* strContentRange = HeaderField(HeaderFields::KStringContentRange); + const char* strContentRange = line.c_str(); if (strContentRange) { // bytes 0-102400/102399 @@ -405,21 +478,20 @@ bool HeaderFields::ContentRange(int* start, int* end, int* total) { std::string bytes = range.substr(6); strutil::Trim(bytes); - size_t range_start = bytes.find("-"); + size_t range_start = bytes.find('-'); if (std::string::npos != range_start) { std::string startstr = bytes.substr(0, range_start); - *start = (int)strtol(startstr.c_str(), NULL, 10); + *start = strtoull(startstr.c_str(), NULL, 10); - size_t range_end = bytes.find("/", range_start + 1); + size_t range_end = bytes.find('/', range_start + 1); if (range_end != std::string::npos) { std::string endstr = bytes.substr(range_start + 1, range_end - range_start - 1); - *end = (int)strtol(endstr.c_str(), NULL, 10); - + *end = strtoull(endstr.c_str(), NULL, 10); std::string totalstr = bytes.substr(range_end + 1); - *total = (int)strtol(totalstr.c_str(), NULL, 10); + *total = strtoull(totalstr.c_str(), NULL, 10); return true; } @@ -429,20 +501,33 @@ bool HeaderFields::ContentRange(int* start, int* end, int* total) { return false; } -const std::string HeaderFields::ToStrig() const { - if (headers_.empty()) return ""; - - std::string str; +bool HeaderFields::ContentRange(uint64_t* start, uint64_t* end, uint64_t* total) const { + *start = 0; + *end = 0; + *total = 0; - for (std::map::const_iterator iter = headers_.begin(); iter != headers_.end(); ++iter) { - str += iter->first + KStringColon + KStringSpace + iter->second + KStringCRLF; + const char* pline = HeaderField(HeaderFields::KStringContentRange); + if (!pline) { + return false; } + return ContentRange(pline, start, end, total); +} +std::string HeaderFields::ToString() const { + std::string str; + for (const auto& header : headers_) { + str += header.first + KStringColon + KStringSpace + header.second + KStringCRLF; + } return str; } - - +std::list> HeaderFields::GetAsList() const { + std::list> result; + for (const auto& entry : headers_) { + result.emplace_back(entry.first, entry.second); + } + return result; +} // implement of IStreamBodyProvider const char* IStreamBodyProvider::EofData() { @@ -461,15 +546,9 @@ void IStreamBodyProvider::AppendTail(AutoBuffer& _body) { _body.Write(KStringCRLF, strlen(KStringCRLF)); } - - - // implement of Builder -Builder::Builder(TCsMode _csmode) - : csmode_(_csmode) - , blockbody_(NULL) - , streambody_(NULL) - , is_manage_body_(false) {} +Builder::Builder(TCsMode _csmode) : csmode_(_csmode), blockbody_(NULL), streambody_(NULL), is_manage_body_(false) { +} Builder::~Builder() { if (is_manage_body_) { @@ -513,11 +592,10 @@ void Builder::BlockBody(IBlockBodyProvider* _body, bool _manage) { xassert2(streambody_ == NULL); if (NULL != streambody_) { - xerror2(TSF"setBlockBody, but streambody had set"); + xerror2(TSF "setBlockBody, but streambody had set"); return; } - if (NULL != blockbody_ && _manage) { delete blockbody_; blockbody_ = NULL; @@ -531,7 +609,7 @@ void Builder::StreamBody(IStreamBodyProvider* _body, bool _manage) { xassert2(blockbody_ == NULL); if (NULL != blockbody_) { - xerror2(TSF"setStreamBody, but blockbody had set"); + xerror2(TSF "setStreamBody, but blockbody had set"); return; } @@ -540,7 +618,6 @@ void Builder::StreamBody(IStreamBodyProvider* _body, bool _manage) { streambody_ = NULL; } - streambody_ = _body; is_manage_body_ = _manage; } @@ -569,11 +646,13 @@ bool Builder::HeaderToBuffer(AutoBuffer& _header) { else firstline = statusline_.ToString(); - if (firstline.empty()) return false; + if (firstline.empty()) + return false; - const std::string strheaders = headfields_.ToStrig(); + const std::string strheaders = headfields_.ToString(); - if (strheaders.empty()) return false; + if (strheaders.empty()) + return false; _header.Write(firstline.c_str(), firstline.size()); _header.Write(strheaders.c_str(), strheaders.size()); @@ -582,35 +661,38 @@ bool Builder::HeaderToBuffer(AutoBuffer& _header) { } bool Builder::HttpToBuffer(AutoBuffer& _http) { - if (!HeaderToBuffer(_http)) return false; - if (blockbody_) { if (blockbody_->Length() > 0) { - headfields_.MakeContentLength((int)blockbody_->Length()); - - if (!blockbody_->FillData(_http)) return false; + headfields_.HeaderFiled(headfields_.MakeContentLength((int)blockbody_->Length())); + if (!HeaderToBuffer(_http) || !blockbody_->FillData(_http)) + return false; } } else if (streambody_) { + headfields_.HeaderFiled(headfields_.MakeTransferEncodingChunked()); + if (!HeaderToBuffer(_http)) + return false; if (streambody_->HaveData()) { - if (!streambody_->Data(_http)) return false; + if (!streambody_->Data(_http)) + return false; } - - headfields_.MakeTransferEncodingChunked(); + } else { + return HeaderToBuffer(_http); } return true; } - // implement of Parser Parser::Parser(BodyReceiver* _body, bool _manage) - : recvstatus_(kStart) - , csmode_(kRespond) - , headfields_() - , bodyreceiver_(_body) - , is_manage_body_(_manage) - , headerlength_(0){ +: recvstatus_(kStart) +, response_header_ready_(false) +, csmode_(kRespond) +, headfields_() +, bodyreceiver_(_body) +, is_manage_body_(_manage) +, firstlinelength_(0) +, headerlength_(0) { } Parser::~Parser() { @@ -622,39 +704,65 @@ Parser::~Parser() { } } -Parser::TRecvStatus Parser::Recv(const void* _buffer, size_t _length) { - xassert2(_buffer); - - if (NULL == _buffer || 0 == _length) { - xwarn2(TSF"Recv(%_, %_), status:%_", _buffer, _length, recvstatus_); +Parser::TRecvStatus Parser::Recv(const void* _buffer, + size_t _length, + size_t* consumed_bytes, + bool only_parse_header /* = false*/) { + if ((NULL == _buffer || 0 == _length) && Fields().IsConnectionClose() && recvstatus_ == kBody) { + xwarn2(TSF "status:%_", recvstatus_); + recvstatus_ = kEnd; + bodyreceiver_->EndData(); return recvstatus_; } - + + if ((NULL == _buffer || 0 == _length)) { + xwarn2(TSF "Recv(%_, %_), status:%_", NULL == _buffer ? "NULL" : _buffer, _length, recvstatus_); + return recvstatus_; + } + + if (recvstatus_ < kBody && headerbuf_.Length() < 4096 && !response_header_ready_) { + headerbuf_.Write(_buffer, std::min(_length, (size_t)4096)); + + const char* pszbuf = (const char*)headerbuf_.Ptr(); + size_t length = headerbuf_.Length(); + + if (length > 4) { + char* pos = string_strnstr(pszbuf, "\r\n\r\n", (int)length); + if (pos != NULL) { + headerbuf_.Length(0, pos - pszbuf + 4); + response_header_ready_ = true; + } + } + } + recvbuf_.Write(_buffer, _length); - + size_t origin_size = recvbuf_.Length(); + while (true) { switch (recvstatus_) { case kStart: case kFirstLine: { char* pBuf = (char*)recvbuf_.Ptr(); char* pos = string_strnstr(pBuf, KStringCRLF, (int)recvbuf_.Length()); - if (NULL == pos && 8 * 1024 < recvbuf_.Length()) { - xerror2(TSF"wrong first line 8k buffer no found CRLF"); + xerror2(TSF "wrong first line 8k buffer no found CRLF"); recvstatus_ = kFirstLineError; return recvstatus_; } - + if (NULL == pos) { recvstatus_ = kFirstLine; + if (consumed_bytes) { + *consumed_bytes = _length; + } return recvstatus_; } - + ptrdiff_t firstlinelength = pos - pBuf + 2; std::string firstline = std::string(pBuf, (size_t)firstlinelength); - + bool parseFirstlineSuc = false; - + if (strutil::StartsWith(firstline, "HTTP/")) { if (statusline_.FromString(firstline)) { csmode_ = kRespond; @@ -666,313 +774,365 @@ Parser::TRecvStatus Parser::Recv(const void* _buffer, size_t _length) { parseFirstlineSuc = true; } } - + if (!parseFirstlineSuc) { - xerror2(TSF"wrong first line: %0", firstline); + xerror2(TSF "wrong first line: %0", firstline); recvstatus_ = kFirstLineError; return recvstatus_; } - - recvstatus_ = kHeaderFields; - recvbuf_.Move(- firstlinelength); - } - break; - + + // HTTP/1.1 4.7 Unauthorized\r\n\r\n + char* pos_2crlf = string_strnstr(pBuf, "\r\n\r\n", (int)recvbuf_.Length()); + if (NULL != pos_2crlf && pos_2crlf == pos) { + recvstatus_ = kBody; + recvbuf_.Move(-(firstlinelength + 2)); + } else { + recvstatus_ = kHeaderFields; + recvbuf_.Move(-firstlinelength); + } + + if (consumed_bytes) { + *consumed_bytes = origin_size - recvbuf_.Length(); + } + + firstlinelength_ = firstlinelength; + } break; + case kHeaderFields: { char* pBuf = (char*)recvbuf_.Ptr(); char* pos = string_strnstr(pBuf, "\r\n\r\n", (int)recvbuf_.Length()); - + if (NULL == pos && 128 * 1024 < recvbuf_.Length()) { - xerror2(TSF"wrong header fields 128k buffer no found CRLFCRLF"); + xerror2(TSF "wrong header fields 128k buffer no found CRLFCRLF"); recvstatus_ = kHeaderFieldsError; return recvstatus_; } - - if (NULL == pos) return recvstatus_; - + + if (NULL == pos) + return recvstatus_; + ptrdiff_t headerslength = pos - pBuf + 4; std::string headers = std::string(pBuf, (size_t)headerslength); - + bool ret = __ParserHeaders(headers, headfields_); - + if (false == ret) { recvstatus_ = kHeaderFieldsError; return recvstatus_; } - + recvstatus_ = kBody; recvbuf_.Move(-headerslength); - } - break; - + + if (consumed_bytes) { + *consumed_bytes = origin_size - recvbuf_.Length(); + } + + headerlength_ = headerslength; + if (only_parse_header) { + xwarn2(TSF "only parse headers."); + return recvstatus_; + } + } break; + case kBody: { xassert2(bodyreceiver_); - + if (bodyreceiver_) { // chunked - + if (headfields_.IsTransferEncodingChunked()) { char* chunkSizeBegin = (char*)recvbuf_.Ptr(); char* chunkSizeEnd = string_strnstr(chunkSizeBegin, KStringCRLF, (int)recvbuf_.Length()); - + if (NULL == chunkSizeEnd) { return recvstatus_; } - + std::string strChunkSize = std::string(chunkSizeBegin, chunkSizeEnd); strutil::Trim(strChunkSize); - + int64_t chunkSize = strtol(strChunkSize.c_str(), NULL, 16); - + ptrdiff_t sizeLen = chunkSizeEnd - chunkSizeBegin; - + if (0 != chunkSize) { - if ((ptrdiff_t)recvbuf_.Length() < chunkSize + sizeLen + 4) return recvstatus_; - + if ((ptrdiff_t)recvbuf_.Length() < chunkSize + sizeLen + 4) + return recvstatus_; + char* chunkBegin = chunkSizeEnd + 2; char* chunkEnd = chunkBegin + chunkSize; - + if (*chunkEnd != '\r' || *(chunkEnd + 1) != '\n') { recvstatus_ = kBodyError; return recvstatus_; } - + bodyreceiver_->AppendData(chunkBegin, (size_t)chunkSize); - + recvbuf_.Move(-(chunkEnd - chunkSizeBegin + 2)); + + if (consumed_bytes) { + *consumed_bytes = origin_size - recvbuf_.Length(); + } } else { // last chunk char* trailerBegin = chunkSizeEnd + 2; - - if (recvbuf_.Length() < (unsigned int)(sizeLen + 4)) return recvstatus_; - + + if (recvbuf_.Length() < (unsigned int)(sizeLen + 4)) + return recvstatus_; + char* trailerEnd = string_strnstr(trailerBegin, KStringCRLF, (int)recvbuf_.Length()); - + if (NULL == trailerEnd) return recvstatus_; - + recvstatus_ = kEnd; bodyreceiver_->EndData(); - - + recvbuf_.Move(-(trailerEnd - chunkSizeBegin + 2)); + + if (consumed_bytes) { + *consumed_bytes = origin_size - recvbuf_.Length(); + } } } else { // no chunk - int contentLength = headfields_.ContentLength(); - int appendlen = 0; - - if (int(recvbuf_.Length() + bodyreceiver_->Length()) <= contentLength) - appendlen = int(recvbuf_.Length()); - else - appendlen = contentLength - int(bodyreceiver_->Length()); - - + int64_t contentLength = headfields_.ContentLength(); + int64_t appendlen = 0; + if (Fields().IsConnectionClose() && 0 == contentLength) { + appendlen = int64_t(recvbuf_.Length()); + } else if (int64_t(recvbuf_.Length() + bodyreceiver_->Length()) <= contentLength) + appendlen = int64_t(recvbuf_.Length()); + else { + xwarn2(TSF "recv len bigger than contentlen, (%_, %_, %_)", + recvbuf_.Length(), + bodyreceiver_->Length(), + contentLength); + appendlen = contentLength - int64_t(bodyreceiver_->Length()); + } + bodyreceiver_->AppendData(recvbuf_.Ptr(), (size_t)appendlen); recvbuf_.Move(-appendlen); - - if ((int)bodyreceiver_->Length() == contentLength) { + + if (consumed_bytes) { + *consumed_bytes = origin_size - recvbuf_.Length(); + } + + if ((int64_t)bodyreceiver_->Length() == contentLength) { recvstatus_ = kEnd; bodyreceiver_->EndData(); - return recvstatus_; + return recvstatus_; } } } - + if (0 == recvbuf_.Length()) return recvstatus_; - } - break; - + } break; + case kEnd: { return recvstatus_; - } - break; - + } break; + default: break; } } - - xassert2(false, TSF"status:%_", recvstatus_); + + xassert2(false, TSF "status:%_", recvstatus_); return recvstatus_; } - Parser::TRecvStatus Parser::Recv(AutoBuffer& _recv_buffer) { - if (NULL == _recv_buffer.Ptr() || 0 == _recv_buffer.Length()) { - xwarn2(TSF"Recv(%_, %_), status:%_", _recv_buffer.Ptr() , _recv_buffer.Length(), recvstatus_); + xwarn2(TSF "Recv(%_, %_), status:%_", _recv_buffer.Ptr(), _recv_buffer.Length(), recvstatus_); return recvstatus_; } + if (recvstatus_ < kBody && headerbuf_.Length() < 4096 && !response_header_ready_) { + headerbuf_.Write(_recv_buffer.Ptr(), std::min(_recv_buffer.Length(), (size_t)4096)); - while (true) { - switch (recvstatus_) { - case kStart: - case kFirstLine: { - char* pBuf = (char*)_recv_buffer.Ptr(); - char* pos = string_strnstr(pBuf, KStringCRLF, (int)_recv_buffer.Length()); - - if (NULL == pos && 8 * 1024 < _recv_buffer.Length()) { - xerror2(TSF"wrong first line 8k buffer no found CRLF"); - recvstatus_ = kFirstLineError; - return recvstatus_; - } + const char* pszbuf = (const char*)headerbuf_.Ptr(); + size_t length = headerbuf_.Length(); - if (NULL == pos) { - recvstatus_ = kFirstLine; - return recvstatus_; + if (length > 4) { + char* pos = string_strnstr(pszbuf, "\r\n\r\n", (int)length); + if (pos != NULL) { + headerbuf_.Length(0, pos - pszbuf + 4); + response_header_ready_ = true; } + } + } - ptrdiff_t firstlinelength = pos - pBuf + 2; - std::string firstline = std::string(pBuf, (size_t)firstlinelength); - - bool parseFirstlineSuc = false; + while (true) { + switch (recvstatus_) { + case kStart: + case kFirstLine: { + char* pBuf = (char*)_recv_buffer.Ptr(); + char* pos = string_strnstr(pBuf, KStringCRLF, (int)_recv_buffer.Length()); - if (strutil::StartsWith(firstline, "HTTP/")) { - if (statusline_.FromString(firstline)) { - csmode_ = kRespond; - parseFirstlineSuc = true; + if (NULL == pos && 8 * 1024 < _recv_buffer.Length()) { + xerror2(TSF "wrong first line 8k buffer no found CRLF"); + recvstatus_ = kFirstLineError; + return recvstatus_; } - } else { - if (requestline_.FromString(firstline)) { - csmode_ = kRequest; - parseFirstlineSuc = true; + + if (NULL == pos) { + recvstatus_ = kFirstLine; + return recvstatus_; } - } - if (!parseFirstlineSuc) { - xerror2(TSF"wrong first line: %0", firstline); - recvstatus_ = kFirstLineError; - return recvstatus_; - } + ptrdiff_t firstlinelength = pos - pBuf + 2; + std::string firstline = std::string(pBuf, (size_t)firstlinelength); - recvstatus_ = kHeaderFields; - _recv_buffer.Move(- firstlinelength); - } - break; + bool parseFirstlineSuc = false; - case kHeaderFields: { - char* pBuf = (char*)_recv_buffer.Ptr(); - char* pos = string_strnstr(pBuf, "\r\n\r\n", (int)_recv_buffer.Length()); + if (strutil::StartsWith(firstline, "HTTP/")) { + if (statusline_.FromString(firstline)) { + csmode_ = kRespond; + parseFirstlineSuc = true; + } + } else { + if (requestline_.FromString(firstline)) { + csmode_ = kRequest; + parseFirstlineSuc = true; + } + } - if (NULL == pos && 128 * 1024 < _recv_buffer.Length()) { - xerror2(TSF"wrong header fields 128k buffer no found CRLFCRLF"); - recvstatus_ = kHeaderFieldsError; - return recvstatus_; - } + if (!parseFirstlineSuc) { + xerror2(TSF "wrong first line: %0", firstline); + recvstatus_ = kFirstLineError; + return recvstatus_; + } - if (NULL == pos) return recvstatus_; + recvstatus_ = kHeaderFields; + _recv_buffer.Move(-firstlinelength); + firstlinelength_ = firstlinelength; + } break; - ptrdiff_t headerslength = pos - pBuf + 4; - std::string headers = std::string(pBuf, (size_t)headerslength); + case kHeaderFields: { + char* pBuf = (char*)_recv_buffer.Ptr(); + char* pos = string_strnstr(pBuf, "\r\n\r\n", (int)_recv_buffer.Length()); - bool ret = __ParserHeaders(headers, headfields_); + if (NULL == pos && 128 * 1024 < _recv_buffer.Length()) { + xerror2(TSF "wrong header fields 128k buffer no found CRLFCRLF"); + recvstatus_ = kHeaderFieldsError; + return recvstatus_; + } - if (false == ret) { - recvstatus_ = kHeaderFieldsError; - return recvstatus_; - } + if (NULL == pos) + return recvstatus_; - recvstatus_ = kBody; - _recv_buffer.Move(-headerslength); - headerlength_ = headerslength; - } - break; + ptrdiff_t headerslength = pos - pBuf + 4; + std::string headers = std::string(pBuf, (size_t)headerslength); - case kBody: { - xassert2(bodyreceiver_); + bool ret = __ParserHeaders(headers, headfields_); - if (bodyreceiver_) { - // chunked + if (false == ret) { + recvstatus_ = kHeaderFieldsError; + return recvstatus_; + } - if (headfields_.IsTransferEncodingChunked()) { - char* chunkSizeBegin = (char*)_recv_buffer.Ptr(); - char* chunkSizeEnd = string_strnstr(chunkSizeBegin, KStringCRLF, (int)_recv_buffer.Length()); + recvstatus_ = kBody; + _recv_buffer.Move(-headerslength); + headerlength_ = headerslength; + } break; - if (NULL == chunkSizeEnd) { - return recvstatus_; - } + case kBody: { + xassert2(bodyreceiver_); - std::string strChunkSize = std::string(chunkSizeBegin, chunkSizeEnd); - strutil::Trim(strChunkSize); + if (bodyreceiver_) { + // chunked - int64_t chunkSize = strtol(strChunkSize.c_str(), NULL, 16); + if (headfields_.IsTransferEncodingChunked()) { + char* chunkSizeBegin = (char*)_recv_buffer.Ptr(); + char* chunkSizeEnd = string_strnstr(chunkSizeBegin, KStringCRLF, (int)_recv_buffer.Length()); - ptrdiff_t sizeLen = chunkSizeEnd - chunkSizeBegin; + if (NULL == chunkSizeEnd) { + return recvstatus_; + } - if (0 != chunkSize) { - if ((ptrdiff_t)_recv_buffer.Length() < chunkSize + sizeLen + 4) return recvstatus_; + std::string strChunkSize = std::string(chunkSizeBegin, chunkSizeEnd); + strutil::Trim(strChunkSize); - char* chunkBegin = chunkSizeEnd + 2; - char* chunkEnd = chunkBegin + chunkSize; + int64_t chunkSize = strtol(strChunkSize.c_str(), NULL, 16); - if (*chunkEnd != '\r' || *(chunkEnd + 1) != '\n') { - recvstatus_ = kBodyError; - return recvstatus_; - } + ptrdiff_t sizeLen = chunkSizeEnd - chunkSizeBegin; - bodyreceiver_->AppendData(chunkBegin, (size_t)chunkSize); + if (0 != chunkSize) { + if ((ptrdiff_t)_recv_buffer.Length() < chunkSize + sizeLen + 4) + return recvstatus_; - _recv_buffer.Move(-(chunkEnd - chunkSizeBegin + 2)); - } else { // last chunk - char* trailerBegin = chunkSizeEnd + 2; + char* chunkBegin = chunkSizeEnd + 2; + char* chunkEnd = chunkBegin + chunkSize; - if (recvbuf_.Length() < (unsigned int)(sizeLen + 4)) return recvstatus_; + if (*chunkEnd != '\r' || *(chunkEnd + 1) != '\n') { + recvstatus_ = kBodyError; + return recvstatus_; + } - char* trailerEnd = string_strnstr(trailerBegin, KStringCRLF, (int)_recv_buffer.Length()); + bodyreceiver_->AppendData(chunkBegin, (size_t)chunkSize); - if (NULL == trailerEnd) - return recvstatus_; + _recv_buffer.Move(-(chunkEnd - chunkSizeBegin + 2)); + } else { // last chunk + char* trailerBegin = chunkSizeEnd + 2; - recvstatus_ = kEnd; - bodyreceiver_->EndData(); + if (_recv_buffer.Length() < (unsigned int)(sizeLen + 4)) + return recvstatus_; + char* trailerEnd = string_strnstr(trailerBegin, KStringCRLF, (int)_recv_buffer.Length()); - _recv_buffer.Move(-(trailerEnd - chunkSizeBegin + 2)); - } - } else { // no chunk - int contentLength = headfields_.ContentLength(); - int appendlen = 0; + if (NULL == trailerEnd) + return recvstatus_; - if (int(_recv_buffer.Length() + bodyreceiver_->Length()) <= contentLength) - appendlen = int(_recv_buffer.Length()); - else - appendlen = contentLength - int(bodyreceiver_->Length()); + recvstatus_ = kEnd; + bodyreceiver_->EndData(); + _recv_buffer.Move(-(trailerEnd - chunkSizeBegin + 2)); + } + } else { // no chunk + int64_t contentLength = headfields_.ContentLength(); + int64_t appendlen = 0; + + if (int64_t(_recv_buffer.Length() + bodyreceiver_->Length()) <= contentLength) + appendlen = int64_t(_recv_buffer.Length()); + else { + xwarn2(TSF "contentLength:%_, body.len:%_, recv len:%_", + contentLength, + int64_t(bodyreceiver_->Length()), + _recv_buffer.Length()); + appendlen = contentLength - int64_t(bodyreceiver_->Length()); + } - bodyreceiver_->AppendData(_recv_buffer.Ptr(), (size_t)appendlen); - _recv_buffer.Move(-appendlen); + bodyreceiver_->AppendData(_recv_buffer.Ptr(), (size_t)appendlen); + _recv_buffer.Move(-appendlen); - if ((int)bodyreceiver_->Length() == contentLength) { - recvstatus_ = kEnd; - bodyreceiver_->EndData(); - return recvstatus_; + if ((int64_t)bodyreceiver_->Length() == contentLength) { + recvstatus_ = kEnd; + bodyreceiver_->EndData(); + return recvstatus_; + } } } - } - if (0 == _recv_buffer.Length()) - return recvstatus_; - } - break; + if (0 == _recv_buffer.Length()) + return recvstatus_; + } break; - case kEnd: { - return recvstatus_; - } - break; + case kEnd: { + return recvstatus_; + } break; - default: - break; + default: + break; } } - xassert2(false, TSF"status:%_", recvstatus_); + xassert2(false, TSF "status:%_", recvstatus_); return recvstatus_; } Parser::TRecvStatus Parser::RecvStatus() const { return recvstatus_; - } TCsMode Parser::CsMode() const { @@ -1003,6 +1163,9 @@ const BodyReceiver& Parser::Body() const { return *bodyreceiver_; } +const AutoBuffer& Parser::HeaderBuffer() const { + return headerbuf_; +} bool Parser::FirstLineReady() const { return kFirstLineError < recvstatus_; @@ -1011,21 +1174,24 @@ bool Parser::FirstLineReady() const { bool Parser::FieldsReady() const { return kHeaderFieldsError < recvstatus_; } -size_t Parser::HeaderLength() const{ + +size_t Parser::FirstLineLength() const { + return firstlinelength_; +} + +size_t Parser::HeaderLength() const { return headerlength_; } bool Parser::BodyReady() const { return kBodyError < recvstatus_; } -bool Parser::BodyRecving() const{ +bool Parser::BodyRecving() const { return kBody == recvstatus_; } bool Parser::Error() const { - return kFirstLineError == recvstatus_ - || kHeaderFieldsError == recvstatus_ - || kBodyError == recvstatus_; + return kFirstLineError == recvstatus_ || kHeaderFieldsError == recvstatus_ || kBodyError == recvstatus_; } bool Parser::Success() const { @@ -1035,16 +1201,17 @@ bool Parser::Success() const { ///////////////////////// test code class TestChunkProvider : public IStreamBodyProvider { - public: - TestChunkProvider() - : m_isEnd(false) {} + public: + TestChunkProvider() : m_isEnd(false) { + } bool HaveData() const { return m_buffer.Length() > 0; } bool Data(AutoBuffer& _body) { - if (m_buffer.Length() == 0) return false; + if (m_buffer.Length() == 0) + return false; _body.Write(m_buffer.Ptr(), m_buffer.Length()); m_buffer.Reset(); @@ -1068,16 +1235,15 @@ class TestChunkProvider : public IStreamBodyProvider { m_buffer.Write(buffer.Ptr(), buffer.Length()); } - private: + private: AutoBuffer m_buffer; bool m_isEnd; }; class TestBodyReceiver : public BodyReceiver { - public: - TestBodyReceiver() {} - ~TestBodyReceiver() {} - + public: + TestBodyReceiver() = default; + ~TestBodyReceiver() = default; void AppendData(const void* _body, size_t _length) { BodyReceiver::AppendData(_body, _length); @@ -1088,9 +1254,20 @@ class TestBodyReceiver : public BodyReceiver { return buffer; } - private: + private: AutoBuffer buffer; }; +} // namespace http + +void URLFactory::AddKeyValue(const std::string& key, const std::string& value) { + if (kvs_.find(key) != kvs_.end()) { + xwarn2(TSF "key:%_, prev val:%_, next val:%_", key, kvs_[key], value); + } + kvs_[key] = value; +} +void StringBody::AppendData(const void* _body, size_t _length) { + databuf_.append(reinterpret_cast(_body), _length); + BodyReceiver::AppendData(_body, _length); } diff --git a/mars/comm/http.h b/mars/comm/http.h index cae453fe7..4f0e77c4d 100644 --- a/mars/comm/http.h +++ b/mars/comm/http.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * HttpRequest.h * @@ -21,16 +20,17 @@ #ifndef HTTP_H_ #define HTTP_H_ -#include +#include #include +#include -#include "autobuffer.h" +#include "mars/comm/autobuffer.h" +#include "mars/comm/strutil.h" namespace http { struct less { - bool operator()(const std::string& __x, const std::string& __y) const - { return 0 > strcasecmp(__x.c_str(), __y.c_str()); } + bool operator()(const std::string& __x, const std::string& __y) const; }; enum THttpVersion { @@ -55,7 +55,7 @@ enum TCsMode { }; class RequestLine { - public: + public: enum THttpMethod { kUnknown = 0, kGet, @@ -71,13 +71,13 @@ class RequestLine { static const char* const kHttpMethodString[kMax]; - public: + public: RequestLine(); RequestLine(THttpMethod _httpMethod, const char* _url, THttpVersion _httpVersion); // RequestLine(const RequestLine&); // RequestLine& operator=(const RequestLine&); - public: + public: void Method(THttpMethod _method); THttpMethod Method() const; @@ -90,20 +90,20 @@ class RequestLine { std::string ToString() const; bool FromString(const std::string& _requestline); - private: + private: THttpMethod http_method_; std::string req_url_; THttpVersion http_version_; }; class StatusLine { - public: + public: StatusLine(); StatusLine(THttpVersion _httpversion, int _statuscode, const std::string& _reasonphrase); // StatusLine(const StatusLine&); // StatusLine& operator=(const StatusLine&); - public: + public: void Version(THttpVersion _version); THttpVersion Version() const; @@ -116,33 +116,36 @@ class StatusLine { std::string ToString() const; bool FromString(const std::string& _statusline); - private: + private: THttpVersion http_version_; int statuscode_; std::string reason_phrase_; }; - class HeaderFields { - public: + public: // HeaderFields(const HeaderFields&); // HeaderFields& operator=(const HeaderFields&); - public: - static std::pair MakeContentLength(int _len); + public: + static std::pair MakeContentLength(uint64_t _len); static std::pair MakeTransferEncodingChunked(); static std::pair MakeConnectionClose(); static std::pair MakeConnectionKeepalive(); static std::pair MakeAcceptAll(); static std::pair MakeAcceptEncodingDefalte(); + static std::pair MakeAcceptEncodingGzip(); static std::pair MakeCacheControlNoCache(); static std::pair MakeContentTypeOctetStream(); + static std::pair MakeUserAgentMicroMessage(); static const char* const KStringHost; static const char* const KStringAccept; static const char* const KStringUserAgent; static const char* const KStringCacheControl; static const char* const KStringConnection; + static const char* const kStringProxyConnection; + static const char* const kStringProxyAuthorization; static const char* const KStringContentType; static const char* const KStringContentLength; static const char* const KStringTransferEncoding; @@ -153,27 +156,39 @@ class HeaderFields { static const char* const KStringRange; static const char* const KStringLocation; static const char* const KStringReferer; + static const char* const kStringServer; + static const char* const KStringKeepalive; void HeaderFiled(const char* _name, const char* _value); void HeaderFiled(const std::pair& _headerfield); - void HeaderFiled(const HeaderFields& _headerfields); + void InsertOrUpdate(const std::pair& _headerfield); + void Manipulate(const std::pair& _headerfield); const char* HeaderField(const char* _key) const; - std::map& GetHeaders() {return headers_;} + void CopyFrom(const HeaderFields& rhs); + std::map& GetHeaders() { + return headers_; + } + std::list> GetAsList() const; - bool IsTransferEncodingChunked(); - int ContentLength(); + bool IsTransferEncodingChunked() const; + bool IsConnectionClose() const; + bool IsConnectionKeepAlive() const; + uint64_t ContentLength() const; + uint32_t KeepAliveTimeout() const; - bool ContentRange(int* start, int* end, int* total); + bool Range(long& _start, long& _end) const; + bool ContentRange(uint64_t* start, uint64_t* end, uint64_t* total) const; + static bool ContentRange(const std::string& line, uint64_t* start, uint64_t* end, uint64_t* total); - const std::string ToStrig() const; + std::string ToString() const; - private: + private: std::map headers_; }; class IBlockBodyProvider { - public: - virtual ~IBlockBodyProvider() {} + public: + virtual ~IBlockBodyProvider() = default; virtual bool Data(AutoBuffer& _body) = 0; virtual bool FillData(AutoBuffer& _body) = 0; @@ -181,30 +196,39 @@ class IBlockBodyProvider { }; class BufferBodyProvider : public IBlockBodyProvider { - public: - bool Data(AutoBuffer& _body) { - if (!buffer_.Ptr()) return false; - - _body.Write(buffer_.Ptr(), buffer_.Length()); - buffer_.Reset(); + public: + bool Data(AutoBuffer& _body) override { + if (!_body.Ptr()) { + return false; + } + + buffer_.Write(_body.Ptr(), _body.Length()); + _body.Reset(); return true; } - bool FillData(AutoBuffer& _body) { - if (!buffer_.Ptr()) return false; + bool FillData(AutoBuffer& _body) override { + if (!buffer_.Ptr()) { + return false; + } _body.Write(buffer_.Ptr(), buffer_.Length()); buffer_.Reset(); return true; } - size_t Length() const {return buffer_.Length();} - AutoBuffer& Buffer() {return buffer_;} - private: + size_t Length() const override { + return buffer_.Length(); + } + AutoBuffer& Buffer() { + return buffer_; + } + + private: AutoBuffer buffer_; }; class IStreamBodyProvider { - public: - virtual ~IStreamBodyProvider() {} + public: + virtual ~IStreamBodyProvider() = default; virtual bool HaveData() const = 0; virtual bool Data(AutoBuffer& _body) = 0; @@ -212,21 +236,21 @@ class IStreamBodyProvider { virtual bool Eof() const = 0; const char* EofData(); - protected: + protected: static void AppendHeader(AutoBuffer& _body, size_t _length); static void AppendTail(AutoBuffer& _body); }; class Builder { - public: - Builder(TCsMode _csmode); + public: + explicit Builder(TCsMode _csmode); ~Builder(); - private: + private: Builder(const Builder&); Builder& operator=(const Builder&); - public: + public: RequestLine& Request(); StatusLine& Status(); const RequestLine& Request() const; @@ -245,7 +269,7 @@ class Builder { bool HeaderToBuffer(AutoBuffer& _header); bool HttpToBuffer(AutoBuffer& _http); - private: + private: TCsMode csmode_; StatusLine statusline_; @@ -259,34 +283,40 @@ class Builder { }; class BodyReceiver { - public: - BodyReceiver(): total_length_(0) {} - virtual ~BodyReceiver() {} + public: + BodyReceiver() = default; + virtual ~BodyReceiver() = default; - virtual void AppendData(const void* _body, size_t _length) { total_length_ += _length;} - virtual void EndData() {} - size_t Length() const {return total_length_;} + virtual void AppendData(const void* /*_body*/, size_t _length) { + total_length_ += _length; + } + virtual void EndData() { + } + size_t Length() const { + return total_length_; + } - private: - size_t total_length_; + private: + size_t total_length_ = 0; }; class MemoryBodyReceiver : public BodyReceiver { - public: - MemoryBodyReceiver(AutoBuffer& _buf) - : body_(_buf) {} - virtual void AppendData(const void* _body, size_t _length) { + public: + explicit MemoryBodyReceiver(AutoBuffer& _buf) : body_(_buf) { + } + void AppendData(const void* _body, size_t _length) override { BodyReceiver::AppendData(_body, _length); body_.Write(_body, _length); } - virtual void EndData() {} + void EndData() override { + } - private: + private: AutoBuffer& body_; }; class Parser { - public: + public: enum TRecvStatus { kStart, kFirstLine, @@ -298,16 +328,19 @@ class Parser { kEnd, }; - public: - Parser(BodyReceiver* _body = new BodyReceiver(), bool _manage = true); + public: + explicit Parser(BodyReceiver* _body = new BodyReceiver(), bool _manage = true); ~Parser(); - private: + private: Parser(const Parser&); Parser& operator=(const Parser&); - public: - TRecvStatus Recv(const void* _buffer, size_t _length); + public: + TRecvStatus Recv(const void* _buffer, + size_t _length, + size_t* consumed_bytes = nullptr, + bool only_parse_header = false); TRecvStatus Recv(AutoBuffer& _recv_buffer); TRecvStatus RecvStatus() const; @@ -315,10 +348,12 @@ class Parser { bool FirstLineReady() const; const RequestLine& Request() const; const StatusLine& Status() const; + const AutoBuffer& HeaderBuffer() const; bool FieldsReady() const; HeaderFields& Fields(); const HeaderFields& Fields() const; + size_t FirstLineLength() const; size_t HeaderLength() const; bool BodyReady() const; @@ -329,9 +364,11 @@ class Parser { bool Error() const; bool Success() const; - private: + private: TRecvStatus recvstatus_; - AutoBuffer recvbuf_; + AutoBuffer recvbuf_; + AutoBuffer headerbuf_; + bool response_header_ready_; TCsMode csmode_; StatusLine statusline_; @@ -341,11 +378,47 @@ class Parser { BodyReceiver* bodyreceiver_; bool is_manage_body_; + size_t firstlinelength_; size_t headerlength_; }; // void testChunk(); - } /* namespace http */ + +class URLFactory { + public: + explicit URLFactory(std::string cgi) : cgi_(std::move(cgi)) { + } + template + void AddKeyValue(const std::string& key, const T& value) { + AddKeyValue(key, strutil::to_string(value)); + } + void AddKeyValue(const std::string& key, const std::string& value); + std::string GetUrl() const { + if (kvs_.empty()) { + return cgi_; + } + std::string url = cgi_; + url += '?'; + for (const auto& kv : kvs_) { + url.append(kv.first).append("=").append(kv.second).append("&"); + } + url.resize(url.size() - 1); + return url; + } + std::string cgi_; + std::map kvs_; +}; + +class StringBody : public http::BodyReceiver { + public: + explicit StringBody(std::string& buf) : databuf_(buf) { + } + void AppendData(const void* _body, size_t _length) override; + + private: + std::string& databuf_; +}; + #endif /* HTTPREQUEST_H_ */ diff --git a/mars/comm/ini.h b/mars/comm/ini.h index 8fa2adf71..c8a2966c5 100644 --- a/mars/comm/ini.h +++ b/mars/comm/ini.h @@ -1,16 +1,16 @@ /* Feather INI Parser - 1.41 You are free to use this however you wish. - + If you find a bug, please attept to debug the cause. Post your environment details and the cause or fix in the issues section of GitHub. - + Written by Turbine. - + Website: https://github.com/Turbine1991/feather-ini-parser http://code.google.com/p/feather-ini-parser/downloads - + Help: Bundled example & readme. http://code.google.com/p/feather-ini-parser/wiki/Tutorials @@ -19,17 +19,17 @@ #ifndef COMM_INI_H_ #define COMM_INI_H_ -#include +#include #include #include #include -#include +#include #include #include -#include #include "assert/__assert.h" +#include "string_cast.h" inline bool VerifyName(const std::string& _name) { if (_name.empty()) @@ -58,7 +58,7 @@ inline bool VerifyName(const std::string& _name) { } class INI { - public: + public: typedef std::map keys_t; typedef std::map sections_t; @@ -68,9 +68,8 @@ class INI { typedef std::pair keyspair_t; typedef std::pair sectionspair_t; - public: - INI(const std::string& fileName, bool parse = true) - : filename(fileName) { + public: + INI(const std::string& fileName, bool parse = true) : filename(fileName) { if (parse) Parse(); } @@ -110,11 +109,33 @@ class INI { return true; } - template - bool Set(const std::string& key, const V& value) - { return Set(currentsection, key, value);} + keys_t CurrentKeys() const { + if (currentsection.empty()) { + return {}; + } + + auto sectionsit = sections.find(currentsection); + if (sectionsit == sections.end()) { + return {}; + } + + return sectionsit->second; + } + + const std::string& CurrentSection() const { + return currentsection; + } + + std::string FileName() const { + return filename; + } + + template + bool Set(const std::string& key, const V& value) { + return Set(currentsection, key, value); + } - template + template bool Set(const std::string& section, const std::string& key, const V& value) { if (!VerifyName(section)) { ASSERT2(false, "---%s---", section.c_str()); @@ -126,9 +147,7 @@ class INI { return false; } - std::stringstream strstream; - strstream << value; - std::string svalue = strstream.str(); + std::string svalue = string_cast(value).str(); if (BUFFER_SIZE < key.size() + svalue.size() + 1) { ASSERT2(false, "%lu", (long unsigned int)(key.size() + svalue.size())); @@ -139,8 +158,13 @@ class INI { return true; } - const std::string& Get(const std::string& key, const std::string& def) - { return Get(currentsection, key, def);} + const std::string& Get(const std::string& key, const std::string& def) { + return Get(currentsection, key, def); + } + + std::string Get(const std::string& key) { + return Get(key, ""); + } const std::string& Get(const std::string& section, const std::string& key, const std::string& def) { if (!VerifyName(section)) { @@ -155,15 +179,16 @@ class INI { keysit_t keys = sections[section].find(key); - if (keys == sections[section].end()) return def; + if (keys == sections[section].end()) + return def; return keys->second; } - template + template V Get(const std::string& key, const V& def); - template + template V Get(const std::string& section, const std::string& key, const V& def); bool Parse() { @@ -179,12 +204,11 @@ class INI { ASSERT(1 * 1024 * 1024 > length); while (true) { - if (feof(file)) break; - + char line[BUFFER_SIZE] = {0}; - + if (NULL == fgets(line, BUFFER_SIZE, file) || ferror(file)) break; @@ -192,11 +216,11 @@ class INI { if ((line_length >= 2) && line[0] == '/' && line[1] == '/') continue; - if (line[line_length-1] == '\n') { - line[line_length-1] = '\0'; + if (line[line_length - 1] == '\n') { + line[line_length - 1] = '\0'; line_length -= 1; } - + if (line[0] == '[') { cur = ""; @@ -258,36 +282,42 @@ class INI { currentsection = ""; } void ClearExceptSection(const std::string& _sectionName) { - INI::sectionsit_t iter = sections.begin(); - for (; iter!=sections.end();) { - if (0==iter->first.compare(_sectionName)) { - ++iter; - } else { - sections.erase(iter++); - } - } + INI::sectionsit_t iter = sections.begin(); + for (; iter != sections.end();) { + if (0 == iter->first.compare(_sectionName)) { + ++iter; + } else { + sections.erase(iter++); + } + } + } + + void ClearSelection() { + if (currentsection.empty()) { + return; + } + auto sec = sections.find(currentsection); + if (sec != sections.end()) { + sections.erase(sec); + } + currentsection = ""; } - + void Save(const std::string& filename = "") { - FILE* file = fopen(((filename == "") ? this->filename : filename).c_str(), "wb"); - + if (NULL == file) { return; } - for (INI::sectionsit_t i = sections.begin(); i != sections.end(); ++i) { if (i->second.size() == 0) continue; - const std::string temp = makeSection(i->first); fwrite(temp.c_str(), 1, temp.length(), file); - for (INI::keysit_t j = i->second.begin(); j != i->second.end(); ++j) { - const std::string temp = makeKeyValue(j->first, j->second); fwrite(temp.c_str(), 1, temp.length(), file); } @@ -301,8 +331,11 @@ class INI { return sections; } - private: - + bool Empty() const { + return sections.empty(); + } + + private: std::string makeSection(const std::string& section) { std::string line; line += '['; @@ -323,8 +356,7 @@ class INI { return line; } - private: - + private: static const unsigned int BUFFER_SIZE = 4096; std::string currentsection; @@ -333,11 +365,12 @@ class INI { std::string filename; }; -template -V INI::Get(const std::string& key, const V& def) -{ return Get(currentsection, key, def);} +template +V INI::Get(const std::string& key, const V& def) { + return Get(currentsection, key, def); +} -template +template V INI::Get(const std::string& section, const std::string& key, const V& def) { if (!VerifyName(section)) { ASSERT2(false, "---%s---", section.c_str()); @@ -351,30 +384,23 @@ V INI::Get(const std::string& section, const std::string& key, const V& def) { keysit_t keys = sections[section].find(key); - if (keys == sections[section].end()) return def; + if (keys == sections[section].end()) + return def; - if (keys->second.empty()) return def; + if (keys->second.empty()) + return def; - V result; - std::stringstream strstream(keys->second); - strstream >> result; + // V result; - if (strstream.bad()) { - ASSERT("strstream.bad()"); - return def; - } else if (strstream.fail()) { - ASSERT("strstream.fail()"); - return def; - } else if (strstream.good() || strstream.eof()) { - return result; - } else { - ASSERT("unkown error"); - return def; - } + number_cast cast(keys->second.c_str()); + if (cast.valid()) + return cast; + return def; } -template<> inline -std::string INI::Get(const std::string& section, const std::string& key, const std::string& def) -{ return Get(section, key, def);} +template <> +inline std::string INI::Get(const std::string& section, const std::string& key, const std::string& def) { + return Get(section, key, def); +} -#endif // COMM_INI_H_ +#endif // COMM_INI_H_ diff --git a/mars/comm/jni/Android.mk b/mars/comm/jni/Android.mk deleted file mode 100644 index 00f6dd7d6..000000000 --- a/mars/comm/jni/Android.mk +++ /dev/null @@ -1,2 +0,0 @@ -LOCAL_PATH :=$(call my-dir) -include $(LOCAL_PATH)/../../mk_template/android_template.mk \ No newline at end of file diff --git a/mars/comm/jni/Application.mk b/mars/comm/jni/Application.mk deleted file mode 100644 index cdda64028..000000000 --- a/mars/comm/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_LOCAL_PATH :=$(call my-dir) -include $(APP_LOCAL_PATH)/../../mk_template/application_template.mk \ No newline at end of file diff --git a/mars/comm/jni/OnAlarm.inl b/mars/comm/jni/OnAlarm.inl deleted file mode 100644 index 4272a5e7f..000000000 --- a/mars/comm/jni/OnAlarm.inl +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OnAlarm.cpp - * - * Created on: 2014-1-13 - * Author: yerungui - */ - - -#include - -extern "C" JNIEXPORT void JNICALL Java_com_tencent_mars_comm_Alarm_onAlarm(JNIEnv *, jclass, jlong id) -{ - xdebug2(TSF"BroadcastMessage seq:%_", (long long)id); - MessageQueue::BroadcastMessage(MessageQueue::GetDefMessageQueue(), MessageQueue::Message(KALARM_MESSAGETITLE, (long long)id, 0)); -} diff --git a/mars/comm/jni/build.conf b/mars/comm/jni/build.conf deleted file mode 100644 index f8ab2b7d1..000000000 --- a/mars/comm/jni/build.conf +++ /dev/null @@ -1,11 +0,0 @@ -TEMP_LOCAL_PATH :=$(call my-dir) - -SELF_BUILD_CMD := BUILD_STATIC_LIBRARY -SELF_LOCAL_MODULE := comm - -SELF_LOCAL_EXPORT_C_INCLUDES := $(TEMP_LOCAL_PATH)/ $(TEMP_LOCAL_PATH)/../ $(TEMP_LOCAL_PATH)/../../ $(TEMP_LOCAL_PATH)/../../../ -SELF_LOCAL_EXPORT_SRC_FILES := -SELF_LOCAL_EXPORT_LDLIBS += -latomic - -SELF_LOCAL_IMPORT_LIBRARIES_PATH := - diff --git a/mars/comm/jni/comm.h b/mars/comm/jni/comm.h new file mode 100644 index 000000000..ae21c38dd --- /dev/null +++ b/mars/comm/jni/comm.h @@ -0,0 +1,126 @@ +// +// Created by Cpan on 2022/9/22. +// + +#ifndef MMNET_COMM_H +#define MMNET_COMM_H +#include + +#include +#include + +class ByteArrayFromJava { + private: + unsigned char* ptr; + unsigned int len; + jbyteArray jData; + jclass cls; + JNIEnv* mEnv; + + public: + ~ByteArrayFromJava() { + if (ptr) { + delete[] ptr; + ptr = NULL; + } + if (mEnv) { + if (cls) { + mEnv->DeleteLocalRef(cls); + } + if (jData) { + mEnv->DeleteLocalRef(jData); + } + } + len = 0; + } + + ByteArrayFromJava(JNIEnv* env, jobject obj, const char* name) { + ptr = NULL; + len = 0; + jData = NULL; + mEnv = env; + cls = NULL; + if (mEnv) { + cls = env->GetObjectClass(obj); + if (cls) { + jfieldID fid = env->GetFieldID(cls, name, "[B"); + jData = (jbyteArray)(env->GetObjectField(obj, fid)); + if (jData) { + len = env->GetArrayLength(jData); + if (len > 0) { + jbyte* ba = env->GetByteArrayElements(jData, JNI_FALSE); + ptr = new unsigned char[len]; + memcpy(ptr, ba, len); + env->ReleaseByteArrayElements(jData, ba, 0); + } + } + } + } + } + + unsigned char* GetPtr() { + return ptr; + } + unsigned int GetLen() { + return len; + } +}; + +class IntArrayFromJava { + private: + int* ptr; + unsigned int count; + jintArray jData; + jclass cls; + JNIEnv* mEnv; + + public: + ~IntArrayFromJava() { + if (ptr) { + delete[] ptr; + ptr = NULL; + } + if (mEnv) { + if (cls) { + mEnv->DeleteLocalRef(cls); + } + if (jData) { + mEnv->DeleteLocalRef(jData); + } + } + count = 0; + } + + IntArrayFromJava(JNIEnv* env, jobject obj, const char* name) { + ptr = NULL; + count = 0; + jData = NULL; + mEnv = env; + cls = NULL; + if (mEnv) { + cls = env->GetObjectClass(obj); + if (cls) { + jfieldID fid = env->GetFieldID(cls, name, "[I"); + jData = (jintArray)(env->GetObjectField(obj, fid)); + if (jData) { + count = env->GetArrayLength(jData); + if (count > 0) { + jint* ba = env->GetIntArrayElements(jData, JNI_FALSE); + ptr = new int[count]; + memcpy(ptr, ba, count * sizeof(int)); + env->ReleaseIntArrayElements(jData, ba, 0); + } + } + } + } + } + + int* GetPtr() { + return ptr; + } + unsigned int GetCount() { + return count; + } +}; + +#endif // MMNET_COMM_H diff --git a/mars/comm/jni/export.mk b/mars/comm/jni/export.mk deleted file mode 100644 index 3c04802c6..000000000 --- a/mars/comm/jni/export.mk +++ /dev/null @@ -1,5 +0,0 @@ -EXPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_EXPORT_C_INCLUDES:= -SELF_LOCAL_EXPORT_SRC_FILES := -SELF_LOCAL_EXPORT_LDLIBS := -include $(EXPORT_LOCAL_PATH)/../../mk_template/export_template.mk \ No newline at end of file diff --git a/mars/comm/jni/ifaddrs.c b/mars/comm/jni/ifaddrs.c deleted file mode 100644 index 4729ff6ca..000000000 --- a/mars/comm/jni/ifaddrs.c +++ /dev/null @@ -1,663 +0,0 @@ -/* -Copyright (c) 2013, Kenneth MacKay -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "ifaddrs.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct NetlinkList -{ - struct NetlinkList *m_next; - struct nlmsghdr *m_data; - unsigned int m_size; -} NetlinkList; - -static int netlink_socket(void) -{ - int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); - if(l_socket < 0) - { - return -1; - } - - struct sockaddr_nl l_addr; - memset(&l_addr, 0, sizeof(l_addr)); - l_addr.nl_family = AF_NETLINK; - if(bind(l_socket, (struct sockaddr *)&l_addr, sizeof(l_addr)) < 0) - { - close(l_socket); - return -1; - } - - return l_socket; -} - -static int netlink_send(int p_socket, int p_request) -{ - struct - { - struct nlmsghdr m_hdr; - struct rtgenmsg m_msg; - } l_data; - - memset(&l_data, 0, sizeof(l_data)); - - l_data.m_hdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg)); - l_data.m_hdr.nlmsg_type = p_request; - l_data.m_hdr.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; - l_data.m_hdr.nlmsg_pid = 0; - l_data.m_hdr.nlmsg_seq = p_socket; - l_data.m_msg.rtgen_family = AF_UNSPEC; - - struct sockaddr_nl l_addr; - memset(&l_addr, 0, sizeof(l_addr)); - l_addr.nl_family = AF_NETLINK; - return (sendto(p_socket, &l_data.m_hdr, l_data.m_hdr.nlmsg_len, 0, (struct sockaddr *)&l_addr, sizeof(l_addr))); -} - -static int netlink_recv(int p_socket, void *p_buffer, size_t p_len) -{ - struct msghdr l_msg; - struct iovec l_iov = { p_buffer, p_len }; - struct sockaddr_nl l_addr; - - for(;;) - { - l_msg.msg_name = (void *)&l_addr; - l_msg.msg_namelen = sizeof(l_addr); - l_msg.msg_iov = &l_iov; - l_msg.msg_iovlen = 1; - l_msg.msg_control = NULL; - l_msg.msg_controllen = 0; - l_msg.msg_flags = 0; - int l_result = recvmsg(p_socket, &l_msg, 0); - - if(l_result < 0) - { - if(errno == EINTR) - { - continue; - } - return -2; - } - - if(l_msg.msg_flags & MSG_TRUNC) - { // buffer was too small - return -1; - } - return l_result; - } -} - -static struct nlmsghdr *getNetlinkResponse(int p_socket, int *p_size, int *p_done) -{ - size_t l_size = 4096; - void *l_buffer = NULL; - - for(;;) - { - free(l_buffer); - l_buffer = malloc(l_size); - if (l_buffer == NULL) - { - return NULL; - } - - int l_read = netlink_recv(p_socket, l_buffer, l_size); - *p_size = l_read; - if(l_read == -2) - { - free(l_buffer); - return NULL; - } - if(l_read >= 0) - { - pid_t l_pid = getpid(); - struct nlmsghdr *l_hdr; - for(l_hdr = (struct nlmsghdr *)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); l_hdr = (struct nlmsghdr *)NLMSG_NEXT(l_hdr, l_read)) - { - if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) - { - continue; - } - - if(l_hdr->nlmsg_type == NLMSG_DONE) - { - *p_done = 1; - break; - } - - if(l_hdr->nlmsg_type == NLMSG_ERROR) - { - free(l_buffer); - return NULL; - } - } - return l_buffer; - } - - l_size *= 2; - } -} - -static NetlinkList *newListItem(struct nlmsghdr *p_data, unsigned int p_size) -{ - NetlinkList *l_item = malloc(sizeof(NetlinkList)); - if (l_item == NULL) - { - return NULL; - } - - l_item->m_next = NULL; - l_item->m_data = p_data; - l_item->m_size = p_size; - return l_item; -} - -static void freeResultList(NetlinkList *p_list) -{ - NetlinkList *l_cur; - while(p_list) - { - l_cur = p_list; - p_list = p_list->m_next; - free(l_cur->m_data); - free(l_cur); - } -} - -static NetlinkList *getResultList(int p_socket, int p_request) -{ - if(netlink_send(p_socket, p_request) < 0) - { - return NULL; - } - - NetlinkList *l_list = NULL; - NetlinkList *l_end = NULL; - int l_size; - int l_done = 0; - while(!l_done) - { - struct nlmsghdr *l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done); - if(!l_hdr) - { // error - freeResultList(l_list); - return NULL; - } - - NetlinkList *l_item = newListItem(l_hdr, l_size); - if (!l_item) - { - freeResultList(l_list); - return NULL; - } - if(!l_list) - { - l_list = l_item; - } - else - { - l_end->m_next = l_item; - } - l_end = l_item; - } - return l_list; -} - -static size_t maxSize(size_t a, size_t b) -{ - return (a > b ? a : b); -} - -static size_t calcAddrLen(sa_family_t p_family, int p_dataSize) -{ - switch(p_family) - { - case AF_INET: - return sizeof(struct sockaddr_in); - case AF_INET6: - return sizeof(struct sockaddr_in6); - case AF_PACKET: - return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize); - default: - return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize); - } -} - -static void makeSockaddr(sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size) -{ - switch(p_family) - { - case AF_INET: - memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size); - break; - case AF_INET6: - memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size); - break; - case AF_PACKET: - memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size); - ((struct sockaddr_ll*)p_dest)->sll_halen = p_size; - break; - default: - memcpy(p_dest->sa_data, p_data, p_size); - break; - } - p_dest->sa_family = p_family; -} - -static void addToEnd(struct ifaddrs **p_resultList, struct ifaddrs *p_entry) -{ - if(!*p_resultList) - { - *p_resultList = p_entry; - } - else - { - struct ifaddrs *l_cur = *p_resultList; - while(l_cur->ifa_next) - { - l_cur = l_cur->ifa_next; - } - l_cur->ifa_next = p_entry; - } -} - -static int interpretLink(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList) -{ - struct ifinfomsg *l_info = (struct ifinfomsg *)NLMSG_DATA(p_hdr); - - size_t l_nameSize = 0; - size_t l_addrSize = 0; - size_t l_dataSize = 0; - - size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); - struct rtattr *l_rta; - for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) - { - __attribute__ ((unused)) void *l_rtaData = RTA_DATA(l_rta); - size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); - switch(l_rta->rta_type) - { - case IFLA_ADDRESS: - case IFLA_BROADCAST: - l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize)); - break; - case IFLA_IFNAME: - l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); - break; - case IFLA_STATS: - l_dataSize += NLMSG_ALIGN(l_rtaSize); - break; - default: - break; - } - } - - struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize); - if (l_entry == NULL) - { - return -1; - } - memset(l_entry, 0, sizeof(struct ifaddrs)); - l_entry->ifa_name = ""; - - char *l_index = ((char *)l_entry) + sizeof(struct ifaddrs); - char *l_name = l_index + sizeof(int); - char *l_addr = l_name + l_nameSize; - char *l_data = l_addr + l_addrSize; - - // save the interface index so we can look it up when handling the addresses. - memcpy(l_index, &l_info->ifi_index, sizeof(int)); - - l_entry->ifa_flags = l_info->ifi_flags; - - l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); - for(l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) - { - void *l_rtaData = RTA_DATA(l_rta); - size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); - switch(l_rta->rta_type) - { - case IFLA_ADDRESS: - case IFLA_BROADCAST: - { - size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize); - makeSockaddr(AF_PACKET, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize); - ((struct sockaddr_ll *)l_addr)->sll_ifindex = l_info->ifi_index; - ((struct sockaddr_ll *)l_addr)->sll_hatype = l_info->ifi_type; - if(l_rta->rta_type == IFLA_ADDRESS) - { - l_entry->ifa_addr = (struct sockaddr *)l_addr; - } - else - { - l_entry->ifa_broadaddr = (struct sockaddr *)l_addr; - } - l_addr += NLMSG_ALIGN(l_addrLen); - break; - } - case IFLA_IFNAME: - strncpy(l_name, l_rtaData, l_rtaDataSize); - l_name[l_rtaDataSize] = '\0'; - l_entry->ifa_name = l_name; - break; - case IFLA_STATS: - memcpy(l_data, l_rtaData, l_rtaDataSize); - l_entry->ifa_data = l_data; - break; - default: - break; - } - } - - addToEnd(p_resultList, l_entry); - return 0; -} - -static struct ifaddrs *findInterface(int p_index, struct ifaddrs **p_links, int p_numLinks) -{ - int l_num = 0; - struct ifaddrs *l_cur = *p_links; - while(l_cur && l_num < p_numLinks) - { - char *l_indexPtr = ((char *)l_cur) + sizeof(struct ifaddrs); - int l_index; - memcpy(&l_index, l_indexPtr, sizeof(int)); - if(l_index == p_index) - { - return l_cur; - } - - l_cur = l_cur->ifa_next; - ++l_num; - } - return NULL; -} - -static int interpretAddr(struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList, int p_numLinks) -{ - struct ifaddrmsg *l_info = (struct ifaddrmsg *)NLMSG_DATA(p_hdr); - struct ifaddrs *l_interface = findInterface(l_info->ifa_index, p_resultList, p_numLinks); - - if(l_info->ifa_family == AF_PACKET) - { - return 0; - } - - size_t l_nameSize = 0; - size_t l_addrSize = 0; - - int l_addedNetmask = 0; - - size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); - struct rtattr *l_rta; - for(l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) - { - __attribute__ ((unused)) void *l_rtaData = RTA_DATA(l_rta); - size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); - - switch(l_rta->rta_type) - { - case IFA_ADDRESS: - case IFA_LOCAL: - if((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) && !l_addedNetmask) - { // make room for netmask - l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); - l_addedNetmask = 1; - } - case IFA_BROADCAST: - l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); - break; - case IFA_LABEL: - l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); - break; - default: - break; - } - } - - struct ifaddrs *l_entry = malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize); - if (l_entry == NULL) - { - return -1; - } - memset(l_entry, 0, sizeof(struct ifaddrs)); - l_entry->ifa_name = (l_interface ? l_interface->ifa_name : ""); - - char *l_name = ((char *)l_entry) + sizeof(struct ifaddrs); - char *l_addr = l_name + l_nameSize; - - l_entry->ifa_flags = l_info->ifa_flags; - if(l_interface) - { - l_entry->ifa_flags |= l_interface->ifa_flags; - } - - l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); - for(l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) - { - void *l_rtaData = RTA_DATA(l_rta); - size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); - switch(l_rta->rta_type) - { - case IFA_ADDRESS: - case IFA_BROADCAST: - case IFA_LOCAL: - { - size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize); - makeSockaddr(l_info->ifa_family, (struct sockaddr *)l_addr, l_rtaData, l_rtaDataSize); - if(l_info->ifa_family == AF_INET6) - { - if(IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)l_rtaData) || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr *)l_rtaData)) - { - ((struct sockaddr_in6 *)l_addr)->sin6_scope_id = l_info->ifa_index; - } - } - - if(l_rta->rta_type == IFA_ADDRESS) - { // apparently in a point-to-point network IFA_ADDRESS contains the dest address and IFA_LOCAL contains the local address - if(l_entry->ifa_addr) - { - l_entry->ifa_dstaddr = (struct sockaddr *)l_addr; - } - else - { - l_entry->ifa_addr = (struct sockaddr *)l_addr; - } - } - else if(l_rta->rta_type == IFA_LOCAL) - { - if(l_entry->ifa_addr) - { - l_entry->ifa_dstaddr = l_entry->ifa_addr; - } - l_entry->ifa_addr = (struct sockaddr *)l_addr; - } - else - { - l_entry->ifa_broadaddr = (struct sockaddr *)l_addr; - } - l_addr += NLMSG_ALIGN(l_addrLen); - break; - } - case IFA_LABEL: - strncpy(l_name, l_rtaData, l_rtaDataSize); - l_name[l_rtaDataSize] = '\0'; - l_entry->ifa_name = l_name; - break; - default: - break; - } - } - - if(l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6)) - { - unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128); - unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen); - char l_mask[16] = {0}; - unsigned i; - for(i=0; i<(l_prefix/8); ++i) - { - l_mask[i] = 0xff; - } - if(l_prefix % 8) - { - l_mask[i] = 0xff << (8 - (l_prefix % 8)); - } - - makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr *)l_addr, l_mask, l_maxPrefix / 8); - l_entry->ifa_netmask = (struct sockaddr *)l_addr; - } - - addToEnd(p_resultList, l_entry); - return 0; -} - -static int interpretLinks(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList) -{ - int l_numLinks = 0; - pid_t l_pid = getpid(); - for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next) - { - unsigned int l_nlsize = p_netlinkList->m_size; - struct nlmsghdr *l_hdr; - for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) - { - if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) - { - continue; - } - - if(l_hdr->nlmsg_type == NLMSG_DONE) - { - break; - } - - if(l_hdr->nlmsg_type == RTM_NEWLINK) - { - if(interpretLink(l_hdr, p_resultList) == -1) - { - return -1; - } - ++l_numLinks; - } - } - } - return l_numLinks; -} - -static int interpretAddrs(int p_socket, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList, int p_numLinks) -{ - pid_t l_pid = getpid(); - for(; p_netlinkList; p_netlinkList = p_netlinkList->m_next) - { - unsigned int l_nlsize = p_netlinkList->m_size; - struct nlmsghdr *l_hdr; - for(l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) - { - if((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) - { - continue; - } - - if(l_hdr->nlmsg_type == NLMSG_DONE) - { - break; - } - - if(l_hdr->nlmsg_type == RTM_NEWADDR) - { - if (interpretAddr(l_hdr, p_resultList, p_numLinks) == -1) - { - return -1; - } - } - } - } - return 0; -} - -int getifaddrs(struct ifaddrs **ifap) -{ - if(!ifap) - { - return -1; - } - *ifap = NULL; - - int l_socket = netlink_socket(); - if(l_socket < 0) - { - return -1; - } - - NetlinkList *l_linkResults = getResultList(l_socket, RTM_GETLINK); - if(!l_linkResults) - { - close(l_socket); - return -1; - } - - NetlinkList *l_addrResults = getResultList(l_socket, RTM_GETADDR); - if(!l_addrResults) - { - close(l_socket); - freeResultList(l_linkResults); - return -1; - } - - int l_result = 0; - int l_numLinks = interpretLinks(l_socket, l_linkResults, ifap); - if(l_numLinks == -1 || interpretAddrs(l_socket, l_addrResults, ifap, l_numLinks) == -1) - { - l_result = -1; - } - - freeResultList(l_linkResults); - freeResultList(l_addrResults); - close(l_socket); - return l_result; -} - -void freeifaddrs(struct ifaddrs *ifa) -{ - struct ifaddrs *l_cur; - while(ifa) - { - l_cur = ifa; - ifa = ifa->ifa_next; - free(l_cur); - } -} diff --git a/mars/comm/jni/ifaddrs.cc b/mars/comm/jni/ifaddrs.cc new file mode 100644 index 000000000..d45f9cabd --- /dev/null +++ b/mars/comm/jni/ifaddrs.cc @@ -0,0 +1,677 @@ +/* + Copyright (c) 2013, Kenneth MacKay + All rights reserved. + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ifaddrs.h" + +#if defined(__ANDROID__) && __ANDROID_API__ < 24 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mars/comm/assert/__assert.h" + +typedef struct NetlinkList { + struct NetlinkList* m_next; + struct nlmsghdr* m_data; + unsigned int m_size; +} NetlinkList; + +static int netlink_socket(void) { + int l_socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + if (l_socket < 0) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -1; + } + + struct sockaddr_nl l_addr; + memset(&l_addr, 0, sizeof(l_addr)); + l_addr.nl_family = AF_NETLINK; + if (bind(l_socket, (struct sockaddr*)&l_addr, sizeof(l_addr)) < 0) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + close(l_socket); + return -1; + } + + return l_socket; +} + +static int netlink_send(int p_socket, int p_request) { + char l_buffer[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + NLMSG_ALIGN(sizeof(struct rtgenmsg))]; + memset(l_buffer, 0, sizeof(l_buffer)); + struct nlmsghdr* l_hdr = (struct nlmsghdr*)l_buffer; + struct rtgenmsg* l_msg = (struct rtgenmsg*)NLMSG_DATA(l_hdr); + + l_hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*l_msg)); + l_hdr->nlmsg_type = p_request; + l_hdr->nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST; + l_hdr->nlmsg_pid = 0; + l_hdr->nlmsg_seq = p_socket; + l_msg->rtgen_family = AF_UNSPEC; + + struct sockaddr_nl l_addr; + memset(&l_addr, 0, sizeof(l_addr)); + l_addr.nl_family = AF_NETLINK; + return (sendto(p_socket, l_hdr, l_hdr->nlmsg_len, 0, (struct sockaddr*)&l_addr, sizeof(l_addr))); +} + +static int netlink_recv(int p_socket, void* p_buffer, size_t p_len) { + struct msghdr l_msg; + struct iovec l_iov = {p_buffer, p_len}; + struct sockaddr_nl l_addr; + + for (;;) { + l_msg.msg_name = (void*)&l_addr; + l_msg.msg_namelen = sizeof(l_addr); + l_msg.msg_iov = &l_iov; + l_msg.msg_iovlen = 1; + l_msg.msg_control = NULL; + l_msg.msg_controllen = 0; + l_msg.msg_flags = 0; + int l_result = recvmsg(p_socket, &l_msg, 0); + + if (l_result < 0) { + if (errno == EINTR) { + continue; + } + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -2; + } + + if (l_msg.msg_flags & MSG_TRUNC) { // buffer was too small + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -1; + } + return l_result; + } +} + +static struct nlmsghdr* getNetlinkResponse(int p_socket, int* p_size, int* p_done) { + size_t l_size = 4096; + void* l_buffer = NULL; + + for (;;) { + free(l_buffer); + l_buffer = malloc(l_size); + if (l_buffer == NULL) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return NULL; + } + + int l_read = netlink_recv(p_socket, l_buffer, l_size); + *p_size = l_read; + if (l_read == -2) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + free(l_buffer); + return NULL; + } + if (l_read >= 0) { + struct sockaddr_nl local_addr; + memset(&local_addr, 0, sizeof(local_addr)); + socklen_t addr_len = sizeof(local_addr); + if (getsockname(p_socket, (struct sockaddr*)&local_addr, &addr_len) < 0) { + ASSERT2(0, "cannot getsockname line:%d", __LINE__); + free(l_buffer); + return NULL; + } + pid_t l_pid = local_addr.nl_pid; + struct nlmsghdr* l_hdr; + for (l_hdr = (struct nlmsghdr*)l_buffer; NLMSG_OK(l_hdr, (unsigned int)l_read); + l_hdr = (struct nlmsghdr*)NLMSG_NEXT(l_hdr, l_read)) { + if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) { + ASSERT2(0, + "l_pid:%d, nlmsg_pid:%d, p_socket:%d, nlmsg_seq:%d", + l_pid, + (pid_t)l_hdr->nlmsg_pid, + p_socket, + (int)l_hdr->nlmsg_seq); + continue; + } + + if (l_hdr->nlmsg_type == NLMSG_DONE) { + *p_done = 1; + break; + } + + if (l_hdr->nlmsg_type == NLMSG_ERROR) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + free(l_buffer); + return NULL; + } + } + return (struct nlmsghdr*)l_buffer; + } + + l_size *= 2; + } +} + +static NetlinkList* newListItem(struct nlmsghdr* p_data, unsigned int p_size) { + NetlinkList* l_item = (NetlinkList*)malloc(sizeof(NetlinkList)); + if (l_item == NULL) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return NULL; + } + + l_item->m_next = NULL; + l_item->m_data = p_data; + l_item->m_size = p_size; + return l_item; +} + +static void freeResultList(NetlinkList* p_list) { + NetlinkList* l_cur; + while (p_list) { + l_cur = p_list; + p_list = p_list->m_next; + free(l_cur->m_data); + free(l_cur); + } +} + +static NetlinkList* getResultList(int p_socket, int p_request) { + if (netlink_send(p_socket, p_request) < 0) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return NULL; + } + + NetlinkList* l_list = NULL; + NetlinkList* l_end = NULL; + int l_size; + int l_done = 0; + while (!l_done) { + struct nlmsghdr* l_hdr = getNetlinkResponse(p_socket, &l_size, &l_done); + if (!l_hdr) { // error + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + freeResultList(l_list); + return NULL; + } + + NetlinkList* l_item = newListItem(l_hdr, l_size); + if (!l_item) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + freeResultList(l_list); + return NULL; + } + if (!l_list) { + l_list = l_item; + } else { + l_end->m_next = l_item; + } + l_end = l_item; + } + return l_list; +} + +static size_t maxSize(size_t a, size_t b) { + return (a > b ? a : b); +} + +static size_t calcAddrLen(sa_family_t p_family, int p_dataSize) { + switch (p_family) { + case AF_INET: + return sizeof(struct sockaddr_in); + case AF_INET6: + return sizeof(struct sockaddr_in6); + case AF_PACKET: + return maxSize(sizeof(struct sockaddr_ll), offsetof(struct sockaddr_ll, sll_addr) + p_dataSize); + default: + return maxSize(sizeof(struct sockaddr), offsetof(struct sockaddr, sa_data) + p_dataSize); + } +} + +static void makeSockaddr(sa_family_t p_family, struct sockaddr* p_dest, void* p_data, size_t p_size) { + switch (p_family) { + case AF_INET: + memcpy(&((struct sockaddr_in*)p_dest)->sin_addr, p_data, p_size); + break; + case AF_INET6: + memcpy(&((struct sockaddr_in6*)p_dest)->sin6_addr, p_data, p_size); + break; + case AF_PACKET: + memcpy(((struct sockaddr_ll*)p_dest)->sll_addr, p_data, p_size); + ((struct sockaddr_ll*)p_dest)->sll_halen = p_size; + break; + default: + memcpy(p_dest->sa_data, p_data, p_size); + break; + } + p_dest->sa_family = p_family; +} + +static void addToEnd(struct ifaddrs** p_resultList, struct ifaddrs* p_entry) { + if (!*p_resultList) { + *p_resultList = p_entry; + } else { + struct ifaddrs* l_cur = *p_resultList; + while (l_cur->ifa_next) { + l_cur = l_cur->ifa_next; + } + l_cur->ifa_next = p_entry; + } +} + +static int interpretLink(struct nlmsghdr* p_hdr, struct ifaddrs** p_resultList) { + struct ifinfomsg* l_info = (struct ifinfomsg*)NLMSG_DATA(p_hdr); + + size_t l_nameSize = 0; + size_t l_addrSize = 0; + size_t l_dataSize = 0; + + size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); + struct rtattr* l_rta; + for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { + __attribute__((unused)) void* l_rtaData = RTA_DATA(l_rta); + size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); + switch (l_rta->rta_type) { + case IFLA_ADDRESS: + case IFLA_BROADCAST: + l_addrSize += NLMSG_ALIGN(calcAddrLen(AF_PACKET, l_rtaDataSize)); + break; + case IFLA_IFNAME: + l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); + break; + case IFLA_STATS: + l_dataSize += NLMSG_ALIGN(l_rtaSize); + break; + default: + break; + } + } + + struct ifaddrs* l_entry = + (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + sizeof(int) + l_nameSize + l_addrSize + l_dataSize); + if (l_entry == NULL) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -1; + } + memset(l_entry, 0, sizeof(struct ifaddrs)); + + char* l_index = ((char*)l_entry) + sizeof(struct ifaddrs); + char* l_name = l_index + sizeof(int); + char* l_addr = l_name + l_nameSize; + char* l_data = l_addr + l_addrSize; + + strcpy(l_name, ""); + l_entry->ifa_name = l_name; + + // save the interface index so we can look it up when handling the addresses. + memcpy(l_index, &l_info->ifi_index, sizeof(int)); + + l_entry->ifa_flags = l_info->ifi_flags; + + l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifinfomsg)); + for (l_rta = IFLA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { + void* l_rtaData = RTA_DATA(l_rta); + size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); + switch (l_rta->rta_type) { + case IFLA_ADDRESS: + case IFLA_BROADCAST: { + size_t l_addrLen = calcAddrLen(AF_PACKET, l_rtaDataSize); + makeSockaddr(AF_PACKET, (struct sockaddr*)l_addr, l_rtaData, l_rtaDataSize); + ((struct sockaddr_ll*)l_addr)->sll_ifindex = l_info->ifi_index; + ((struct sockaddr_ll*)l_addr)->sll_hatype = l_info->ifi_type; + if (l_rta->rta_type == IFLA_ADDRESS) { + l_entry->ifa_addr = (struct sockaddr*)l_addr; + } else { + l_entry->ifa_broadaddr = (struct sockaddr*)l_addr; + } + l_addr += NLMSG_ALIGN(l_addrLen); + break; + } + case IFLA_IFNAME: + strncpy(l_name, (const char*)l_rtaData, l_rtaDataSize); + l_name[l_rtaDataSize] = '\0'; + l_entry->ifa_name = l_name; + break; + case IFLA_STATS: + memcpy(l_data, l_rtaData, l_rtaDataSize); + l_entry->ifa_data = l_data; + break; + default: + break; + } + } + + addToEnd(p_resultList, l_entry); + return 0; +} + +static struct ifaddrs* findInterface(int p_index, struct ifaddrs** p_links, int p_numLinks) { + int l_num = 0; + struct ifaddrs* l_cur = *p_links; + while (l_cur && l_num < p_numLinks) { + char* l_indexPtr = ((char*)l_cur) + sizeof(struct ifaddrs); + int l_index; + memcpy(&l_index, l_indexPtr, sizeof(int)); + if (l_index == p_index) { + return l_cur; + } + + l_cur = l_cur->ifa_next; + ++l_num; + } + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return NULL; +} + +static int interpretAddr(struct nlmsghdr* p_hdr, struct ifaddrs** p_resultList, int p_numLinks) { + struct ifaddrmsg* l_info = (struct ifaddrmsg*)NLMSG_DATA(p_hdr); + struct ifaddrs* l_interface = findInterface(l_info->ifa_index, p_resultList, p_numLinks); + + if (l_info->ifa_family == AF_PACKET) { + return 0; + } + + size_t l_nameSize = 0; + size_t l_addrSize = 0; + + int l_addedNetmask = 0; + + size_t l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); + struct rtattr* l_rta; + for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { + __attribute__((unused)) void* l_rtaData = RTA_DATA(l_rta); + size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); + + switch (l_rta->rta_type) { + case IFA_ADDRESS: + case IFA_LOCAL: + if ((l_info->ifa_family == AF_INET || l_info->ifa_family == AF_INET6) + && !l_addedNetmask) { // make room for netmask + l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); + l_addedNetmask = 1; + } + l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); + break; + case IFA_BROADCAST: + l_addrSize += NLMSG_ALIGN(calcAddrLen(l_info->ifa_family, l_rtaDataSize)); + break; + case IFA_LABEL: + l_nameSize += NLMSG_ALIGN(l_rtaSize + 1); + break; + default: + break; + } + } + + struct ifaddrs* l_entry = (struct ifaddrs*)malloc(sizeof(struct ifaddrs) + l_nameSize + l_addrSize); + if (l_entry == NULL) { + return -1; + } + memset(l_entry, 0, sizeof(struct ifaddrs)); + + char* l_name = ((char*)l_entry) + sizeof(struct ifaddrs); + char* l_addr = l_name + l_nameSize; + + strcpy(l_name, ""); + l_entry->ifa_name = (l_interface ? l_interface->ifa_name : l_name); + l_entry->ifa_flags = l_info->ifa_flags; + if (l_interface) { + l_entry->ifa_flags |= l_interface->ifa_flags; + } + + l_rtaSize = NLMSG_PAYLOAD(p_hdr, sizeof(struct ifaddrmsg)); + for (l_rta = IFA_RTA(l_info); RTA_OK(l_rta, l_rtaSize); l_rta = RTA_NEXT(l_rta, l_rtaSize)) { + void* l_rtaData = RTA_DATA(l_rta); + size_t l_rtaDataSize = RTA_PAYLOAD(l_rta); + switch (l_rta->rta_type) { + case IFA_ADDRESS: + case IFA_BROADCAST: + case IFA_LOCAL: { + size_t l_addrLen = calcAddrLen(l_info->ifa_family, l_rtaDataSize); + makeSockaddr(l_info->ifa_family, (struct sockaddr*)l_addr, l_rtaData, l_rtaDataSize); + if (l_info->ifa_family == AF_INET6) { + if (IN6_IS_ADDR_LINKLOCAL((struct in6_addr*)l_rtaData) + || IN6_IS_ADDR_MC_LINKLOCAL((struct in6_addr*)l_rtaData)) { + ((struct sockaddr_in6*)l_addr)->sin6_scope_id = l_info->ifa_index; + } + } + + if (l_rta->rta_type == IFA_ADDRESS) { // apparently in a point-to-point network IFA_ADDRESS contains + // the dest address and IFA_LOCAL contains the local address + if (l_entry->ifa_addr) { + l_entry->ifa_ifu.ifu_dstaddr = (struct sockaddr*)l_addr; + } else { + l_entry->ifa_addr = (struct sockaddr*)l_addr; + } + } else if (l_rta->rta_type == IFA_LOCAL) { + if (l_entry->ifa_addr) { + l_entry->ifa_ifu.ifu_dstaddr = l_entry->ifa_addr; + } + l_entry->ifa_addr = (struct sockaddr*)l_addr; + } else { + l_entry->ifa_broadaddr = (struct sockaddr*)l_addr; + } + l_addr += NLMSG_ALIGN(l_addrLen); + break; + } + case IFA_LABEL: + strncpy(l_name, (const char*)l_rtaData, l_rtaDataSize); + l_name[l_rtaDataSize] = '\0'; + l_entry->ifa_name = l_name; + break; + default: + break; + } + } + + if (l_entry->ifa_addr && (l_entry->ifa_addr->sa_family == AF_INET || l_entry->ifa_addr->sa_family == AF_INET6)) { + unsigned l_maxPrefix = (l_entry->ifa_addr->sa_family == AF_INET ? 32 : 128); + unsigned l_prefix = (l_info->ifa_prefixlen > l_maxPrefix ? l_maxPrefix : l_info->ifa_prefixlen); + char l_mask[16] = {0}; + unsigned i; + for (i = 0; i < (l_prefix / 8); ++i) { + l_mask[i] = 0xff; + } + if (l_prefix % 8) { + l_mask[i] = 0xff << (8 - (l_prefix % 8)); + } + + makeSockaddr(l_entry->ifa_addr->sa_family, (struct sockaddr*)l_addr, l_mask, l_maxPrefix / 8); + l_entry->ifa_netmask = (struct sockaddr*)l_addr; + } + + addToEnd(p_resultList, l_entry); + return 0; +} + +static int interpretLinks(int p_socket, NetlinkList* p_netlinkList, struct ifaddrs** p_resultList) { + int l_numLinks = 0; + struct sockaddr_nl local_addr; + memset(&local_addr, 0, sizeof(local_addr)); + socklen_t addr_len = sizeof(local_addr); + if (getsockname(p_socket, (struct sockaddr*)&local_addr, &addr_len) < 0) { + ASSERT2(0, "cannot getsockname line:%d", __LINE__); + return -1; + } + pid_t l_pid = local_addr.nl_pid; + for (; p_netlinkList; p_netlinkList = p_netlinkList->m_next) { + unsigned int l_nlsize = p_netlinkList->m_size; + struct nlmsghdr* l_hdr; + for (l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) { + if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) { + ASSERT2(0, + "l_pid:%d, nlmsg_pid:%d, p_socket:%d, nlmsg_seq:%d", + l_pid, + (pid_t)l_hdr->nlmsg_pid, + p_socket, + (int)l_hdr->nlmsg_seq); + continue; + } + + if (l_hdr->nlmsg_type == NLMSG_DONE) { + break; + } + + if (l_hdr->nlmsg_type == RTM_NEWLINK) { + if (interpretLink(l_hdr, p_resultList) == -1) { + return -1; + } + ++l_numLinks; + } + } + } + return l_numLinks; +} + +static int interpretAddrs(int p_socket, NetlinkList* p_netlinkList, struct ifaddrs** p_resultList, int p_numLinks) { + struct sockaddr_nl local_addr; + memset(&local_addr, 0, sizeof(local_addr)); + socklen_t addr_len = sizeof(local_addr); + if (getsockname(p_socket, (struct sockaddr*)&local_addr, &addr_len) < 0) { + ASSERT2(0, "cannot getsockname line:%d", __LINE__); + return -1; + } + pid_t l_pid = local_addr.nl_pid; + for (; p_netlinkList; p_netlinkList = p_netlinkList->m_next) { + unsigned int l_nlsize = p_netlinkList->m_size; + struct nlmsghdr* l_hdr; + for (l_hdr = p_netlinkList->m_data; NLMSG_OK(l_hdr, l_nlsize); l_hdr = NLMSG_NEXT(l_hdr, l_nlsize)) { + if ((pid_t)l_hdr->nlmsg_pid != l_pid || (int)l_hdr->nlmsg_seq != p_socket) { + ASSERT2(0, + "l_pid:%d, nlmsg_pid:%d, p_socket:%d, nlmsg_seq:%d", + l_pid, + (pid_t)l_hdr->nlmsg_pid, + p_socket, + (int)l_hdr->nlmsg_seq); + continue; + } + + if (l_hdr->nlmsg_type == NLMSG_DONE) { + break; + } + + if (l_hdr->nlmsg_type == RTM_NEWADDR) { + if (interpretAddr(l_hdr, p_resultList, p_numLinks) == -1) { + return -1; + } + } + } + } + return 0; +} + +class ScopedDL { + public: + ScopedDL(const char* sopath) { + handle_ = dlopen(sopath, RTLD_NOW | RTLD_LOCAL); + } + ~ScopedDL() { + if (handle_ != nullptr) + dlclose(handle_); + + handle_ = nullptr; + } + + template + FN GetSymbol(const char* signature) { + if (!handle_) + return nullptr; + void* pfn = dlsym(handle_, signature); + if (!pfn) + return nullptr; + + return reinterpret_cast(pfn); + } + + private: + void* handle_ = nullptr; +}; + +ScopedDL g_libcdl("libc.so"); + +// +typedef int (*getifaddrs_proc)(struct ifaddrs** ifap); +typedef void (*freeifaddrs_proc)(struct ifaddrs* ifa); + +int getifaddrs(struct ifaddrs** ifap) { + if (!ifap) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -1; + } + *ifap = NULL; + + getifaddrs_proc api = g_libcdl.GetSymbol("getifaddrs"); + if (api != nullptr) { + return api(ifap); + } + + int l_socket = netlink_socket(); + if (l_socket < 0) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + return -1; + } + + NetlinkList* l_linkResults = getResultList(l_socket, RTM_GETLINK); + if (!l_linkResults) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + close(l_socket); + return -1; + } + + NetlinkList* l_addrResults = getResultList(l_socket, RTM_GETADDR); + if (!l_addrResults) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + close(l_socket); + freeResultList(l_linkResults); + return -1; + } + + int l_result = 0; + int l_numLinks = interpretLinks(l_socket, l_linkResults, ifap); + if (l_numLinks == -1 || interpretAddrs(l_socket, l_addrResults, ifap, l_numLinks) == -1) { + ASSERT2(0, "line %d error %d, %s", __LINE__, errno, strerror(errno)); + l_result = -1; + } + + freeResultList(l_linkResults); + freeResultList(l_addrResults); + close(l_socket); + return l_result; +} + +void freeifaddrs(struct ifaddrs* ifa) { + freeifaddrs_proc api = g_libcdl.GetSymbol("freeifaddrs"); + if (api != nullptr) { + api(ifa); + return; + } + + struct ifaddrs* l_cur; + while (ifa) { + l_cur = ifa; + ifa = ifa->ifa_next; + free(l_cur); + } +} +#endif diff --git a/mars/comm/jni/ifaddrs.h b/mars/comm/jni/ifaddrs.h index 9282efa6a..409269cdd 100644 --- a/mars/comm/jni/ifaddrs.h +++ b/mars/comm/jni/ifaddrs.h @@ -22,33 +22,17 @@ * * BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp */ +#ifndef _IFADDRS_H_ +#define _IFADDRS_H_ -#ifndef _IFADDRS_H_ -#define _IFADDRS_H_ - -struct ifaddrs { - struct ifaddrs *ifa_next; - char *ifa_name; - unsigned int ifa_flags; - struct sockaddr *ifa_addr; - struct sockaddr *ifa_netmask; - struct sockaddr *ifa_dstaddr; - void *ifa_data; -}; - -/* - * This may have been defined in . Note that if is - * to be included it must be included before this header file. - */ -#ifndef ifa_broadaddr -#define ifa_broadaddr ifa_dstaddr /* broadcast address interface */ -#endif +#include +#if defined(__ANDROID__) && __ANDROID_API__ < 24 #include - __BEGIN_DECLS -extern int getifaddrs(struct ifaddrs **ifap); -extern void freeifaddrs(struct ifaddrs *ifa); +extern int getifaddrs(struct ifaddrs** ifap); +extern void freeifaddrs(struct ifaddrs* ifa); __END_DECLS +#endif // __ANDROID_API__ -#endif +#endif //_IFADDRS_2_H_ diff --git a/mars/comm/jni/import.mk b/mars/comm/jni/import.mk deleted file mode 100644 index 5f3c8a4e7..000000000 --- a/mars/comm/jni/import.mk +++ /dev/null @@ -1,3 +0,0 @@ -IMPORT_LOCAL_PATH := $(call my-dir) -SELF_LOCAL_IMPORT_LIBRARIES_PATH := -include $(IMPORT_LOCAL_PATH)/../../mk_template/import_template.mk \ No newline at end of file diff --git a/mars/comm/jni/jnicat/jnicat_core.cpp b/mars/comm/jni/jnicat/jnicat_core.cpp new file mode 100644 index 000000000..e3c6854f3 --- /dev/null +++ b/mars/comm/jni/jnicat/jnicat_core.cpp @@ -0,0 +1,939 @@ +// +// Created by PeterFan on 2018/4/19. +// + +#include "jnicat_core.h" + +#include + +#define xdebug(args...) __android_log_print(ANDROID_LOG_DEBUG, "jnicat", args) +#define xerror(args...) __android_log_print(ANDROID_LOG_ERROR, "jnicat", args) + +namespace jnicat { + +const char* version() { + return "1.2.3"; +} + +std::string jstring_to_string(JNIEnv* env, jstring jstr) { + std::string str; + if (jstr == nullptr) { + return str; + } + auto cls = jcache::shared()->get_class(env, "java/lang/String"); + auto mid = jcache::shared()->get_methodid(env, cls, "getBytes", "(Ljava/lang/String;)[B"); + auto encoding = env->NewStringUTF("utf-8"); + auto bytes = (jbyteArray)env->CallObjectMethod(jstr, mid, encoding); + auto len = env->GetArrayLength(bytes); + if (len > 0) { + jbyte* cstr = env->GetByteArrayElements(bytes, 0); + str.assign((const char*)cstr, len); + env->ReleaseByteArrayElements(bytes, cstr, JNI_ABORT); + } + env->DeleteLocalRef(encoding); + env->DeleteLocalRef(bytes); + return str; +} + +jstring cstr_to_jstring(JNIEnv* env, const char* cstr) { + auto cls = jcache::shared()->get_class(env, "java/lang/String"); + auto ctor = jcache::shared()->get_methodid(env, cls, "", "([BLjava/lang/String;)V"); + jbyteArray bytes; + if (cstr != nullptr) { + auto len = strlen(cstr); + bytes = env->NewByteArray(len); + env->SetByteArrayRegion(bytes, 0, len, (const jbyte*)cstr); + } else { + char null_str[1] = {0}; + bytes = env->NewByteArray(1); + env->SetByteArrayRegion(bytes, 0, 1, (const jbyte*)null_str); + } + + auto encoding = env->NewStringUTF("utf-8"); + auto jstr = (jstring)env->NewObject(cls, ctor, bytes, encoding); + env->DeleteLocalRef(bytes); + env->DeleteLocalRef(encoding); + return jstr; +} + +jbyteArray string_to_jbytearray(JNIEnv* env, const std::string& str) { + return NewArray(env, (jsize)str.size(), (const jbyte*)str.data()); +} + +std::string jbytearray_to_string(JNIEnv* env, jbyteArray array) { + return jarray_to_vector(env, array); +} + +std::string jobject_to_pbstring(JNIEnv* env, const jobject obj, const std::string& sig) { + jclass pbClass = jcache::shared()->get_class(env, sig.c_str()); + jmethodID toByteArray = env->GetMethodID(pbClass, "toByteArray", std::string("()[B").c_str()); + jbyteArray pb_byte_array = (jbyteArray)env->CallObjectMethod(obj, toByteArray); + return jni_j2c_cast(env, pb_byte_array); +} + +std::vector jobjectarray_to_pbstringvector(JNIEnv* env, const jobjectArray array, const std::string& sig) { + jclass pbClass = jcache::shared()->get_class(env, sig.c_str()); + jmethodID toByteArray = env->GetMethodID(pbClass, "toByteArray", std::string("()[B").c_str()); + auto len = env->GetArrayLength(array); + std::vector vec; + vec.reserve(len); + for (auto i = 0; i < len; ++i) { + auto jobj = (jobject)env->GetObjectArrayElement(array, i); + jbyteArray pb_byte_array = (jbyteArray)env->CallObjectMethod(jobj, toByteArray); + vec.push_back(jni_j2c_cast(env, pb_byte_array)); + env->DeleteLocalRef(pb_byte_array); + } + return vec; +} + +jobjectArray cpbarray_to_jobjectarray(JNIEnv* env, const std::vector& vec, const std::string& sig) { + jclass cls = jcache::shared()->get_class(env, sig.c_str()); + jmethodID mid = env->GetStaticMethodID(cls, "parseFrom", ("([B)L" + sig + ";").c_str()); + auto array = (jobjectArray)env->NewObjectArray(vec.size(), cls, nullptr); + for (unsigned long i = 0; i < vec.size(); ++i) { + jobject obj = (jobject)env->CallStaticObjectMethod(cls, mid, jni_c2j_cast(env, vec[i])); + env->SetObjectArrayElement(array, i, obj); + } + return array; +} + +std::vector jobjectarray_to_stringvector(JNIEnv* env, jobjectArray array) { + auto len = env->GetArrayLength(array); + std::vector vec; + vec.reserve(len); + for (auto i = 0; i < len; ++i) { + auto jstr = (jstring)env->GetObjectArrayElement(array, i); + vec.push_back(jni_j2c_cast(env, jstr)); + env->DeleteLocalRef(jstr); + } + return vec; +} + +std::vector> jobjectarray_to_stringvector2(JNIEnv* env, jobjectArray array) { + auto len = env->GetArrayLength(array); + std::vector> vec; + vec.reserve(len); + for (auto i = 0; i < len; ++i) { + auto arr = (jobjectArray)env->GetObjectArrayElement(array, i); + vec.push_back(jobjectarray_to_stringvector(env, arr)); + env->DeleteLocalRef(arr); + } + return vec; +} + +jobjectArray stringvector_to_jobjectarray(JNIEnv* env, const std::vector& vec) { + auto cls = jcache::shared()->get_class(env, "java/lang/String"); + auto array = env->NewObjectArray(vec.size(), cls, nullptr); + for (unsigned long i = 0; i < vec.size(); ++i) { + env->SetObjectArrayElement(array, i, env->NewStringUTF(vec[i].c_str())); + } + return array; +} + +jobjectArray stringvector2_to_jobjectarray(JNIEnv* env, const std::vector>& vec) { + auto cls = jcache::shared()->get_class(env, "[Ljava/lang/String;"); + auto array = env->NewObjectArray(vec.size(), cls, nullptr); + for (unsigned long i = 0; i < vec.size(); ++i) { + jobject value = stringvector_to_jobjectarray(env, vec[i]); + env->SetObjectArrayElement(array, i, value); + } + return array; +} + +jobject stringvector_to_arraylist(JNIEnv* env, const std::vector& vec) { + auto cls = jcache::shared()->get_class(env, "java/util/ArrayList"); + auto ctor_method = jcache::shared()->get_methodid(env, cls, "", "()V"); + auto add_method = jcache::shared()->get_methodid(env, cls, "add", "(Ljava/lang/Object;)Z"); + auto obj = env->NewObject(cls, ctor_method); + for (const auto& str : vec) { + auto array = string_to_jbytearray(env, str); + env->CallBooleanMethod(obj, add_method, array); + env->DeleteLocalRef(array); + } + return obj; +} + +std::vector arraylist_to_stringvector(JNIEnv* env, jobject obj) { + auto cls = jcache::shared()->get_class(env, "java/util/ArrayList"); + auto toarray_method = jcache::shared()->get_methodid(env, cls, "toArray", "()[Ljava/lang/Object;"); + jobjectArray array = (jobjectArray)env->CallObjectMethod(obj, toarray_method); + auto len = env->GetArrayLength(array); + std::vector vec; + vec.reserve(len); + for (auto i = 0; i < len; ++i) { + auto arr = (jbyteArray)env->GetObjectArrayElement(array, i); + vec.push_back(jbytearray_to_string(env, arr)); + env->DeleteLocalRef(arr); + } + return vec; +} + +jbooleanArray NewArray(JNIEnv* env, jsize len, const jboolean* buf) { + auto array = env->NewBooleanArray(len); + env->SetBooleanArrayRegion(array, 0, len, buf); + return array; +} + +jbyteArray NewArray(JNIEnv* env, jsize len, const jbyte* buf) { + auto array = env->NewByteArray(len); + env->SetByteArrayRegion(array, 0, len, buf); + return array; +} + +jcharArray NewArray(JNIEnv* env, jsize len, const jchar* buf) { + auto array = env->NewCharArray(len); + env->SetCharArrayRegion(array, 0, len, buf); + return array; +} + +jshortArray NewArray(JNIEnv* env, jsize len, const jshort* buf) { + auto array = env->NewShortArray(len); + env->SetShortArrayRegion(array, 0, len, buf); + return array; +} + +jintArray NewArray(JNIEnv* env, jsize len, const jint* buf) { + auto array = env->NewIntArray(len); + env->SetIntArrayRegion(array, 0, len, buf); + return array; +} + +jlongArray NewArray(JNIEnv* env, jsize len, const jlong* buf) { + auto array = env->NewLongArray(len); + env->SetLongArrayRegion(array, 0, len, buf); + return array; +} + +jfloatArray NewArray(JNIEnv* env, jsize len, const jfloat* buf) { + auto array = env->NewFloatArray(len); + env->SetFloatArrayRegion(array, 0, len, buf); + return array; +} + +jdoubleArray NewArray(JNIEnv* env, jsize len, const jdouble* buf) { + auto array = env->NewDoubleArray(len); + env->SetDoubleArrayRegion(array, 0, len, buf); + return array; +} + +static void __cache_all_cacheitem(JNIEnv* env); +static void __register_all_jnimethod(JNIEnv* env); + +static void try_detach_current_thread() { + auto jc = jcache::shared(); + if (jc->is_auto_detach() && jc->java_vm() != nullptr) { + xdebug("auto detach enabled, call DetachCurrentThread()"); + jc->java_vm()->DetachCurrentThread(); + } +} + +static void enable_detach_current_thread() { + static thread_local struct OnExit { + ~OnExit() { + xdebug("try_detach_current_thread: thread_local"); + try_detach_current_thread(); + } + } dummy; +}; + +jcache* jcache::instance_ = nullptr; + +jcache::jcache() : vm_(nullptr), is_auto_detach_(true), exception_handler_(nullptr) { +} + +jcache::~jcache() { + __clear_cache(); +} + +jcache* jcache::shared() { + if (instance_ == nullptr) { + instance_ = new jcache(); + } + return instance_; +} + +void jcache::release() { + if (instance_ != nullptr) { + delete instance_; + instance_ = nullptr; + } +} + +int jcache::init(JavaVM* vm) { + jnienv_ptr env(vm); + if (env.get() == nullptr) { + return JNI_ERR; + } + + vm_ = vm; + __cache_class(env); + __cache_method(env); + __register_all_jnimethod(env); + return JNI_VERSION_1_6; +} + +JavaVM* jcache::java_vm() const { + return vm_; +} + +void jcache::set_auto_detach(bool is_auto_detach) { + is_auto_detach_ = is_auto_detach; +} + +bool jcache::is_auto_detach() const { + return is_auto_detach_; +} + +void jcache::set_exception_handler(C2JavaExceptionHandler handler) { + exception_handler_ = handler; +} + +void jcache::__cache_class(JNIEnv* env) { + for (auto classname : kJarrayClassnameMap) { + get_class(env, classname); + } + + for (auto classname : kJwrapperClassnameMap) { + get_class(env, classname); + } + + get_class(env, "java/lang/String"); + get_class(env, "[Ljava/lang/String;"); + get_class(env, "java/util/ArrayList"); +} + +void jcache::__cache_method(JNIEnv* env) { + __cache_all_cacheitem(env); +} + +void jcache::__clear_cache() { + std::lock_guard lock(mutex_); + if (vm_ == nullptr) { + return; + } + + jnienv_ptr env(vm_); + for (const auto& item : classmap_) { + env->DeleteGlobalRef(item.second); + } + for (const auto& item : fieldmap_) { + env->DeleteGlobalRef(item.first); + delete item.second; + } + for (const auto& item : methodmap_) { + env->DeleteGlobalRef(item.first); + delete item.second; + } + env.detach(); +} + +jclass jcache::get_class(JNIEnv* env, const char* name) { + assert(env != nullptr); + assert(name != nullptr); + + std::lock_guard lock(mutex_); + class_map_t::iterator it = classmap_.find(name); + if (it != classmap_.end()) { + return it->second; + } + + auto cls = env->FindClass(name); + if (cls == nullptr) { + return nullptr; + } + + auto gcls = (jclass)env->NewGlobalRef(cls); + env->DeleteLocalRef(cls); + classmap_.insert(std::make_pair(name, gcls)); + return gcls; +} + +static std::string __name_sig_hash(const char* name, const char* sig) { + std::string hash(name); + hash.append(":"); + hash.append(sig); + return hash; +} + +jfieldID jcache::get_fieldid(JNIEnv* env, jobject obj, const char* fieldname, const char* signature) { + auto cls = env->GetObjectClass(obj); + if (cls == nullptr) { + return nullptr; + } + auto fid = get_fieldid(env, cls, fieldname, signature); + env->DeleteLocalRef(cls); + return fid; +} + +jfieldID jcache::get_static_fieldid(JNIEnv* env, jobject obj, const char* fieldname, const char* signature) { + auto cls = env->GetObjectClass(obj); + if (cls == nullptr) { + return nullptr; + } + auto fid = get_static_fieldid(env, cls, fieldname, signature); + env->DeleteLocalRef(cls); + return fid; +} + +jmethodID jcache::get_methodid(JNIEnv* env, jobject obj, const char* methodname, const char* signature) { + auto cls = env->GetObjectClass(obj); + if (cls == nullptr) { + return nullptr; + } + auto mid = get_methodid(env, cls, methodname, signature); + env->DeleteLocalRef(cls); + return mid; +} + +jmethodID jcache::get_static_methodid(JNIEnv* env, jobject obj, const char* methodname, const char* signature) { + auto cls = env->GetObjectClass(obj); + if (cls == nullptr) { + return nullptr; + } + auto mid = get_static_methodid(env, cls, methodname, signature); + env->DeleteLocalRef(cls); + return mid; +} + +jfieldID jcache::get_fieldid(JNIEnv* env, jclass cls, const char* fieldname, const char* signature) { + assert(env != nullptr); + assert(cls != nullptr); + assert(fieldname != nullptr); + assert(signature != nullptr); + + std::lock_guard lock(mutex_); + auto fmap = __get_field_map(env, cls); + assert(fmap != nullptr); + auto key = __name_sig_hash(fieldname, signature); + auto it = fmap->find(key); + if (it != fmap->end()) { + return it->second; + } + + auto fid = env->GetFieldID(cls, fieldname, signature); + if (fid == nullptr) { + return nullptr; + } + + fmap->insert(std::make_pair(key, fid)); + return fid; +} + +jfieldID jcache::get_static_fieldid(JNIEnv* env, jclass cls, const char* fieldname, const char* signature) { + assert(env != nullptr); + assert(cls != nullptr); + assert(fieldname != nullptr); + assert(signature != nullptr); + + std::lock_guard lock(mutex_); + auto fmap = __get_field_map(env, cls); + assert(fmap != nullptr); + auto key = __name_sig_hash(fieldname, signature); + auto it = fmap->find(key); + if (it != fmap->end()) { + return it->second; + } + + auto fid = env->GetStaticFieldID(cls, fieldname, signature); + if (fid == nullptr) { + return nullptr; + } + + fmap->insert(std::make_pair(key, fid)); + return fid; +} + +jmethodID jcache::get_methodid(JNIEnv* env, jclass cls, const char* methodname, const char* signature) { + assert(env != nullptr); + assert(cls != nullptr); + assert(methodname != nullptr); + assert(signature != nullptr); + + std::lock_guard lock(mutex_); + auto mmap = __get_method_map(env, cls); + assert(mmap != nullptr); + auto key = __name_sig_hash(methodname, signature); + auto it = mmap->find(key); + if (it != mmap->end()) { + return it->second; + } + + auto mid = env->GetMethodID(cls, methodname, signature); + if (mid == nullptr) { + return nullptr; + } + + mmap->insert(std::make_pair(key, mid)); + return mid; +} + +jmethodID jcache::get_static_methodid(JNIEnv* env, jclass cls, const char* methodname, const char* signature) { + assert(env != nullptr); + assert(cls != nullptr); + assert(methodname != nullptr); + assert(signature != nullptr); + + std::lock_guard lock(mutex_); + auto mmap = __get_method_map(env, cls); + assert(mmap != nullptr); + auto key = __name_sig_hash(methodname, signature); + auto it = mmap->find(key); + if (it != mmap->end()) { + return it->second; + } + + auto mid = env->GetStaticMethodID(cls, methodname, signature); + if (mid == nullptr) { + return nullptr; + } + + mmap->insert(std::make_pair(key, mid)); + return mid; +} + +jfieldID jcache::get_fieldid(JNIEnv* env, const char* classname, const char* fieldname, const char* signature) { + auto cls = get_class(env, classname); + if (cls == nullptr) { + return nullptr; + } + return get_fieldid(env, cls, fieldname, signature); +} + +jfieldID jcache::get_static_fieldid(JNIEnv* env, const char* classname, const char* fieldname, const char* signature) { + auto cls = get_class(env, classname); + if (cls == nullptr) { + return nullptr; + } + return get_static_fieldid(env, cls, fieldname, signature); +} + +jmethodID jcache::get_methodid(JNIEnv* env, const char* classname, const char* methodname, const char* signature) { + auto cls = get_class(env, classname); + if (cls == nullptr) { + return nullptr; + } + return get_methodid(env, cls, methodname, signature); +} + +jmethodID jcache::get_static_methodid(JNIEnv* env, + const char* classname, + const char* methodname, + const char* signature) { + auto cls = get_class(env, classname); + if (cls == nullptr) { + return nullptr; + } + return get_static_methodid(env, cls, methodname, signature); +} + +struct jobject_compare_t { + public: + jobject_compare_t(JNIEnv* env, jobject obj) : env_(env), obj_(obj) { + } + bool operator()(const jcache::class_field_map_t::value_type& rhs) const { + return env_->IsSameObject(obj_, rhs.first); + } + bool operator()(const jcache::class_method_map_t::value_type& rhs) const { + return env_->IsSameObject(obj_, rhs.first); + } + + private: + JNIEnv* env_; + jobject obj_; +}; + +jcache::field_map_t* jcache::__get_field_map(JNIEnv* env, jclass cls) { + auto it = std::find_if(fieldmap_.begin(), fieldmap_.end(), jobject_compare_t(env, cls)); + if (it != fieldmap_.end()) { + return it->second; + } + auto fmap = new field_map_t(); + auto gcls = (jclass)env->NewGlobalRef(cls); + fieldmap_.insert(std::make_pair(gcls, fmap)); + return fmap; +} + +jcache::method_map_t* jcache::__get_method_map(JNIEnv* env, jclass cls) { + auto it = std::find_if(methodmap_.begin(), methodmap_.end(), jobject_compare_t(env, cls)); + if (it != methodmap_.end()) { + return it->second; + } + auto mmap = new method_map_t(); + auto gcls = (jclass)env->NewGlobalRef(cls); + methodmap_.insert(std::make_pair(gcls, mmap)); + return mmap; +} + +static void __dump_fieldmap(jcache::field_map_t* fmap) { + for (const auto& item : *fmap) { + xdebug(" %s -> %p", item.first.c_str(), item.second); + } +} + +static void __dump_methodmap(jcache::method_map_t* mmap) { + for (const auto& item : *mmap) { + xdebug(" %s -> %p", item.first.c_str(), item.second); + } +} + +void jcache::dump() { + std::lock_guard lock(mutex_); + xdebug("********** class cache ********** count %d", (int)classmap_.size()); + for (const auto& item : classmap_) { + xdebug("%s -> %p", item.first.c_str(), item.second); + } + xdebug("********** field cache ********** count %d", (int)fieldmap_.size()); + for (const auto& item : fieldmap_) { + xdebug("%p:", item.first); + __dump_fieldmap(item.second); + } + xdebug("********** method cache ********** count %d", (int)methodmap_.size()); + for (const auto& item : methodmap_) { + xdebug("%p:", item.first); + __dump_methodmap(item.second); + } +} + +JNICAT_DEFINE_METHOD(kThrowable_toString, "java/lang/Throwable", "toString", "()Ljava/lang/String;") +std::string GetExceptionString(jthrowable e) { + jnienv_ptr env; + return j2c_cast(c2j_call(jstring, e, kThrowable_toString)); +} + +JNICAT_DEFINE_STATIC_METHOD(kLog_getStackTraceString, + "android/util/Log", + "getStackTraceString", + "(Ljava/lang/Throwable;)Ljava/lang/String;") +std::string GetStackTraceString(jthrowable e) { + jnienv_ptr env; + return j2c_cast(c2j_call_static(jstring, kLog_getStackTraceString, e)); +} + +void jcache::check_exception(JNIEnv* env) { + if (env == nullptr) { + return; + } + if (jthrowable e = env->ExceptionOccurred()) { + env->ExceptionDescribe(); + env->ExceptionClear(); + std::string stacktrace = GetStackTraceString(e); + // no need to call DeleteLocalRef + // env->DeleteLocalRef(e); + if (exception_handler_ != nullptr) { + exception_handler_(stacktrace); + } else { + env->FatalError(stacktrace.c_str()); + } + } +} + +jobject NewObjectV(JNIEnv* env, const char* classname, const char* methodname, const char* signature, va_list args) { + // xdebug("NewObjectV(\"%s\", \"%s\", \"%s\")", classname, name, signature); + auto cls = jcache::shared()->get_class(env, classname); + auto mid = jcache::shared()->get_methodid(env, cls, methodname, signature); + return env->NewObjectV(cls, mid, args); +} + +jobject NewObject(JNIEnv* env, const char* classname, const char* methodname, const char* signature, ...) { + va_list args; + va_start(args, signature); + jobject result = NewObjectV(env, classname, methodname, signature, args); + va_end(args); + return result; +} + +jobject NewObject(JNIEnv* env, const jcacheitem* ci, ...) { + va_list args; + va_start(args, ci); + jobject result = NewObjectV(env, ci->classname, ci->name, ci->signature, args); + va_end(args); + return result; +} + +jvalue CallStaticMethodV(JNIEnv* env, + const char* classname, + const char* methodname, + const char* signature, + va_list args) { + // xdebug("CallStaticMethodV(\"%s\", \"%s\", \"%s\")", classname, name, signature); + jvalue result; + memset(&result, 0, sizeof(result)); + auto cls = jcache::shared()->get_class(env, classname); + auto mid = jcache::shared()->get_static_methodid(env, cls, methodname, signature); + + auto p = strchr(signature, ')'); + if (p == nullptr) { + env->FatalError("illegal signature"); + return result; + } + + ++p; + switch (*p) { + case 'V': + env->CallStaticVoidMethodV(cls, mid, args); + break; + + case '[': + case 'L': + result.l = env->CallStaticObjectMethodV(cls, mid, args); + break; + + case 'Z': + result.z = env->CallStaticBooleanMethodV(cls, mid, args); + break; + + case 'B': + result.b = env->CallStaticByteMethodV(cls, mid, args); + break; + + case 'C': + result.c = env->CallStaticCharMethodV(cls, mid, args); + break; + + case 'S': + result.s = env->CallStaticShortMethodV(cls, mid, args); + break; + + case 'I': + result.i = env->CallStaticIntMethodV(cls, mid, args); + break; + + case 'J': + result.j = env->CallStaticLongMethodV(cls, mid, args); + break; + + case 'F': + result.f = env->CallStaticFloatMethodV(cls, mid, args); + break; + + case 'D': + result.d = env->CallStaticDoubleMethodV(cls, mid, args); + break; + + default: + env->FatalError("illegal descriptor"); + break; + } + jcache::shared()->check_exception(env); + return result; +} + +jvalue CallStaticMethod(JNIEnv* env, const char* classname, const char* methodname, const char* signature, ...) { + va_list args; + va_start(args, signature); + jvalue result = CallStaticMethodV(env, classname, methodname, signature, args); + va_end(args); + return result; +} + +jvalue CallStaticMethod(JNIEnv* env, const jcacheitem* ci, ...) { + va_list args; + va_start(args, ci); + jvalue result = CallStaticMethodV(env, ci->classname, ci->name, ci->signature, args); + va_end(args); + return result; +} + +jvalue CallMethodV(JNIEnv* env, jobject obj, const char* methodname, const char* signature, va_list args) { + // xdebug("CallMethodV(\"%p\", \"%s\", \"%s\")", obj, name, signature); + jvalue result; + memset(&result, 0, sizeof(result)); + auto mid = jcache::shared()->get_methodid(env, obj, methodname, signature); + + auto p = strchr(signature, ')'); + if (p == nullptr) { + env->FatalError("illegal signature"); + return result; + } + + ++p; + switch (*p) { + case 'V': + env->CallVoidMethodV(obj, mid, args); + break; + + case '[': + case 'L': + result.l = env->CallObjectMethodV(obj, mid, args); + break; + + case 'Z': + result.z = env->CallBooleanMethodV(obj, mid, args); + break; + + case 'B': + result.b = env->CallByteMethodV(obj, mid, args); + break; + + case 'C': + result.c = env->CallCharMethodV(obj, mid, args); + break; + + case 'S': + result.s = env->CallShortMethodV(obj, mid, args); + break; + + case 'I': + result.i = env->CallIntMethodV(obj, mid, args); + break; + + case 'J': + result.j = env->CallLongMethodV(obj, mid, args); + break; + + case 'F': + result.f = env->CallFloatMethodV(obj, mid, args); + break; + + case 'D': + result.d = env->CallDoubleMethodV(obj, mid, args); + break; + + default: + env->FatalError("illegal descriptor"); + break; + } + jcache::shared()->check_exception(env); + return result; +} + +jvalue CallMethod(JNIEnv* env, jobject obj, const char* methodname, const char* signature, ...) { + va_list args; + va_start(args, signature); + jvalue result = CallMethodV(env, obj, methodname, signature, args); + va_end(args); + return result; +} + +jvalue CallMethod(JNIEnv* env, jobject obj, const jcacheitem* ci, ...) { + va_list args; + va_start(args, ci); + jvalue result = CallMethodV(env, obj, ci->name, ci->signature, args); + va_end(args); + return result; +} + +static std::vector& __get_all_cacheitem() { + static std::vector cache; + return cache; +} + +static std::vector& __get_all_jnimethod() { + static std::vector cache; + return cache; +} + +static void __cache_all_cacheitem(JNIEnv* env) { + // xdebug("__cache_all_cacheitem(), size %d", __get_all_cacheitem().size()); + auto cache = __get_all_cacheitem(); + for (auto ci : cache) { + xdebug("cacheitem(\"%s\", \"%s\", \"%s\", %d)", ci->classname, ci->name, ci->signature, ci->type); + switch (ci->type) { + case kCacheClass: { + jcache::shared()->get_class(env, ci->classname); + break; + } + case kCacheMethod: { + jcache::shared()->get_methodid(env, ci->classname, ci->name, ci->signature); + break; + } + case kCacheStaticMethod: { + jcache::shared()->get_static_methodid(env, ci->classname, ci->name, ci->signature); + break; + } + case kCacheField: { + jcache::shared()->get_fieldid(env, ci->classname, ci->name, ci->signature); + break; + } + case kCacheStaticField: { + jcache::shared()->get_static_fieldid(env, ci->classname, ci->name, ci->signature); + break; + } + default: + break; + } + } +} + +static void __register_all_jnimethod(JNIEnv* env) { + auto cache = __get_all_jnimethod(); + for (auto ni : cache) { + auto clz = jcache::shared()->get_class(env, ni->classname); + jint error = env->RegisterNatives(clz, ni->methods, ni->count); + if (error != JNI_OK) { + xerror("RegisterNatives() failed %d: classname %s", error, ni->classname); + } + } +} + +const jcacheitem* add_cacheitem(const jcacheitem* ci) { + __get_all_cacheitem().push_back(ci); + return ci; +} + +const jnativeitem* add_nativeitem(const jnativeitem* ni) { + __get_all_jnimethod().push_back(ni); + return ni; +} + +jnienv_ptr::jnienv_ptr(JavaVM* vm) : vm_(vm), env_(nullptr), attached_(false) { + if (vm_ == nullptr) { + vm_ = jcache::shared()->java_vm(); + } + + assert(vm_ != nullptr); + + JNIEnv* env = nullptr; + jint error = vm_->GetEnv((void**)&env, JNI_VERSION_1_6); + // xdebug("jnienv_ptr GetEnv %d", error); + if (error == JNI_OK) { + env_ = env; + return; + } + + error = vm_->AttachCurrentThread(&env, nullptr); + xdebug("jnienv_ptr AttachCurrentThread() %d", error); + if (error == JNI_OK) { + env_ = env; + attached_ = true; + // NOTE: + // using thread_local is more portable than pthread_key_xxx + enable_detach_current_thread(); + } +} + +jnienv_ptr::~jnienv_ptr() { +} + +void jnienv_ptr::detach() { + if (vm_ != nullptr && attached_) { + vm_->DetachCurrentThread(); + attached_ = false; + } +} + +jobject jnienv_ptr::get_object_field(jobject obj, const char* fieldname, const char* signature, jobject default_value) { + jobject value = default_value; + jfieldID fid = jcache::shared()->get_fieldid(env_, obj, fieldname, signature); + if (fid != nullptr) { + GetField(env_, obj, fid, value); + } + return value; +} + +void jnienv_ptr::set_object_field(jobject obj, const char* fieldname, const char* signature, jobject value) { + jfieldID fid = jcache::shared()->get_fieldid(env_, obj, fieldname, signature); + if (fid != nullptr) { + SetField(env_, obj, fid, value); + } +} + +} // namespace jnicat + +// extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { +// return jcache::shared()->init(vm); +//} +// +// extern "C" JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) { +// jcache::release(); +//} diff --git a/mars/comm/jni/jnicat/jnicat_core.h b/mars/comm/jni/jnicat/jnicat_core.h new file mode 100644 index 000000000..019ed4d0d --- /dev/null +++ b/mars/comm/jni/jnicat/jnicat_core.h @@ -0,0 +1,1122 @@ +// +// Created by PeterFan on 2018/4/19. +// + +#ifndef JNIRPC_JNICAT_CORE_H +#define JNIRPC_JNICAT_CORE_H + +#ifdef JNICAT_NO_OWL +#include "mars/comm/owl/mpl/typelist.h" +#else +#include "mars/comm/owl/mpl/typelist.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace jnicat { + +const char* version(); + +using C2JavaExceptionHandler = void (*)(const std::string& stacktrace); + +class jcache { + public: + typedef std::map class_map_t; + typedef std::map field_map_t; + typedef std::map method_map_t; + typedef std::map class_field_map_t; + typedef std::map class_method_map_t; + + public: + static jcache* shared(); + static void release(); + + int init(JavaVM* vm); + JavaVM* java_vm() const; + void set_auto_detach(bool is_auto_detach); + bool is_auto_detach() const; + void set_exception_handler(C2JavaExceptionHandler handler); + void check_exception(JNIEnv* env); + + jclass get_class(JNIEnv* env, const char* name); + + jfieldID get_fieldid(JNIEnv* env, jobject obj, const char* fieldname, const char* signature); + jfieldID get_static_fieldid(JNIEnv* env, jobject obj, const char* fieldname, const char* signature); + jmethodID get_methodid(JNIEnv* env, jobject obj, const char* methodname, const char* signature); + jmethodID get_static_methodid(JNIEnv* env, jobject obj, const char* methodname, const char* signature); + + jfieldID get_fieldid(JNIEnv* env, jclass cls, const char* fieldname, const char* signature); + jfieldID get_static_fieldid(JNIEnv* env, jclass cls, const char* fieldname, const char* signature); + jmethodID get_methodid(JNIEnv* env, jclass cls, const char* methodname, const char* signature); + jmethodID get_static_methodid(JNIEnv* env, jclass cls, const char* methodname, const char* signature); + + jfieldID get_fieldid(JNIEnv* env, const char* classname, const char* fieldname, const char* signature); + jfieldID get_static_fieldid(JNIEnv* env, const char* classname, const char* fieldname, const char* signature); + jmethodID get_methodid(JNIEnv* env, const char* classname, const char* methodname, const char* signature); + jmethodID get_static_methodid(JNIEnv* env, const char* classname, const char* methodname, const char* signature); + + void dump(); + + jcache(const jcache&) = delete; + jcache& operator=(const jcache&) = delete; + + private: + jcache(); + ~jcache(); + + field_map_t* __get_field_map(JNIEnv* env, jclass cls); + method_map_t* __get_method_map(JNIEnv* env, jclass cls); + + void __cache_class(JNIEnv* env); + void __cache_method(JNIEnv* env); + void __clear_cache(); + + private: + static jcache* instance_; + + JavaVM* vm_; + class_map_t classmap_; + class_field_map_t fieldmap_; + class_method_map_t methodmap_; + std::mutex mutex_; + bool is_auto_detach_; + C2JavaExceptionHandler exception_handler_; +}; + +using typemap_j2c_t = owl::make_typemap, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + // owl::pair, + // owl::pair, + owl::pair, + owl::pair>, + owl::pair, + owl::pair>, + owl::pair>, + owl::pair>, + owl::pair>, + owl::pair>, + owl::pair>>; + +using typemap_j2jarray_t = owl::make_typemap, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair, + owl::pair>; + +template +using typemap_j2c = owl::typemap_get; + +template +using typemap_c2j = owl::typemap_flip_get; + +template +using typemap_jarray2j = owl::typemap_flip_get; + +template +using typemap_j2jarray = owl::typemap_get; + +template +struct is_j_arithmetic { + enum { begin_index_ = owl::typemap_find::value }; + enum { end_index_ = owl::typemap_find::value }; + enum { index_ = owl::typemap_find::value }; + + enum { value = begin_index_ <= index_ <= end_index_ }; +}; + +template +struct is_c_arithmetic { + enum { begin_index_ = owl::typemap_flip_find::value }; + enum { end_index_ = owl::typemap_flip_find::value }; + enum { index_ = owl::typemap_flip_find::value }; + + enum { value = begin_index_ <= index_ <= end_index_ }; +}; + +static const char* const kJshortClassnameMap[] = {"Z", "B", "C", "S", "I", "J", "F", "D"}; + +static const char* const kJarrayClassnameMap[] = {"[Z", "[B", "[C", "[S", "[I", "[J", "[F", "[D"}; + +static const char* const kJwrapperClassnameMap[] = {"java/lang/Boolean", + "java/lang/Byte", + "java/lang/Character", + "java/lang/Short", + "java/lang/Integer", + "java/lang/Long", + "java/lang/Float", + "java/lang/Double"}; + +static const char* const kJwrapperInitSigMap[] = {"(Z)V", "(B)V", "(C)V", "(S)V", "(I)V", "(J)V", "(F)V", "(D)V"}; + +static const char* const kJtypeClassnameMap[] = + {"Z", "B", "C", "S", "I", "J", "F", "D", "Ljava/lang/String;", "[Z", "[B", "[C", "[S", "[I", "[J", "[F", "[D"}; + +template +constexpr const char* jarray_classname() { + return kJarrayClassnameMap[owl::typemap_find::value]; +} + +template +constexpr const char* jshort_classname() { + return kJshortClassnameMap[owl::typemap_flip_find::value]; +} + +template +constexpr const char* jfull_classname() { + return kJwrapperClassnameMap[owl::typemap_flip_find::value]; +} + +template +constexpr const char* jwrapper_init_sig() { + return kJwrapperInitSigMap[owl::typemap_flip_find::value]; +} + +template +constexpr const char* jtype_classname() { + return kJtypeClassnameMap[owl::typemap_find::value]; +} + +std::string jstring_to_string(JNIEnv* env, jstring jstr); +jstring cstr_to_jstring(JNIEnv* env, const char* cstr); +jbyteArray string_to_jbytearray(JNIEnv* env, const std::string& str); +std::string jbytearray_to_string(JNIEnv* env, jbyteArray array); + +jbooleanArray NewArray(JNIEnv* env, jsize len, const jboolean* buf); +jbyteArray NewArray(JNIEnv* env, jsize len, const jbyte* buf); +jcharArray NewArray(JNIEnv* env, jsize len, const jchar* buf); +jshortArray NewArray(JNIEnv* env, jsize len, const jshort* buf); +jintArray NewArray(JNIEnv* env, jsize len, const jint* buf); +jlongArray NewArray(JNIEnv* env, jsize len, const jlong* buf); +jfloatArray NewArray(JNIEnv* env, jsize len, const jfloat* buf); +jdoubleArray NewArray(JNIEnv* env, jsize len, const jdouble* buf); + +inline jboolean* GetArrayElements(JNIEnv* env, jbooleanArray array) { + return env->GetBooleanArrayElements(array, 0); +} +inline jbyte* GetArrayElements(JNIEnv* env, jbyteArray array) { + return env->GetByteArrayElements(array, 0); +} +inline jchar* GetArrayElements(JNIEnv* env, jcharArray array) { + return env->GetCharArrayElements(array, 0); +} +inline jshort* GetArrayElements(JNIEnv* env, jshortArray array) { + return env->GetShortArrayElements(array, 0); +} +inline jint* GetArrayElements(JNIEnv* env, jintArray array) { + return env->GetIntArrayElements(array, 0); +} +inline jlong* GetArrayElements(JNIEnv* env, jlongArray array) { + return env->GetLongArrayElements(array, 0); +} +inline jfloat* GetArrayElements(JNIEnv* env, jfloatArray array) { + return env->GetFloatArrayElements(array, 0); +} +inline jdouble* GetArrayElements(JNIEnv* env, jdoubleArray array) { + return env->GetDoubleArrayElements(array, 0); +} + +inline void ReleaseArrayElements(JNIEnv* env, jbooleanArray array, jboolean* elems) { + env->ReleaseBooleanArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jbyteArray array, jbyte* elems) { + env->ReleaseByteArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jcharArray array, jchar* elems) { + env->ReleaseCharArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jshortArray array, jshort* elems) { + env->ReleaseShortArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jintArray array, jint* elems) { + env->ReleaseIntArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jlongArray array, jlong* elems) { + env->ReleaseLongArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jfloatArray array, jfloat* elems) { + env->ReleaseFloatArrayElements(array, elems, 0); +} +inline void ReleaseArrayElements(JNIEnv* env, jdoubleArray array, jdouble* elems) { + env->ReleaseDoubleArrayElements(array, elems, 0); +} + +inline std::string jarray_to_vector(JNIEnv* env, jstring jstr) { + return jstring_to_string(env, jstr); +} + +template ::value>::type* = nullptr> +auto jarray_to_vector(JNIEnv* env, T array) -> typemap_j2c { + typemap_j2c vec; + if (nullptr != array && env->GetArrayLength(array) > 0) { + auto data = GetArrayElements(env, array); + auto size = env->GetArrayLength(array); + vec.assign(data, data + size); + ReleaseArrayElements(env, array, data); + } + return vec; +} + +template ::value>::type* = nullptr> +std::vector jarray_to_vector2(JNIEnv* env, T array) { + std::vector vec; + if (nullptr != array && env->GetArrayLength(array) > 0) { + auto data = GetArrayElements(env, array); + auto size = env->GetArrayLength(array); + vec.assign(data, data + size); + ReleaseArrayElements(env, array, data); + } + return vec; +} + +template ::value>::type* = nullptr> +auto jni_j2c_cast(JNIEnv* env, T t) -> typemap_j2c { + return jarray_to_vector(env, t); +} + +template ::value>::type* = nullptr> +auto jni_j2c_cast(JNIEnv*, T t) -> typemap_j2c { + return t; +} + +template ::value>::type* = nullptr> +T vector_to_jarray(JNIEnv* env, const std::string& str) { + return cstr_to_jstring(env, str.c_str()); +} + +template ::value>::type* = nullptr> +T vector_to_jarray(JNIEnv* env, const std::string* str) { + return str == nullptr ? nullptr : vector_to_jarray(env, *str); +} + +template ::value>::type* = nullptr> +T vector_to_jarray(JNIEnv* env, const char* str) { + return cstr_to_jstring(env, str); +} + +template ::value>::type* = nullptr> +T vector_to_jarray(JNIEnv* env, const F& f) { + typedef typemap_jarray2j value_type; + return NewArray(env, (jsize)f.size(), (const value_type*)f.data()); +} + +template ::value>::type* = nullptr> +T vector_to_jarray(JNIEnv* env, const F* f) { + return f == nullptr ? nullptr : vector_to_jarray(env, *f); +} + +template ::value>::type* = nullptr> +T jni_c2j_cast(JNIEnv* env, const F& f) { + return vector_to_jarray(env, f); +} + +template ::value>::type* = nullptr> +T jni_c2j_cast(JNIEnv*, F f) { + return f; +} + +// String[] to std::vector +std::vector jobjectarray_to_stringvector(JNIEnv* env, jobjectArray array); + +// std::vector to String[] +jobjectArray stringvector_to_jobjectarray(JNIEnv* env, const std::vector& vec); + +// String[][] to std::vector> +std::vector> jobjectarray_to_stringvector2(JNIEnv* env, jobjectArray array); + +// std::vector> to String[][] +jobjectArray stringvector2_to_jobjectarray(JNIEnv* env, const std::vector>& vec); + +template +struct jni_type_traits { + typedef typemap_j2jarray array_type; + typedef typemap_j2c vector_type; +}; + +template <> +struct jni_type_traits { + typedef jobjectArray array_type; + typedef std::vector> vector_type; +}; + +// T[][] to std::vector> +// T -> (jboolean, jbyte, jchar, jshort, jint, jlong, jfloat, jdouble, jstring) +// U -> (T, jbyte, jstring -> std::string) +template ::value>::type* = nullptr> +auto jobjectarray_to_vector2(JNIEnv* env, jobjectArray array) -> std::vector::vector_type> { + typedef typename jni_type_traits::vector_type vector_type; + typedef typename jni_type_traits::array_type array_type; + auto len = env->GetArrayLength(array); + std::vector vecvec; + vecvec.reserve(len); + for (auto i = 0; i < len; ++i) { + auto arr = (array_type)env->GetObjectArrayElement(array, i); + vecvec.push_back(jarray_to_vector(env, arr)); + env->DeleteLocalRef(arr); + } + return vecvec; +} + +template ::value>::type* = nullptr> +auto jobjectarray_to_vector2(JNIEnv* env, jobjectArray array) -> std::vector> { + return jobjectarray_to_stringvector2(env, array); +} + +// std::vector> to T[][] +// T -> (jboolean, jbyte, jchar, jshort, jint, jlong, jfloat, jdouble, jstring) +// U -> (T, jbyte, jstring -> std::string) +template ::value>::type* = nullptr> +jobjectArray vector2_to_jobjectarray(JNIEnv* env, const std::vector::vector_type>& vec) { + typedef typename jni_type_traits::array_type array_type; + auto cls = jcache::shared()->get_class(env, jarray_classname()); + auto array = (jobjectArray)env->NewObjectArray(vec.size(), cls, nullptr); + for (auto i = 0; i < vec.size(); ++i) { + jobject value = vector_to_jarray(env, vec[i]); + env->SetObjectArrayElement(array, i, value); + } + return array; +}; + +template ::value>::type* = nullptr> +jobjectArray vector2_to_jobjectarray(JNIEnv* env, const std::vector>& vec) { + return stringvector2_to_jobjectarray(env, vec); +} + +template ::value>::type* = nullptr> +jobject cenum_to_jobject(JNIEnv* env, F data, const std::string& sig) { + jclass cls = jcache::shared()->get_class(env, sig.c_str()); + jmethodID mid = env->GetStaticMethodID(cls, "forNumber", ("(I)L" + sig + ";").c_str()); + jobject obj = (jobject)env->CallStaticObjectMethod(cls, mid, (jint)data); + return obj; +} + +template +jobject cpb_to_jobject(JNIEnv* env, const F& data, const std::string& sig) { + jclass cls = jcache::shared()->get_class(env, sig.c_str()); + jmethodID mid = env->GetStaticMethodID(cls, "parseFrom", ("([B)L" + sig + ";").c_str()); + jobject obj = (jobject)env->CallStaticObjectMethod(cls, mid, jni_c2j_cast(env, data)); + return obj; +} + +std::string jobject_to_pbstring(JNIEnv* env, const jobject obj, const std::string& sig); + +std::vector jobjectarray_to_pbstringvector(JNIEnv* env, const jobjectArray array, const std::string& sig); + +jobjectArray cpbarray_to_jobjectarray(JNIEnv* env, const std::vector& vec, const std::string& sig); +// std::vector to ArrayList +jobject stringvector_to_arraylist(JNIEnv* env, const std::vector& vec); + +// ArrayList to std::vector +std::vector arraylist_to_stringvector(JNIEnv* env, jobject obj); + +// const char*/std::string -> jstring +inline jstring __jni_c2j_cast_s(JNIEnv* env, const char* x) { + return cstr_to_jstring(env, x); +} + +inline jstring __jni_c2j_cast_s(JNIEnv* env, const std::string& x) { + return cstr_to_jstring(env, x.c_str()); +} + +// T -> c++ type +// if T is arithmetic -> T +// if T is const char*/std::string -> jbyteArray +// std::vector -> typemap_j2jarray +template ::value>::type* = nullptr> +T __jni_c2j_cast(JNIEnv* env, T x) { + return x; +} + +inline jbyteArray __jni_c2j_cast(JNIEnv* env, const char* x) { + return NewArray(env, (jsize)strlen(x), (const jbyte*)x); +} + +inline jbyteArray __jni_c2j_cast(JNIEnv* env, const std::string& x) { + return NewArray(env, (jsize)x.size(), (const jbyte*)x.data()); +} + +template +auto __jni_c2j_cast(JNIEnv* env, const std::vector& x) -> typemap_j2jarray { + return NewArray(env, (jsize)x.size(), (const T*)x.data()); +} + +#define __c2j_cast(arg) jnicat::__jni_c2j_cast(env, arg) +#define __c2j_cast_s(arg) jnicat::__jni_c2j_cast_s(env, arg) + +} // namespace jnicat + +#define j2c_cast(arg) jnicat::jni_j2c_cast(env, arg) +#define c2j_cast(T, arg) jnicat::jni_c2j_cast(env, arg) + +#define j2c_cast_sv(arg) jnicat::jobjectarray_to_stringvector(env, arg) +#define j2c_cast_vv(T, arg) jnicat::jobjectarray_to_vector2(env, arg) + +#define c2j_cast_sv(arg) jnicat::stringvector_to_jobjectarray(env, arg) +#define c2j_cast_vv(T, arg) jnicat::vector2_to_jobjectarray(env, arg) + +#define c2j_cast_sv_alba(arg) jnicat::stringvector_to_arraylist(env, arg) +#define j2c_cast_sv_alba(arg) jnicat::arraylist_to_stringvector(env, arg) + +#define j2c_cast_v(T, arg) jnicat::jarray_to_vector2(env, arg) + +#define c2j_enum_cast(arg1, arg2) jnicat::cenum_to_jobject(env, arg1, arg2) +#define c2j_pb_cast(arg1, arg2) jnicat::cpb_to_jobject(env, arg1, arg2) + +#define c2j_pb_cast_v(arg1, arg2) jnicat::cpbarray_to_jobjectarray(env, arg1, arg2) + +#define j2c_pb_cast(arg1, arg2) jnicat::jobject_to_pbstring(env, arg1, arg2) + +#define j2c_pb_cast_v(arg1, arg2) jnicat::jobjectarray_to_pbstringvector(env, arg1, arg2) + +// support for Java wrapper class Boolean,Int,etc... +namespace jnicat { + +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean value) { + env->SetBooleanField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jchar value) { + env->SetCharField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte value) { + env->SetByteField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jshort value) { + env->SetShortField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jint value) { + env->SetIntField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jlong value) { + env->SetLongField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat value) { + env->SetFloatField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble value) { + env->SetDoubleField(obj, fieldID, value); +} +inline void SetField(JNIEnv* env, jobject obj, jfieldID fieldID, jobject value) { + env->SetObjectField(obj, fieldID, value); +} + +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean& value) { + value = env->GetBooleanField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jchar& value) { + value = env->GetCharField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte& value) { + value = env->GetByteField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jshort& value) { + value = env->GetShortField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jint& value) { + value = env->GetIntField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jlong& value) { + value = env->GetLongField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat& value) { + value = env->GetFloatField(obj, fieldID); +} +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble& value) { + value = env->GetDoubleField(obj, fieldID); +} + +template ::value>::type* = nullptr> +inline void GetField(JNIEnv* env, jobject obj, jfieldID fieldID, T& value) { + value = (T)env->GetObjectField(obj, fieldID); +} + +template +class jref { + public: + jref(JNIEnv* env, jobject obj) : env_(env), obj_(obj), value_() { + cls_ = jcache::shared()->get_class(env, jfull_classname()); + fid_ = jcache::shared()->get_fieldid(env, cls_, "value", jshort_classname()); + if (cls_ != nullptr && fid_ != nullptr) { + GetField(env_, obj_, fid_, value_); + } + } + ~jref() { + if (cls_ != nullptr && fid_ != nullptr) { + SetField(env_, obj_, fid_, value_); + } + } + + T value() const { + return value_; + } + void set_value(T value) { + value_ = value; + } + + operator T() const { + return value_; + } + jref& operator=(T value) { + value_ = value; + return *this; + } + + jref(jref&& rhs) { + env_ = rhs.env_; + obj_ = rhs.obj_; + cls_ = rhs.cls_; + fid_ = rhs.fid_; + value_ = rhs.value_; + + rhs.cls_ = nullptr; + } + + jref& operator=(const jref& rhs) { + value_ = rhs.value_; + return *this; + } + + jref(const jref&) = delete; + + private: + JNIEnv* env_; + jobject obj_; + jclass cls_; + jfieldID fid_; + T value_; +}; + +// Java fundamental type int,byte,etc to Java wrapper class Integer,Byte,etc +template ::value>::type* = nullptr> +jobject jni_c2jobject(JNIEnv* env, T t) { + auto cls = jcache::shared()->get_class(env, jfull_classname()); + auto ctor = jcache::shared()->get_methodid(env, cls, "", jwrapper_init_sig()); + if (cls != nullptr && ctor != nullptr) { + return env->NewObject(cls, ctor, t); + } + return nullptr; +} + +template +T jni_jobject2c(JNIEnv* env, jobject obj) { + T value; + auto cls = jcache::shared()->get_class(env, jfull_classname()); + auto fid = jcache::shared()->get_fieldid(env, cls, "value", jshort_classname()); + if (cls != nullptr && fid != nullptr) { + GetField(env, obj, fid, value); + } + return value; +} + +// jintArray -> jarray +// T -> bool, int, etc +// j_type -> jboolean, jint, etc +// jarray_type -> jbooleanArray, jintArray, etc +template +class jarray { + static_assert(is_c_arithmetic::value, ""); + typedef typemap_c2j j_type; + typedef typemap_j2jarray jarray_type; + + public: + jarray(JNIEnv* env, jarray_type array) : env_(env), array_(array), ptr_(nullptr), size_(0) { + size_ = env_->GetArrayLength(array_); + } + + ~jarray() { + __release_ptr(); + } + + jarray(jarray&& rhs) { + env_ = rhs.env_; + array_ = rhs.array_; + ptr_ = rhs.ptr_; + size_ = rhs.size_; + + rhs.ptr_ = nullptr; + rhs.size_ = 0; + } + + jarray(jarray&) = delete; + jarray& operator=(jarray&) = delete; + + T* data() { + return __get_ptr(); + } + size_t size() const { + return size_; + } + bool empty() const { + return size_ == 0; + } + + T& operator[](size_t pos) { + assert(pos < size_); + return data()[pos]; + } + + private: + T* __get_ptr() const { + if (ptr_ == nullptr) { + ptr_ = GetArrayElements(env_, array_); + } + return ptr_; + } + + void __release_ptr() { + if (ptr_ != nullptr) { + ReleaseArrayElements(env_, array_, ptr_); + ptr_ = nullptr; + } + } + + private: + JNIEnv* env_; + jarray_type array_; + mutable j_type* ptr_; + mutable size_t size_; +}; + +class jbuffer { + public: + jbuffer() : data_(nullptr), size_(0) { + } + + jbuffer(void* data, int64_t size) : data_((uint8_t*)data), size_(size) { + } + + jbuffer(JNIEnv* env, jobject obj) { + data_ = (uint8_t*)env->GetDirectBufferAddress(obj); + size_ = env->GetDirectBufferCapacity(obj); + } + + ~jbuffer() { + } + + uint8_t* data() { + return data_; + } + int64_t size() const { + return size_; + } + bool empty() const { + return size_ == 0; + } + uint8_t& operator[](size_t pos) { + assert(pos < size_); + return data_[pos]; + } + + jobject to_bytebuffer(JNIEnv* env) { + if (data_ == nullptr) { + return nullptr; + } + return env->NewDirectByteBuffer(data_, size_); + } + + private: + uint8_t* data_; + int64_t size_; +}; + +enum jcachetype { kCacheClass, kCacheMethod, kCacheStaticMethod, kCacheField, kCacheStaticField }; + +struct jcacheitem { + const char* classname; + const char* name; + const char* signature; + jcachetype type; +}; + +struct jnativeitem { + const char* classname; + const JNINativeMethod* methods; + size_t count; +}; + +inline jboolean __jvalue_cast(jvalue val, jboolean*) { + return val.z; +} +inline jbyte __jvalue_cast(jvalue val, jbyte*) { + return val.b; +} +inline jchar __jvalue_cast(jvalue val, jchar*) { + return val.c; +} +inline jshort __jvalue_cast(jvalue val, jshort*) { + return val.s; +} +inline jint __jvalue_cast(jvalue val, jint*) { + return val.i; +} +inline jlong __jvalue_cast(jvalue val, jlong*) { + return val.j; +} +inline jfloat __jvalue_cast(jvalue val, jfloat*) { + return val.f; +} +inline jdouble __jvalue_cast(jvalue val, jdouble*) { + return val.d; +} +inline jobject __jvalue_cast(jvalue val, void*) { + return val.l; +} + +// T -> jni primitive types & jobject types +template ::value>::type* = nullptr> +T jvalue_cast(jvalue val) { + return (T)__jvalue_cast(val, (T*)nullptr); +} + +template ::value>::type* = nullptr> +void jvalue_cast(jvalue val) { +} + +std::string GetStackTraceString(jthrowable e); + +jobject NewObjectV(JNIEnv* env, const char* classname, const char* methodname, const char* signature, va_list args); +jobject NewObject(JNIEnv* env, const char* classname, const char* methodname, const char* signature, ...); +jobject NewObject(JNIEnv* env, const jcacheitem* ci, ...); + +jvalue CallStaticMethodV(JNIEnv* env, + const char* classname, + const char* methodname, + const char* signature, + va_list args); +jvalue CallStaticMethod(JNIEnv* env, const char* classname, const char* methodname, const char* signature, ...); +jvalue CallStaticMethod(JNIEnv* env, const jcacheitem* ci, ...); + +jvalue CallMethodV(JNIEnv* env, jobject obj, const char* methodname, const char* signature, va_list args); +jvalue CallMethod(JNIEnv* env, jobject obj, const char* methodname, const char* signature, ...); +jvalue CallMethod(JNIEnv* env, jobject obj, const jcacheitem* ci, ...); + +const jcacheitem* add_cacheitem(const jcacheitem* ci); +const jnativeitem* add_nativeitem(const jnativeitem* ni); + +// jobject 类型参数会返回自己,其它基本类型参数返回 nullptr +inline jobject __filter_object_arg(jobject arg) { + return arg; +} + +template ::value>::type* = nullptr> +jobject __filter_object_arg(T) { + return nullptr; +} +inline jobject __filter_object_arg(void* arg) { + return nullptr; +} + +template +void __delete_localref_array(JNIEnv* env, jobject (&object_args)[N]) { + for (auto obj : object_args) { + if (obj != nullptr) { + env->DeleteLocalRef(obj); + } + } +} + +class jnienv_ptr { + public: + explicit jnienv_ptr(JavaVM* vm = nullptr); + ~jnienv_ptr(); + + operator JNIEnv*() const { + return env_; + } + JNIEnv* operator->() const { + return env_; + } + JNIEnv* get() const { + return env_; + } + void detach(); + + jnienv_ptr(const jnienv_ptr&) = delete; + jnienv_ptr& operator=(const jnienv_ptr&) = delete; + + template + jobject new_object(const char* classname, const char* methodname, const char* signature, Args... args) { + return NewObject(env_, classname, methodname, signature, args...); + } + + template + jobject new_object(const jcacheitem* ci, Args... args) { + return NewObject(env_, ci, args...); + } + + // NOTE: + // C++ 调用 Java 的情况下,C++ 层构造出的 jobject 类型参数在调用结束后, + // 必须调用 DeleteLocalRef() 删除局部引用, + // 否则会出现泄漏,在 Android 8.0 以下局部引用数超出限制会导致 Crash + // + // PS: + // 返回给 Java 层的 jobject 对象,由 Java 层负责管理,无需调用 DeleteLocalRef() + + // 解决办法: + // 使用元编程构造一个 jobject 数组: + // 1)对于 jobject 参数,在数组中的值是本身; + // 2)对于非 jobject 参数,在数组中的值是 nullptr; + // 3)CallStaticMethod()/CallMethod() 调用结束后,循环释放局部引用 + + template + T call_static_method(const char* classname, const char* methodname, const char* signature, Args... args) { + jobject object_args[sizeof...(args) + 1]{__filter_object_arg(args)...}; + auto result = CallStaticMethod(env_, classname, methodname, signature, args...); + __delete_localref_array(env_, object_args); + return jvalue_cast(result); + } + + template + T call_static_method(const jcacheitem* ci, Args... args) { + return call_static_method(ci->classname, ci->name, ci->signature, args...); + } + + template + T call_method(jobject obj, const char* methodname, const char* signature, Args... args) { + jobject object_args[sizeof...(args) + 1]{__filter_object_arg(args)...}; + auto result = CallMethod(env_, obj, methodname, signature, args...); + __delete_localref_array(env_, object_args); + return jvalue_cast(result); + } + + template + T call_method(jobject obj, const jcacheitem* ci, Args... args) { + return call_method(obj, ci->name, ci->signature, args...); + } + + template + T call_method_without_release(jobject obj, const char* methodname, const char* signature, Args... args) { + auto result = CallMethod(env_, obj, methodname, signature, args...); + return jvalue_cast(result); + } + + template + T call_method_without_release(jobject obj, const jcacheitem* ci, Args... args) { + return call_method(obj, ci->name, ci->signature, args...); + } + + template + T call_static_method_raw(const char* classname, const char* methodname, const char* signature, Args... args) { + return jvalue_cast(CallStaticMethod(env_, classname, methodname, signature, args...)); + } + + template + T call_static_method_raw(const jcacheitem* ci, Args... args) { + return jvalue_cast(CallStaticMethod(env_, ci->classname, ci->name, ci->signature, args...)); + } + + template + T call_method_raw(jobject obj, const char* methodname, const char* signature, Args... args) { + return jvalue_cast(CallMethod(env_, obj, methodname, signature, args...)); + } + + template + T call_method_raw(jobject obj, const jcacheitem* ci, Args... args) { + return jvalue_cast(CallMethod(env_, ci->name, ci->signature, args...)); + } + + template ::value>::type* = nullptr> + T get_field(jobject obj, const char* fieldname, T default_value = T()) { + T value = default_value; + const char* signature = jtype_classname(); + jfieldID fid = jcache::shared()->get_fieldid(env_, obj, fieldname, signature); + if (fid != nullptr) { + GetField(env_, obj, fid, value); + } + return value; + } + + template ::value>::type* = nullptr> + void set_field(jobject obj, const char* fieldname, T value) { + const char* signature = jtype_classname(); + jfieldID fid = jcache::shared()->get_fieldid(env_, obj, fieldname, signature); + if (fid != nullptr) { + SetField(env_, obj, fid, value); + } + } + + jobject get_object_field(jobject obj, + const char* fieldname, + const char* signature, + jobject default_value = nullptr); + void set_object_field(jobject obj, const char* fieldname, const char* signature, jobject value); + + private: + JavaVM* vm_; + JNIEnv* env_; + bool attached_; +}; + +} // namespace jnicat + +template +using jref_t = jnicat::jref; + +template +using jarray_t = jnicat::jarray; + +using jbuffer_t = jnicat::jbuffer; +using jcache = jnicat::jcache; +using jnienv_ptr = jnicat::jnienv_ptr; + +#define j2c_cast_ref(T, arg) jref_t(env, arg) +#define j2c_cast_out(T, arg) jarray_t(env, arg) + +#define j2c_cast_buf(arg) jbuffer_t(env, arg) +#define j2c_cast_obj(T, arg) jnicat::jni_jobject2c(env, arg) +#define c2j_cast_buf(arg) arg.to_bytebuffer(env) +#define c2j_cast_obj(arg) jnicat::jni_c2jobject(env, arg) + +#define c2j_new_object(methodinfo, ...) env.new_object(methodinfo, ##__VA_ARGS__) + +#define c2j_call_static(T, methodinfo, ...) env.call_static_method(methodinfo, ##__VA_ARGS__) + +#define c2j_call(T, obj, methodinfo, ...) env.call_method(obj, methodinfo, ##__VA_ARGS__) + +#define c2j_call_without_release(T, obj, methodinfo, ...) \ + env.call_method_without_release(obj, methodinfo, ##__VA_ARGS__) + +// PP_CAT +#ifndef PP_JNICAT +#define PP_JNICAT(x, y) PP_JNICAT_I(x, y) +#define PP_JNICAT_I(x, y) x##y +#endif + +#define JNICAT_DEFINE_CLASS(classname) \ + JNICAT_DEFINE_CACHE(PP_JNICAT(kClass, __LINE__), classname, "", "", jnicat::kCacheClass) + +#define JNICAT_DEFINE_METHOD(varname, classname, methodname, signature) \ + JNICAT_DEFINE_CACHE(varname, classname, methodname, signature, jnicat::kCacheMethod) + +#define JNICAT_DEFINE_STATIC_METHOD(varname, classname, methodname, signature) \ + JNICAT_DEFINE_CACHE(varname, classname, methodname, signature, jnicat::kCacheStaticMethod) + +#define JNICAT_DEFINE_FIELD(varname, classname, fieldname, signature) \ + JNICAT_DEFINE_CACHE(varname, classname, fieldname, signature, jnicat::kCacheField) + +#define JNICAT_DEFINE_STATIC_FIELD(varname, classname, fieldname, signature) \ + JNICAT_DEFINE_CACHE(varname, classname, fieldname, signature, jnicat::kCacheStaticField) + +#define JNICAT_DEFINE_CACHE(var, classname, name, signature, type) \ + static const jnicat::jcacheitem PP_JNICAT(ci_, var){classname, name, signature, type}; \ + static const jnicat::jcacheitem* const var = jnicat::add_cacheitem(&PP_JNICAT(ci_, var)); + +#define JNICAT_DEFINE_JNI_METHOD(var, classname, jni_methods, count) \ + static const jnicat::jnativeitem PP_JNICAT(ni_, var){classname, jni_methods, count}; \ + static const jnicat::jnativeitem* const var = jnicat::add_nativeitem(&PP_JNICAT(ni_, var)); + +static constexpr int __sig_index(const char* s, int i) { + return s[i] == '\0' ? -1 : (s[i] == ')' ? i + 1 : __sig_index(s, i + 1)); +} + +static constexpr char __sig_char(const char* s) { + return __sig_index(s, 0) == -1 ? '\0' : s[__sig_index(s, 0)]; +} + +template +struct sig_to_return_type; + +#define DECL_SIG_TO_RETURN_TYPE(S, R) \ + template <> \ + struct sig_to_return_type { \ + typedef R type; \ + }; + +DECL_SIG_TO_RETURN_TYPE('V', void) +DECL_SIG_TO_RETURN_TYPE('[', jobject) +DECL_SIG_TO_RETURN_TYPE('L', jobject) +DECL_SIG_TO_RETURN_TYPE('Z', jboolean) +DECL_SIG_TO_RETURN_TYPE('B', jbyte) +DECL_SIG_TO_RETURN_TYPE('C', jchar) +DECL_SIG_TO_RETURN_TYPE('S', jshort) +DECL_SIG_TO_RETURN_TYPE('I', jint) +DECL_SIG_TO_RETURN_TYPE('J', jlong) +DECL_SIG_TO_RETURN_TYPE('F', jfloat) +DECL_SIG_TO_RETURN_TYPE('D', jdouble) + +template +using jreturn_type = typename sig_to_return_type::type; + +class jObject { + public: + explicit jObject(jobject object) : object_(object) { + } + + jObject(const char* classname, const char* init_signature, ...) : object_(0) { + va_list args; + va_start(args, init_signature); + object_ = jnicat::NewObjectV(env_, classname, "", init_signature, args); + va_end(args); + } + + virtual ~jObject() { + env_->DeleteLocalRef(object_); + } + + jobject raw() const { + return object_; + } + + protected: + jnienv_ptr env_; + jobject object_; +}; + +#define JNICAT_CLASS_BEGIN(cpp_classname, java_classname) \ + JNICAT_DEFINE_CLASS(java_classname) \ + class cpp_classname : public jObject { \ + typedef cpp_classname CppClassType; \ + static constexpr const char* classname() { \ + return java_classname; \ + } \ + \ + public: \ + explicit cpp_classname(jobject object) : jObject(object) { \ + } \ + template \ + cpp_classname(const char* init_signature, Args... args) : jObject(java_classname, init_signature, args...) { \ + } + +#define JNICAT_INIT_METHOD(methodname, signature) \ + template \ + static CppClassType* methodname(Args... args) { \ + return new CppClassType(signature, args...); \ + } + +#define JNICAT_METHOD(methodname, signature) \ + template \ + auto methodname(Args... args)->jreturn_type<__sig_char(signature)> { \ + using R = jreturn_type<__sig_char(signature)>; \ + return env_.call_method_raw(object_, #methodname, signature, args...); \ + } + +#define JNICAT_STATIC_METHOD(methodname, signature) \ + template \ + static auto methodname(Args... args)->jreturn_type<__sig_char(signature)> { \ + using R = jreturn_type<__sig_char(signature)>; \ + jnienv_ptr env; \ + return env.call_static_method_raw(classname(), #methodname, signature, args...); \ + } + +#define JNICAT_CLASS_END() \ + } \ + ; + +#endif // JNIRPC_JNICAT_CORE_H diff --git a/mars/comm/jni/jnicat/jnicat_jni_handle.h b/mars/comm/jni/jnicat/jnicat_jni_handle.h new file mode 100644 index 000000000..39cc62e37 --- /dev/null +++ b/mars/comm/jni/jnicat/jnicat_jni_handle.h @@ -0,0 +1,44 @@ +// +// Created by yong zhang on 2021/7/21. +// + +#ifndef ILINKTEST_JNI_HANDLE_H +#define ILINKTEST_JNI_HANDLE_H +#include +namespace jnicat { +jfieldID inline getHandleField(JNIEnv* env, jobject obj) { + jclass c = env->GetObjectClass(obj); + // J is the type signature for long: + return env->GetFieldID(c, "nativeHandle", "J"); +} + +jfieldID inline getHandleField(JNIEnv* env, jobject obj, const char* field) { + jclass c = env->GetObjectClass(obj); + return env->GetFieldID(c, field, "J"); +} + +template +T* getHandle(JNIEnv* env, jobject obj) { + jlong handle = env->GetLongField(obj, getHandleField(env, obj)); + return reinterpret_cast(handle); +} + +template +T* getHandle(JNIEnv* env, jobject obj, const char* field) { + jlong handle = env->GetLongField(obj, getHandleField(env, obj, field)); + return reinterpret_cast(handle); +} + +template +void setHandle(JNIEnv* env, jobject obj, T* t) { + jlong handle = reinterpret_cast(t); + env->SetLongField(obj, getHandleField(env, obj), handle); +} + +template +void setHandle(JNIEnv* env, jobject obj, T* t, const char* field) { + jlong handle = reinterpret_cast(t); + env->SetLongField(obj, getHandleField(env, obj, field), handle); +} +} // namespace jnicat +#endif // ILINKTEST_JNI_HANDLE_H diff --git a/mars/comm/jni/jnicat/jnicat_object_wrapper.h b/mars/comm/jni/jnicat/jnicat_object_wrapper.h new file mode 100644 index 000000000..f7ca9b442 --- /dev/null +++ b/mars/comm/jni/jnicat/jnicat_object_wrapper.h @@ -0,0 +1,164 @@ +// +// Created by yong zhang on 2021/7/21. +// + +#ifndef ILINKTEST_SMART_POINTER_H +#define ILINKTEST_SMART_POINTER_H + +#include + +#include "jnicat_jni_handle.h" +//#include "owl/zlog.h" + +/** @brief a Wrapper for smart pointers to be used in JNI code + * + * **Usage** + * Instantiation: + * JniObjectWrapper obj = new JniObjectWrapper(arguments); + * obj->instantiate(env,instance); + * + * Recovery: + * std::shared_ptr obj = JniObjectWrapper::object(env,instance); + * + * or + * + * JniObjectWrapper wrapper = JniObjectWrapper::get(env,instance); + * std::shared_ptr obj = wrapper->get(); + * + * Dispose: + * JniObjectWrapper wrapper = JniObjectWrapper::get(env,instance); + * delete wrapper; + * + * or simpler + * + * JniObjectWrapper::dispose(env,instance); + */ +namespace jnicat { +// template +// class JniObjectWrapper { +// std::shared_ptr mObject; +// public: +// template +// explicit JniObjectWrapper(ARGS... a) { +// mObject = std::make_shared(a...); +// } +// +// explicit JniObjectWrapper(std::shared_ptr obj) { +// mObject = obj; +// } +// +// virtual ~JniObjectWrapper() { +// +// if (mObject.get()) { +// zdebug("mObject not nulls %_", mObject.use_count()); +// mObject.reset(); +//// delete mObject.get(); +// } else { +// mObject.reset(); +// } +// } +// +// void instantiate(JNIEnv *env, jobject instance) { +// setHandle(env, instance, this); +// } +// +// void instantiate(JNIEnv *env, jobject instance, const char *field) { +// setHandle(env, instance, this, field); +// } +// +// jlong instance() const { +// return reinterpret_cast(this); +// } +// +// std::shared_ptr get() const { +// return mObject; +// } +// +// static std::shared_ptr object(JNIEnv *env, jobject instance) { +// return get(env, instance)->get(); +// } +// +// static JniObjectWrapper *get(JNIEnv *env, jobject instance) { +// return getHandle>(env, instance); +// } +// +// static JniObjectWrapper *get(JNIEnv *env, jobject instance, const char *field) { +// return getHandle>(env, instance, field); +// } +// +// static void dispose(JNIEnv *env, jobject instance) { +// auto obj = get(env, instance); +// if (obj) delete obj; +// setHandle(env, instance, nullptr); +// } +// +// static void dispose(JNIEnv *env, jobject instance, const char *field) { +// auto obj = get(env, instance, field); +// if (obj) delete obj; +// } +// }; +template +class JniObjectWrapper { + T* mObject; + + public: + template + explicit JniObjectWrapper(ARGS... a) { + mObject = new T(a...); + } + + explicit JniObjectWrapper(T* obj) { + mObject = obj; + } + + virtual ~JniObjectWrapper() { + } + + void instantiate(JNIEnv* env, jobject instance) { + setHandle(env, instance, this); + } + + void instantiate(JNIEnv* env, jobject instance, const char* field) { + setHandle(env, instance, this, field); + } + + jlong instance() const { + return reinterpret_cast(this); + } + + T* get() const { + return mObject; + } + + static T* object(JNIEnv* env, jobject instance) { + return get(env, instance)->get(); + } + + static JniObjectWrapper* get(JNIEnv* env, jobject instance) { + return getHandle>(env, instance); + } + + static JniObjectWrapper* get(JNIEnv* env, jobject instance, const char* field) { + return getHandle>(env, instance, field); + } + + static void dispose(JNIEnv* env, jobject instance) { + auto obj = get(env, instance); + if (obj) + delete obj; + setHandle(env, instance, nullptr); + } + + static void dispose(JNIEnv* env, jobject instance, const char* field, bool disposeRealObject = false) { + auto obj = get(env, instance, field); + if (disposeRealObject) { + auto real = obj->get(); + if (real) + delete real; + } + if (obj) + delete obj; + } +}; +} // namespace jnicat +#endif // ILINKTEST_SMART_POINTER_H diff --git a/mars/comm/jni/platform_comm.cc b/mars/comm/jni/platform_comm.cc index 0690237be..dc3db3484 100644 --- a/mars/comm/jni/platform_comm.cc +++ b/mars/comm/jni/platform_comm.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,60 +10,91 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /** * created on : 2012-7-19 * author : yanguoyue */ -#include "../platform_comm.h" +#include "mars/comm/platform_comm.h" +#include #include -#include "../xlogger/xlogger.h" +#include "mars/boost/bind.hpp" +#include "mars/boost/ref.hpp" +#include "mars/comm/coroutine/coro_async.h" +#include "mars/comm/coroutine/coroutine.h" +#include "mars/comm/thread/lock.h" +#include "mars/comm/time_utils.h" +#include "mars/comm/xlogger/xlogger.h" #include "util/comm_function.h" #include "util/scope_jenv.h" #include "util/scoped_jstring.h" #include "util/var_cache.h" -#include "mars/comm/thread/lock.h" - -#ifdef ANDROID - int g_NetInfo = 0; // global cache netinfo for android - WifiInfo g_wifi_info; - SIMInfo g_sim_info; - APNInfo g_apn_info; - Mutex g_net_mutex; -#endif +namespace mars { +namespace comm { +#ifndef NATIVE_CALLBACK +namespace { +NetType g_NetInfo = kNoNet; // global cache netinfo for android +uint64_t g_last_networkchange_tick = gettickcount(); +WifiInfo g_wifi_info; +SIMInfo g_sim_info; +APNInfo g_apn_info; +Mutex g_net_mutex; +} // namespace +// 把 platform 编译到相应 so 中时这个函数一定要被调用。不然缓存信息清除不了 +// 参看 stn_logic.cc +void OnPlatformNetworkChange() { + xinfo_function(); + ScopedLock lock(g_net_mutex); + g_NetInfo = kNoNet; + g_last_networkchange_tick = gettickcount(); + g_wifi_info.ssid.clear(); + g_wifi_info.bssid.clear(); + g_sim_info.isp_code.clear(); + g_sim_info.isp_name.clear(); + g_apn_info.nettype = kNoNet - 1; + g_apn_info.sub_nettype = 0; + g_apn_info.extra_info.clear(); + lock.unlock(); +} DEFINE_FIND_CLASS(KPlatformCommC2Java, "com/tencent/mars/comm/PlatformComm$C2Java") -#ifdef ANDROID -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_startAlarm, KPlatformCommC2Java, "startAlarm", "(II)Z") -bool startAlarm(int64_t id, int after) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, startAlarm, "(III)Z") +bool startAlarm(int type, int64_t id, int after) { xverbose_function(); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&startAlarm, type, id, after)); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); - jboolean ret = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_startAlarm, (jint)id, (jint)after).z; - xdebug2(TSF"id= %0, after= %1, ret= %2", id, after, (bool)ret); + jboolean ret = + JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_startAlarm, (jint)type, (jint)id, (jint)after).z; + xdebug2(TSF "id= %0, after= %1, type= %2, ret= %3", id, after, type, (bool)ret); return (bool)ret; } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_stopAlarm, KPlatformCommC2Java, "stopAlarm", "(I)Z") -bool stopAlarm(int64_t id) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, stopAlarm, "(I)Z") +bool stopAlarm(int64_t id) { xverbose_function(); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&stopAlarm, id)); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); jboolean ret = JNU_CallStaticMethodByMethodInfo(scopeJEnv.GetEnv(), KPlatformCommC2Java_stopAlarm, (jint)id).z; - xdebug2(TSF"id= %0, ret= %1", id, (bool)ret); + xdebug2(TSF "id= %0, ret= %1", id, (bool)ret); return (bool)ret; } -#endif -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getProxyInfo, KPlatformCommC2Java, "getProxyInfo", "(Ljava/lang/StringBuffer;)I") +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getProxyInfo, "(Ljava/lang/StringBuffer;)I") bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { xverbose_function(); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&getProxyInfo, boost::ref(port), boost::ref(strProxy), _host)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); @@ -82,7 +113,7 @@ bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { ret = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getProxyInfo, stringbufferObj).i; if (ret <= 0) { - xinfo2(TSF"getProxyInfo port == 0, no proxy"); + xinfo2(TSF "getProxyInfo port == 0, no proxy"); env->DeleteLocalRef(stringbufferObj); port = 0; strProxy = ""; @@ -97,7 +128,8 @@ bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { if (retString != NULL) { strProxy.assign(ScopedJstring(env, retString).GetChar()); - if (strProxy == "null") strProxy.clear(); + if (strProxy == "null") + strProxy.clear(); env->DeleteLocalRef(retString); } else { @@ -106,123 +138,92 @@ bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { // free the local reference env->DeleteLocalRef(stringbufferObj); - xverbose2(TSF"strProxy= %0, port= %1", strProxy.c_str(), port); + xverbose2(TSF "strProxy= %0, port= %1", strProxy.c_str(), port); return !strProxy.empty(); } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getNetInfo, KPlatformCommC2Java, "getNetInfo", "()I") -int getNetInfo() { - xverbose_function(); - - if (g_NetInfo != 0) +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getNetInfo, "()I") +NetType getNetInfo(bool realtime /*=false*/) { + xverbose_function(); + // 防止获取的信息不准确,切换网络后延迟 1min 再使用缓存信息,1min 这个值没什么讲究主要是做个延迟。 + if (!realtime && g_NetInfo != 0 && gettickcount() >= g_last_networkchange_tick + 60 * 1000) { return g_NetInfo; + } + + // if (coroutine::isCoroutine()) + // return coroutine::MessageInvoke(&getNetInfo); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); jint netType = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getNetInfo).i; - g_NetInfo = netType; + g_NetInfo = (NetType)netType; - xverbose2(TSF"netInfo= %0", netType); - return (int)netType; + xdebug2(TSF "getNetInfo from JAVA %_", netType); + return g_NetInfo; } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getCurRadioAccessNetworkInfo, KPlatformCommC2Java, "getCurRadioAccessNetworkInfo", "()I") -bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getStatisticsNetType, "()I") +NetTypeForStatistics getNetTypeForStatistics() { xverbose_function(); - VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); - jint netType = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getCurRadioAccessNetworkInfo).i; - - xverbose2(TSF"netInfo= %0", netType); - - switch ((int)netType) { - case 0: - break; - - case 1: - _raninfo.radio_access_network = GPRS; - break; - - case 2: - _raninfo.radio_access_network = Edge; - break; - - case 3: - _raninfo.radio_access_network = UMTS; - break; - - case 4: - _raninfo.radio_access_network = CDMA; - break; - - case 5: - _raninfo.radio_access_network = CDMAEVDORev0; - break; - - case 6: - _raninfo.radio_access_network = CDMAEVDORevA; - break; - - case 7: - _raninfo.radio_access_network = CDMA1x; - break; - - case 8: - _raninfo.radio_access_network = HSDPA; - break; - - case 9: - _raninfo.radio_access_network = HSUPA; - break; - - case 10: - _raninfo.radio_access_network = HSPA; - break; - - case 11: - _raninfo.radio_access_network = IDEN; - break; - - case 12: - _raninfo.radio_access_network = CDMAEVDORevB; - break; - - case 13: - _raninfo.radio_access_network = LTE; - break; - - case 14: - _raninfo.radio_access_network = eHRPD; - break; - - case 15: - _raninfo.radio_access_network = HSPAP; - break; + return (NetTypeForStatistics)JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getStatisticsNetType).i; +} - default: - break; +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getCurRadioAccessNetworkInfo, "()I") +bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo) { + xverbose_function(); + // change interface calling to "getNetTypeForStatistics" + // because of Android's network info method calling restrictions + NetTypeForStatistics netType = getNetTypeForStatistics(); + + switch (netType) { + case NETTYPE_NON: + case NETTYPE_NOT_WIFI: + case NETTYPE_UNKNOWN: + break; + case NETTYPE_WIFI: + _raninfo.radio_access_network = WIFI; + break; + + case NETTYPE_WAP: + case NETTYPE_2G: + _raninfo.radio_access_network = GPRS; + break; + + case NETTYPE_3G: + _raninfo.radio_access_network = WCDMA; + break; + + case NETTYPE_4G: + case NETTYPE_5G: + _raninfo.radio_access_network = LTE; + break; + + default: + break; } + xverbose2(TSF "netInfo= %0, %1", netType, _raninfo.radio_access_network); return !_raninfo.radio_access_network.empty(); } - - -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getCurWifiInfo, KPlatformCommC2Java, - "getCurWifiInfo", "()Lcom/tencent/mars/comm/PlatformComm$WifiInfo;") -bool getCurWifiInfo(WifiInfo& wifiInfo) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getCurWifiInfo, "()Lcom/tencent/mars/comm/PlatformComm$WifiInfo;") +bool getCurWifiInfo(WifiInfo& wifiInfo, bool _force_refresh) { xverbose_function(); - if (!g_wifi_info.ssid.empty()) { - wifiInfo = g_wifi_info; - return true; + if (!_force_refresh && !g_wifi_info.ssid.empty()) { + wifiInfo = g_wifi_info; + return true; } + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&getCurWifiInfo, boost::ref(wifiInfo), _force_refresh)); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); @@ -232,13 +233,12 @@ bool getCurWifiInfo(WifiInfo& wifiInfo) { jobject retObj = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getCurWifiInfo).l; if (NULL == retObj) { - xwarn2(TSF"getCurWifiInfo error return null"); + xwarn2(TSF "getCurWifiInfo error return null"); return false; } - jstring ssidJstr = (jstring)JNU_GetField(env, retObj, "ssid", "Ljava/lang/String;").l; - jstring bssidJstr = (jstring)JNU_GetField(env, retObj, "bssid", "Ljava/lang/String;").l; + jstring bssidJstr = (jstring)JNU_GetField(env, retObj, "bssid", "Ljava/lang/String;").l; if (NULL == ssidJstr || NULL == bssidJstr) { return false; @@ -253,17 +253,18 @@ bool getCurWifiInfo(WifiInfo& wifiInfo) { return true; } - -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getCurSIMInfo, KPlatformCommC2Java, "getCurSIMInfo", - "()Lcom/tencent/mars/comm/PlatformComm$SIMInfo;") -bool getCurSIMInfo(SIMInfo& simInfo) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getCurSIMInfo, "()Lcom/tencent/mars/comm/PlatformComm$SIMInfo;") +bool getCurSIMInfo(SIMInfo& simInfo, bool realtime /*=false*/) { xverbose_function(); - if (!g_sim_info.isp_code.empty()) { - simInfo = g_sim_info; - return true; + if (!realtime && !g_sim_info.isp_code.empty()) { + simInfo = g_sim_info; + return true; } + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&getCurSIMInfo, boost::ref(simInfo), realtime)); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); @@ -272,11 +273,10 @@ bool getCurSIMInfo(SIMInfo& simInfo) { jobject retObj = JNU_CallStaticMethodByMethodInfo(env, KPlatformCommC2Java_getCurSIMInfo).l; if (NULL == retObj) { - xwarn2(TSF"getCurSIMInfo error return null"); + xwarn2(TSF "getCurSIMInfo error return null"); return false; } - jstring ispCodeJstr = (jstring)JNU_GetField(env, retObj, "ispCode", "Ljava/lang/String;").l; jstring ispNameJstr = (jstring)JNU_GetField(env, retObj, "ispName", "Ljava/lang/String;").l; @@ -288,15 +288,17 @@ bool getCurSIMInfo(SIMInfo& simInfo) { xgroup2_define(group); ScopedJstring icJstr(env, ispCodeJstr); - xdebug2(TSF"ispCode:%0, ", icJstr.GetChar()) >> group; + xdebug2(TSF "ispCode:%0, ", icJstr.GetChar()) >> group; g_sim_info.isp_code = icJstr.GetChar(); env->DeleteLocalRef(ispCodeJstr); - if (NULL == ispNameJstr) { return true; } // isp name may NULL or empty + if (NULL == ispNameJstr) { + return true; + } // isp name may NULL or empty ScopedJstring inJstr(env, ispNameJstr); - xdebug2(TSF"ispName:%0", inJstr.GetChar()) >> group; + xdebug2(TSF "ispName:%0", inJstr.GetChar()) >> group; g_sim_info.isp_name = inJstr.GetChar(); env->DeleteLocalRef(ispNameJstr); @@ -306,29 +308,35 @@ bool getCurSIMInfo(SIMInfo& simInfo) { return true; } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getAPNInfo, KPlatformCommC2Java, "getAPNInfo", "()Lcom/tencent/mars/comm/PlatformComm$APNInfo;") +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getAPNInfo, "()Lcom/tencent/mars/comm/PlatformComm$APNInfo;") bool getAPNInfo(APNInfo& info) { xverbose_function(); if (g_apn_info.nettype >= kNoNet) { - info = g_apn_info; - return true; + info = g_apn_info; + return true; } + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&getAPNInfo, boost::ref(info))); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); ScopedLock lock(g_net_mutex); - jobject retObj = JNU_CallStaticMethodByName(env, cacheInstance->GetClass(env, KPlatformCommC2Java), "getAPNInfo", "()Lcom/tencent/mars/comm/PlatformComm$APNInfo;").l; + jobject retObj = JNU_CallStaticMethodByName(env, + cacheInstance->GetClass(env, KPlatformCommC2Java), + "getAPNInfo", + "()Lcom/tencent/mars/comm/PlatformComm$APNInfo;") + .l; if (NULL == retObj) { - xinfo2(TSF"getAPNInfo error return null"); + xinfo2(TSF "getAPNInfo error return null"); return false; } - g_apn_info.nettype = (int)JNU_GetField(env, retObj, "netType", "I").i; g_apn_info.sub_nettype = (int)JNU_GetField(env, retObj, "subNetType", "I").i; @@ -340,7 +348,7 @@ bool getAPNInfo(APNInfo& info) { ScopedJstring extraJstr(env, extraStr); if (extraJstr.GetChar() != NULL) { - g_apn_info.extra_info = extraJstr.GetChar(); + g_apn_info.extra_info = extraJstr.GetChar(); } env->DeleteLocalRef(extraStr); @@ -350,42 +358,46 @@ bool getAPNInfo(APNInfo& info) { return true; } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_getSignal, KPlatformCommC2Java, "getSignal", "(Z)J") - -unsigned int getSignal(bool isWifi) { +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, getSignal, "(Z)J") +uint32_t getSignal(bool isWifi) { xverbose_function(); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&getSignal, isWifi)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); jlong signal = JNU_CallStaticMethodByMethodInfo(scopeJEnv.GetEnv(), KPlatformCommC2Java_getSignal, isWifi).j; - xverbose2(TSF"Signal Strength= %0, wifi:%1", signal, isWifi); + xverbose2(TSF "Signal Strength= %0, wifi:%1", signal, isWifi); return (unsigned int)signal; } -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_isNetworkConnected, KPlatformCommC2Java, "isNetworkConnected", "()Z") +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, isNetworkConnected, "()Z") bool isNetworkConnected() { xverbose_function(); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(&isNetworkConnected); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); jboolean ret = JNU_CallStaticMethodByMethodInfo(scopeJEnv.GetEnv(), KPlatformCommC2Java_isNetworkConnected).z; - xverbose2(TSF"ret= %0", (bool)ret); + xverbose2(TSF "ret= %0", (bool)ret); return (bool)ret; } - bool getifaddrs_ipv4_hotspot(std::string& _ifname, std::string& _ip) { return false; } -#ifdef ANDROID -DEFINE_FIND_STATIC_METHOD(KPlatformCommC2Java_wakeupLock_new, KPlatformCommC2Java, "wakeupLock_new", - "()Lcom/tencent/mars/comm/WakerLock;") +DEFINE_FIND_STATIC_METHOD2(KPlatformCommC2Java, wakeupLock_new, "()Lcom/tencent/mars/comm/WakerLock;") void* wakeupLock_new() { xverbose_function(); + + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(&wakeupLock_new); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); @@ -394,19 +406,22 @@ void* wakeupLock_new() { if (ret) { jobject newref = env->NewGlobalRef(ret); env->DeleteLocalRef(ret); - xdebug2(TSF"newref= %0", newref); + xdebug2(TSF "newref= %0", newref); return newref; } else { - xerror2(TSF"wakeupLock_new return null"); + xerror2(TSF "wakeupLock_new return null"); return NULL; } } -void wakeupLock_delete(void* _object) { +void wakeupLock_delete(void* _object) { xverbose_function(); - xdebug2(TSF"_object= %0", _object); + xdebug2(TSF "_object= %0", _object); + if (NULL == _object) + return; - if (NULL == _object) return; + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&wakeupLock_delete, _object)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); @@ -414,10 +429,13 @@ void wakeupLock_delete(void* _object) { env->DeleteGlobalRef((jobject)_object); } -void wakeupLock_Lock(void* _object) { +void wakeupLock_Lock(void* _object) { xverbose_function(); xassert2(_object); - xdebug2(TSF"_object= %0", _object); + xdebug2(TSF "_object= %0", _object); + + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&wakeupLock_Lock, _object)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); @@ -425,11 +443,14 @@ void wakeupLock_Lock(void* _object) { JNU_CallMethodByName(env, (jobject)_object, "lock", "()V"); } -void wakeupLock_Lock_Timeout(void* _object, int64_t _timeout) { +void wakeupLock_Lock_Timeout(void* _object, int64_t _timeout) { xverbose_function(); xassert2(_object); xassert2(0 < _timeout); - xverbose2(TSF"_object= %0, _timeout= %1", _object, _timeout); + xverbose2(TSF "_object= %0, _timeout= %1", _object, _timeout); + + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&wakeupLock_Lock_Timeout, _object, _timeout)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); @@ -437,10 +458,13 @@ void wakeupLock_Lock_Timeout(void* _object, int64_t _timeout) { JNU_CallMethodByName(env, (jobject)_object, "lock", "(J)V", (jlong)_timeout); } -void wakeupLock_Unlock(void* _object) { +void wakeupLock_Unlock(void* _object) { xverbose_function(); xassert2(_object); - xdebug2(TSF"_object= %0", _object); + xdebug2(TSF "_object= %0", _object); + + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&wakeupLock_Unlock, _object)); VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); @@ -448,19 +472,143 @@ void wakeupLock_Unlock(void* _object) { JNU_CallMethodByName(env, (jobject)_object, "unLock", "()V"); } -bool wakeupLock_IsLocking(void* _object) { +bool wakeupLock_IsLocking(void* _object) { xverbose_function(); xassert2(_object); + if (coroutine::isCoroutine()) + return coroutine::MessageInvoke(boost::bind(&wakeupLock_IsLocking, _object)); + VarCache* cacheInstance = VarCache::Singleton(); ScopeJEnv scopeJEnv(cacheInstance->GetJvm()); JNIEnv* env = scopeJEnv.GetEnv(); jboolean ret = JNU_CallMethodByName(env, (jobject)_object, "isLocking", "()Z").z; - xdebug2(TSF"_object= %0, ret= %1", _object, (bool)ret); + xdebug2(TSF "_object= %0, ret= %1", _object, (bool)ret); return (bool)ret; } -#endif +#else // #ifndef NATIVE_CALLBACK + +namespace { +std::shared_ptr s_default_network_cb = std::make_shared(); +std::shared_ptr s_default_alarm_cb = std::make_shared(); +std::shared_ptr s_default_wakeup_lock_cb = std::make_shared(); + +std::weak_ptr s_network_cb; +std::weak_ptr s_alarm_cb; +std::weak_ptr s_wakeup_lock_cb; + +std::shared_ptr getNetworkInfoCallback() { + auto cb = s_network_cb.lock(); + if (cb) { + return cb; + } + xerror2("no network info callback"); + return s_default_network_cb; +} +std::shared_ptr getAlarmCallback() { + auto cb = s_alarm_cb.lock(); + if (cb) { + return cb; + } + xerror2("no alarm callback"); + return s_default_alarm_cb; +} +std::shared_ptr getWakeUpLockCallback() { + auto cb = s_wakeup_lock_cb.lock(); + if (cb) { + return cb; + } + xerror2("no wakeup lock callback"); + return s_default_wakeup_lock_cb; +} +} // namespace + +void SetNetworkInfoCallback(const std::shared_ptr& _cb) { + s_network_cb = _cb; +} +void SetAlarmCallback(const std::shared_ptr& _cb) { + s_alarm_cb = _cb; +} +void SetWakeUpLockCallback(const std::shared_ptr& _cb) { + s_wakeup_lock_cb = _cb; +} + +bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { + return getNetworkInfoCallback()->getProxyInfo(port, strProxy, _host); +} +bool getAPNInfo(APNInfo& info) { + return getNetworkInfoCallback()->getAPNInfo(info); +} +NetType getNetInfo(bool realtime) { + return getNetworkInfoCallback()->getNetInfo(realtime); +} +NetTypeForStatistics getNetTypeForStatistics() { + return getNetworkInfoCallback()->getNetTypeForStatistics(); +} +bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _info) { + return getNetworkInfoCallback()->getCurRadioAccessNetworkInfo(_info); +} +bool getCurWifiInfo(WifiInfo& _wifi_info, bool _force_refresh) { + return getNetworkInfoCallback()->getCurWifiInfo(_wifi_info, _force_refresh); +} +bool getCurSIMInfo(SIMInfo& _sim_info, bool realtime) { + return getNetworkInfoCallback()->getCurSIMInfo(_sim_info, realtime); +} +uint32_t getSignal(bool isWifi) { + return getNetworkInfoCallback()->getSignal(isWifi); +} +bool isNetworkConnected() { + return getNetworkInfoCallback()->isNetworkConnected(); +} +bool getifaddrs_ipv4_hotspot(std::string& _ifname, std::string& _ifip) { + return getNetworkInfoCallback()->getIfAddrsIpv4HotSpot(_ifname, _ifip); +} + +bool startAlarm(int type, int64_t id, int after) { + return getAlarmCallback()->startAlarm(type, id, after); +} +bool stopAlarm(int64_t id) { + return getAlarmCallback()->stopAlarm(id); +} +void* wakeupLock_new() { + return getWakeUpLockCallback()->wakeupLock_new(); +} +void wakeupLock_delete(void* _object) { + getWakeUpLockCallback()->wakeupLock_delete(_object); +} +void wakeupLock_Lock(void* _object) { + getWakeUpLockCallback()->wakeupLock_Lock(_object); +} +void wakeupLock_Lock_Timeout(void* _object, int64_t _timeout) { + getWakeUpLockCallback()->wakeupLock_Lock_Timeout(_object, _timeout); +} +void wakeupLock_Unlock(void* _object) { + getWakeUpLockCallback()->wakeupLock_Unlock(_object); +} +bool wakeupLock_IsLocking(void* _object) { + return getWakeUpLockCallback()->wakeupLock_IsLocking(_object); +} +#endif // #ifndef NATIVE_CALLBACK + +std::string GetCurrentProcessName() { + static std::string cmdline; + if (!cmdline.empty()) + return cmdline; + + int fd = open("/proc/self/cmdline", O_RDONLY); + if (fd < 0) + return cmdline; + char szcmdline[128] = {0}; + if (read(fd, &szcmdline[0], sizeof(szcmdline) - 1) > 0) { + size_t bytes = strlen(szcmdline); + cmdline.assign(szcmdline, bytes); + } + close(fd); + return cmdline; +} +} // namespace comm +} // namespace mars diff --git a/mars/comm/jni/sources.mk b/mars/comm/jni/sources.mk deleted file mode 100644 index 4b292831c..000000000 --- a/mars/comm/jni/sources.mk +++ /dev/null @@ -1,133 +0,0 @@ - -TEMP_LOCAL_PATH :=$(call my-dir)/.. - -include $(TEMP_LOCAL_PATH)/../mk_template/util.mk -include $(TEMP_LOCAL_PATH)/../mk_template/flags.mk - -LOCAL_CFLAGS += -fvisibility=hidden -LOCAL_CFLAGS += -Wno-error=strict-aliasing - -LOCAL_CFLAGS += -DUSING_XLOG_WEAK_FUNC - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/crypt/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/thread/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/crypt/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(call enum-files-subdir-all-src,$(TEMP_LOCAL_PATH)/../boost/libs) -SRC := $(foreach n,$(SRC), $(if $(filter-out %/win32/,$(dir $(n))),$(n))) -SRC := $(foreach n,$(SRC), $(if $(filter-out %/windows/,$(dir $(n))),$(n))) -EXCLUDE_SRC_FILES := $(TEMP_LOCAL_PATH)/../boost/libs/thread/src/pthread/thread.cpp -SRC := $(filter-out $(EXCLUDE_SRC_FILES),$(SRC)) -ifeq ($(TARGET_ARCH), arm) - arm_src_files := $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/jump_arm_aapcs_elf_gas.S \ - $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/make_arm_aapcs_elf_gas.S - SRC += $(arm_src_files) - LOCAL_CFLAGS += $(arm_cflags) -endif -ifeq ($(TARGET_ARCH), arm64) - arm_src_files := $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/jump_arm64_aapcs_elf_gas.S \ - $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/make_arm64_aapcs_elf_gas.S - SRC += $(arm_src_files) - LOCAL_CFLAGS += $(arm_cflags) -endif -ifeq ($(TARGET_ARCH), x86) - arm_src_files := $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/jump_i386_sysv_elf_gas.S \ - $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/make_i386_sysv_elf_gas.S - SRC += $(arm_src_files) - LOCAL_CFLAGS += $(arm_cflags) -endif -ifeq ($(TARGET_ARCH), x86_64) - arm_src_files := $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/jump_x86_64_sysv_elf_gas.S \ - $(TEMP_LOCAL_PATH)/../boost/libs/context/src/asm/make_x86_64_sysv_elf_gas.S - SRC += $(arm_src_files) - LOCAL_CFLAGS += $(arm_cflags) -endif - -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/android/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/network/*.c*) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/android/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/DnsResolve/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/messagequeue/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/socket/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/socket/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/jni/*.c*) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/jni/util/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/corepattern/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/coroutine/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/unix/socketselect/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/debugger/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/http/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/dns/*.cc) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/assert/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - -SRC := $(wildcard $(TEMP_LOCAL_PATH)/xlogger/*.c) -SRC := $(SRC:$(LOCAL_PATH)/%=%) -LOCAL_SRC_FILES += $(SRC) - - diff --git a/mars/comm/jni/util/JNI_OnLoad.h b/mars/comm/jni/util/JNI_OnLoad.h index a091dbc05..5ddf5ad72 100644 --- a/mars/comm/jni/util/JNI_OnLoad.h +++ b/mars/comm/jni/util/JNI_OnLoad.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,14 +10,14 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - - #include + #include "comm/bootregister.h" -typedef jint JNICALL(*JniOnLoadFunc)(JavaVM*, void*); +typedef jint JNICALL (*JniOnLoadFunc)(JavaVM*, void*); struct JniOnload_t { - explicit JniOnload_t(JniOnLoadFunc _func): func(_func) {} + explicit JniOnload_t(JniOnLoadFunc _func) : func(_func) { + } JniOnLoadFunc func; }; diff --git a/mars/comm/jni/util/comm_function.cc b/mars/comm/jni/util/comm_function.cc index 6ff107b1f..d5ad3b5c8 100644 --- a/mars/comm/jni/util/comm_function.cc +++ b/mars/comm/jni/util/comm_function.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /** * created on : 2012-07-30 * author : yanguoyue @@ -18,25 +17,135 @@ #include "comm_function.h" +#include #include + #include #include "assert/__assert.h" -#include "var_cache.h" #include "autobuffer.h" +#include "mars/comm/xlogger/xlogger.h" +#include "scoped_jstring.h" +#include "var_cache.h" +using namespace std; +// +/* + * Get a human-readable summary of an exception object. The buffer will + * be populated with the "binary" class name and, if present, the + * exception message. + */ +static void getExceptionSummary(JNIEnv* env, jthrowable exception, char* buf, size_t bufLen) { + int success = 0; + /* get the name of the exception's class */ + jclass exceptionClazz = env->GetObjectClass(exception); // can't fail + jclass classClazz = env->GetObjectClass(exceptionClazz); // java.lang.Class, can't fail + jmethodID classGetNameMethod = env->GetMethodID(classClazz, "getName", "()Ljava/lang/String;"); + jstring classNameStr = (jstring)env->CallObjectMethod(exceptionClazz, classGetNameMethod); + if (classNameStr != NULL) { + /* get printable string */ + const char* classNameChars = env->GetStringUTFChars(classNameStr, NULL); + if (classNameChars != NULL) { + /* if the exception has a message string, get that */ + jmethodID throwableGetMessageMethod = + env->GetMethodID(exceptionClazz, "getMessage", "()Ljava/lang/String;"); + jstring messageStr = (jstring)env->CallObjectMethod(exception, throwableGetMessageMethod); + if (messageStr != NULL) { + const char* messageChars = env->GetStringUTFChars(messageStr, NULL); + if (messageChars != NULL) { + snprintf(buf, bufLen, "%s: %s", classNameChars, messageChars); + env->ReleaseStringUTFChars(messageStr, messageChars); + } else { + env->ExceptionClear(); // clear OOM + snprintf(buf, bufLen, "%s: ", classNameChars); + } + env->DeleteLocalRef(messageStr); + } else { + strncpy(buf, classNameChars, bufLen); + buf[bufLen - 1] = '\0'; + } + env->ReleaseStringUTFChars(classNameStr, classNameChars); + success = 1; + } + env->DeleteLocalRef(classNameStr); + } + env->DeleteLocalRef(classClazz); + env->DeleteLocalRef(exceptionClazz); + if (!success) { + env->ExceptionClear(); + snprintf(buf, bufLen, "%s", ""); + } +} +/* + * Formats an exception as a string with its stack trace. + */ +static void printStackTrace(JNIEnv* env, jthrowable exception, char* buf, size_t bufLen) { + int success = 0; + jclass stringWriterClazz = env->FindClass("java/io/StringWriter"); + if (stringWriterClazz != NULL) { + jmethodID stringWriterCtor = env->GetMethodID(stringWriterClazz, "", "()V"); + jmethodID stringWriterToStringMethod = env->GetMethodID(stringWriterClazz, "toString", "()Ljava/lang/String;"); + jclass printWriterClazz = env->FindClass("java/io/PrintWriter"); + if (printWriterClazz != NULL) { + jmethodID printWriterCtor = env->GetMethodID(printWriterClazz, "", "(Ljava/io/Writer;)V"); + jobject stringWriterObj = env->NewObject(stringWriterClazz, stringWriterCtor); + if (stringWriterObj != NULL) { + jobject printWriterObj = env->NewObject(printWriterClazz, printWriterCtor, stringWriterObj); + if (printWriterObj != NULL) { + jclass exceptionClazz = env->GetObjectClass(exception); // can't fail + jmethodID printStackTraceMethod = + env->GetMethodID(exceptionClazz, "printStackTrace", "(Ljava/io/PrintWriter;)V"); + env->CallVoidMethod(exception, printStackTraceMethod, printWriterObj); + if (!env->ExceptionCheck()) { + jstring messageStr = + (jstring)env->CallObjectMethod(stringWriterObj, stringWriterToStringMethod); + if (messageStr != NULL) { + jsize messageStrLength = env->GetStringLength(messageStr); + if (messageStrLength >= (jsize)bufLen) { + messageStrLength = bufLen - 1; + } + env->GetStringUTFRegion(messageStr, 0, messageStrLength, buf); + env->DeleteLocalRef(messageStr); + buf[messageStrLength] = '\0'; + success = 1; + } + } + env->DeleteLocalRef(exceptionClazz); + env->DeleteLocalRef(printWriterObj); + } + env->DeleteLocalRef(stringWriterObj); + } + env->DeleteLocalRef(printWriterClazz); + } + env->DeleteLocalRef(stringWriterClazz); + } + if (!success) { + env->ExceptionClear(); + getExceptionSummary(env, exception, buf, bufLen); + } +} -using namespace std; +/* + * Log an exception. + * If exception is NULL, logs the current exception in the JNI environment, if any. + */ +static void jniLogException(JNIEnv* env) { + jthrowable exception = env->ExceptionOccurred(); + if (exception == NULL) { + return; + } + env->ExceptionDescribe(); + env->ExceptionClear(); + char szbuffer[1024] = {0}; + printStackTrace(env, exception, szbuffer, sizeof(szbuffer)); + xerror2(TSF "jni exception %_", szbuffer); + __android_log_write(ANDROID_LOG_WARN, "mars::jniexception", szbuffer); +} -jvalue __JNU_CallMethodByName( - JNIEnv* env, - jobject obj, - const char* name, - const char* descriptor, - va_list args) { - +// +jvalue __JNU_CallMethodByName(JNIEnv* env, jobject obj, const char* name, const char* descriptor, va_list args) { ASSERT(env != NULL); ASSERT(obj != NULL); ASSERT(name != NULL); @@ -47,7 +156,7 @@ jvalue __JNU_CallMethodByName( jclass clazz; jmethodID mid; jvalue result; - memset(&result, 0 , sizeof(result)); + memset(&result, 0, sizeof(result)); if (env->EnsureLocalCapacity(2) == JNI_OK) { clazz = env->GetObjectClass(obj); @@ -70,52 +179,53 @@ jvalue __JNU_CallMethodByName( p++; switch (*p) { - case 'V': - env->CallVoidMethodV(obj, mid, args); - break; - - case '[': - case 'L': - result.l = env->CallObjectMethodV(obj, mid, args); - break; - - case 'Z': - result.z = env->CallBooleanMethodV(obj, mid, args); - break; - - case 'B': - result.b = env->CallByteMethodV(obj, mid, args); - break; - - case 'C': - result.c = env->CallCharMethodV(obj, mid, args); - break; - - case 'S': - result.s = env->CallShortMethodV(obj, mid, args); - break; - - case 'I': - result.i = env->CallIntMethodV(obj, mid, args); - break; - - case 'J': - result.j = env->CallLongMethodV(obj, mid, args); - break; - - case 'F': - result.f = env->CallFloatMethodV(obj, mid, args); - break; - - case 'D': - result.d = env->CallDoubleMethodV(obj, mid, args); - break; - - default: - env->FatalError("illegal descriptor"); - break; + case 'V': + env->CallVoidMethodV(obj, mid, args); + break; + + case '[': + case 'L': + result.l = env->CallObjectMethodV(obj, mid, args); + break; + + case 'Z': + result.z = env->CallBooleanMethodV(obj, mid, args); + break; + + case 'B': + result.b = env->CallByteMethodV(obj, mid, args); + break; + + case 'C': + result.c = env->CallCharMethodV(obj, mid, args); + break; + + case 'S': + result.s = env->CallShortMethodV(obj, mid, args); + break; + + case 'I': + result.i = env->CallIntMethodV(obj, mid, args); + break; + + case 'J': + result.j = env->CallLongMethodV(obj, mid, args); + break; + + case 'F': + result.f = env->CallFloatMethodV(obj, mid, args); + break; + + case 'D': + result.d = env->CallDoubleMethodV(obj, mid, args); + break; + + default: + env->FatalError("illegal descriptor"); + break; } + jniLogException(env); } env->DeleteLocalRef(clazz); @@ -132,45 +242,36 @@ jvalue __JNU_CallMethodByName( * @param _descriptor the _descriptor of the method's parameters * @return */ -jvalue JNU_CallMethodByName( - JNIEnv* _env, - jobject obj, - const char* _name, - const char* _descriptor, ...) { - +jvalue JNU_CallMethodByName(JNIEnv* _env, jobject obj, const char* _name, const char* _descriptor, ...) { ASSERT(_env != NULL); ASSERT(obj != NULL); ASSERT(_name != NULL); ASSERT(_descriptor != NULL); va_list args; - va_start(args, _descriptor); + va_start(args, _descriptor); - jvalue result = __JNU_CallMethodByName( _env, obj, _name, _descriptor, args); + jvalue result = __JNU_CallMethodByName(_env, obj, _name, _descriptor, args); - va_end(args); - return result; + va_end(args); + return result; } - -jvalue __JNU_CallStaticMethodByName( - JNIEnv* _env, - jclass _clazz, - const char* _name, - const char* _descriptor, - va_list args) { - +jvalue __JNU_CallStaticMethodByName(JNIEnv* _env, + jclass _clazz, + const char* _name, + const char* _descriptor, + va_list args) { ASSERT(_env != NULL); ASSERT(_clazz != NULL); ASSERT(_name != NULL); ASSERT(_descriptor != NULL); - VarCache* cacheInastance = VarCache::Singleton(); jmethodID mid; jvalue result; - memset(&result, 0 , sizeof(result)); + memset(&result, 0, sizeof(result)); mid = cacheInastance->GetStaticMethodId(_env, _clazz, _name, _descriptor); @@ -188,61 +289,59 @@ jvalue __JNU_CallStaticMethodByName( p++; switch (*p) { - case 'V': - _env->CallStaticVoidMethodV(_clazz, mid, args); - break; + case 'V': + _env->CallStaticVoidMethodV(_clazz, mid, args); + break; - case '[': - case 'L': - result.l = _env->CallStaticObjectMethodV(_clazz, mid, args); - break; + case '[': + case 'L': + result.l = _env->CallStaticObjectMethodV(_clazz, mid, args); + break; - case 'Z': - result.z = _env->CallStaticBooleanMethodV(_clazz, mid, args); - break; + case 'Z': + result.z = _env->CallStaticBooleanMethodV(_clazz, mid, args); + break; - case 'B': - result.b = _env->CallStaticByteMethodV(_clazz, mid, args); - break; + case 'B': + result.b = _env->CallStaticByteMethodV(_clazz, mid, args); + break; - case 'C': - result.c = _env->CallStaticCharMethodV(_clazz, mid, args); - break; + case 'C': + result.c = _env->CallStaticCharMethodV(_clazz, mid, args); + break; - case 'S': - result.s = _env->CallStaticShortMethodV(_clazz, mid, args); - break; + case 'S': + result.s = _env->CallStaticShortMethodV(_clazz, mid, args); + break; - case 'I': - result.i = _env->CallStaticIntMethodV(_clazz, mid, args); - break; + case 'I': + result.i = _env->CallStaticIntMethodV(_clazz, mid, args); + break; - case 'J': - result.j = _env->CallStaticLongMethodV(_clazz, mid, args); - break; + case 'J': + result.j = _env->CallStaticLongMethodV(_clazz, mid, args); + break; - case 'F': - result.f = _env->CallStaticFloatMethodV(_clazz, mid, args); - break; + case 'F': + result.f = _env->CallStaticFloatMethodV(_clazz, mid, args); + break; - case 'D': - result.d = _env->CallStaticDoubleMethodV(_clazz, mid, args); - break; + case 'D': + result.d = _env->CallStaticDoubleMethodV(_clazz, mid, args); + break; - default: - _env->FatalError("illegal _descriptor"); - break; + default: + _env->FatalError("illegal _descriptor"); + break; } + + jniLogException(_env); } return result; } -jvalue JNU_CallStaticMethodByName( - JNIEnv* _env, - jclass _clazz, - const char* _name, - const char* _descriptor, ...) { +jvalue JNU_CallStaticMethodByName(JNIEnv* _env, jclass _clazz, const char* _name, const char* _descriptor, ...) { ASSERT(_env != NULL); ASSERT(_clazz != NULL); ASSERT(_name != NULL); @@ -257,11 +356,11 @@ jvalue JNU_CallStaticMethodByName( return result; } -jvalue JNU_CallStaticMethodByName( - JNIEnv* _env, - const char* className, - const char* _name, - const char* _descriptor, ...) { +jvalue JNU_CallStaticMethodByName(JNIEnv* _env, + const char* className, + const char* _name, + const char* _descriptor, + ...) { ASSERT(_env != NULL); ASSERT(className != NULL); ASSERT(_name != NULL); @@ -285,7 +384,8 @@ jvalue JNU_CallStaticMethodByMethodInfo(JNIEnv* _env, JniMethodInfo methodInfo, va_list args; va_start(args, methodInfo); - jvalue result = __JNU_CallStaticMethodByName(_env, _clazz, methodInfo.methodname.c_str(), methodInfo.methodsig.c_str(), args); + jvalue result = + __JNU_CallStaticMethodByName(_env, _clazz, methodInfo.methodname.c_str(), methodInfo.methodsig.c_str(), args); va_end(args); return result; @@ -297,9 +397,8 @@ jvalue JNU_GetStaticField(JNIEnv* _env, jclass _clazz, const char* _name, const ASSERT(NULL != _name); ASSERT(NULL != sig); - jvalue result; - memset(&result, 0 , sizeof(result)); + memset(&result, 0, sizeof(result)); jfieldID fid = VarCache::Singleton()->GetStaticFieldId(_env, _clazz, _name, sig); @@ -308,54 +407,56 @@ jvalue JNU_GetStaticField(JNIEnv* _env, jclass _clazz, const char* _name, const } switch (*sig) { - case '[': - case 'L': - result.l = _env->GetStaticObjectField(_clazz, fid); - break; - - case 'Z': - result.z = _env->GetStaticBooleanField(_clazz, fid); - break; - - case 'B': - result.b = _env->GetStaticByteField(_clazz, fid); - break; - - case 'C': - result.c = _env->GetStaticCharField(_clazz, fid); - break; - - case 'S': - result.s = _env->GetStaticShortField(_clazz, fid); - break; - - case 'I': - result.i = _env->GetStaticIntField(_clazz, fid); - break; - - case 'J': - result.j = _env->GetStaticLongField(_clazz, fid); - break; - - case 'F': - result.f = _env->GetStaticFloatField(_clazz, fid); - break; - - case 'D': - result.d = _env->GetStaticDoubleField(_clazz, fid); - break; - - default: - _env->FatalError("illegal _descriptor"); - break; + case '[': + case 'L': + result.l = _env->GetStaticObjectField(_clazz, fid); + break; + + case 'Z': + result.z = _env->GetStaticBooleanField(_clazz, fid); + break; + + case 'B': + result.b = _env->GetStaticByteField(_clazz, fid); + break; + + case 'C': + result.c = _env->GetStaticCharField(_clazz, fid); + break; + + case 'S': + result.s = _env->GetStaticShortField(_clazz, fid); + break; + + case 'I': + result.i = _env->GetStaticIntField(_clazz, fid); + break; + + case 'J': + result.j = _env->GetStaticLongField(_clazz, fid); + break; + + case 'F': + result.f = _env->GetStaticFloatField(_clazz, fid); + break; + + case 'D': + result.d = _env->GetStaticDoubleField(_clazz, fid); + break; + + default: + _env->FatalError("illegal _descriptor"); + break; } + jniLogException(_env); + return result; } jvalue JNU_GetField(JNIEnv* _env, jobject obj, const char* _name, const char* sig) { jvalue result; - memset(&result, 0 , sizeof(result)); + memset(&result, 0, sizeof(result)); if (_env->ExceptionOccurred()) { return result; @@ -375,56 +476,56 @@ jvalue JNU_GetField(JNIEnv* _env, jobject obj, const char* _name, const char* si } switch (*sig) { - case '[': - case 'L': - result.l = _env->GetObjectField(obj, fid); - break; - - case 'Z': - result.z = _env->GetBooleanField(obj, fid); - break; - - case 'B': - result.b = _env->GetByteField(obj, fid); - break; - - case 'C': - result.c = _env->GetCharField(obj, fid); - break; - - case 'S': - result.s = _env->GetShortField(obj, fid); - break; - - case 'I': - result.i = _env->GetIntField(obj, fid); - break; - - case 'J': - result.j = _env->GetLongField(obj, fid); - break; - - case 'F': - result.f = _env->GetFloatField(obj, fid); - break; - - case 'D': - result.d = _env->GetDoubleField(obj, fid); - break; - - default: - _env->FatalError("illegal _descriptor"); - break; + case '[': + case 'L': + result.l = _env->GetObjectField(obj, fid); + break; + + case 'Z': + result.z = _env->GetBooleanField(obj, fid); + break; + + case 'B': + result.b = _env->GetByteField(obj, fid); + break; + + case 'C': + result.c = _env->GetCharField(obj, fid); + break; + + case 'S': + result.s = _env->GetShortField(obj, fid); + break; + + case 'I': + result.i = _env->GetIntField(obj, fid); + break; + + case 'J': + result.j = _env->GetLongField(obj, fid); + break; + + case 'F': + result.f = _env->GetFloatField(obj, fid); + break; + + case 'D': + result.d = _env->GetDoubleField(obj, fid); + break; + + default: + _env->FatalError("illegal _descriptor"); + break; } + jniLogException(_env); + return result; } - jvalue JNU_CallMethodByMethodInfo(JNIEnv* env, jobject obj, JniMethodInfo methodInfo, ...) { ASSERT(env != NULL); - va_list args; va_start(args, methodInfo); @@ -449,7 +550,7 @@ jbyteArray JNU_Buffer2JbyteArray(JNIEnv* _env, const AutoBuffer& ab) { } jbyteArray bytes = _env->NewByteArray((jsize)len); - _env->SetByteArrayRegion(bytes, 0, (jsize)len, (jbyte*) ab.Ptr()); + _env->SetByteArrayRegion(bytes, 0, (jsize)len, (jbyte*)ab.Ptr()); return bytes; } @@ -461,7 +562,7 @@ jbyteArray JNU_Buffer2JbyteArray(JNIEnv* _env, const void* _buffer, size_t _leng } jbyteArray bytes = _env->NewByteArray((jsize)len); - _env->SetByteArrayRegion(bytes, 0, (jsize)len, (jbyte*) _buffer); + _env->SetByteArrayRegion(bytes, 0, (jsize)len, (jbyte*)_buffer); return bytes; } @@ -471,10 +572,7 @@ void JNU_FreeJbyteArray(JNIEnv* _env, jbyteArray bytes) { _env->DeleteLocalRef(bytes); } -bool JNU_JbyteArray2Buffer( - JNIEnv* _env, - const jbyteArray bytes, - AutoBuffer& ab) { +bool JNU_JbyteArray2Buffer(JNIEnv* _env, const jbyteArray bytes, AutoBuffer& ab) { ASSERT(_env != NULL); if (_env == NULL) { @@ -495,15 +593,12 @@ bool JNU_JbyteArray2Buffer( return true; } - /** * @param _env * @param jstr * @return */ -wchar_t* JNU_Jstring2Wchar( - JNIEnv* _env, - const jstring jstr) { +wchar_t* JNU_Jstring2Wchar(JNIEnv* _env, const jstring jstr) { ASSERT(_env != NULL); if (jstr == NULL) @@ -519,7 +614,7 @@ void JNU_FreeWchar(JNIEnv* _env, jstring str, wchar_t* wchar) { ASSERT(wchar != NULL); ASSERT(str != NULL); - _env->ReleaseStringChars(str, (jchar*) wchar); + _env->ReleaseStringChars(str, (jchar*)wchar); } /** @@ -529,9 +624,7 @@ void JNU_FreeWchar(JNIEnv* _env, jstring str, wchar_t* wchar) { * @param jstr * @return */ -jstring JNU_Wstring2Jstring( - JNIEnv* _env, - const std::wstring& wstr) { +jstring JNU_Wstring2Jstring(JNIEnv* _env, const std::wstring& wstr) { ASSERT(_env != NULL); ASSERT(wstr.size() != 0); @@ -565,17 +658,16 @@ jstring JNU_Chars2Jstring(JNIEnv* _env, const char* pat) { if (pat != NULL) { bytes = _env->NewByteArray((jsize)strlen(pat)); - _env->SetByteArrayRegion(bytes, 0, (jsize)strlen(pat), (jbyte*) pat); + _env->SetByteArrayRegion(bytes, 0, (jsize)strlen(pat), (jbyte*)pat); } else { bytes = _env->NewByteArray(1); - char ch[1] = - { 0 }; - _env->SetByteArrayRegion(bytes, 0, 1, (jbyte*) ch); + char ch[1] = {0}; + _env->SetByteArrayRegion(bytes, 0, 1, (jbyte*)ch); } jstring encoding = _env->NewStringUTF("utf-8"); - jstring jstr = (jstring) _env->NewObject(str_class, ctorID, bytes, encoding); + jstring jstr = (jstring)_env->NewObject(str_class, ctorID, bytes, encoding); _env->DeleteLocalRef(bytes); _env->DeleteLocalRef(encoding); @@ -587,3 +679,36 @@ void JNU_FreeJstring(JNIEnv* _env, jstring str) { _env->DeleteLocalRef(str); } + +std::map JNU_JObject2Map(JNIEnv* _env, const jobject _obj) { + ASSERT(_env != NULL); + + std::map result; + jclass c_Map = _env->FindClass("java/util/Map"); + jmethodID m_KeySet = _env->GetMethodID(c_Map, "keySet", "()Ljava/util/Set;"); + jobject jKeySet = _env->CallObjectMethod(_obj, m_KeySet); + + jclass c_Set = _env->FindClass("java/util/Set"); + jmethodID m_ToArray = _env->GetMethodID(c_Set, "toArray", "()[Ljava/lang/Object;"); + jobjectArray jobjArray = (jobjectArray)_env->CallObjectMethod(jKeySet, m_ToArray); + if (jobjArray == NULL) { + return result; + } + + jmethodID m_Get = _env->GetMethodID(c_Map, "get", "(Ljava/lang/Object;)Ljava/lang/Object;"); + jsize arraysize = _env->GetArrayLength(jobjArray); + for (int i = 0; i < arraysize; i++) { + jstring jkey = (jstring)_env->GetObjectArrayElement(jobjArray, i); + jstring jvalue = (jstring)_env->CallObjectMethod(_obj, m_Get, jkey); + result[ScopedJstring(_env, jkey).GetChar()] = ScopedJstring(_env, jvalue).GetChar(); + _env->DeleteLocalRef(jkey); + _env->DeleteLocalRef(jvalue); + } + + _env->DeleteLocalRef(jobjArray); + _env->DeleteLocalRef(jKeySet); + _env->DeleteLocalRef(c_Set); + _env->DeleteLocalRef(c_Map); + + return result; +} diff --git a/mars/comm/jni/util/comm_function.h b/mars/comm/jni/util/comm_function.h index 08f8069a2..98ed3b8b0 100644 --- a/mars/comm/jni/util/comm_function.h +++ b/mars/comm/jni/util/comm_function.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /** * created on : 2012-07-16 * author : yanguoyue @@ -20,13 +19,20 @@ #define _COMM_FUNCTION_H_ #include + +#include #include + struct JniMethodInfo; class AutoBuffer; jvalue JNU_CallMethodByName(JNIEnv* _env, jobject obj, const char* _name, const char* descriptor, ...); jvalue JNU_CallStaticMethodByName(JNIEnv* _env, jclass clazz, const char* _name, const char* descriptor, ...); -jvalue JNU_CallStaticMethodByName(JNIEnv* _env, const char* _class_name, const char* _name, const char* descriptor, ...); +jvalue JNU_CallStaticMethodByName(JNIEnv* _env, + const char* _class_name, + const char* _name, + const char* descriptor, + ...); jvalue JNU_CallStaticMethodByMethodInfo(JNIEnv* _env, JniMethodInfo _method_info, ...); jvalue JNU_GetStaticField(JNIEnv* _env, jclass clazz, const char* _name, const char* sig); jvalue JNU_GetField(JNIEnv* _env, jobject obj, const char* _name, const char* sig); @@ -39,7 +45,8 @@ void JNU_FreeJbyteArray(JNIEnv* _env, jbyteArray bytes); bool JNU_JbyteArray2Buffer(JNIEnv* _env, const jbyteArray bytes, AutoBuffer& ab); -// bool JNU_Jstring2Wstring( JNIEnv* _env, const jstring jstr, std::wstring& wstr); //in linux sizeof(wchar_t)==4 but sizeof(jchar)==2 +// bool JNU_Jstring2Wstring( JNIEnv* _env, const jstring jstr, std::wstring& wstr); //in linux sizeof(wchar_t)==4 but +// sizeof(jchar)==2 wchar_t* JNU_Jstring2Wchar(JNIEnv* _env, const jstring jstr); void JNU_FreeWchar(JNIEnv* _env, jstring str, wchar_t* wchar); jstring JNU_Wstring2Jstring(JNIEnv* _env, const std::wstring& wstr); @@ -49,4 +56,6 @@ jstring JNU_Wchar2JString(JNIEnv* _env, wchar_t* wchar); jstring JNU_Chars2Jstring(JNIEnv* _env, const char* pat); void JNU_FreeJstring(JNIEnv* _env, jstring str); +std::map JNU_JObject2Map(JNIEnv* _env, const jobject _obj); + #endif diff --git a/mars/comm/jni/util/scope_jenv.cc b/mars/comm/jni/util/scope_jenv.cc index 97cb25a1a..f02acab71 100644 --- a/mars/comm/jni/util/scope_jenv.cc +++ b/mars/comm/jni/util/scope_jenv.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * scop_jenv.cpp * @@ -19,45 +18,52 @@ */ #include "scope_jenv.h" + +#include #include #include -#include -#include "assert/__assert.h" -extern pthread_key_t g_env_key; +#include -ScopeJEnv::ScopeJEnv(JavaVM* jvm, jint _capacity) - : vm_(jvm), env_(NULL), we_attach_(false), status_(0) { +#include "assert/__assert.h" +#include "mars/comm/jni/util/var_cache.h" + +ScopeJEnv::ScopeJEnv(JavaVM* jvm, jint _capacity) : env_(NULL), status_(0) { + if (nullptr == jvm) { + jvm = VarCache::Singleton()->GetJvm(); + } ASSERT(jvm); do { - env_ = (JNIEnv*)pthread_getspecific(g_env_key); - - if (NULL != env_) { - break; - } - - status_ = vm_->GetEnv((void**) &env_, JNI_VERSION_1_6); + status_ = jvm->GetEnv((void**)&env_, JNI_VERSION_1_6); if (JNI_OK == status_) { + ASSERT2(env_ != NULL, "env_ %p", env_); break; } + char thread_name[32] = {0}; + snprintf(thread_name, sizeof(thread_name), "mars::%d", (int)gettid()); JavaVMAttachArgs args; args.group = NULL; - args.name = "default"; + args.name = thread_name; args.version = JNI_VERSION_1_6; - status_ = vm_->AttachCurrentThread(&env_, &args); + status_ = jvm->AttachCurrentThread(&env_, &args); if (JNI_OK == status_) { - we_attach_ = true; - pthread_setspecific(g_env_key, env_); + thread_local struct OnExit { + ~OnExit() { + if (NULL != VarCache::Singleton()->GetJvm()) { + VarCache::Singleton()->GetJvm()->DetachCurrentThread(); + } + } + } dummy; } else { - ASSERT2(false, "vm:%p, env:%p, status:%d", vm_, env_, status_); + ASSERT2(false, "vm:%p, env:%p, status:%d", jvm, env_, status_); env_ = NULL; return; } } while (false); - + jint ret = env_->PushLocalFrame(_capacity); ASSERT2(0 == ret, "ret:%d", ret); } diff --git a/mars/comm/jni/util/scope_jenv.h b/mars/comm/jni/util/scope_jenv.h index a97b79dbc..dce96bd4a 100644 --- a/mars/comm/jni/util/scope_jenv.h +++ b/mars/comm/jni/util/scope_jenv.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * scop_jenv.h * @@ -24,19 +23,16 @@ #include class ScopeJEnv { - public: - ScopeJEnv(JavaVM* jvm, jint _capacity = 16); + public: + ScopeJEnv(JavaVM* jvm = nullptr, jint _capacity = 16); ~ScopeJEnv(); JNIEnv* GetEnv(); int Status(); - private: - JavaVM* vm_; + private: JNIEnv* env_; - bool we_attach_; int status_; }; - #endif /* SCOP_JENV_H_ */ diff --git a/mars/comm/jni/util/scoped_jstring.cc b/mars/comm/jni/util/scoped_jstring.cc index 327b9a811..2b453af8a 100644 --- a/mars/comm/jni/util/scoped_jstring.cc +++ b/mars/comm/jni/util/scoped_jstring.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * ScopedJstring.cpp * @@ -26,10 +25,7 @@ #include "assert/__assert.h" ScopedJstring::ScopedJstring(JNIEnv* _env, jstring _jstr) -: env_(_env) -, jstr_((jstring)_env->NewLocalRef(_jstr)) -, char_(NULL) -, jstr2char_(true) { +: env_(_env), jstr_((jstring)_env->NewLocalRef(_jstr)), char_(NULL), jstr2char_(true) { ASSERT(env_); if (NULL == env_ || NULL == jstr_) { return; @@ -39,15 +35,11 @@ ScopedJstring::ScopedJstring(JNIEnv* _env, jstring _jstr) return; } - char_ = env_->GetStringUTFChars(jstr_, NULL); + char_ = env_->GetStringUTFChars(jstr_, NULL); } ScopedJstring::ScopedJstring(JNIEnv* _env, const char* _char) -: env_(_env) -, jstr_(NULL) -, char_(_char) -, jstr2char_(false) { - +: env_(_env), jstr_(NULL), char_(_char), jstr2char_(false) { ASSERT(env_); if (NULL == env_ || NULL == _char) { return; @@ -61,10 +53,10 @@ ScopedJstring::ScopedJstring(JNIEnv* _env, const char* _char) jmethodID ctorID = env_->GetMethodID(strClass, "", "([BLjava/lang/String;)V"); jbyteArray bytes = env_->NewByteArray((jsize)strlen(char_)); - env_->SetByteArrayRegion(bytes, 0, (jsize)strlen(char_), (jbyte*) char_); + env_->SetByteArrayRegion(bytes, 0, (jsize)strlen(char_), (jbyte*)char_); jstring encoding = env_->NewStringUTF("utf-8"); - jstr_ = (jstring) env_->NewObject(strClass, ctorID, bytes, encoding); + jstr_ = (jstring)env_->NewObject(strClass, ctorID, bytes, encoding); env_->DeleteLocalRef(bytes); env_->DeleteLocalRef(encoding); @@ -95,6 +87,11 @@ const char* ScopedJstring::GetChar() const { return char_; } +const char* ScopedJstring::SafeGetChar() const { + const char* realstr = GetChar(); + return NULL == realstr ? "" : realstr; +} + jstring ScopedJstring::GetJstr() const { if (env_->ExceptionOccurred()) { return NULL; @@ -102,4 +99,3 @@ jstring ScopedJstring::GetJstr() const { return jstr_; } - diff --git a/mars/comm/jni/util/scoped_jstring.h b/mars/comm/jni/util/scoped_jstring.h index 040107bfc..20ac0d4d4 100644 --- a/mars/comm/jni/util/scoped_jstring.h +++ b/mars/comm/jni/util/scoped_jstring.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * ScopedJstring.h * @@ -24,27 +23,26 @@ #include class ScopedJstring { - public: + public: ScopedJstring(JNIEnv* _env, jstring _jstr); ScopedJstring(JNIEnv* _env, const char* _char); ~ScopedJstring(); const char* GetChar() const; + const char* SafeGetChar() const; jstring GetJstr() const; - private: + private: ScopedJstring(); ScopedJstring(const ScopedJstring&); ScopedJstring& operator=(const ScopedJstring&); - private: + private: JNIEnv* env_; jstring jstr_; const char* char_; bool jstr2char_; }; - - #endif /* SCOPEDJSTRING_H_ */ diff --git a/mars/comm/jni/util/var_cache.cc b/mars/comm/jni/util/var_cache.cc index a81c23879..62417204e 100644 --- a/mars/comm/jni/util/var_cache.cc +++ b/mars/comm/jni/util/var_cache.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,34 +10,35 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /** * created on : 2012-07-30 * author : yanguoyue */ #include "var_cache.h" -#include "scope_jenv.h" -#include + #include +#include #include "assert/__assert.h" +#include "scope_jenv.h" #include "thread/lock.h" -template T& getListByClass(JNIEnv* _env, const jclass& _clz, std::map& _map) { +template +T& getListByClass(JNIEnv* _env, const jclass& _clz, std::map& _map) { for (typename std::map::iterator iter = _map.begin(); iter != _map.end(); ++iter) { if (_env->IsSameObject(_clz, (*iter).first)) return (*iter).second; } jclass gloableClz = (jclass)_env->NewGlobalRef(_clz); - std::pair::iterator, bool> retPair = _map.insert(std::pair(gloableClz, T())); + std::pair::iterator, bool> retPair = + _map.insert(std::pair(gloableClz, T())); ASSERT(retPair.second); return retPair.first->second; } - struct method_struct { std::string methodName; std::string signature; @@ -52,19 +53,16 @@ struct field_struct { VarCache* VarCache::instance_ = NULL; -VarCache::VarCache() : - vm_(NULL) { +VarCache::VarCache() : vm_(NULL) { } VarCache::~VarCache() { ScopeJEnv scopeJEnv(vm_); JNIEnv* env = scopeJEnv.GetEnv(); + mars::comm::ScopedSpinLock lock(class_map_lock_); - ScopedSpinLock lock(class_map_lock_); - - for (std::map::iterator iter = class_map_.begin(); - iter != class_map_.end(); ++iter) { + for (std::map::iterator iter = class_map_.begin(); iter != class_map_.end(); ++iter) { env->DeleteGlobalRef(iter->second); } } @@ -105,14 +103,14 @@ jclass VarCache::GetClass(JNIEnv* _env, const char* const _class_path) { ASSERT(_env != NULL); ASSERT(_class_path != NULL); - ScopedSpinLock lock(class_map_lock_); + mars::comm::ScopedSpinLock lock(class_map_lock_); std::map::iterator iter = class_map_.find(_class_path); if (iter != class_map_.end()) { return iter->second; } - jclass clz = /*newClass(env, classPath); // */_env->FindClass(_class_path); + jclass clz = /*newClass(env, classPath); // */ _env->FindClass(_class_path); ASSERT2(clz != NULL, "classpath:%s", _class_path); @@ -127,7 +125,7 @@ jclass VarCache::GetClass(JNIEnv* _env, const char* const _class_path) { return NULL; } - jclass gloable_clz = (jclass) _env->NewGlobalRef(clz); + jclass gloable_clz = (jclass)_env->NewGlobalRef(clz); _env->DeleteLocalRef(clz); class_map_.insert(std::pair(_class_path, gloable_clz)); @@ -143,7 +141,7 @@ void VarCache::CacheClass(const char* const _class_path, jclass _clz) { return; } - ScopedSpinLock lock(class_map_lock_); + mars::comm::ScopedSpinLock lock(class_map_lock_); std::map::iterator iter = class_map_.find(_class_path); if (iter == class_map_.end()) { @@ -158,9 +156,10 @@ void VarCache::CacheClass(const char* const _class_path, jclass _clz) { * @param _signature the signature of the method's parameter */ - -jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, jclass _clz, - const char* const _method_name, const char* const _signature) { +jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, + jclass _clz, + const char* const _method_name, + const char* const _signature) { if (_env->ExceptionOccurred()) { return NULL; } @@ -179,20 +178,18 @@ jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, jclass _clz, // std::list& methodStructList = staticMethodMap[clz]; std::list& methodStructList = getListByClass(_env, _clz, staticMethodMap); - for (list::iterator iter = methodStructList.begin(); - iter != methodStructList.end(); ++iter) { + for (list::iterator iter = methodStructList.begin(); iter != methodStructList.end(); ++iter) { method_struct& mStruct = *iter; if (strcmp(mStruct._method_name.c_str(), _method_name) == 0 - && strcmp(mStruct._signature.c_str(), _signature) == 0) { + && strcmp(mStruct._signature.c_str(), _signature) == 0) { return mStruct.mid; } } #endif - jmethodID mid = _env->GetStaticMethodID(_clz, _method_name, - _signature); + jmethodID mid = _env->GetStaticMethodID(_clz, _method_name, _signature); ASSERT2(mid != NULL, "NULL sig:%s, mid:%s", _signature, _method_name); @@ -222,8 +219,10 @@ jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, jclass _clz, return mid; } -jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, const char* const _class_path, - const char* const _method_name, const char* const _signature) { +jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, + const char* const _class_path, + const char* const _method_name, + const char* const _signature) { ASSERT(_env != NULL); ASSERT(_class_path != NULL); ASSERT(_method_name != NULL); @@ -233,8 +232,10 @@ jmethodID VarCache::GetStaticMethodId(JNIEnv* _env, const char* const _class_pat return GetStaticMethodId(_env, clz, _method_name, _signature); } -jmethodID VarCache::GetMethodId(JNIEnv* _env, jclass _clz, - const char* const _method_name, const char* const _signature) { +jmethodID VarCache::GetMethodId(JNIEnv* _env, + jclass _clz, + const char* const _method_name, + const char* const _signature) { if (_env->ExceptionOccurred()) { return NULL; } @@ -253,20 +254,18 @@ jmethodID VarCache::GetMethodId(JNIEnv* _env, jclass _clz, // std::list& methodStructList = methodMap[clz]; std::list& methodStructList = getListByClass(_env, _clz, methodMap); - for (list::iterator iter = methodStructList.begin(); - iter != methodStructList.end(); ++iter) { + for (list::iterator iter = methodStructList.begin(); iter != methodStructList.end(); ++iter) { method_struct& mStruct = *iter; if (strcmp(mStruct._method_name.c_str(), _method_name) == 0 - && strcmp(mStruct._signature.c_str(), _signature) == 0) { + && strcmp(mStruct._signature.c_str(), _signature) == 0) { return mStruct.mid; } } #endif - jmethodID mid = _env->GetMethodID(_clz, _method_name, - _signature); + jmethodID mid = _env->GetMethodID(_clz, _method_name, _signature); ASSERT2(mid != NULL, "method:%s, sig:%s", _method_name, _signature); @@ -289,12 +288,13 @@ jmethodID VarCache::GetMethodId(JNIEnv* _env, jclass _clz, } } - return mid; } -jmethodID VarCache::GetMethodId(JNIEnv* _env, const char* const _class_path, - const char* const _method_name, const char* const _signature) { +jmethodID VarCache::GetMethodId(JNIEnv* _env, + const char* const _class_path, + const char* const _method_name, + const char* const _signature) { ASSERT(_env != NULL); ASSERT(_class_path != NULL); ASSERT(_method_name != NULL); @@ -305,8 +305,10 @@ jmethodID VarCache::GetMethodId(JNIEnv* _env, const char* const _class_path, return GetMethodId(_env, clz, _method_name, _signature); } - -jfieldID VarCache::GetStaticFieldId(JNIEnv* _env, const char* const _class_path, const char* const _name, const char* const _sig) { +jfieldID VarCache::GetStaticFieldId(JNIEnv* _env, + const char* const _class_path, + const char* const _name, + const char* const _sig) { ASSERT(NULL != _env); ASSERT(NULL != _class_path); ASSERT(NULL != _name); @@ -339,12 +341,10 @@ jfieldID VarCache::GetStaticFieldId(JNIEnv* _env, jclass _clazz, const char* con ScopedSpinLock lock(fieldMapLock); std::list& fieldStructList = getListByClass(_env, _clazz, fieldMap); - for (list::iterator iter = fieldStructList.begin(); - iter != fieldStructList.end(); ++iter) { + for (list::iterator iter = fieldStructList.begin(); iter != fieldStructList.end(); ++iter) { field_struct& fStruct = *iter; - if (strcmp(fStruct.fieldName.c_str(), _name) == 0 - && strcmp(fStruct.signature.c_str(), _sig) == 0) { + if (strcmp(fStruct.fieldName.c_str(), _name) == 0 && strcmp(fStruct.signature.c_str(), _sig) == 0) { return fStruct.fid; } } @@ -376,15 +376,13 @@ jfieldID VarCache::GetStaticFieldId(JNIEnv* _env, jclass _clazz, const char* con return fid; } - /** * description: get the jfieldID, if it does not exist in the cache,find and cache it. * @param _clz find the jfieldID in the class * @param _field_name the name of the field * @param _signature the signature of the filed's type */ -jfieldID VarCache::GetFieldId(JNIEnv* _env, jclass _clz, const char* const _field_name, - const char* const _signature) { +jfieldID VarCache::GetFieldId(JNIEnv* _env, jclass _clz, const char* const _field_name, const char* const _signature) { if (_env->ExceptionOccurred()) { return NULL; } @@ -403,12 +401,11 @@ jfieldID VarCache::GetFieldId(JNIEnv* _env, jclass _clz, const char* const _fiel // std::list& fieldStructList = fieldMap[clz]; std::list& fieldStructList = getListByClass(_env, _clz, fieldMap); - for (list::iterator iter = fieldStructList.begin(); - iter != fieldStructList.end(); ++iter) { + for (list::iterator iter = fieldStructList.begin(); iter != fieldStructList.end(); ++iter) { field_struct& fStruct = *iter; if (strcmp(fStruct._field_name.c_str(), _field_name) == 0 - && strcmp(fStruct._signature.c_str(), _signature) == 0) { + && strcmp(fStruct._signature.c_str(), _signature) == 0) { return fStruct.fid; } } @@ -441,8 +438,10 @@ jfieldID VarCache::GetFieldId(JNIEnv* _env, jclass _clz, const char* const _fiel return fid; } -jfieldID VarCache::GetFieldId(JNIEnv* _env, const char* const _class_path, - const char* const _field_name, const char* const _signature) { +jfieldID VarCache::GetFieldId(JNIEnv* _env, + const char* const _class_path, + const char* const _field_name, + const char* const _signature) { ASSERT(_env != NULL); ASSERT(_class_path != NULL); ASSERT(_field_name != NULL); @@ -453,7 +452,6 @@ jfieldID VarCache::GetFieldId(JNIEnv* _env, const char* const _class_path, return GetFieldId(_env, clz, _field_name, _signature); } - /***************************************************************************************/ #include @@ -464,13 +462,13 @@ static std::set& __GetClassNameSet() { bool LoadClass(JNIEnv* env) { ASSERT(NULL != env); - std::set& class_name_set = __GetClassNameSet(); + std::set& class_name_set = __GetClassNameSet(); for (std::set::iterator it = class_name_set.begin(); it != class_name_set.end(); ++it) { jclass clz = VarCache::Singleton()->GetClass(env, (*it).c_str()); if (NULL == clz) { - class_name_set.clear(); + class_name_set.clear(); return false; } } @@ -481,7 +479,7 @@ bool LoadClass(JNIEnv* env) { bool AddClass(const char* const _class_path) { ASSERT(_class_path != NULL); - std::set& classNameSet = __GetClassNameSet(); + std::set& classNameSet = __GetClassNameSet(); return classNameSet.insert(_class_path).second; } @@ -502,7 +500,10 @@ bool LoadStaticMethod(JNIEnv* _env) { std::set methoNameSet = __GetStaticMethodInfoSet(); for (std::set::iterator iter = methoNameSet.begin(); iter != methoNameSet.end(); ++iter) { - jmethodID mid = VarCache::Singleton()->GetStaticMethodId(_env, (*iter).classname.c_str(), (*iter).methodname.c_str(), (*iter).methodsig.c_str()); + jmethodID mid = VarCache::Singleton()->GetStaticMethodId(_env, + (*iter).classname.c_str(), + (*iter).methodname.c_str(), + (*iter).methodsig.c_str()); if (NULL == mid) { return false; @@ -518,7 +519,10 @@ bool LoadMethod(JNIEnv* env) { std::set methoNameSet = __GetMethodInfoSet(); for (std::set::iterator iter = methoNameSet.begin(); iter != methoNameSet.end(); ++iter) { - jmethodID mid = VarCache::Singleton()->GetMethodId(env, (*iter).classname.c_str(), (*iter).methodname.c_str(), (*iter).methodsig.c_str()); + jmethodID mid = VarCache::Singleton()->GetMethodId(env, + (*iter).classname.c_str(), + (*iter).methodname.c_str(), + (*iter).methodsig.c_str()); if (NULL == mid) { return false; @@ -528,13 +532,12 @@ bool LoadMethod(JNIEnv* env) { return true; } - bool AddStaticMethod(const char* const _classname, const char* const _methodname, const char* const _methodsig) { ASSERT(_classname != NULL); ASSERT(_methodname != NULL); ASSERT(_methodsig != NULL); - std::set& method_name_set = __GetStaticMethodInfoSet(); + std::set& method_name_set = __GetStaticMethodInfoSet(); return method_name_set.insert(JniMethodInfo(_classname, _methodname, _methodsig)).second; } @@ -544,7 +547,7 @@ bool AddMethod(const char* const _classname, const char* const _methodname, cons ASSERT(_methodname != NULL); ASSERT(_methodsig != NULL); - std::set& methodNameSet = __GetMethodInfoSet(); + std::set& methodNameSet = __GetMethodInfoSet(); return methodNameSet.insert(JniMethodInfo(_classname, _methodname, _methodsig)).second; } diff --git a/mars/comm/jni/util/var_cache.h b/mars/comm/jni/util/var_cache.h index bbc8d231f..08a7e985d 100644 --- a/mars/comm/jni/util/var_cache.h +++ b/mars/comm/jni/util/var_cache.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /** * created on : 2012-07-30 * author : yanguoyue @@ -20,8 +19,9 @@ #define _VAR_CACHE_H_ #include -#include + #include +#include #include #include "comm/thread/spinlock.h" @@ -31,9 +31,10 @@ struct field_struct; struct JniMethodInfo { JniMethodInfo(const std::string& _classname, const std::string& _methodname, const std::string& _methodsig) - : classname(_classname), methodname(_methodname), methodsig(_methodsig) {} + : classname(_classname), methodname(_methodname), methodsig(_methodsig) { + } - bool operator <(const JniMethodInfo& _info) const { + bool operator<(const JniMethodInfo& _info) const { if (classname < _info.classname) { return true; } @@ -42,9 +43,7 @@ struct JniMethodInfo { return true; } - if (classname == _info.classname - && methodname == _info.methodname - && methodsig < _info.methodsig) { + if (classname == _info.classname && methodname == _info.methodname && methodsig < _info.methodsig) { return true; } @@ -57,7 +56,7 @@ struct JniMethodInfo { }; class VarCache { - public: + public: static VarCache* Singleton(); static void Release(); ~VarCache(); @@ -80,10 +79,10 @@ class VarCache { jfieldID GetFieldId(JNIEnv*, const char* const, const char* const, const char* const); jfieldID GetFieldId(JNIEnv*, jclass, const char* const, const char* const); - private: + private: VarCache(); - private: + private: static VarCache* instance_; JavaVM* vm_; @@ -100,7 +99,7 @@ class VarCache { }; #ifdef __GNUC__ -#define VARIABLE_IS_NOT_USED __attribute__ ((unused)) +#define VARIABLE_IS_NOT_USED __attribute__((unused)) #else #define VARIABLE_IS_NOT_USED #endif @@ -108,24 +107,34 @@ class VarCache { bool LoadClass(JNIEnv* env); bool AddClass(const char* const classPath); -#define DEFINE_FIND_CLASS(classname, classpath) \ - VARIABLE_IS_NOT_USED static bool b_##classname = AddClass(classpath);\ +#define DEFINE_FIND_CLASS(classname, classpath) \ + VARIABLE_IS_NOT_USED static bool b_##classname = AddClass(classpath); \ VARIABLE_IS_NOT_USED static const char* classname = classpath; - bool LoadStaticMethod(JNIEnv* env); bool AddStaticMethod(const char* const _classname, const char* const _methodname, const char* const _methodsig); bool LoadMethod(JNIEnv* env); bool AddMethod(const char* const _classname, const char* const _methodname, const char* const _methodsig); -#define DEFINE_FIND_STATIC_METHOD(methodid, classname, methodname, methodsig) \ - VARIABLE_IS_NOT_USED static bool b_static_##methodid = AddStaticMethod(classname, methodname, methodsig);\ +#define DEFINE_FIND_STATIC_METHOD(methodid, classname, methodname, methodsig) \ + VARIABLE_IS_NOT_USED static bool b_static_##methodid = AddStaticMethod(classname, methodname, methodsig); \ VARIABLE_IS_NOT_USED const static JniMethodInfo methodid = JniMethodInfo(classname, methodname, methodsig); -#define DEFINE_FIND_METHOD(methodid, classname, methodname, methodsig) \ - VARIABLE_IS_NOT_USED static bool b_##methodid = AddMethod(classname, methodname, methodsig);\ +#define DEFINE_FIND_METHOD(methodid, classname, methodname, methodsig) \ + VARIABLE_IS_NOT_USED static bool b_##methodid = AddMethod(classname, methodname, methodsig); \ VARIABLE_IS_NOT_USED const static JniMethodInfo methodid = JniMethodInfo(classname, methodname, methodsig); -#endif +// 展开后和DEFINE_FIND_STATIC_METHOD完全一样,不需要调用方通过classname和 methodname拼出methodid +#define DEFINE_FIND_STATIC_METHOD2(classname, methodname, methodsig) \ + VARIABLE_IS_NOT_USED static bool b_static_##classname##_##methodname = \ + AddStaticMethod(classname, #methodname, methodsig); \ + VARIABLE_IS_NOT_USED const static JniMethodInfo classname##_##methodname = \ + JniMethodInfo(classname, #methodname, methodsig); +#define DEFINE_FIND_METHOD2(classname, methodname, methodsig) \ + VARIABLE_IS_NOT_USED static bool b_##classname##_##methodname = AddMethod(classname, #methodname, methodsig); \ + VARIABLE_IS_NOT_USED const static JniMethodInfo classname##_##methodname = \ + JniMethodInfo(classname, #methodname, methodsig); + +#endif diff --git a/mars/comm/macro.h b/mars/comm/macro.h new file mode 100644 index 000000000..a558f127f --- /dev/null +++ b/mars/comm/macro.h @@ -0,0 +1,22 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef COMM_MACRO_H_ +#define COMM_MACRO_H_ + +#if defined(__clang__) +#define NO_DESTROY [[clang::no_destroy]] +#else +#define NO_DESTROY +#endif + +#endif \ No newline at end of file diff --git a/mars/comm/marcotoolkit.h b/mars/comm/marcotoolkit.h index 561d68dc8..b5b52d139 100644 --- a/mars/comm/marcotoolkit.h +++ b/mars/comm/marcotoolkit.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /******************************************************************** created: 2009/11/16 created: 16:11:2009 18:26 @@ -36,60 +35,61 @@ #define MT_ARRAYCOUNT(_Array) (sizeof(_Array) / sizeof(_Array[0])) #else extern "C++" { - template - char (*__countof_helper(_CountofType(&_Array)[_SizeOfArray]))[_SizeOfArray]; +template +char (*__countof_helper(_CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray]; #define MT_ARRAYCOUNT(_Array) sizeof(*__countof_helper(_Array)) } #endif #endif #ifdef __cplusplus -template +template inline T MT_MAX(const T& a, const T& b) { - if (a < b) return b; + if (a < b) + return b; return a; } -template +template inline T MT_MIN(const T& a, const T& b) { - if (b < a) return b; + if (b < a) + return b; return a; } #else -#define MT_MAX(a, b) (((a) > (b)) ? (a) : (b)) -#define MT_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MT_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MT_MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif /* Define MT_OFFSETOF macro */ #ifdef __cplusplus -#ifdef _WIN64 -#define MT_OFFSETOF(s, m) (size_t)( (ptrdiff_t)&reinterpret_cast((((s *)0)->m)) ) +#ifdef _WIN64 +#define MT_OFFSETOF(s, m) (size_t)((ptrdiff_t) & reinterpret_cast((((s*)0)->m))) #else -#define MT_OFFSETOF(s, m) (size_t)&reinterpret_cast((((s *)0)->m)) +#define MT_OFFSETOF(s, m) (size_t) & reinterpret_cast((((s*)0)->m)) #endif #else -#ifdef _WIN64 -#define MT_OFFSETOF(s, m) (size_t)( (ptrdiff_t)&(((s *)0)->m) ) +#ifdef _WIN64 +#define MT_OFFSETOF(s, m) (size_t)((ptrdiff_t) & (((s*)0)->m)) #else -#define MT_OFFSETOF(s, m) (size_t)&(((s *)0)->m) +#define MT_OFFSETOF(s, m) (size_t) & (((s*)0)->m) #endif -#endif /* __cplusplus */ - +#endif /* __cplusplus */ /* Define MT_DELETE macro */ #if !defined(MT_DELETE) #if defined(__cplusplus) -#define MT_DELETE(x)\ - if (MT_NULL != x) {\ - delete x;\ - x = MT_NULL;\ +#define MT_DELETE(x) \ + if (MT_NULL != x) { \ + delete x; \ + x = MT_NULL; \ } #endif #endif @@ -97,20 +97,20 @@ inline T MT_MIN(const T& a, const T& b) { /* Define MT_DELETE_ARRAY macro */ #if !defined(MT_DELETE_ARRAY) #if defined(__cplusplus) -#define MT_DELETE_ARRAY(x)\ - if (MT_NULL != x) {\ - delete[] x;\ - x = MT_NULL;\ +#define MT_DELETE_ARRAY(x) \ + if (MT_NULL != x) { \ + delete[] x; \ + x = MT_NULL; \ } #endif #endif /* Define MT_FREE macro */ #if !defined(MT_FREE) -#define MT_FREE(x)\ - if (MT_NULL != x) {\ - free(x);\ - x = MT_NULL;\ +#define MT_FREE(x) \ + if (MT_NULL != x) { \ + free(x); \ + x = MT_NULL; \ } #endif diff --git a/mars/comm/md5.c b/mars/comm/md5.c deleted file mode 100644 index ead6e11e6..000000000 --- a/mars/comm/md5.c +++ /dev/null @@ -1,352 +0,0 @@ - -#include "md5.h" -//#include -#include - -#pragma GCC diagnostic ignored "-Wunused-value" - -#define INIT_DATA_A (unsigned long)0x67452301L -#define INIT_DATA_B (unsigned long)0xefcdab89L -#define INIT_DATA_C (unsigned long)0x98badcfeL -#define INIT_DATA_D (unsigned long)0x10325476L - -#if _BYTE_ORDER==_LITTLE_ENDIAN -# define HOST_c2l(c,l) ((l)=*((const unsigned int *)(c)), (c)+=4, (l)) -# define HOST_l2c(l,c) (*((unsigned int *)(c))=(unsigned int)(l), (c)+=4, (l)) -#endif - -#ifndef HOST_c2l -#define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \ - l|=(((unsigned long)(*((c)++)))<<16), \ - l|=(((unsigned long)(*((c)++)))<< 8), \ - l|=(((unsigned long)(*((c)++))) ), \ - l) -#endif -#ifndef HOST_l2c -#define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \ - *((c)++)=(unsigned char)(((l)>>16)&0xff), \ - *((c)++)=(unsigned char)(((l)>> 8)&0xff), \ - *((c)++)=(unsigned char)(((l) )&0xff), \ - l) -#endif - -#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d)) -#define G(b,c,d) ((((b) ^ (c)) & (d)) ^ (c)) -#define H(b,c,d) ((b) ^ (c) ^ (d)) -#define I(b,c,d) (((~(d)) | (b)) ^ (c)) - -#define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) - -#define R0(a,b,c,d,k,s,t) { \ - a+=((k)+(t)+F((b),(c),(d))); \ - a=ROTATE(a,s); \ - a+=b; };\ - -#define R1(a,b,c,d,k,s,t) { \ - a+=((k)+(t)+G((b),(c),(d))); \ - a=ROTATE(a,s); \ - a+=b; }; - -#define R2(a,b,c,d,k,s,t) { \ - a+=((k)+(t)+H((b),(c),(d))); \ - a=ROTATE(a,s); \ - a+=b; }; - -#define R3(a,b,c,d,k,s,t) { \ - a+=((k)+(t)+I((b),(c),(d))); \ - a=ROTATE(a,s); \ - a+=b; }; - -static void md5_block_data_order(md5_t *c, const void *data_, size_t num) -{ - const unsigned char *data = data_; - register unsigned long A, B, C, D, l; - /* See comment in crypto/sha/sha_locl.h for details. */ - unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, XX11, - XX12, XX13, XX14, XX15; - -# define X(i) XX##i - - A = c->A; - B = c->B; - C = c->C; - D = c->D; - - for (; num--;) - { - HOST_c2l(data, l); - X( 0) = l; - HOST_c2l(data, l); - X( 1) = l; - /* Round 0 */ - R0(A, B, C, D, X( 0), 7, 0xd76aa478L); - HOST_c2l(data, l); - X( 2) = l; - R0(D, A, B, C, X( 1), 12, 0xe8c7b756L); - HOST_c2l(data, l); - X( 3) = l; - R0(C, D, A, B, X( 2), 17, 0x242070dbL); - HOST_c2l(data, l); - X( 4) = l; - R0(B, C, D, A, X( 3), 22, 0xc1bdceeeL); - HOST_c2l(data, l); - X( 5) = l; - R0(A, B, C, D, X( 4), 7, 0xf57c0fafL); - HOST_c2l(data, l); - X( 6) = l; - R0(D, A, B, C, X( 5), 12, 0x4787c62aL); - HOST_c2l(data, l); - X( 7) = l; - R0(C, D, A, B, X( 6), 17, 0xa8304613L); - HOST_c2l(data, l); - X( 8) = l; - R0(B, C, D, A, X( 7), 22, 0xfd469501L); - HOST_c2l(data, l); - X( 9) = l; - R0(A, B, C, D, X( 8), 7, 0x698098d8L); - HOST_c2l(data, l); - X(10) = l; - R0(D, A, B, C, X( 9), 12, 0x8b44f7afL); - HOST_c2l(data, l); - X(11) = l; - R0(C, D, A, B, X(10), 17, 0xffff5bb1L); - HOST_c2l(data, l); - X(12) = l; - R0(B, C, D, A, X(11), 22, 0x895cd7beL); - HOST_c2l(data, l); - X(13) = l; - R0(A, B, C, D, X(12), 7, 0x6b901122L); - HOST_c2l(data, l); - X(14) = l; - R0(D, A, B, C, X(13), 12, 0xfd987193L); - HOST_c2l(data, l); - X(15) = l; - R0(C, D, A, B, X(14), 17, 0xa679438eL); - R0(B, C, D, A, X(15), 22, 0x49b40821L); - /* Round 1 */ - R1(A, B, C, D, X( 1), 5, 0xf61e2562L); - R1(D, A, B, C, X( 6), 9, 0xc040b340L); - R1(C, D, A, B, X(11), 14, 0x265e5a51L); - R1(B, C, D, A, X( 0), 20, 0xe9b6c7aaL); - R1(A, B, C, D, X( 5), 5, 0xd62f105dL); - R1(D, A, B, C, X(10), 9, 0x02441453L); - R1(C, D, A, B, X(15), 14, 0xd8a1e681L); - R1(B, C, D, A, X( 4), 20, 0xe7d3fbc8L); - R1(A, B, C, D, X( 9), 5, 0x21e1cde6L); - R1(D, A, B, C, X(14), 9, 0xc33707d6L); - R1(C, D, A, B, X( 3), 14, 0xf4d50d87L); - R1(B, C, D, A, X( 8), 20, 0x455a14edL); - R1(A, B, C, D, X(13), 5, 0xa9e3e905L); - R1(D, A, B, C, X( 2), 9, 0xfcefa3f8L); - R1(C, D, A, B, X( 7), 14, 0x676f02d9L); - R1(B, C, D, A, X(12), 20, 0x8d2a4c8aL); - /* Round 2 */ - R2(A, B, C, D, X( 5), 4, 0xfffa3942L); - R2(D, A, B, C, X( 8), 11, 0x8771f681L); - R2(C, D, A, B, X(11), 16, 0x6d9d6122L); - R2(B, C, D, A, X(14), 23, 0xfde5380cL); - R2(A, B, C, D, X( 1), 4, 0xa4beea44L); - R2(D, A, B, C, X( 4), 11, 0x4bdecfa9L); - R2(C, D, A, B, X( 7), 16, 0xf6bb4b60L); - R2(B, C, D, A, X(10), 23, 0xbebfbc70L); - R2(A, B, C, D, X(13), 4, 0x289b7ec6L); - R2(D, A, B, C, X( 0), 11, 0xeaa127faL); - R2(C, D, A, B, X( 3), 16, 0xd4ef3085L); - R2(B, C, D, A, X( 6), 23, 0x04881d05L); - R2(A, B, C, D, X( 9), 4, 0xd9d4d039L); - R2(D, A, B, C, X(12), 11, 0xe6db99e5L); - R2(C, D, A, B, X(15), 16, 0x1fa27cf8L); - R2(B, C, D, A, X( 2), 23, 0xc4ac5665L); - /* Round 3 */ - R3(A, B, C, D, X( 0), 6, 0xf4292244L); - R3(D, A, B, C, X( 7), 10, 0x432aff97L); - R3(C, D, A, B, X(14), 15, 0xab9423a7L); - R3(B, C, D, A, X( 5), 21, 0xfc93a039L); - R3(A, B, C, D, X(12), 6, 0x655b59c3L); - R3(D, A, B, C, X( 3), 10, 0x8f0ccc92L); - R3(C, D, A, B, X(10), 15, 0xffeff47dL); - R3(B, C, D, A, X( 1), 21, 0x85845dd1L); - R3(A, B, C, D, X( 8), 6, 0x6fa87e4fL); - R3(D, A, B, C, X(15), 10, 0xfe2ce6e0L); - R3(C, D, A, B, X( 6), 15, 0xa3014314L); - R3(B, C, D, A, X(13), 21, 0x4e0811a1L); - R3(A, B, C, D, X( 4), 6, 0xf7537e82L); - R3(D, A, B, C, X(11), 10, 0xbd3af235L); - R3(C, D, A, B, X( 2), 15, 0x2ad7d2bbL); - R3(B, C, D, A, X( 9), 21, 0xeb86d391L); - - A = c->A += A; - B = c->B += B; - C = c->C += C; - D = c->D += D; - } -} - -void MD5_init(md5_t* c) -{ - memset(c, 0, sizeof(*c)); - c->A = INIT_DATA_A; - c->B = INIT_DATA_B; - c->C = INIT_DATA_C; - c->D = INIT_DATA_D; -} - -void MD5_process(md5_t * c, const void *data_, unsigned int len) -{ - const unsigned char *data = data_; - unsigned char *p; - unsigned int l; - size_t n; - - if (len == 0) - return; - - l = (c->Nl + (((unsigned int) len) << 3)) & 0xffffffffUL; - /* 95-05-24 eay Fixed a bug with the overflow handling, thanks to - * Wei Dai for pointing it out. */ - if (l < c->Nl) /* overflow */ - c->Nh++; - c->Nh += (unsigned int) (len >> 29); /* might cause compiler warning on 16-bit */ - c->Nl = l; - - n = c->num; - if (n != 0) - { - p = (unsigned char *) c->data; - - if (len >= MD5_CBLOCK || len + n >= MD5_CBLOCK) - { - memcpy(p + n, data, MD5_CBLOCK - n); - md5_block_data_order(c, p, 1); - n = MD5_CBLOCK - n; - data += n; - len -= n; - c->num = 0; - memset(p, 0, MD5_CBLOCK); /* keep it zeroed */ - } - else - { - memcpy(p + n, data, len); - c->num += (unsigned int) len; - return; - } - } - - n = len / MD5_CBLOCK; - if (n > 0) - { - md5_block_data_order(c, data, n); - n *= MD5_CBLOCK; - data += n; - len -= n; - } - - if (len != 0) - { - p = (unsigned char *) c->data; - c->num = (unsigned int) len; - memcpy(p, data, len); - } -} - -#define HASH_MAKE_STRING(c,s) do { \ - unsigned long ll; \ - ll=(c)->A; HOST_l2c(ll,(s)); \ - ll=(c)->B; HOST_l2c(ll,(s)); \ - ll=(c)->C; HOST_l2c(ll,(s)); \ - ll=(c)->D; HOST_l2c(ll,(s)); \ - } while (0) - -void MD5_finish(md5_t *c, void *md) -{ - unsigned char *p = (unsigned char *) c->data; - size_t n = c->num; - char* _md = (char*)md; - - p[n] = 0x80; /* there is always room for one */ - n++; - - if (n > (MD5_CBLOCK - 8)) - { - memset(p + n, 0, MD5_CBLOCK - n); - n = 0; - md5_block_data_order(c, p, 1); - } - memset(p + n, 0, MD5_CBLOCK - 8 - n); - - p += MD5_CBLOCK - 8; - (void) HOST_l2c(c->Nl,p); - (void) HOST_l2c(c->Nh,p); - p -= MD5_CBLOCK; - md5_block_data_order(c, p, 1); - c->num = 0; - memset(p, 0, MD5_CBLOCK); - - HASH_MAKE_STRING(c, _md); - -} - -void MD5_buffer(const char *buffer, const unsigned int buf_len, void *signature) -{ - md5_t md5; - - /* initialize the computation context */ - MD5_init(&md5); - - /* process whole buffer but last buf_len % MD5_BLOCK bytes */ - MD5_process(&md5, buffer, buf_len); - - /* put result in desired memory area */ - MD5_finish(&md5, signature); -} - -#define HEX_STRING "0123456789abcdef" - - -void MD5_sig_to_string(const void *signature, char str[2*MD5_SIZE]) -{ - unsigned char *sig_p; - char *str_p, *max_p; - unsigned int high, low; - - str_p = str; - max_p = str + 2*MD5_SIZE; - - for (sig_p = (unsigned char *) signature; - sig_p < (unsigned char *) signature + MD5_SIZE; sig_p++) - { - high = *sig_p / 16; - low = *sig_p % 16; - /* account for 2 chars */ - if (str_p + 1 >= max_p) - { - break; - } - *str_p++ = HEX_STRING[high]; - *str_p++ = HEX_STRING[low]; - } - /* account for 2 chars */ - if (str_p < max_p) - { - *str_p++ = '\0'; - } -} - -void MD5_sig_from_string(void *signature, const char str[2*MD5_SIZE]) -{ - unsigned char *sig_p; - const char *str_p; - char *hex; - int high, low, val; - - hex = HEX_STRING; - sig_p = signature; - - for (str_p = str; str_p < str + MD5_SIZE * 2; str_p += 2) - { - high =(int)(strchr(hex, *str_p) - hex); - low = (int)(strchr(hex, *(str_p + 1)) - hex); - val = high * 16 + low; - *sig_p++ = (unsigned char)val; - } -} diff --git a/mars/comm/md5.h b/mars/comm/md5.h deleted file mode 100644 index 75827dbad..000000000 --- a/mars/comm/md5.h +++ /dev/null @@ -1,40 +0,0 @@ - - -#ifndef COMM_MD5_H_ -#define COMM_MD5_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MD5_CBLOCK 64 -#define MD5_LBLOCK (MD5_CBLOCK/4) -#define MD5_SIZE 16 - -typedef struct { - unsigned int A, B, C, D; - unsigned int Nl, Nh; - unsigned int data[MD5_LBLOCK]; - unsigned int num; -} md5_t; - -void MD5_init(md5_t*); -void MD5_process(md5_t*, const void*, unsigned int); -void MD5_finish(md5_t*, void*); - -void MD5_buffer(const char* buffer, const unsigned int buf_len, void* signature); - -void MD5_sig_to_string(const void* signature, char str[2 * MD5_SIZE]); -void MD5_sig_from_string(void* signature, const char str[2 * MD5_SIZE]); - -#ifdef __cplusplus -} -#endif - -#define MD5_CTX md5_t -#define Hash_MD5Init(A) MD5_init(A) -#define Hash_MD5Update(A, B, C) MD5_process(A, B, C) -#define Hash_MD5Final(A, B) MD5_finish(A, B) -#define Hash_MD5(A, B, C) MD5_buffer(A, B, C) - -#endif /* COMM_MD5_H_ */ diff --git a/mars/comm/memdbg.cc b/mars/comm/memdbg.cc index 461cda8e1..ed2ed0c7f 100644 --- a/mars/comm/memdbg.cc +++ b/mars/comm/memdbg.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /******************************************************************** created: 2012/9/13 filename: memdbg.cc @@ -19,18 +18,18 @@ *********************************************************************/ #include "comm/assert/__assert.h" - +#include "mars/comm/macro.h" #ifdef DEBUG -#include -#include #include +#include +#include + #include -#include #ifdef ANDROID #include -#include "comm/android/callstack.h" #endif +#include "mars/comm/xlogger/xlogger.h" enum TMemoryType { ECType = 0, @@ -38,39 +37,34 @@ enum TMemoryType { ECPPArrayType = 2, }; -const char* gs_typename[] = { - "ECType", - "ECPPType", - "ECPPArrayType" -}; +const char* gs_typename[] = {"ECType", "ECPPType", "ECPPArrayType"}; struct CrtMem { - const char* _crtFileName; - int _crtLine; - const char* _crtFuncName; - void* _crtMemAddr; - size_t _crtMemLen; - TMemoryType _crtMemoryType; -#ifdef ANDROID - android::CallStack _crtCallStack; -#endif + const char* _crtFileName; + int _crtLine; + const char* _crtFuncName; + void* _crtMemAddr; + size_t _crtMemLen; + TMemoryType _crtMemoryType; }; -static std::vector gs_CrtMemRoot; +NO_DESTROY static std::vector gs_CrtMemRoot; -static void __LogAlloc(void* _retp, size_t _size, const char* _filename, int _line, const char* _func, TMemoryType _type) { +static void __LogAlloc(void* _retp, + size_t _size, + const char* _filename, + int _line, + const char* _func, + TMemoryType _type) { ASSERT(_retp); CrtMem crtMemCell; - crtMemCell._crtFileName = _filename; - crtMemCell._crtLine = _line; - crtMemCell._crtFuncName = _func; - crtMemCell._crtMemAddr = _retp; - crtMemCell._crtMemLen = _size; + crtMemCell._crtFileName = _filename; + crtMemCell._crtLine = _line; + crtMemCell._crtFuncName = _func; + crtMemCell._crtMemAddr = _retp; + crtMemCell._crtMemLen = _size; crtMemCell._crtMemoryType = _type; -#ifdef ANDROID - crtMemCell._crtCallStack.update(); -#endif gs_CrtMemRoot.push_back(crtMemCell); } @@ -79,18 +73,13 @@ static void __DeleteLogAlloc(void* _p, const char* _filename, int _line, const c for (std::vector::iterator it = gs_CrtMemRoot.begin(); it != gs_CrtMemRoot.end(); ++it) { if (_p == it->_crtMemAddr) { if (_type != it->_crtMemoryType) { - std::stringstream strstream; + XMessage strstream; strstream << "\n[" << it->_crtFileName << ", " << it->_crtLine << ", " << it->_crtFuncName << "]" << "alloc type is: " << gs_typename[it->_crtMemoryType] << "\n" << "[" << _filename << ", " << _line << ", " << _func << "]" << "dealloc type is: " << gs_typename[_type] << "\n"; -#ifdef ANDROID - android::CallStack callstack; - callstack.update(); - std::string str_stack = callstack.Format("dealloc type error stack dump", "memdbg"); - strstream << str_stack; -#endif - __ASSERT(__FILE__, __LINE__, __FUNCTION__, strstream.str().c_str()); + + __ASSERT(__FILE__, __LINE__, __FUNCTION__, strstream.String().c_str()); } gs_CrtMemRoot.erase(it); @@ -100,42 +89,42 @@ static void __DeleteLogAlloc(void* _p, const char* _filename, int _line, const c } extern "C" { - void* malloc_dbg(size_t _size, const char* _filename, int _line, const char* _func) { - void* ret = malloc(_size); - ASSERT(ret); +void* malloc_dbg(size_t _size, const char* _filename, int _line, const char* _func) { + void* ret = malloc(_size); + ASSERT(ret); - if (ret) - __LogAlloc(ret, _size, _filename, _line, _func, ECType); + if (ret) + __LogAlloc(ret, _size, _filename, _line, _func, ECType); - return ret; - } + return ret; +} - void* calloc_dbg(size_t _num, size_t _size, const char* _filename, int _line, const char* _func) { - void* ret = calloc(_num, _size); - __LogAlloc(ret, _num * _size, _filename, _line, _func, ECType); - return ret; - } +void* calloc_dbg(size_t _num, size_t _size, const char* _filename, int _line, const char* _func) { + void* ret = calloc(_num, _size); + __LogAlloc(ret, _num * _size, _filename, _line, _func, ECType); + return ret; +} - void* realloc_dbg(void* _oldpointer, size_t _newsize, const char* _filename, int _line, const char* _func) { - if (NULL != _oldpointer) - __DeleteLogAlloc(_oldpointer, _filename, _line, _func, ECType); +void* realloc_dbg(void* _oldpointer, size_t _newsize, const char* _filename, int _line, const char* _func) { + if (NULL != _oldpointer) + __DeleteLogAlloc(_oldpointer, _filename, _line, _func, ECType); - void* ret = realloc(_oldpointer, _newsize); - ASSERT(ret); + void* ret = realloc(_oldpointer, _newsize); + ASSERT(ret); - if (ret) - __LogAlloc(ret, _newsize, _filename, _line, _func, ECType); + if (ret) + __LogAlloc(ret, _newsize, _filename, _line, _func, ECType); - return ret; - } + return ret; +} - void free_dbg(void* _p, const char* _filename, int _line, const char* _func) { - if (!_p) - return; +void free_dbg(void* _p, const char* _filename, int _line, const char* _func) { + if (!_p) + return; - __DeleteLogAlloc(_p, _filename, _line, _func, ECType); - free(_p); - } + __DeleteLogAlloc(_p, _filename, _line, _func, ECType); + free(_p); +} } // "C" @@ -193,7 +182,7 @@ void operator delete[](void* _p, size_t /*_size*/) { #endif -extern "C" void DumpMemoryLeaks(void (* _pfunoutput)(const char*)) { +extern "C" void DumpMemoryLeaks(void (*_pfunoutput)(const char*)) { ASSERT(_pfunoutput); #ifdef DEBUG @@ -202,14 +191,14 @@ extern "C" void DumpMemoryLeaks(void (* _pfunoutput)(const char*)) { return; } - std::stringstream strstream; + XMessage strstream; strstream << "Detected memory leaks!\n"; strstream << "<--------------------------------Dumping objects-------------------------------->\n"; for (std::vector::iterator it = gs_CrtMemRoot.begin(); it != gs_CrtMemRoot.end(); ++it) { strstream << "[" << it->_crtFileName << ", " << it->_crtLine << ", " << it->_crtFuncName << "]" - << ": block at " << it->_crtMemAddr << ", type= " << gs_typename[it->_crtMemoryType] << ", " << it->_crtMemLen - << " bytes long\n Data <"; + << ": block at " << it->_crtMemAddr << ", type= " << gs_typename[it->_crtMemoryType] << ", " + << it->_crtMemLen << " bytes long\n Data <"; size_t length = it->_crtMemLen < 100 ? it->_crtMemLen : 50; char buf[12]; @@ -220,14 +209,12 @@ extern "C" void DumpMemoryLeaks(void (* _pfunoutput)(const char*)) { } strstream << ">\n"; -#ifdef ANDROID - strstream << it->_crtCallStack.Format("memory leaks stack dump", "memdbg"); -#endif + strstream << "<--------------------------------Separator---------------------------------->\n"; } strstream << "<--------------------------------Dump end----------------------------------->\n"; - _pfunoutput(strstream.str().c_str()); + _pfunoutput(strstream.String().c_str()); #else _pfunoutput("Notice memdbg isn't running, because \"NO DEBUG\" was defined"); #endif diff --git a/mars/comm/memdbg.h b/mars/comm/memdbg.h index 0691f8bf7..0be3047dd 100644 --- a/mars/comm/memdbg.h +++ b/mars/comm/memdbg.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /******************************************************************** created: 2012/9/13 filename: memdbg.h @@ -31,15 +30,15 @@ #include #ifndef _MSC_VER - #define __MEMDBG_FUNCTION__ __PRETTY_FUNCTION__ +#define __MEMDBG_FUNCTION__ __PRETTY_FUNCTION__ +#else +// Definitely, VC6 not support this feature! +#if _MSC_VER > 1200 +#define __MEMDBG_FUNCTION__ __FUNCTION__ #else - // Definitely, VC6 not support this feature! - #if _MSC_VER > 1200 - #define __MEMDBG_FUNCTION__ __FUNCTION__ - #else - #define __MEMDBG_FUNCTION__ "N/A" - #warning "'__FUNCTION__' is not supported by this compiler" - #endif +#define __MEMDBG_FUNCTION__ "N/A" +#warning "'__FUNCTION__' is not supported by this compiler" +#endif #endif #if defined(__cplusplus) @@ -55,35 +54,35 @@ void operator delete[](void* _p, size_t _size); #endif -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif void* malloc_dbg(size_t _size, const char* _filename, int _line, const char* _func); void* calloc_dbg(size_t _num, size_t _size, const char* _filename, int _line, const char* _func); void* realloc_dbg(void* _oldpointer, size_t _newsize, const char* _filename, int _line, const char* _func); -void free_dbg(void* _p, const char* _filename, int _line, const char* _func); +void free_dbg(void* _p, const char* _filename, int _line, const char* _func); -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#define malloc(s) malloc_dbg(s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) -#define calloc(c, s) calloc_dbg(c, s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) -#define realloc(p, s) realloc_dbg(p, s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) -#define free(p) free_dbg(p, __FILE__, __LINE__, __MEMDBG_FUNCTION__) +#define malloc(s) malloc_dbg(s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) +#define calloc(c, s) calloc_dbg(c, s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) +#define realloc(p, s) realloc_dbg(p, s, __FILE__, __LINE__, __MEMDBG_FUNCTION__) +#define free(p) free_dbg(p, __FILE__, __LINE__, __MEMDBG_FUNCTION__) -#define new new(__FILE__, __LINE__, __MEMDBG_FUNCTION__) +#define new new (__FILE__, __LINE__, __MEMDBG_FUNCTION__) // #define new(poject) new(poject, __FILE__, __LINE__, __MEMDBG_FUNCTION__) #endif // -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif void DumpMemoryLeaks(void (*)(const char*)); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/mars/comm/messagequeue/callback.h b/mars/comm/messagequeue/callback.h new file mode 100644 index 000000000..02ba96be4 --- /dev/null +++ b/mars/comm/messagequeue/callback.h @@ -0,0 +1,97 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +/* + * callback.h + * + * Created on: 2018-12-13 + * Author: zhouzhijie + */ + +#ifndef callback_h +#define callback_h +#include "boost/bind.hpp" +#include "mars/comm/thread/thread.h" +#include "mars/comm/xlogger/xlogger.h" +#include "message_queue.h" + +namespace mars { + +using namespace comm::MessageQueue; + +template +class CallBack { + public: + typedef boost::function invoke_function; + + // if MessageQueue::KNullHandler, will callback in worker thread + CallBack(const T& _func, MessageHandler_t _handler = comm::MessageQueue::KNullHandler) + : cb_handler_(_handler), cb_func_(_func), valid_(true) { + } + + CallBack(const T& _func, MessageTitle_t _title, MessageHandler_t _handler = comm::MessageQueue::KNullHandler) + : cb_handler_(_handler), title_(_title), cb_func_(_func), valid_(true) { + } + + CallBack() : cb_handler_(comm::MessageQueue::KNullHandler), valid_(false) { + } + + void set(const T& _func, MessageTitle_t _title = 0, MessageHandler_t _handler = comm::MessageQueue::KNullHandler) { + comm::ScopedLock lock(mutex_); + cb_handler_ = _handler; + cb_func_ = _func; + valid_ = true; + title_ = _title; + } + + operator bool() { + comm::ScopedLock lock(mutex_); + return valid_; + } + + void invalidate() { + // should call in messagequeue of cb_handler_ + xassert2(comm::MessageQueue::CurrentThreadMessageQueue() == comm::MessageQueue::Handler2Queue(cb_handler_)); + comm::ScopedLock lock(mutex_); + valid_ = false; + } + + template + void operator()(const Args&... rest) { + comm::ScopedLock lock(mutex_); + if (!valid_) { + return; + } + + boost::function func = boost::bind(cb_func_, rest...); + if (comm::MessageQueue::KNullHandler == cb_handler_) { + func(); + return; + } + if (title_ != 0) { + comm::MessageQueue::AsyncInvoke(func, title_, cb_handler_); + } else { + comm::MessageQueue::AsyncInvoke(func, cb_handler_); + } + } + + private: + MessageHandler_t cb_handler_; + MessageTitle_t title_; + T cb_func_; + comm::Mutex mutex_; + bool valid_; +}; + +} // namespace mars + +#endif /* callback_h */ diff --git a/mars/comm/messagequeue/message_queue.cc b/mars/comm/messagequeue/message_queue.cc index 4287524f5..1be6b3234 100644 --- a/mars/comm/messagequeue/message_queue.cc +++ b/mars/comm/messagequeue/message_queue.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * MessageQueue.cpp * @@ -18,28 +17,40 @@ * Author: yerungui */ -#include +#include #include +#include #include -#include +#include #ifndef _WIN32 #define __STDC_FORMAT_MACROS #include #endif #include "boost/bind.hpp" - -#include "comm/thread/lock.h" #include "comm/anr.h" +#include "comm/bootrun.h" #include "comm/messagequeue/message_queue.h" +#include "comm/thread/lock.h" #include "comm/time_utils.h" #ifdef __APPLE__ #include "comm/debugger/debugger_utils.h" #endif + +#ifdef ANDROID +#include "android/fatal_assert.h" +#endif + #undef min +namespace mars { +namespace comm { namespace MessageQueue { +std::function g_mq_max_size_callback = nullptr; + +#define MAX_MQ_SIZE 5000 + static unsigned int __MakeSeq() { static unsigned int s_seq = 0; @@ -47,8 +58,11 @@ static unsigned int __MakeSeq() { } struct MessageWrapper { - MessageWrapper(const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing, unsigned int _seq) - : message(_message), timing(_timing) { + MessageWrapper(const MessageHandler_t& _handlerid, + const Message& _message, + const MessageTiming& _timing, + unsigned int _seq) + : message(_message), timing(_timing) { postid.reg = _handlerid; postid.seq = _seq; periodstatus = kImmediately; @@ -71,12 +85,15 @@ struct MessageWrapper { MessageTiming timing; TMessageTiming periodstatus; uint64_t record_time; - boost::shared_ptr wait_end_cond; + std::shared_ptr wait_end_cond; }; struct HandlerWrapper { - HandlerWrapper(const MessageHandler& _handler, bool _recvbroadcast, const MessageQueue_t& _messagequeueid, unsigned int _seq) - : handler(_handler), recvbroadcast(_recvbroadcast) { + HandlerWrapper(const MessageHandler& _handler, + bool _recvbroadcast, + const MessageQueue_t& _messagequeueid, + unsigned int _seq) + : handler(_handler), recvbroadcast(_recvbroadcast) { reg.seq = _seq; reg.queue = _messagequeueid; } @@ -87,50 +104,64 @@ struct HandlerWrapper { }; struct RunLoopInfo { - RunLoopInfo():runing_message(NULL) { runing_cond = boost::make_shared();} - - boost::shared_ptr runing_cond; + RunLoopInfo() : runing_message(NULL) { + runing_cond = std::make_shared(); + } + + std::shared_ptr runing_cond; MessagePost_t runing_message_id; Message* runing_message; - std::list runing_handler; + std::list runing_handler; }; - + class Cond : public RunloopCond { -public: - Cond(){} - -public: + public: + Cond() { + } + + public: const boost::typeindex::type_info& type() const { return boost::typeindex::type_id().type_info(); } - + virtual void Wait(ScopedLock& _lock, long _millisecond) { cond_.wait(_lock, _millisecond); } virtual void Notify(ScopedLock& _lock) { cond_.notifyAll(_lock); } - -private: + + private: Cond(const Cond&); void operator=(const Cond&); - -private: + + private: Condition cond_; }; - + struct MessageQueueContent { -public: - MessageQueueContent(): breakflag(false), anr_timeout(-1) {} + MessageQueueContent() : breakflag(false) { + } + +#if defined(ANDROID) + MessageQueueContent(const MessageQueueContent&) : breakflag(false) { /*ASSERT(false);*/ + } +#endif MessageHandler_t invoke_reg; bool breakflag; - boost::shared_ptr breaker; + std::shared_ptr breaker; std::list lst_message; std::list lst_handler; - int anr_timeout; - + std::list lst_runloop_info; + + private: + void operator=(const MessageQueueContent&); + +#if !defined(ANDROID) + MessageQueueContent(const MessageQueueContent&); +#endif }; #define sg_messagequeue_map_mutex messagequeue_map_mutex() @@ -144,11 +175,42 @@ static std::map& messagequeue_map() { return *mq_map; } +static std::string DumpMessage(const std::list& _message_lst, int _cnt) { + XMessage xmsg; + xmsg(TSF "**************Dump MQ Message**************size:%_\n", _message_lst.size()); + int index = 0; + for (auto iter = _message_lst.crbegin(); iter != _message_lst.crend(); ++iter) { + xmsg(TSF "postid:%_, timing:%_, record_time:%_, message:%_\n", + (*iter)->postid.ToString(), + (*iter)->timing.ToString(), + (*iter)->record_time, + (*iter)->message.ToString()); + if (++index > _cnt) + break; + } + return xmsg.String(); +} +std::string DumpMQ(const MessageQueue_t& _msq_queue_id) { + ScopedLock lock(sg_messagequeue_map_mutex); + const MessageQueue_t& id = _msq_queue_id; + + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { + // ASSERT2(false, "%" PRIu64, id); + xinfo2(TSF "message queue not found."); + return ""; + } + + MessageQueueContent& content = pos->second; + return DumpMessage(content.lst_message, 50); +} + MessageQueue_t CurrentThreadMessageQueue() { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueue_t id = (MessageQueue_t)ThreadUtil::currentthreadid(); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) id = KInvalidQueueID; + if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) + id = KInvalidQueueID; return id; } @@ -157,70 +219,90 @@ MessageQueue_t TID2MessageQueue(thread_tid _tid) { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueue_t id = (MessageQueue_t)_tid; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id))id = KInvalidQueueID; + if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) + id = KInvalidQueueID; return id; } - -thread_tid MessageQueue2TID(MessageQueue_t _id) { + +thread_tid MessageQueue2TID(MessageQueue_t _id) { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueue_t& id = _id; - - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return 0; - + + if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) + return 0; + return (thread_tid)id; } -void WaitForRuningLockEnd(const MessagePost_t& _message) { - if (Handler2Queue(Post2Handler(_message)) == CurrentThreadMessageQueue()) return; +void WaitForRunningLockEnd(const MessagePost_t& _message) { + if (Handler2Queue(Post2Handler(_message)) == CurrentThreadMessageQueue()) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = Handler2Queue(Post2Handler(_message)); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return; - MessageQueueContent& content = sg_messagequeue_map[id]; - - if (content.lst_runloop_info.empty()) return; - - auto find_it = std::find_if(content.lst_runloop_info.begin(), content.lst_runloop_info.end(), - [&_message](const RunLoopInfo& _v){ return _message == _v.runing_message_id; }); - - if (find_it == content.lst_runloop_info.end()) return; - - boost::shared_ptr runing_cond = find_it->runing_cond; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return; + MessageQueueContent& content = pos->second; + + if (content.lst_runloop_info.empty()) + return; + + auto find_it = std::find_if(content.lst_runloop_info.begin(), + content.lst_runloop_info.end(), + [&_message](const RunLoopInfo& _v) { + return _message == _v.runing_message_id; + }); + + if (find_it == content.lst_runloop_info.end()) + return; + + std::shared_ptr runing_cond = find_it->runing_cond; runing_cond->wait(lock); } -void WaitForRuningLockEnd(const MessageQueue_t& _messagequeueid) { - if (_messagequeueid == CurrentThreadMessageQueue()) return; +void WaitForRunningLockEnd(const MessageQueue_t& _messagequeueid) { + if (_messagequeueid == CurrentThreadMessageQueue()) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _messagequeueid; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return; - MessageQueueContent& content = sg_messagequeue_map[id]; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return; + MessageQueueContent& content = pos->second; - if (content.lst_runloop_info.empty()) return; - if (KNullPost == content.lst_runloop_info.front().runing_message_id) return; + if (content.lst_runloop_info.empty()) + return; + if (KNullPost == content.lst_runloop_info.front().runing_message_id) + return; - boost::shared_ptr runing_cond = content.lst_runloop_info.front().runing_cond; + std::shared_ptr runing_cond = content.lst_runloop_info.front().runing_cond; runing_cond->wait(lock); } -void WaitForRuningLockEnd(const MessageHandler_t& _handler) { - if (Handler2Queue(_handler) == CurrentThreadMessageQueue()) return; +void WaitForRunningLockEnd(const MessageHandler_t& _handler) { + if (Handler2Queue(_handler) == CurrentThreadMessageQueue()) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = Handler2Queue(_handler); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { return; } - MessageQueueContent& content = sg_messagequeue_map[id]; - if (content.lst_runloop_info.empty()) return; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { + return; + } + MessageQueueContent& content = pos->second; + if (content.lst_runloop_info.empty()) + return; - for(auto& i : content.lst_runloop_info) { + for (auto& i : content.lst_runloop_info) { for (auto& x : i.runing_handler) { - if (_handler==x) { - boost::shared_ptr runing_cond = i.runing_cond; + if (_handler == x) { + std::shared_ptr runing_cond = i.runing_cond; runing_cond->wait(lock); return; } @@ -228,34 +310,38 @@ void WaitForRuningLockEnd(const MessageHandler_t& _handler) { } } -void BreakMessageQueueRunloop(const MessageQueue_t& _messagequeueid) { +void BreakMessageQueueRunloop(const MessageQueue_t& _messagequeueid) { ASSERT(0 != _messagequeueid); ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _messagequeueid; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { - ASSERT2(false, "%" PRIu64, id); + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { + // ASSERT2(false, "%llu", (unsigned long long)id); return; } - sg_messagequeue_map[id].breakflag = true; - sg_messagequeue_map[id].breaker->Notify(lock); + pos->second.breakflag = true; + pos->second.breaker->Notify(lock); } -MessageHandler_t InstallMessageHandler(const MessageHandler& _handler, bool _recvbroadcast, const MessageQueue_t& _messagequeueid) { +MessageHandler_t InstallMessageHandler(const MessageHandler& _handler, + bool _recvbroadcast, + const MessageQueue_t& _messagequeueid) { ASSERT(bool(_handler)); ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _messagequeueid; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { - ASSERT2(false, "%" PRIu64, id); + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { + ASSERT2(false, "%llu", (unsigned long long)id); return KNullHandler; } HandlerWrapper* handler = new HandlerWrapper(_handler, _recvbroadcast, _messagequeueid, __MakeSeq()); - sg_messagequeue_map[id].lst_handler.push_back(handler); + pos->second.lst_handler.push_back(handler); return handler->reg; } @@ -263,34 +349,61 @@ void UnInstallMessageHandler(const MessageHandler_t& _handlerid) { ASSERT(0 != _handlerid.queue); ASSERT(0 != _handlerid.seq); - if (0 == _handlerid.queue || 0 == _handlerid.seq) return; + if (0 == _handlerid.queue || 0 == _handlerid.seq) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return; - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; for (std::list::iterator it = content.lst_handler.begin(); it != content.lst_handler.end(); ++it) { if (_handlerid == (*it)->reg) { - delete(*it); + delete (*it); content.lst_handler.erase(it); break; } } } +static uint64_t sg_last_callback_tick = 0; +static void _MQMaxSizeCallback(const std::list& _lst_message) { + uint64_t now = gettickcount(); + if (now <= sg_last_callback_tick + 60 * 1000) { + return; + } + sg_last_callback_tick = now; + size_t size = _lst_message.size(); + xwarn2(TSF "%_", DumpMessage(_lst_message, 50)); + ASSERT2(false, "Over MAX_MQ_SIZE, size:%d", (int)size); + if (nullptr != g_mq_max_size_callback) { + std::string dump_msg = DumpMessage(_lst_message, 5); + std::thread([=] { + g_mq_max_size_callback(size, dump_msg); + }).detach(); + } +} + MessagePost_t PostMessage(const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing) { ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { - ASSERT2(false, "%" PRIu64, id); + // xinfo2(TSF"mq map size:%_", sg_messagequeue_map.size()); + // xinfo2(TSF"mq id:%_", id); + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { + // ASSERT2(false, "%" PRIu64, id); return KNullPost; } - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; + if (content.lst_message.size() >= MAX_MQ_SIZE) { + _MQMaxSizeCallback(content.lst_message); + } MessageWrapper* messagewrapper = new MessageWrapper(_handlerid, _message, _timing, __MakeSeq()); @@ -299,13 +412,18 @@ MessagePost_t PostMessage(const MessageHandler_t& _handlerid, const Message& _me return messagewrapper->postid; } -MessagePost_t SingletonMessage(bool _replace, const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing) { +MessagePost_t SingletonMessage(bool _replace, + const MessageHandler_t& _handlerid, + const Message& _message, + const MessageTiming& _timing) { ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return KNullPost; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return KNullPost; - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; MessagePost_t post_id; @@ -313,7 +431,7 @@ MessagePost_t SingletonMessage(bool _replace, const MessageHandler_t& _handlerid if ((*it)->postid.reg == _handlerid && (*it)->message == _message) { if (_replace) { post_id = (*it)->postid; - delete(*it); + delete (*it); content.lst_message.erase(it); break; } else { @@ -322,22 +440,33 @@ MessagePost_t SingletonMessage(bool _replace, const MessageHandler_t& _handlerid } } - MessageWrapper* messagewrapper = new MessageWrapper(_handlerid, _message, _timing, 0 != post_id.seq ? post_id.seq : __MakeSeq()); + if (content.lst_message.size() >= MAX_MQ_SIZE) { + _MQMaxSizeCallback(content.lst_message); + } + + MessageWrapper* messagewrapper = + new MessageWrapper(_handlerid, _message, _timing, 0 != post_id.seq ? post_id.seq : __MakeSeq()); content.lst_message.push_back(messagewrapper); content.breaker->Notify(lock); return messagewrapper->postid; } -MessagePost_t BroadcastMessage(const MessageQueue_t& _messagequeueid, const Message& _message, const MessageTiming& _timing) { +MessagePost_t BroadcastMessage(const MessageQueue_t& _messagequeueid, + const Message& _message, + const MessageTiming& _timing) { ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _messagequeueid; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { ASSERT2(false, "%" PRIu64, id); return KNullPost; } - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; + if (content.lst_message.size() >= MAX_MQ_SIZE) { + _MQMaxSizeCallback(content.lst_message); + } MessageHandler_t reg; reg.queue = _messagequeueid; @@ -356,14 +485,14 @@ static int64_t __ComputerWaitTime(const MessageWrapper& _wrap) { wait_time = 0; } else if (kAfter == _wrap.timing.type) { int64_t time_cost = ::gettickspan(_wrap.record_time); - wait_time = _wrap.timing.after - time_cost; + wait_time = _wrap.timing.after - time_cost; } else if (kPeriod == _wrap.timing.type) { int64_t time_cost = ::gettickspan(_wrap.record_time); if (kAfter == _wrap.periodstatus) { - wait_time = _wrap.timing.after - time_cost; + wait_time = _wrap.timing.after - time_cost; } else if (kPeriod == _wrap.periodstatus) { - wait_time = _wrap.timing.period - time_cost; + wait_time = _wrap.timing.period - time_cost; } } @@ -374,9 +503,11 @@ MessagePost_t FasterMessage(const MessageHandler_t& _handlerid, const Message& _ ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return KNullPost; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return KNullPost; - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; MessageWrapper* messagewrapper = new MessageWrapper(_handlerid, _message, _timing, __MakeSeq()); @@ -388,57 +519,98 @@ MessagePost_t FasterMessage(const MessageHandler_t& _handlerid, const Message& _ } messagewrapper->postid = (*it)->postid; - delete(*it); + delete (*it); content.lst_message.erase(it); break; } } + if (content.lst_message.size() >= MAX_MQ_SIZE) { + _MQMaxSizeCallback(content.lst_message); + } content.lst_message.push_back(messagewrapper); content.breaker->Notify(lock); return messagewrapper->postid; } -bool WaitMessage(const MessagePost_t& _message) { +MessagePost_t PostMessageAtFirst(const MessageHandler_t& _handlerid, const Message& _message) { + ScopedLock lock(sg_messagequeue_map_mutex); + const MessageQueue_t& id = _handlerid.queue; + + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return KNullPost; + + MessageQueueContent& content = pos->second; + if (content.lst_message.size() >= MAX_MQ_SIZE) { + _MQMaxSizeCallback(content.lst_message); + } + + MessageWrapper* messagewrapper = new MessageWrapper(_handlerid, _message, kImmediately, __MakeSeq()); + content.lst_message.push_front(messagewrapper); + content.breaker->Notify(lock); + return messagewrapper->postid; +} + +bool WaitMessage(const MessagePost_t& _message, long _timeoutInMs) { bool is_in_mq = Handler2Queue(Post2Handler(_message)) == CurrentThreadMessageQueue(); ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = Handler2Queue(Post2Handler(_message)); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return false; - MessageQueueContent& content = sg_messagequeue_map[id]; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return false; + MessageQueueContent& content = pos->second; - auto find_it = std::find_if(content.lst_message.begin(), content.lst_message.end(), - [&_message](const MessageWrapper * const &_v) { + auto find_it = std::find_if(content.lst_message.begin(), + content.lst_message.end(), + [&_message](const MessageWrapper* const& _v) { return _message == _v->postid; }); - + if (find_it == content.lst_message.end()) { - auto find_it = std::find_if(content.lst_runloop_info.begin(), content.lst_runloop_info.end(), - [&_message](const RunLoopInfo& _v){ return _message == _v.runing_message_id; }); - + auto find_it = std::find_if(content.lst_runloop_info.begin(), + content.lst_runloop_info.end(), + [&_message](const RunLoopInfo& _v) { + return _message == _v.runing_message_id; + }); + if (find_it != content.lst_runloop_info.end()) { - if (is_in_mq) return false; - - boost::shared_ptr runing_cond = find_it->runing_cond; - runing_cond->wait(lock); + if (is_in_mq) + return false; + + std::shared_ptr runing_cond = find_it->runing_cond; + if (_timeoutInMs < 0) { + runing_cond->wait(lock); + } else { + int ret = runing_cond->wait(lock, _timeoutInMs); + return ret == 0; + } } } else { - if (is_in_mq) { lock.unlock(); - RunLoop( [&_message](){ - MessageQueueContent& content = sg_messagequeue_map[Handler2Queue(Post2Handler(_message))]; - return content.lst_message.end() == std::find_if(content.lst_message.begin(), content.lst_message.end(), - [&_message](const MessageWrapper * const &_v) { - return _message == _v->postid; - }); + RunLoop([&_message]() { + MessageQueueContent& content = sg_messagequeue_map[Handler2Queue(Post2Handler(_message))]; + return content.lst_message.end() + == std::find_if(content.lst_message.begin(), + content.lst_message.end(), + [&_message](const MessageWrapper* const& _v) { + return _message == _v->postid; + }); }).Run(); - + } else { - if (!((*find_it)->wait_end_cond))(*find_it)->wait_end_cond = boost::make_shared(); + if (!((*find_it)->wait_end_cond)) + (*find_it)->wait_end_cond = std::make_shared(); - boost::shared_ptr wait_end_cond = (*find_it)->wait_end_cond; - wait_end_cond->wait(lock); + std::shared_ptr wait_end_cond = (*find_it)->wait_end_cond; + if (_timeoutInMs < 0) { + wait_end_cond->wait(lock); + } else { + int ret = wait_end_cond->wait(lock, _timeoutInMs); + return ret == 0; + } } } @@ -449,17 +621,27 @@ bool FoundMessage(const MessagePost_t& _message) { ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = Handler2Queue(Post2Handler(_message)); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return false; - MessageQueueContent& content = sg_messagequeue_map[id]; - if (content.lst_runloop_info.empty()) return false; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return false; + MessageQueueContent& content = pos->second; + if (content.lst_runloop_info.empty()) + return false; + + auto find_it = std::find_if(content.lst_runloop_info.begin(), + content.lst_runloop_info.end(), + [&_message](const RunLoopInfo& _v) { + return _message == _v.runing_message_id; + }); - auto find_it = std::find_if(content.lst_runloop_info.begin(), content.lst_runloop_info.end(), - [&_message](const RunLoopInfo& _v){ return _message == _v.runing_message_id; }); - - if (find_it != content.lst_runloop_info.end()) { return true; } + if (find_it != content.lst_runloop_info.end()) { + return true; + } for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); ++it) { - if (_message == (*it)->postid) { return true;} + if (_message == (*it)->postid) { + return true; + } } return false; @@ -470,25 +652,33 @@ bool CancelMessage(const MessagePost_t& _postid) { ASSERT(0 != _postid.seq); // 0==_postid.reg.seq for BroadcastMessage - if (0 == _postid.reg.queue || 0 == _postid.seq) return false; + if (0 == _postid.reg.queue || 0 == _postid.seq) + return false; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _postid.reg.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { ASSERT2(false, "%" PRIu64, id); return false; } - MessageQueueContent& content = sg_messagequeue_map[id]; - + MessageQueueContent& content = pos->second; + MessageWrapper* tmpMessage = nullptr; for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); ++it) { if (_postid == (*it)->postid) { - delete(*it); + tmpMessage = *it; content.lst_message.erase(it); - return true; + break; } } + lock.unlock(); + + if (tmpMessage != nullptr) { + delete tmpMessage; + return true; + } return false; } @@ -497,93 +687,115 @@ void CancelMessage(const MessageHandler_t& _handlerid) { ASSERT(0 != _handlerid.queue); // 0==_handlerid.seq for BroadcastMessage - if (0 == _handlerid.queue) return; + if (0 == _handlerid.queue) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { // ASSERT2(false, "%lu", id); return; } - MessageQueueContent& content = sg_messagequeue_map[id]; - + MessageQueueContent& content = pos->second; + std::list lstMessages; for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end();) { if (_handlerid == (*it)->postid.reg) { - delete(*it); + lstMessages.push_back(*it); it = content.lst_message.erase(it); } else { ++it; } } + lock.unlock(); + + for (std::list::iterator it = lstMessages.begin(); it != lstMessages.end();) { + delete (*it); + it = lstMessages.erase(it); + } } void CancelMessage(const MessageHandler_t& _handlerid, const MessageTitle_t& _title) { ASSERT(0 != _handlerid.queue); // 0==_handlerid.seq for BroadcastMessage - if (0 == _handlerid.queue) return; + if (0 == _handlerid.queue) + return; ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _handlerid.queue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { ASSERT2(false, "%" PRIu64, id); return; } - MessageQueueContent& content = sg_messagequeue_map[id]; - + MessageQueueContent& content = pos->second; + std::list lstMessages; for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end();) { if (_handlerid == (*it)->postid.reg && _title == (*it)->message.title) { - delete(*it); + lstMessages.push_back(*it); it = content.lst_message.erase(it); } else { ++it; } } + lock.unlock(); + + for (std::list::iterator it = lstMessages.begin(); it != lstMessages.end();) { + delete (*it); + it = lstMessages.erase(it); + } } - -const Message& RuningMessage() { + +const Message& RunningMessage() { MessageQueue_t id = (MessageQueue_t)ThreadUtil::currentthreadid(); ScopedLock lock(sg_messagequeue_map_mutex); - - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) { + + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) { return KNullMessage; } - - MessageQueueContent& content = sg_messagequeue_map[id]; - return *(content.lst_runloop_info.back().runing_message); + + Message* runing_message = pos->second.lst_runloop_info.back().runing_message; + return runing_message ? *runing_message : KNullMessage; } - -MessagePost_t RuningMessageID() { + +MessagePost_t RunningMessageID() { MessageQueue_t id = (MessageQueue_t)ThreadUtil::currentthreadid(); - return RuningMessageID(id); + return RunningMessageID(id); } -MessagePost_t RuningMessageID(const MessageQueue_t& _id) { +MessagePost_t RunningMessageID(const MessageQueue_t& _id) { ScopedLock lock(sg_messagequeue_map_mutex); - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(_id)) { + std::map::iterator pos = sg_messagequeue_map.find(_id); + if (sg_messagequeue_map.end() == pos) { return KNullPost; } - MessageQueueContent& content = sg_messagequeue_map[_id]; + MessageQueueContent& content = pos->second; return content.lst_runloop_info.back().runing_message_id; } static void __AsyncInvokeHandler(const MessagePost_t& _id, Message& _message) { - (*boost::any_cast >(_message.body1))(); + auto spfunc = boost::any_cast >(_message.body1); + if (!spfunc || spfunc->empty()) { + xerror2(TSF "!! call empty function: %_", _message.msg_name); + } + + (*spfunc)(); } MessageHandler_t InstallAsyncHandler(const MessageQueue_t& id) { ASSERT(0 != id); return InstallMessageHandler(__AsyncInvokeHandler, false, id); } - -static MessageQueue_t __CreateMessageQueueInfo(boost::shared_ptr& _breaker, thread_tid _tid, int _anr_timeout = 10*60*1000) { +static MessageQueue_t __CreateMessageQueueInfo(std::shared_ptr& _breaker, thread_tid _tid) { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueue_t id = (MessageQueue_t)_tid; @@ -593,36 +805,108 @@ static MessageQueue_t __CreateMessageQueueInfo(boost::shared_ptr& _ HandlerWrapper* handler = new HandlerWrapper(&__AsyncInvokeHandler, false, id, __MakeSeq()); content.lst_handler.push_back(handler); content.invoke_reg = handler->reg; - content.anr_timeout = _anr_timeout; if (_breaker) content.breaker = _breaker; else - content.breaker = boost::make_shared(); - content.breakflag = false; + content.breaker = std::make_shared(); } return id; } - -static void __ReleaseMessageQueueInfo() { +static void __ReleaseMessageQueueInfo() { MessageQueue_t id = (MessageQueue_t)ThreadUtil::currentthreadid(); - if (sg_messagequeue_map.end() != sg_messagequeue_map.find(id)) { - MessageQueueContent& content = sg_messagequeue_map[id]; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() != pos) { + MessageQueueContent& content = pos->second; - for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); ++it) { - delete(*it); + for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); + ++it) { + delete (*it); } - for (std::list::iterator it = content.lst_handler.begin(); it != content.lst_handler.end(); ++it) { - delete(*it); + for (std::list::iterator it = content.lst_handler.begin(); it != content.lst_handler.end(); + ++it) { + delete (*it); } sg_messagequeue_map.erase(id); } } +const static int kMQCallANRId = 110; +const static long kWaitANRTimeout = 15 * 1000; +static void __ANRAssert(bool _iOS_style, const mars::comm::check_content& _content, MessageHandler_t _mq_id) { + thread_tid tid = MessageQueue2TID(_mq_id.queue); + if (tid == 0) { + xwarn2(TSF "messagequeue already destroy, handler:(%_,%_)", _mq_id.queue, _mq_id.seq); + return; + } + + __ASSERT2(_content.file.c_str(), + _content.line, + _content.func.c_str(), + "anr dead lock", + "timeout:%d, tid:%" PRIu64 ", runing time:%" PRIu64 ", real time:%" PRIu64 ", used_cpu_time:%" PRIu64 + ", iOS_style:%d", + _content.timeout, + _content.tid, + clock_app_monotonic() - _content.start_time, + gettickcount() - _content.start_tickcount, + _content.used_cpu_time, + _iOS_style); +#ifdef ANDROID + pthread_kill(tid, SIGILL); +// __FATAL_ASSERT2(_content.file.c_str(), _content.line, _content.func.c_str(), "anr dead lock", "timeout:%d, +// tid:%" PRIu64 ", runing time:%" PRIu64 ", real time:%" PRIu64 ", used_cpu_time:%" PRIu64 ", iOS_style:%s", +// _content.timeout, _content.tid, clock_app_monotonic() - _content.start_time, gettickcount() - +// _content.start_tickcount, _content.used_cpu_time, _iOS_style?"true":"false"); +#endif +} + +static void __ANRCheckCallback(bool _iOS_style, const mars::comm::check_content& _content) { + if (kMQCallANRId != _content.call_id) { + return; + } + + MessageHandler_t mq_id = *((MessageHandler_t*)_content.extra_info); + xinfo2(TSF "anr check content:%_, handler:(%_,%_)", _content.call_id, mq_id.queue, mq_id.seq); + + std::shared_ptr thread(new Thread(boost::bind(__ANRAssert, _iOS_style, _content, mq_id))); + thread->start_after(kWaitANRTimeout); + + MessageQueue::AsyncInvoke( + [=]() { + if (thread->isruning()) { + xinfo2( + TSF + "misjudge anr, timeout:%_, tid:%_, runing time:%_, real time:%_, used_cpu_time:%_, handler:(%_,%_)", + _content.timeout, + _content.tid, + clock_app_monotonic() - _content.start_time, + gettickcount() - _content.start_tickcount, + _content.used_cpu_time, + mq_id.queue, + mq_id.seq); + thread->cancel_after(); + } + }, + MessageQueue::DefAsyncInvokeHandler(mq_id.queue), + "__ANRCheckCallback"); +} +#ifndef ANR_CHECK_DISABLE + +static void __RgisterANRCheckCallback() { + GetSignalCheckHit().connect(5, boost::bind(&__ANRCheckCallback, _1, _2)); +} +static void __UnregisterANRCheckCallback() { + GetSignalCheckHit().disconnect(5); +} + +BOOT_RUN_STARTUP(__RgisterANRCheckCallback); +BOOT_RUN_EXIT(__UnregisterANRCheckCallback); +#endif void RunLoop::Run() { MessageQueue_t id = CurrentThreadMessageQueue(); ASSERT(0 != id); @@ -631,6 +915,8 @@ void RunLoop::Run() { sg_messagequeue_map[id].lst_runloop_info.push_back(RunLoopInfo()); } + xinfo_function(TSF "messagequeue id:%_", id); + while (true) { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueueContent& content = sg_messagequeue_map[id]; @@ -639,6 +925,9 @@ void RunLoop::Run() { content.lst_runloop_info.back().runing_handler.clear(); content.lst_runloop_info.back().runing_cond->notifyAll(lock); + if (duty_func_) + duty_func_(); + if ((content.breakflag || (breaker_func_ && breaker_func_()))) { content.lst_runloop_info.pop_back(); if (content.lst_runloop_info.empty()) @@ -650,7 +939,8 @@ void RunLoop::Run() { MessageWrapper* messagewrapper = NULL; bool delmessage = true; - for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); ++it) { + for (std::list::iterator it = content.lst_message.begin(); it != content.lst_message.end(); + ++it) { if (kImmediately == (*it)->timing.type) { messagewrapper = *it; content.lst_message.erase(it); @@ -704,8 +994,10 @@ void RunLoop::Run() { std::list fit_handler; - for (std::list::iterator it = content.lst_handler.begin(); it != content.lst_handler.end(); ++it) { - if (messagewrapper->postid.reg == (*it)->reg || ((*it)->recvbroadcast && messagewrapper->postid.reg.isbroadcast())) { + for (std::list::iterator it = content.lst_handler.begin(); it != content.lst_handler.end(); + ++it) { + if (messagewrapper->postid.reg == (*it)->reg + || ((*it)->recvbroadcast && messagewrapper->postid.reg.isbroadcast())) { fit_handler.push_back(**it); content.lst_runloop_info.back().runing_handler.push_back((*it)->reg); } @@ -713,11 +1005,12 @@ void RunLoop::Run() { content.lst_runloop_info.back().runing_message_id = messagewrapper->postid; content.lst_runloop_info.back().runing_message = &messagewrapper->message; - int anr_timeout = content.anr_timeout; + int64_t anr_timeout = messagewrapper->message.anr_timeout; lock.unlock(); + messagewrapper->message.execute_time = ::gettickcount(); for (std::list::iterator it = fit_handler.begin(); it != fit_handler.end(); ++it) { - SCOPE_ANR_AUTO(anr_timeout); + SCOPE_ANR_AUTO((int)anr_timeout, kMQCallANRId, &(*it).reg); uint64_t timestart = ::clock_app_monotonic(); (*it).handler(messagewrapper->postid, messagewrapper->message); uint64_t timeend = ::clock_app_monotonic(); @@ -725,7 +1018,12 @@ void RunLoop::Run() { if (!isDebuggerPerforming()) #endif - ASSERT2(0 >= anr_timeout || anr_timeout >= (int)(timeend - timestart), "anr_timeout:%d < cost:%" PRIu64", timestart:%" PRIu64", timeend:%" PRIu64, anr_timeout, timeend - timestart, timestart, timeend); + ASSERT2(0 >= anr_timeout || anr_timeout >= (int64_t)(timeend - timestart), + "anr_timeout:%" PRId64 " < cost:%" PRIu64 ", timestart:%" PRIu64 ", timeend:%" PRIu64, + anr_timeout, + timeend - timestart, + timestart, + timeend); } if (delmessage) { @@ -734,27 +1032,31 @@ void RunLoop::Run() { } } -boost::shared_ptr RunloopCond::CurrentCond() { +std::shared_ptr RunloopCond::CurrentCond() { ScopedLock lock(sg_messagequeue_map_mutex); MessageQueue_t id = (MessageQueue_t)ThreadUtil::currentthreadid(); - - if (sg_messagequeue_map.end() != sg_messagequeue_map.find(id)) { - MessageQueueContent& content = sg_messagequeue_map[id]; + + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() != pos) { + MessageQueueContent& content = pos->second; return content.breaker; } else { - return boost::shared_ptr(); + return std::shared_ptr(); } } MessageQueueCreater::MessageQueueCreater(bool _iscreate, const char* _msg_queue_name) - : MessageQueueCreater(boost::shared_ptr(), _iscreate, _msg_queue_name) -{} - -MessageQueueCreater::MessageQueueCreater(boost::shared_ptr _breaker, bool _iscreate, const char* _msg_queue_name) - : thread_(boost::bind(&MessageQueueCreater::__ThreadRunloop, this), _msg_queue_name) - , messagequeue_id_(KInvalidQueueID), breaker_(_breaker) { - if (_iscreate) - CreateMessageQueue(); +: MessageQueueCreater(std::shared_ptr(), _iscreate, _msg_queue_name) { +} + +MessageQueueCreater::MessageQueueCreater(std::shared_ptr _breaker, + bool _iscreate, + const char* _msg_queue_name) +: thread_(boost::bind(&MessageQueueCreater::__ThreadRunloop, this), _msg_queue_name) +, messagequeue_id_(KInvalidQueueID) +, breaker_(_breaker) { + if (_iscreate) + CreateMessageQueue(); } MessageQueueCreater::~MessageQueueCreater() { @@ -764,9 +1066,8 @@ MessageQueueCreater::~MessageQueueCreater() { void MessageQueueCreater::__ThreadRunloop() { ScopedLock lock(messagequeue_mutex_); lock.unlock(); - + RunLoop().Run(); - messagequeue_id_ = 0; } MessageQueue_t MessageQueueCreater::GetMessageQueue() { @@ -776,10 +1077,14 @@ MessageQueue_t MessageQueueCreater::GetMessageQueue() { MessageQueue_t MessageQueueCreater::CreateMessageQueue() { ScopedLock lock(messagequeue_mutex_); - if (thread_.isruning()) return messagequeue_id_; + if (thread_.isruning()) + return messagequeue_id_; - if (0 != thread_.start()) { return KInvalidQueueID;} + if (0 != thread_.start()) { + return KInvalidQueueID; + } messagequeue_id_ = __CreateMessageQueueInfo(breaker_, thread_.tid()); + xinfo2(TSF "create messageqeue id:%_", messagequeue_id_); return messagequeue_id_; } @@ -787,20 +1092,30 @@ MessageQueue_t MessageQueueCreater::CreateMessageQueue() { void MessageQueueCreater::CancelAndWait() { ScopedLock lock(messagequeue_mutex_); - if (KInvalidQueueID != messagequeue_id_) BreakMessageQueueRunloop(messagequeue_id_); + if (KInvalidQueueID == messagequeue_id_) + return; + BreakMessageQueueRunloop(messagequeue_id_); + messagequeue_id_ = KInvalidQueueID; lock.unlock(); - thread_.join(); + if (ThreadUtil::currentthreadid() != thread_.tid()) { + thread_.join(); + } } -MessageQueue_t MessageQueueCreater::CreateNewMessageQueue(boost::shared_ptr _breaker, const char* _messagequeue_name) { - +MessageQueue_t MessageQueueCreater::CreateNewMessageQueue(std::shared_ptr _breaker, thread_tid _tid) { + return (__CreateMessageQueueInfo(_breaker, _tid)); +} + +MessageQueue_t MessageQueueCreater::CreateNewMessageQueue(std::shared_ptr _breaker, + const char* _messagequeue_name) { SpinLock* sp = new SpinLock; - Thread thread(boost::bind(&__ThreadNewRunloop, sp), _messagequeue_name); - thread.outside_join(); + Thread thread(boost::bind(&__ThreadNewRunloop, sp), _messagequeue_name, true); + // thread.outside_join(); ScopedSpinLock lock(*sp); if (0 != thread.start()) { + lock.unlock(); delete sp; return KInvalidQueueID; } @@ -808,20 +1123,30 @@ MessageQueue_t MessageQueueCreater::CreateNewMessageQueue(boost::shared_ptr(), _messagequeue_name); + return CreateNewMessageQueue(std::shared_ptr(), _messagequeue_name); } - -void MessageQueueCreater::ReleaseNewMessageQueue(MessageQueue_t _messagequeue_id){ - - if (KInvalidQueueID == _messagequeue_id) return; - + +// TODO ThreadUtil::join do not set thread isjoined, then when join a joined thread will crash. +void MessageQueueCreater::ReleaseNewMessageQueue(MessageQueue_t _messagequeue_id) { + if (KInvalidQueueID == _messagequeue_id) + return; + BreakMessageQueueRunloop(_messagequeue_id); - WaitForRuningLockEnd(_messagequeue_id); + WaitForRunningLockEnd(_messagequeue_id); ThreadUtil::join((thread_tid)_messagequeue_id); } +void MessageQueueCreater::ReleaseNewMessageCreator(MessageQueueCreater& _creator) { + if (KInvalidQueueID == _creator.messagequeue_id_) { + return; + } + BreakMessageQueueRunloop(_creator.messagequeue_id_); + WaitForRunningLockEnd(_creator.messagequeue_id_); + _creator.__JoinThread(); +} + void MessageQueueCreater::__ThreadNewRunloop(SpinLock* _sp) { ScopedSpinLock lock(*_sp); lock.unlock(); @@ -830,6 +1155,13 @@ void MessageQueueCreater::__ThreadNewRunloop(SpinLock* _sp) { RunLoop().Run(); } +void MessageQueueCreater::__JoinThread() { + if (ThreadUtil::currentthreadid() != thread_.tid()) { + thread_.join(); + } + messagequeue_id_ = KInvalidQueueID; +} + MessageQueue_t GetDefMessageQueue() { static MessageQueueCreater* s_defmessagequeue = new MessageQueueCreater; return s_defmessagequeue->CreateMessageQueue(); @@ -844,10 +1176,34 @@ MessageHandler_t DefAsyncInvokeHandler(const MessageQueue_t& _messagequeue) { ScopedLock lock(sg_messagequeue_map_mutex); const MessageQueue_t& id = _messagequeue; - if (sg_messagequeue_map.end() == sg_messagequeue_map.find(id)) return KNullHandler; + std::map::iterator pos = sg_messagequeue_map.find(id); + if (sg_messagequeue_map.end() == pos) + return KNullHandler; - MessageQueueContent& content = sg_messagequeue_map[id]; + MessageQueueContent& content = pos->second; return content.invoke_reg; } +ScopeRegister::ScopeRegister(const MessageHandler_t& _reg) : m_reg(new MessageHandler_t(_reg)) { +} + +ScopeRegister::~ScopeRegister() { + Cancel(); + delete m_reg; +} + +const MessageHandler_t& ScopeRegister::Get() const { + return *m_reg; +} + +void ScopeRegister::Cancel() const { + UnInstallMessageHandler(*m_reg); + CancelMessage(*m_reg); +} +void ScopeRegister::CancelAndWait() const { + Cancel(); + WaitForRunningLockEnd(*m_reg); +} } // namespace MessageQueue +} // namespace comm +} // namespace mars diff --git a/mars/comm/messagequeue/message_queue.h b/mars/comm/messagequeue/message_queue.h index 0159c7f10..e287b5f3b 100644 --- a/mars/comm/messagequeue/message_queue.h +++ b/mars/comm/messagequeue/message_queue.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -10,7 +10,6 @@ // either express or implied. See the License for the specific language governing permissions and // limitations under the License. - /* * MessageQueue.h * @@ -21,222 +20,386 @@ #ifndef MESSAGEQUEUE_H_ #define MESSAGEQUEUE_H_ -#include "boost/function.hpp" +#include + +#include +#include + #include "boost/any.hpp" -#include "boost/smart_ptr.hpp" +#include "boost/function.hpp" + +#if UWP //???andrewu temp compile pass +#include "boost/utility/result_of.hpp" +#endif #if __cplusplus >= 201103L #include "boost/static_assert.hpp" -#include "boost/utility/result_of.hpp" #include "boost/type_traits/is_same.hpp" +#include "boost/utility/result_of.hpp" +#else +#ifdef WIN32 +#include "boost/utility/result_of.hpp" +#endif // DEBUG #endif +#include "mars/comm/strutil.h" #include "mars/comm/thread/thread.h" +#include "mars/comm/time_utils.h" +#include "mars/comm/xlogger/xlogger.h" +namespace mars { +namespace comm { namespace MessageQueue { typedef uint64_t MessageQueue_t; -typedef boost::function AsyncInvokeFunction; +typedef boost::function AsyncInvokeFunction; const MessageQueue_t KInvalidQueueID = 0; struct MessageHandler_t { - MessageHandler_t(): queue(KInvalidQueueID), seq(0) {} - bool operator == (const MessageHandler_t& _rhs) const {return queue == _rhs.queue && seq == _rhs.seq;} - bool operator!=(const MessageHandler_t& _rhs) const {return !operator==(_rhs);} - bool isbroadcast() const {return 0 == seq;} + MessageHandler_t() : queue(KInvalidQueueID), seq(0) { + } + bool operator==(const MessageHandler_t& _rhs) const { + return queue == _rhs.queue && seq == _rhs.seq; + } + bool operator!=(const MessageHandler_t& _rhs) const { + return !operator==(_rhs); + } + bool isbroadcast() const { + return 0 == seq; + } MessageQueue_t queue; unsigned int seq; }; struct MessagePost_t { - MessagePost_t(): seq(0) {} - bool operator == (const MessagePost_t& _rhs) const {return reg == _rhs.reg && seq == _rhs.seq;} - bool operator!=(const MessagePost_t& _rhs) const {return !operator==(_rhs);} + MessagePost_t() : seq(0) { + } + bool operator==(const MessagePost_t& _rhs) const { + return reg == _rhs.reg && seq == _rhs.seq; + } + bool operator!=(const MessagePost_t& _rhs) const { + return !operator==(_rhs); + } MessageHandler_t reg; unsigned int seq; + + std::string ToString() const { + XMessage xmsg; + xmsg(TSF "(seq:%_, handler:%_, queue:%_)", seq, reg.seq, reg.queue); + return xmsg.String(); + } }; struct MessageTitle_t { - MessageTitle_t(): title(0) {} - template MessageTitle_t(const T& _title): title((uintptr_t)_title) { BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(uintptr_t));} + MessageTitle_t() : title(0) { + } + template + MessageTitle_t(const T& _title) : title((uintptr_t)_title) { + BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(uintptr_t)); + } - bool operator == (const MessageTitle_t& _rhs) const { return title == _rhs.title;} - bool operator!=(const MessageTitle_t& _rhs) const { return !operator==(_rhs);} + bool operator==(const MessageTitle_t& _rhs) const { + return title == _rhs.title; + } + bool operator!=(const MessageTitle_t& _rhs) const { + return !operator==(_rhs); + } uintptr_t title; }; - struct Message { - Message(): title(0) {} - Message(const MessageTitle_t& _title, const boost::any& _body1, const boost::any& _body2) - : title(_title), body1(_body1), body2(_body2) {} + Message() : title(0), anr_timeout(0), create_time(0), execute_time(0) { + } + Message(const MessageTitle_t& _title, + const boost::any& _body1, + const boost::any& _body2, + const std::string& _name = "") + : title(_title) + , body1(_body1) + , body2(_body2) + , anr_timeout(10 * 60 * 1000) + , msg_name(_name) + , create_time(::gettickcount()) + , execute_time(0) { + } template - Message(const MessageTitle_t& _title, const F& _func) - : title(_title), body1(boost::make_shared()), body2() { - *boost::any_cast >(body1) = _func; + Message(const MessageTitle_t& _title, const F& _func, const std::string& _name = "") + : title(_title) + , body1(std::make_shared()) + , body2() + , anr_timeout(10 * 60 * 1000) + , msg_name(_name) + , create_time(::gettickcount()) + , execute_time(0) { + if (msg_name.empty()) { + const char* funcname = typeid(_func).name(); + if (funcname != nullptr) { + msg_name = funcname; + } + } + *boost::any_cast >(body1) = _func; } - bool operator == (const Message& _rhs) const {return title == _rhs.title;} + bool operator==(const Message& _rhs) const { + return title == _rhs.title; + } + + std::string ToString() const { + XMessage xmsg; + xmsg(TSF "(msg_name:%_, create_time:%_, execute_time:%_)", msg_name, create_time, execute_time); + return xmsg.String(); + } MessageTitle_t title; boost::any body1; boost::any body2; -}; + int64_t anr_timeout; -enum TMessageTiming { - kAfter, - kPeriod, - kImmediately, + std::string msg_name; + uint64_t create_time; + uint64_t execute_time; }; - + +const char* const TMessageTimingString[] = {"kAfter", "kPeriod", "kImmediately"}; struct MessageTiming { - + enum TMessageTiming { + kAfter, + kPeriod, + kImmediately, + }; + MessageTiming(TMessageTiming _timing, int64_t _after, int64_t _period) - : type(_timing) - , after(_after) - , period(_period) - {} - - MessageTiming(int64_t _after, int64_t _period) - : type(TMessageTiming::kPeriod) - , after(_after) - , period(_period) - {} - - MessageTiming(int64_t _after) - : type(TMessageTiming::kAfter) - , after(_after) - , period(0) - {} - - MessageTiming() - : type(TMessageTiming::kImmediately) - , after(0) - , period(0) - {} + : type(_timing), after(_after), period(_period) { + } + + MessageTiming(int64_t _after, int64_t _period) : type(TMessageTiming::kPeriod), after(_after), period(_period) { + } + + MessageTiming(int64_t _after) : type(TMessageTiming::kAfter), after(_after), period(0) { + } + + MessageTiming() : type(TMessageTiming::kImmediately), after(0), period(0) { + } + + std::string ToString() const { + XMessage xmsg; + xmsg(TSF "(type:%_, after:%_, period:%_)", TMessageTimingString[type], after, period); + return xmsg.String(); + } TMessageTiming type; int64_t after; int64_t period; }; -typedef boost::function MessageHandler; +using TMessageTiming = MessageTiming::TMessageTiming; +const TMessageTiming kAfter = MessageTiming::TMessageTiming::kAfter; +const TMessageTiming kPeriod = MessageTiming::TMessageTiming::kPeriod; +const TMessageTiming kImmediately = MessageTiming::TMessageTiming::kImmediately; + +typedef boost::function MessageHandler; -const MessageTiming KDefTiming; -const MessageHandler_t KNullHandler; -const MessagePost_t KNullPost; -const Message KNullMessage; +const MessageTiming KDefTiming; +const MessageHandler_t KNullHandler; +const MessagePost_t KNullPost; +const Message KNullMessage; + +inline const MessageHandler_t& Post2Handler(const MessagePost_t& _postid) { + return _postid.reg; +} +inline const MessageQueue_t& Handler2Queue(const MessageHandler_t& _handler) { + return _handler.queue; +} -inline const MessageHandler_t& Post2Handler(const MessagePost_t& _postid) { return _postid.reg;} -inline const MessageQueue_t& Handler2Queue(const MessageHandler_t& _handler) { return _handler.queue;} - MessageQueue_t CurrentThreadMessageQueue(); MessageQueue_t TID2MessageQueue(thread_tid _tid); -thread_tid MessageQueue2TID(MessageQueue_t _id); - -const Message& RuningMessage(); - -MessagePost_t RuningMessageID(); -MessagePost_t RuningMessageID(const MessageQueue_t& _id); -MessageQueue_t GetDefMessageQueue(); -MessageQueue_t GetDefTaskQueue(); +thread_tid MessageQueue2TID(MessageQueue_t _id); + +const Message& RunningMessage(); + +MessagePost_t RunningMessageID(); +MessagePost_t RunningMessageID(const MessageQueue_t& _id); +MessageQueue_t GetDefMessageQueue(); +MessageQueue_t GetDefTaskQueue(); MessageHandler_t DefAsyncInvokeHandler(const MessageQueue_t& _messagequeue = CurrentThreadMessageQueue()); -void WaitForRuningLockEnd(const MessagePost_t& _message); -void WaitForRuningLockEnd(const MessageHandler_t& _handler); -void WaitForRuningLockEnd(const MessageQueue_t& _messagequeueid); -void BreakMessageQueueRunloop(const MessageQueue_t& _messagequeueid); +void WaitForRunningLockEnd(const MessagePost_t& _message); +void WaitForRunningLockEnd(const MessageHandler_t& _handler); +void WaitForRunningLockEnd(const MessageQueue_t& _messagequeueid); +void BreakMessageQueueRunloop(const MessageQueue_t& _messagequeueid); -MessageHandler_t InstallMessageHandler(const MessageHandler& _handler, bool _recvbroadcast = false, const MessageQueue_t& _messagequeueid = GetDefMessageQueue()); +MessageHandler_t InstallMessageHandler(const MessageHandler& _handler, + bool _recvbroadcast = false, + const MessageQueue_t& _messagequeueid = GetDefMessageQueue()); void UnInstallMessageHandler(const MessageHandler_t& _handlerid); -MessagePost_t PostMessage(const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing = KDefTiming); -MessagePost_t SingletonMessage(bool _replace, const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing = KDefTiming); -MessagePost_t BroadcastMessage(const MessageQueue_t& _messagequeueid, const Message& _message, const MessageTiming& _timing = KDefTiming); -MessagePost_t FasterMessage(const MessageHandler_t& _handlerid, const Message& _message, const MessageTiming& _timing = KDefTiming); - -bool WaitMessage(const MessagePost_t& _message); +MessagePost_t PostMessage(const MessageHandler_t& _handlerid, + const Message& _message, + const MessageTiming& _timing = KDefTiming); +MessagePost_t SingletonMessage(bool _replace, + const MessageHandler_t& _handlerid, + const Message& _message, + const MessageTiming& _timing = KDefTiming); +MessagePost_t BroadcastMessage(const MessageQueue_t& _messagequeueid, + const Message& _message, + const MessageTiming& _timing = KDefTiming); +MessagePost_t FasterMessage(const MessageHandler_t& _handlerid, + const Message& _message, + const MessageTiming& _timing = KDefTiming); +MessagePost_t PostMessageAtFirst(const MessageHandler_t& _handlerid, const Message& _message); + +bool WaitMessage(const MessagePost_t& _message, long _timeoutInMs = -1); bool FoundMessage(const MessagePost_t& _message); bool CancelMessage(const MessagePost_t& _postid); void CancelMessage(const MessageHandler_t& _handlerid); void CancelMessage(const MessageHandler_t& _handlerid, const MessageTitle_t& _title); -//AsyncInvoke +std::string DumpMQ(const MessageQueue_t& _msq_queue_id); +// AsyncInvoke MessageHandler_t InstallAsyncHandler(const MessageQueue_t& id); +//---with message name +// no title +template +MessagePost_t AsyncInvoke(const F& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(0, _func, _msg_name)); +} +template +MessagePost_t AsyncInvokeAfter(int64_t _after, + const F& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(0, _func, _msg_name), MessageTiming(kAfter, _after, 0)); +} +template +MessagePost_t AsyncInvokePeriod(int64_t _after, + int64_t _period, + const F& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(0, _func, _msg_name), MessageTiming(kPeriod, _after, _period)); +} +//~no title +// title +template +MessagePost_t AsyncInvoke(const F& _func, + const MessageTitle_t& _title, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(_title, _func, _msg_name)); +} + +template +MessagePost_t AsyncInvokeAfter(int64_t _after, + const F& _func, + const MessageTitle_t& _title, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(_title, _func, _msg_name), MessageTiming(kAfter, _after, 0)); +} + +template +MessagePost_t AsyncInvokePeriod(int64_t _after, + int64_t _period, + const F& _func, + const MessageTitle_t& _title, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(_title, _func, _msg_name), MessageTiming(kPeriod, _after, _period)); +} + +template +MessagePost_t AsyncInvokeAtFirst(const F& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessageAtFirst(_handlerid, Message(0, _func, _msg_name)); +} +//~title +//---~with message name +/* template MessagePost_t AsyncInvoke(const F& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(0, _func)); } template -MessagePost_t AsyncInvokeAfter(int64_t _after, const F& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(0, _func), MessageTiming(kAfter, _after, 0)); +MessagePost_t AsyncInvokeAfter(int64_t _after, const F& _func, const MessageHandler_t& _handlerid = +DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(0, _func), MessageTiming(kAfter, _after, 0)); } template -MessagePost_t AsyncInvokePeriod(int64_t _after, int64_t _period, const F& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(0, _func), MessageTiming(kPeriod, _after, _period)); +MessagePost_t AsyncInvokePeriod(int64_t _after, int64_t _period, const F& _func, const MessageHandler_t& _handlerid = +DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(0, _func), MessageTiming(kPeriod, _after, _period)); } template -MessagePost_t AsyncInvoke(const F& _func, const MessageTitle_t& _title, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(_title, _func)); +MessagePost_t AsyncInvoke(const F& _func, const MessageTitle_t& _title, const MessageHandler_t& _handlerid = +DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(_title, _func)); } template -MessagePost_t AsyncInvokeAfter(int64_t _after, const F& _func, const MessageTitle_t& _title, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(_title, _func), MessageTiming(kAfter, _after, 0)); +MessagePost_t AsyncInvokeAfter(int64_t _after, const F& _func, const MessageTitle_t& _title, const MessageHandler_t& +_handlerid = DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(_title, _func), MessageTiming(kAfter, +_after, 0)); } template -MessagePost_t AsyncInvokePeriod(int64_t _after, int64_t _period, const F& _func, const MessageTitle_t& _title, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(_title, _func), MessageTiming(kPeriod, _after, _period)); +MessagePost_t AsyncInvokePeriod(int64_t _after, int64_t _period, const F& _func, const MessageTitle_t& _title, const +MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { return PostMessage(_handlerid, Message(_title, _func), +MessageTiming(kPeriod, _after, _period)); } - + */ class RunLoop { public: - template - RunLoop(const F& _breaker_func):breaker_func_(_breaker_func) {} - RunLoop() {} - + template + RunLoop(const B& _breaker_func) : breaker_func_(_breaker_func) { + } + template + RunLoop(const B& _breaker_func, const D& _duty_func) : breaker_func_(_breaker_func), duty_func_(_duty_func) { + } + RunLoop() { + } + public: void Run(); - + private: - RunLoop(const RunLoop&); - RunLoop& operator=(const RunLoop&); - + RunLoop(const RunLoop&); + RunLoop& operator=(const RunLoop&); + private: - boost::function breaker_func_; - + boost::function breaker_func_; + boost::function duty_func_; }; - + class RunloopCond { -public: - RunloopCond() {}; - virtual ~RunloopCond() {}; - - static boost::shared_ptr CurrentCond(); - -public: + public: + RunloopCond(){}; + virtual ~RunloopCond(){}; + + static std::shared_ptr CurrentCond(); + + public: virtual const boost::typeindex::type_info& type() const = 0; - virtual void Wait(ScopedLock& _lock, long _millisecond) = 0; - virtual void Notify(ScopedLock& _lock) = 0; - -private: + virtual void Wait(ScopedLock& _lock, long _millisecond) = 0; + virtual void Notify(ScopedLock& _lock) = 0; + + private: RunloopCond(const RunloopCond&); void operator=(const RunloopCond&); }; - - + class MessageQueueCreater { - public: + public: MessageQueueCreater(bool _iscreate = false, const char* _msg_queue_name = NULL); - MessageQueueCreater(boost::shared_ptr _breaker, bool _iscreate = false, const char* _msg_queue_name = NULL); + MessageQueueCreater(std::shared_ptr _breaker, + bool _iscreate = false, + const char* _msg_queue_name = NULL); ~MessageQueueCreater(); MessageQueue_t GetMessageQueue(); @@ -244,65 +407,70 @@ class MessageQueueCreater { void CancelAndWait(); static MessageQueue_t CreateNewMessageQueue(const char* _messagequeue_name = NULL); - static MessageQueue_t CreateNewMessageQueue(boost::shared_ptr _breaker, const char* _messagequeue_name = NULL); + static MessageQueue_t CreateNewMessageQueue(std::shared_ptr _breaker, + const char* _messagequeue_name = NULL); + static MessageQueue_t CreateNewMessageQueue(std::shared_ptr _breaker, thread_tid _tid); static void ReleaseNewMessageQueue(MessageQueue_t _messagequeue_id); // block api + static void ReleaseNewMessageCreator(MessageQueueCreater& _creator); - private: + private: MessageQueueCreater(const MessageQueueCreater&); MessageQueueCreater& operator=(const MessageQueueCreater&); - void __ThreadRunloop(); + void __JoinThread(); static void __ThreadNewRunloop(SpinLock* _sp); - private: - Thread thread_; - Mutex messagequeue_mutex_; - MessageQueue_t messagequeue_id_; - boost::shared_ptr breaker_; + private: + Thread thread_; + Mutex messagequeue_mutex_; + MessageQueue_t messagequeue_id_; + std::shared_ptr breaker_; }; template class AsyncResult { - private: + private: struct AsyncResultWrapper { - AsyncResultWrapper(): result_holder(new R), result_valid(false), result(*result_holder) {} - AsyncResultWrapper(R& _result): result_holder(NULL), result_valid(false), result(_result) {} + AsyncResultWrapper() : result_holder(new R), result_valid(false), result(result_holder) { + } + AsyncResultWrapper(R* _result) : result_holder(NULL), result_valid(false), result(_result) { + } ~AsyncResultWrapper() { if (!result_valid && callback_function) - callback_function(result, false); + callback_function(*result, false); + + if (result_holder) + delete result_holder; } - R* result_holder; + R* result_holder; boost::function invoke_function; - boost::function callback_function; + boost::function callback_function; bool result_valid; - R& result; + R* result; }; - public: - template - AsyncResult(const T& _func) - : wrapper_(new AsyncResultWrapper()) { + public: + template + AsyncResult(const T& _func) : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R>::value); #endif wrapper_->invoke_function = _func; } - template - AsyncResult(const T& _func, R& _result_holder) - : wrapper_(new AsyncResultWrapper(_result_holder)) { + template + AsyncResult(const T& _func, R* _result_holder) : wrapper_(new AsyncResultWrapper(_result_holder)) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R>::value); #endif wrapper_->invoke_function = _func; } - template - AsyncResult(const T& _func, const C& _callback) - : wrapper_(new AsyncResultWrapper()) { + template + AsyncResult(const T& _func, const C& _callback) : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R>::value); #endif @@ -310,9 +478,9 @@ class AsyncResult { wrapper_->callback_function = _callback; } - template - AsyncResult(const T& _func, R& _result_holder, const C& _callback) - : wrapper_(new AsyncResultWrapper(_result_holder)) { + template + AsyncResult(const T& _func, const C& _callback, R* _result_holder) + : wrapper_(new AsyncResultWrapper(_result_holder)) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R>::value); #endif @@ -320,55 +488,62 @@ class AsyncResult { wrapper_->callback_function = _callback; } - void operator()() { - wrapper_->result = wrapper_->invoke_function(); + void operator()() const { + Invoke(wrapper_->invoke_function()); + } + R& Result() const { + return *(wrapper_->result); + } + operator bool() const { + return wrapper_->result_valid; + } + + private: + void Invoke(const R& _result) const { + if (wrapper_->result) + *(wrapper_->result) = _result; wrapper_->result_valid = true; if (wrapper_->callback_function) - wrapper_->callback_function(Result(), true); + wrapper_->callback_function(_result, true); } - boost::function& Function() { return wrapper_->invoke_function;} - boost::function& CallFunction() { return wrapper_->callback_function;} - R& Result() { return wrapper_->result;} - operator bool() const { return wrapper_->result_valid;} - - private: + private: AsyncResult& operator=(const AsyncResult&); // AsyncResult(const AsyncResult& _ref); - private: - boost::shared_ptr wrapper_; + private: + std::shared_ptr wrapper_; }; template <> class AsyncResult { - private: + private: struct AsyncResultWrapper { - AsyncResultWrapper(): result_valid(false) {} + AsyncResultWrapper() : result_valid(false) { + } ~AsyncResultWrapper() { if (!result_valid && callback_function) callback_function(false); } - boost::function invoke_function; - boost::function callback_function; + boost::function invoke_function; + boost::function callback_function; bool result_valid; }; - public: - template - AsyncResult(const T& _func) - : wrapper_(new AsyncResultWrapper()) { + public: + template + AsyncResult(const T& _func, const void* _place_holder = NULL) : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, void>::value); #endif wrapper_->invoke_function = _func; } - template - AsyncResult(const T& _func, const C& _callback) - : wrapper_(new AsyncResultWrapper()) { + template + AsyncResult(const T& _func, const C& _callback, const void* _place_holder = NULL) + : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, void>::value); #endif @@ -376,7 +551,7 @@ class AsyncResult { wrapper_->callback_function = _callback; } - void operator()() { + void operator()() const { wrapper_->invoke_function(); wrapper_->result_valid = true; @@ -384,49 +559,50 @@ class AsyncResult { wrapper_->callback_function(true); } - boost::function& Function() { return wrapper_->invoke_function;} - boost::function& CallFunction() { return wrapper_->callback_function;} - void Result() {} - operator bool() const { return wrapper_->result_valid;} + void Result() const { + } + operator bool() const { + return wrapper_->result_valid; + } - private: + private: AsyncResult& operator=(const AsyncResult&); // AsyncResult(const AsyncResult& _ref); - private: - boost::shared_ptr wrapper_; + private: + std::shared_ptr wrapper_; }; template -class AsyncResult { - private: +class AsyncResult { + private: struct AsyncResultWrapper { - AsyncResultWrapper(): result_valid(false), result(NULL) {} + AsyncResultWrapper() : result_valid(false), result(NULL) { + } ~AsyncResultWrapper() { if (!result_valid && callback_function) callback_function(*result, false); } - boost::function invoke_function; - boost::function callback_function; + boost::function invoke_function; + boost::function callback_function; bool result_valid; R* result; }; - public: - template - AsyncResult(const T& _func) - : wrapper_(new AsyncResultWrapper()) { + public: + template + AsyncResult(const T& _func, const void* _place_holder = NULL) : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R&>::value); #endif wrapper_->invoke_function = _func; } - template - AsyncResult(const T& _func, const C& _callback) - : wrapper_(new AsyncResultWrapper()) { + template + AsyncResult(const T& _func, const C& _callback, const void* _place_holder = NULL) + : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, R&>::value); #endif @@ -434,57 +610,59 @@ class AsyncResult { wrapper_->callback_function = _callback; } - void operator()() { - wrapper_->result = & (wrapper_->invoke_function()); + void operator()() const { + wrapper_->result = &(wrapper_->invoke_function()); wrapper_->result_valid = true; if (wrapper_->callback_function) wrapper_->callback_function(Result(), true); } - boost::function& Function() { return wrapper_->invoke_function;} - boost::function& CallFunction() { return wrapper_->callback_function;} - R& Result() { return *(wrapper_->result);} - operator bool() const { return wrapper_->result_valid;} + R& Result() const { + return *(wrapper_->result); + } + operator bool() const { + return wrapper_->result_valid; + } - private: + private: AsyncResult& operator=(const AsyncResult&); // AsyncResult(const AsyncResult& _ref); - private: - boost::shared_ptr wrapper_; + private: + std::shared_ptr wrapper_; }; template -class AsyncResult { - private: +class AsyncResult { + private: struct AsyncResultWrapper { - AsyncResultWrapper(): result_valid(false), result(NULL) {} + AsyncResultWrapper() : result_valid(false), result(NULL) { + } ~AsyncResultWrapper() { if (!result_valid && callback_function) callback_function(*result, false); } - boost::function invoke_function; - boost::function callback_function; + boost::function invoke_function; + boost::function callback_function; bool result_valid; const R* result; }; - public: - template - AsyncResult(const T& _func) - : wrapper_(new AsyncResultWrapper()) { + public: + template + AsyncResult(const T& _func, const void* _place_holder = NULL) : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, const R&>::value); #endif wrapper_->invoke_function = _func; } - template - AsyncResult(const T& _func, const C& _callback) - : wrapper_(new AsyncResultWrapper()) { + template + AsyncResult(const T& _func, const C& _callback, const void* _place_holder = NULL) + : wrapper_(new AsyncResultWrapper()) { #if __cplusplus >= 201103L BOOST_STATIC_ASSERT(boost::is_same::type, const R&>::value); #endif @@ -492,59 +670,218 @@ class AsyncResult { wrapper_->callback_function = _callback; } - void operator()() { - wrapper_->result = & (wrapper_->invoke_function()); + void operator()() const { + wrapper_->result = &(wrapper_->invoke_function()); wrapper_->result_valid = true; if (wrapper_->callback_function) wrapper_->callback_function(Result(), true); } - boost::function& Function() { return wrapper_->invoke_function;} - boost::function& CallFunction() { return wrapper_->callback_function;} - const R& Result() { return *(wrapper_->result);} - operator bool() const { return wrapper_->result_valid;} + const R& Result() const { + return *(wrapper_->result); + } + operator bool() const { + return wrapper_->result_valid; + } - private: + private: AsyncResult& operator=(const AsyncResult&); // AsyncResult(const AsyncResult& _ref); - private: - boost::shared_ptr wrapper_; + private: + std::shared_ptr wrapper_; }; template -bool WaitInvoke(const AsyncResult& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - +R& WaitInvoke(const AsyncResult& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { if (CurrentThreadMessageQueue() == Handler2Queue(_handlerid)) { _func(); - return (bool)(_func); + return _func.Result(); } else { - WaitMessage(AsyncInvoke(_func, _handlerid)); - return (bool)(_func); + WaitMessage(AsyncInvoke(_func, _handlerid, _msg_name)); + return _func.Result(); } } - + template -typename boost::result_of< F()>::type WaitInvoke(const F& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - +typename boost::result_of::type WaitInvoke(const F& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { if (CurrentThreadMessageQueue() == Handler2Queue(_handlerid)) { return _func(); } else { - typedef typename boost::result_of::type R; MessageQueue::AsyncResult result(_func); - - WaitMessage(AsyncInvoke(result, _handlerid)); + + WaitMessage(AsyncInvoke(result, _handlerid, _msg_name)); return result.Result(); } } +template +R WaitInvoke(const F& _func, + R _ret, + long _timeout = -1, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + if (CurrentThreadMessageQueue() == Handler2Queue(_handlerid)) { + return _func(); + } else { + // typedef typename boost::result_of::type R; + MessageQueue::AsyncResult result(_func); + + bool hasRun = WaitMessage(AsyncInvoke(result, _handlerid, _msg_name), _timeout); + if (hasRun) + return result.Result(); + else + return _ret; + } +} + template -MessagePost_t AsyncInvoke(const AsyncResult& _func, const MessageHandler_t& _handlerid = DefAsyncInvokeHandler()) { - return PostMessage(_handlerid, Message(0, _func)); +MessagePost_t AsyncInvoke(const AsyncResult& _func, + const MessageHandler_t& _handlerid = DefAsyncInvokeHandler(), + const std::string& _msg_name = "default_name") { + return PostMessage(_handlerid, Message(0, _func, _msg_name)); } - -} namespace mq = MessageQueue; //namespace MessageQueue +class ScopeRegister { + public: + ScopeRegister(const MessageHandler_t& _reg); + ~ScopeRegister(); + + const MessageHandler_t& Get() const; + void Cancel() const; + void CancelAndWait() const; + + private: + ScopeRegister(const ScopeRegister&); + ScopeRegister& operator=(const ScopeRegister&); + + private: + MessageHandler_t* m_reg; +}; + +//------ + +#define MESSAGE_NAME(file, function) (strutil::GetFileNameFromPath(file) + ":" + function) +#define ASYNC_BLOCK_END_MSGNAME(msg_name) \ + }, AYNC_HANDLER, msg_name); + +#define ASYNC_BLOCK_START mars::comm::MessageQueue::AsyncInvoke([=] () { +#define ASYNC_BLOCK_END ASYNC_BLOCK_END_MSGNAME(MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------ +#define SYNC2ASYNC_FUNC_MSGNAME(func, msg_name) \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + mars::comm::MessageQueue::AsyncInvoke(func, AYNC_HANDLER, msg_name); \ + return; \ + } + +#define SYNC2ASYNC_FUNC(func) SYNC2ASYNC_FUNC_MSGNAME(func, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------ +#define RETURN_SYNC2ASYNC_FUNC_MSGNAME(func, ret, msg_name) \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + mars::comm::MessageQueue::AsyncInvoke(func, AYNC_HANDLER, msg_name); \ + return ret; \ + } + +/* + * sync to async, will not wait, but immediately return ret + */ +#define RETURN_SYNC2ASYNC_FUNC(func, ret) \ + RETURN_SYNC2ASYNC_FUNC_MSGNAME(func, ret, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------ +#define RETURN_SYNC2ASYNC_FUNC_TITLE_MSGNAME(func, title, ret, msg_name) \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + mars::comm::MessageQueue::AsyncInvoke(func, title, AYNC_HANDLER, msg_name); \ + return ret; \ + } + +#define RETURN_SYNC2ASYNC_FUNC_TITLE(func, title, ret) \ + RETURN_SYNC2ASYNC_FUNC_TITLE_MSGNAME(func, title, ret, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------ +#define RETURN_WAIT_SYNC2ASYNC_FUNC_MSGNAME(func, ret, msg_name) \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + mars::comm::MessageQueue::MessagePost_t postId = \ + mars::comm::MessageQueue::AsyncInvoke(func, AYNC_HANDLER, msg_name); \ + mars::comm::MessageQueue::WaitMessage(postId); \ + return ret; \ + } + +/* + * sync to async, wait utils async function end + * when wait ends, will return ret + */ +#define RETURN_WAIT_SYNC2ASYNC_FUNC(func, ret) \ + RETURN_WAIT_SYNC2ASYNC_FUNC_MSGNAME(func, ret, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------ +#define WAIT_SYNC2ASYNC_FUNC_MSGNAME(func, msg_name) \ + \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + return mars::comm::MessageQueue::WaitInvoke(func, AYNC_HANDLER, msg_name); \ + } + +/* + * sync to async, wait utils async function end + */ +#define WAIT_SYNC2ASYNC_FUNC(func) WAIT_SYNC2ASYNC_FUNC_MSGNAME(func, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +//------- + +#define WAIT_SYNC2ASYNC_FUNC_MSGNAME_WITH_HOOK(func, pre_lambda, post_lambda, msg_name, ret, timeout) \ + \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + pre_lambda(); \ + auto r = mars::comm::MessageQueue::WaitInvoke(func, ret, timeout, AYNC_HANDLER, msg_name); \ + return post_lambda(r); \ + } + +/* + * sync to async, wait utils async function end + * pre_lambda: function will be called before transform to async, will only be called in caller's thread + */ +#define WAIT_SYNC2ASYNC_FUNC_WITH_HOOK(func, pre_lambda, post_lambda, ret, timeout) \ + WAIT_SYNC2ASYNC_FUNC_MSGNAME_WITH_HOOK(func, \ + pre_lambda, \ + post_lambda, \ + MESSAGE_NAME(__FILE__, __FUNCTION__), \ + ret, \ + timeout) + +#define WAIT_SYNC2ASYNC_FUNC_MSGNAME_WITH_PREHOOK(func, pre_lambda, msg_name) \ + \ + if (mars::comm::MessageQueue::CurrentThreadMessageQueue() \ + != mars::comm::MessageQueue::Handler2Queue(AYNC_HANDLER)) { \ + pre_lambda(); \ + return mars::comm::MessageQueue::WaitInvoke(func, AYNC_HANDLER, msg_name); \ + } + +/* + * sync to async, wait utils async function end + * pre_lambda: function will be called before transform to async, will only be called in caller's thread + */ +#define WAIT_SYNC2ASYNC_FUNC_WITH_PREHOOK(func, pre_lambda) \ + WAIT_SYNC2ASYNC_FUNC_MSGNAME_WITH_PREHOOK(func, pre_lambda, MESSAGE_NAME(__FILE__, __FUNCTION__)) + +// define AYNC_HANDLER in source file +//#define AYNC_HANDLER handler + +} // namespace MessageQueue +namespace mq = MessageQueue; // namespace MessageQueue +} // namespace comm +} // namespace mars #endif /* MESSAGEQUEUE_H_ */ diff --git a/mars/comm/messagequeue/message_queue_utils.cc b/mars/comm/messagequeue/message_queue_utils.cc deleted file mode 100644 index 8221a7eb6..000000000 --- a/mars/comm/messagequeue/message_queue_utils.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - -// -// MessageQueueUtils.cpp -// PublicComponent -// -// Created by yerungui on 14-5-21. -// - -#include "comm/messagequeue/message_queue.h" -#include "comm/messagequeue/message_queue_utils.h" - - -namespace MessageQueue { - -ScopeRegister::ScopeRegister(const MessageHandler_t& _reg) - : m_reg(new MessageHandler_t(_reg)) {} - -ScopeRegister::~ScopeRegister() { - Cancel(); - delete m_reg; -} - -const MessageHandler_t& ScopeRegister::Get() const -{return *m_reg;} - -void ScopeRegister::Cancel() const { - UnInstallMessageHandler(*m_reg); - CancelMessage(*m_reg); -} -void ScopeRegister::CancelAndWait() const { - Cancel(); - WaitForRuningLockEnd(*m_reg); -} - -} // namespace MessageQueue diff --git a/mars/comm/messagequeue/message_queue_utils.h b/mars/comm/messagequeue/message_queue_utils.h deleted file mode 100644 index 1bd384d3a..000000000 --- a/mars/comm/messagequeue/message_queue_utils.h +++ /dev/null @@ -1,103 +0,0 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - - -/* - * MessageQueueUtils.h - * - * Created on: 2013-4-8 - * Author: yerungui - */ - -#ifndef MESSAGEQUEUEUTIL_H_ -#define MESSAGEQUEUEUTIL_H_ - - -namespace MessageQueue { - -struct MessageHandler_t; - -class ScopeRegister { - public: - ScopeRegister(const MessageHandler_t& _reg); - ~ScopeRegister(); - - const MessageHandler_t& Get() const; - void Cancel() const; - void CancelAndWait() const; - - private: - ScopeRegister(const ScopeRegister&); - ScopeRegister& operator=(const ScopeRegister&); - - private: - MessageHandler_t* m_reg; -}; - -#define SCOPEUTIL(classname, type, invoke) \ - class classname\ - {\ - public:\ - classname(){}\ - ~classname()\ - {\ - for (std::list::iterator it = m_lst.begin(); it != m_lst.end(); ++it)\ - {\ - invoke(*it);\ - }\ - }\ - \ - void operator+=(const type& _val) { m_lst.push_back(_val); }\ - void operator-=(const type& _val) { m_lst.remove(_val); }\ - \ - private:\ - classname(const classname&);\ - classname& operator=(const classname&);\ - \ - private:\ - std::list m_lst;\ - } - -} -// SCOPEUTIL(ScopeRegister, MessageRegister_t, UnRegisterMessageHandler); -// SCOPEUTIL(ScopePoster, MessagePost_t, CancelMessage); - -#define ASYNC_BLOCK_START MessageQueue::AsyncInvoke([=] () { -#define ASYNC_BLOCK_END }, AYNC_HANDLER); - -#define SYNC2ASYNC_FUNC(func) \ - if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(AYNC_HANDLER)) \ - { MessageQueue::AsyncInvoke(func, AYNC_HANDLER); return; } \ - -#define RETURN_SYNC2ASYNC_FUNC(func, ret) \ - if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(AYNC_HANDLER)) \ - { MessageQueue::AsyncInvoke(func, AYNC_HANDLER); return ret; } \ - -#define RETURN_SYNC2ASYNC_FUNC_TITLE(func, title, ret) \ - if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(AYNC_HANDLER)) \ - { MessageQueue::AsyncInvoke(func, title, AYNC_HANDLER); return ret; } \ - -#define RETURN_WAIT_SYNC2ASYNC_FUNC(func, ret) \ - if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(AYNC_HANDLER)) \ - { MessageQueue::MessagePost_t postId = MessageQueue::AsyncInvoke(func, AYNC_HANDLER);MessageQueue::WaitMessage(postId); return ret; } \ - -#define WAIT_SYNC2ASYNC_FUNC(func) \ - \ - if (MessageQueue::CurrentThreadMessageQueue() != MessageQueue::Handler2Queue(AYNC_HANDLER)) \ - {\ - return MessageQueue::WaitInvoke(func, AYNC_HANDLER);\ - } - -// define AYNC_HANDLER in source file -//#define AYNC_HANDLER handler - -#endif diff --git a/mars/comm/mmap_util.cc b/mars/comm/mmap_util.cc index 7478fadf8..4bec1cf0b 100644 --- a/mars/comm/mmap_util.cc +++ b/mars/comm/mmap_util.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -19,17 +19,16 @@ #include "mmap_util.h" -#include #include +#include #include "boost/filesystem.hpp" bool IsMmapFileOpenSucc(const boost::iostreams::mapped_file& _mmmap_file) { - return !_mmmap_file.operator !() && _mmmap_file.is_open(); + return !_mmmap_file.operator!() && _mmmap_file.is_open(); } bool OpenMmapFile(const char* _filepath, unsigned int _size, boost::iostreams::mapped_file& _mmmap_file) { - if (NULL == _filepath || 0 == strnlen(_filepath, 128) || 0 == _size) { return false; } @@ -37,13 +36,13 @@ bool OpenMmapFile(const char* _filepath, unsigned int _size, boost::iostreams::m if (IsMmapFileOpenSucc(_mmmap_file)) { CloseMmapFile(_mmmap_file); } - + if (_mmmap_file.is_open() && _mmmap_file.operator!()) { return false; } - boost::iostreams::mapped_file_params param; - param.path = _filepath; + boost::iostreams::basic_mapped_file_params param; + param.path = boost::filesystem::path(_filepath); param.flags = boost::iostreams::mapped_file_base::readwrite; bool file_exist = boost::filesystem::exists(_filepath); @@ -54,15 +53,15 @@ bool OpenMmapFile(const char* _filepath, unsigned int _size, boost::iostreams::m _mmmap_file.open(param); bool is_open = IsMmapFileOpenSucc(_mmmap_file); - +#ifndef _WIN32 if (!file_exist && is_open) { - - //Extending a file with ftruncate, thus creating a big hole, and then filling the hole by mod-ifying a shared mmap() can lead to SIGBUS when no space left - //the boost library uses ftruncate, so we pre-allocate the file's backing store by writing zero. + // Extending a file with ftruncate, thus creating a big hole, and then filling the hole by mod-ifying a shared + // mmap() can lead to SIGBUS when no space left the boost library uses ftruncate, so we pre-allocate the file's + // backing store by writing zero. FILE* file = fopen(_filepath, "rb+"); if (NULL == file) { _mmmap_file.close(); - remove(_filepath); + boost::filesystem::remove(_filepath); return false; } @@ -72,14 +71,14 @@ bool OpenMmapFile(const char* _filepath, unsigned int _size, boost::iostreams::m if (_size != fwrite(zero_data, sizeof(char), _size, file)) { _mmmap_file.close(); fclose(file); - remove(_filepath); + boost::filesystem::remove(_filepath); delete[] zero_data; return false; } fclose(file); delete[] zero_data; } - +#endif return is_open; } diff --git a/mars/comm/mmap_util.h b/mars/comm/mmap_util.h index ae74b7da0..6d0b86bf8 100644 --- a/mars/comm/mmap_util.h +++ b/mars/comm/mmap_util.h @@ -1,15 +1,15 @@ -// Tencent is pleased to support the open source community by making Mars available. -// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. - -// Licensed under the MIT License (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://opensource.org/licenses/MIT - -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. - +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + /* * mmap_util.h * @@ -28,7 +28,4 @@ bool OpenMmapFile(const char* _filepath, unsigned int _size, boost::iostreams::m void CloseMmapFile(boost::iostreams::mapped_file& _mmmap_file); - - - #endif /* MMAP_UTIL_H_ */ diff --git a/mars/comm/move_wrapper.h b/mars/comm/move_wrapper.h new file mode 100644 index 000000000..43b0b0510 --- /dev/null +++ b/mars/comm/move_wrapper.h @@ -0,0 +1,117 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License is +// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions and +// limitations under the License. + +// +// move_wrapper.h +// comm +// +// Created by yerungui on 13-10-17. +// + +#ifndef COMM_COPY_WRAPPER_H_ +#define COMM_COPY_WRAPPER_H_ + +template +class copy_wrapper_helper { + public: + static void copy_constructor(S& _lhs, S& _rhs) { + _lhs = _rhs; + } + + static void copy_constructor(S& _lhs, const S& _rhs) { + _lhs = _rhs; + } + + static void destructor(S& _delobj) { + } +}; + +template +class copy_wrapper_helper_ref { + public: + static const D& ref(const S& _ref) { + return _ref; + } + static D& ref(S& _ref) { + return _ref; + } +}; + +template +class move_wrapper { + public: + typedef S SRC; + typedef D DST; + + move_wrapper(S& t) { + copy_wrapper_helper::copy_constructor(m_t, t); + } + + move_wrapper(const S& t) { + copy_wrapper_helper::copy_constructor(m_t, t); + } + + ~move_wrapper() { + copy_wrapper_helper::destructor(m_t); + } + + move_wrapper& operator=(move_wrapper& _ref) { + copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); + return *this; + } + + move_wrapper& operator=(const move_wrapper& _ref) { + copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); + return *this; + } + + move_wrapper(move_wrapper& _ref) { + copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); + } + + move_wrapper(const move_wrapper& _ref) { + copy_wrapper_helper::copy_constructor(m_t, _ref.m_t); + } + + operator D&() { + return copy_wrapper_helper_ref::ref(m_t); + } + operator const D&() const { + return copy_wrapper_helper_ref::ref(m_t); + } + + D* operator->() { + return ©_wrapper_helper_ref::ref(m_t); + } + const D* operator->() const { + return ©_wrapper_helper_ref::ref(m_t); + } + + D& get() { + return copy_wrapper_helper_ref::ref(m_t); + } + const D& get() const { + return copy_wrapper_helper_ref::ref(m_t); + } + + D* get_pointer() { + return ©_wrapper_helper_ref::ref(m_t); + } + const D* get_pointer() const { + return ©_wrapper_helper_ref::ref(m_t); + } + + private: + S m_t; +}; + +#endif // COMM_COPY_WRAPPER_H_ diff --git a/mars/comm/network/getaddrinfo_with_timeout.cc b/mars/comm/network/getaddrinfo_with_timeout.cc new file mode 100644 index 000000000..c284cc3fc --- /dev/null +++ b/mars/comm/network/getaddrinfo_with_timeout.cc @@ -0,0 +1,253 @@ +#if (!UWP && !WIN32) +#include +#include +#else +#define USE_WIN32_CODE +#include +#include +#endif +#include + +#include "comm/thread/condition.h" +#include "comm/thread/lock.h" +#include "comm/thread/mutex.h" +#include "comm/thread/thread.h" +#include "comm/time_utils.h" +#include "comm/xlogger/xlogger.h" +#include "getaddrinfo_with_timeout.h" +#include "mars/comm/macro.h" +#include "socket/local_ipstack.h" +namespace mars { +namespace comm { + +enum { + kGetADDRNotBegin, + kGetADDRDoing, + kGetADDRTimeout, + kGetADDRSuc, + kGetADDRFail, +}; + +enum { kRetCodeInternalStateError = -888, kRetCodeParamNotMatch, kRetCodeDnsItemNotFound, kRetCodeGetADDRTimeout }; +struct DnsItem { + thread_tid threadid; + // parameter + const char* node; + const char* service; + const struct addrinfo* hints; + struct addrinfo** res; + //~parameter + + int error_code; + int status; + + DnsItem() + : threadid(0), node(NULL), service(NULL), hints(NULL), res(NULL), error_code(0), status(kGetADDRNotBegin) { + } + + bool EqualParameter(const DnsItem& _item) { + return _item.node == node && _item.service == service && _item.hints == hints && _item.res == res; + } + std::string ToString() const { + XMessage xmsg; + xmsg(TSF "node:%_, service:%_, hints:%_, res:%_, tid:%_, error_code:%_, status:%_", + NULL == node ? "NULL" : node, + NULL == service ? "NULL" : service, + NULL == hints ? (void*)0 : hints, + NULL == res ? (void*)0 : res, + threadid, + error_code, + status); + return xmsg.String(); + } +}; + +NO_DESTROY static std::vector sg_dnsitem_vec; +NO_DESTROY static Condition sg_condition; +NO_DESTROY static Mutex sg_mutex; + +static void __WorkerFunc() { + xverbose_function(); + + // parameter + std::string worker_node; + std::string worker_service; + struct addrinfo worker_hints; + struct addrinfo* worker_res0 = NULL; + memset(&worker_hints, 0, sizeof(worker_hints)); + + ScopedLock lock(sg_mutex); + std::vector::iterator iter = sg_dnsitem_vec.begin(); + + for (; iter != sg_dnsitem_vec.end(); ++iter) { + if (iter->threadid == ThreadUtil::currentthreadid()) { + worker_node = iter->node ? iter->node : ""; + worker_service = iter->service ? iter->service : ""; + if (iter->hints) + worker_hints = *iter->hints; + iter->status = kGetADDRDoing; + break; + } + } + if (iter == sg_dnsitem_vec.end()) { + xerror2(TSF "timeout before sys getaddrinfo"); + return; + } + lock.unlock(); + + // xinfo2(TSF "sys getaddrinfo start"); + uint64_t start = gettickcount(); + int error = getaddrinfo(worker_node.c_str(), + worker_service.empty() ? NULL : worker_service.c_str(), + &worker_hints, + &worker_res0); + + xinfo2(TSF "sys getaddrinfo error:%_, node:%_, service:%_ cost:%_", + error, + worker_node, + worker_service, + (gettickcount() - start)); + + lock.lock(); + + iter = sg_dnsitem_vec.begin(); + for (; iter != sg_dnsitem_vec.end(); ++iter) { + if (iter->threadid == ThreadUtil::currentthreadid()) { + break; + } + } + + if (error != 0) { + if (iter != sg_dnsitem_vec.end()) { + iter->error_code = error; + iter->status = kGetADDRFail; + xassert2(NULL != iter->res); + *(iter->res) = worker_res0; + } else { + if (worker_res0 != NULL) { + xinfo2(TSF "getaddrinfo fail and timeout. free worker_res0 @%_", worker_res0); + freeaddrinfo(worker_res0); + } + xinfo2(TSF "getaddrinfo fail and timeout. worker_node:%_", worker_node); + } + sg_condition.notifyAll(); + } else { + if (iter != sg_dnsitem_vec.end()) { + if (iter->status == kGetADDRDoing) { + iter->status = kGetADDRSuc; + xassert2(NULL != iter->res); + *(iter->res) = worker_res0; + } else { + if (worker_res0 != NULL) { + xinfo2(TSF "getaddrinfo end but timeout. free worker_res0 @%_", worker_res0); + freeaddrinfo(worker_res0); + } + xinfo2(TSF "getaddrinfo end but timeout. worker_node:%_", worker_node); + } + } else { + if (worker_res0 != NULL) { + xinfo2(TSF "getaddrinfo end but timeout. free worker_res0 @%_", worker_res0); + freeaddrinfo(worker_res0); + } + } + + sg_condition.notifyAll(); + } +} + +int getaddrinfo_with_timeout(const char* node, + const char* service, + const struct addrinfo* hints, + struct addrinfo** res, + bool& _is_timeout, + unsigned long long _timeout_msec) { + xverbose_function(); + // Check param + + ScopedLock lock(sg_mutex); + + std::string threadname(node); + threadname.append("@dns_with_timeout"); + + Thread thread(&__WorkerFunc, threadname.c_str()); + int start_ret = thread.start(); + + if (start_ret != 0) { + xerror2(TSF "start the thread fail, host:%_", node); + return kRetCodeInternalStateError; + } + + DnsItem dns_item; + dns_item.threadid = thread.tid(); + dns_item.node = node; + dns_item.service = service; + dns_item.hints = hints; + dns_item.res = res; + dns_item.status = kGetADDRNotBegin; + sg_dnsitem_vec.push_back(dns_item); + + uint64_t time_end = gettickcount() + (uint64_t)_timeout_msec; + + while (true) { + uint64_t time_cur = gettickcount(); + uint64_t time_wait = time_end > time_cur ? time_end - time_cur : 0; + + int wait_ret = sg_condition.wait(lock, (long)time_wait); + + std::vector::iterator it = sg_dnsitem_vec.begin(); + + for (; it != sg_dnsitem_vec.end(); ++it) { + if (dns_item.threadid == it->threadid) + break; + } + + xassert2(it != sg_dnsitem_vec.end()); + + if (it != sg_dnsitem_vec.end()) { + if (ETIMEDOUT == wait_ret) { + it->status = kGetADDRTimeout; + } + + if (kGetADDRNotBegin == it->status || kGetADDRDoing == it->status) { + continue; + } + + if (kGetADDRSuc == it->status) { + if (it->EqualParameter(dns_item)) { + sg_dnsitem_vec.erase(it); + return 0; + } else { + std::vector::iterator iter = sg_dnsitem_vec.begin(); + int i = 0; + for (; iter != sg_dnsitem_vec.end(); ++iter) { + xerror2(TSF "sg_dnsitem_vec[%_]:%_", i++, iter->ToString()); + } + xassert2(false, TSF "dns_item:%_", dns_item.ToString()); + return kRetCodeParamNotMatch; + } + } + + if (kGetADDRTimeout == it->status) { + xinfo2(TSF "dns get ip status:kGetADDRTimeout item:%_", it->ToString()); + sg_dnsitem_vec.erase(it); + _is_timeout = true; + return kRetCodeGetADDRTimeout; + } else if (kGetADDRFail == it->status) { + xinfo2(TSF "dns get ip status:kGetADDRFail item:%_", it->ToString()); + int ret_code = it->error_code; + sg_dnsitem_vec.erase(it); + return ret_code; + } + + xassert2(false, TSF "%_", it->status); + + sg_dnsitem_vec.erase(it); + } + return kRetCodeDnsItemNotFound; + } + + return kRetCodeInternalStateError; +} + +} // namespace comm +} // namespace mars diff --git a/mars/comm/network/getaddrinfo_with_timeout.h b/mars/comm/network/getaddrinfo_with_timeout.h new file mode 100644 index 000000000..b198d0d3f --- /dev/null +++ b/mars/comm/network/getaddrinfo_with_timeout.h @@ -0,0 +1,23 @@ +#ifndef getaddrinfo_with_timeout_h +#define getaddrinfo_with_timeout_h + +#ifdef _WIN32 +#include +#else +#include +#endif // _WIN32 + +namespace mars { +namespace comm { + +int getaddrinfo_with_timeout(const char* node, + const char* service, + const struct ::addrinfo* hints, + struct ::addrinfo** res, + bool& _is_timeout, + unsigned long long _timeout_msec); + +} +} // namespace mars + +#endif /* getaddrinfo_with_timeout_h */ diff --git a/mars/comm/network/getdnssvraddrs.cc b/mars/comm/network/getdnssvraddrs.cc index 96d86ef91..2ca867cff 100644 --- a/mars/comm/network/getdnssvraddrs.cc +++ b/mars/comm/network/getdnssvraddrs.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -19,10 +19,10 @@ #include "comm/network/getdnssvraddrs.h" +namespace mars { +namespace comm { #ifdef ANDROID - #include -#include void getdnssvraddrs(std::vector& dnsServers) { char buf1[PROP_VALUE_MAX]; @@ -52,9 +52,8 @@ void getdnssvraddrs(std::vector& _dnssvraddrs) { } else if (AF_INET6 == addrs[i].sin.sin_family) { _dnssvraddrs.push_back(socket_address(addrs[i].sin6)); } - } - + res_ndestroy(&stat); } @@ -62,29 +61,40 @@ void getdnssvraddrs(std::vector& _dnssvraddrs) { void getdnssvraddrs(std::vector& _dnssvraddrs) { } #elif defined _WIN32 +#include #include #include -#include #pragma comment(lib, "Iphlpapi.lib") void getdnssvraddrs(std::vector& _dnssvraddrs) { - FIXED_INFO fi; - ULONG ulOutBufLen = sizeof(fi); - - if (::GetNetworkParams(&fi, &ulOutBufLen) != ERROR_SUCCESS) { + FIXED_INFO* pFixedInfo = (FIXED_INFO*)malloc(sizeof(FIXED_INFO)); + if (!pFixedInfo) { return; } - - IP_ADDR_STRING* pIPAddr = fi.DnsServerList.Next; - - while (pIPAddr != NULL) { - _dnssvraddrs.push_back(socket_address(pIPAddr->IpAddress.String) ); - pIPAddr = pIPAddr->Next; + ULONG ulOutBufLen = 0; + + if (GetNetworkParams(pFixedInfo, &ulOutBufLen) == ERROR_BUFFER_OVERFLOW) { + free(pFixedInfo); + pFixedInfo = (FIXED_INFO*)malloc(ulOutBufLen); + if (!pFixedInfo) { + return; + } } - + if (GetNetworkParams(pFixedInfo, &ulOutBufLen) == NO_ERROR) { + IP_ADDR_STRING* pIPAddr = pFixedInfo->DnsServerList.Next; + while (pIPAddr != NULL) { + _dnssvraddrs.push_back(socket_address(pIPAddr->IpAddress.String, 53)); + pIPAddr = pIPAddr->Next; + } + } + + free(pFixedInfo); return; } #else -#error "no imp" +void getdnssvraddrs(std::vector& _dnssvraddrs) { +} #endif +} // namespace comm +} // namespace mars diff --git a/mars/comm/network/getdnssvraddrs.h b/mars/comm/network/getdnssvraddrs.h index 14f7dfbcc..f4db3d5e5 100644 --- a/mars/comm/network/getdnssvraddrs.h +++ b/mars/comm/network/getdnssvraddrs.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -21,8 +21,15 @@ #define getdnssvraddress_hpp #include + #include "comm/socket/socket_address.h" +namespace mars { +namespace comm { + void getdnssvraddrs(std::vector& _dnssvraddrs); +} +} // namespace mars + #endif /* getdnssvraddress_hpp */ diff --git a/mars/comm/network/getgateway.c b/mars/comm/network/getgateway.c index 26882af91..5a8dfaa43 100644 --- a/mars/comm/network/getgateway.c +++ b/mars/comm/network/getgateway.c @@ -13,8 +13,8 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include +#include #ifndef WIN32 #include #include @@ -47,12 +47,17 @@ #define USE_SYSCTL_NET_ROUTE #include -#if !TARGET_OS_SIMULATOR +#if TARGET_OS_IOS #undef __ROUTE_HEADER_FILE__ -#define __ROUTE_HEADER_FILE__ "comm/objc/route.h" +#define __ROUTE_HEADER_FILE__ "comm/objc/route.h" +#endif + +#if TARGET_OS_WATCH +#undef USE_SYSCTL_NET_ROUTE +#define USE_DUMMY_CODE #endif -#endif //__APPLE__ +#endif //__APPLE__ #if (defined(sun) && defined(__SVR4)) #undef USE_PROC_NET_ROUTE @@ -70,15 +75,15 @@ #ifdef USE_SYSCTL_NET_ROUTE #include -#include #include +#include #include __ROUTE_HEADER_FILE__ #endif #ifdef USE_SOCKET_ROUTE -#include +#include #include #include -#include +#include #include __ROUTE_HEADER_FILE__ #endif #ifdef WIN32 @@ -89,33 +94,30 @@ #endif #include "comm/network/getgateway.h" -#ifndef WIN32 #define SUCCESS (0) -#define FAILED (-1) -#endif +#define FAILED (-1) typedef uint32_t in_addr_t; #ifdef USE_PROC_NET_ROUTE -int getdefaultgateway(struct in_addr * addr) -{ +int getdefaultgateway(struct in_addr* addr) { long d, g; char buf[256]; int line = 0; - FILE * f; - char * p; + FILE* f; + char* p; f = fopen("/proc/net/route", "r"); if (!f) return FAILED; - while(fgets(buf, sizeof(buf), f)) { + while (fgets(buf, sizeof(buf), f)) { if (line > 0) { p = buf; - while(*p && !isspace(*p)) + while (*p && !isspace(*p)) p++; - while(*p && isspace(*p)) + while (*p && isspace(*p)) p++; - if (sscanf(p, "%lx%lx", &d, &g)==2) { + if (sscanf(p, "%lx%lx", &d, &g) == 2) { if (d == 0) { /* default */ - addr->s_addr = (in_addr_t)g; + addr->s_addr = (in_addr_t)g; fclose(f); return SUCCESS; } @@ -129,60 +131,56 @@ int getdefaultgateway(struct in_addr * addr) return FAILED; } -int getdefaultgateway6(struct in6_addr * addr) { - return FAILED; +int getdefaultgateway6(struct in6_addr* addr) { + return FAILED; } #endif /* #ifdef USE_PROC_NET_ROUTE */ - #ifdef USE_SYSCTL_NET_ROUTE -#define ROUNDUP(a) \ - ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#define ROUNDUP(a) ((a) > 0 ? (1 + (((a)-1) | (sizeof(long) - 1))) : sizeof(long)) -int getdefaultgateway(struct in_addr * addr) -{ +int getdefaultgateway(struct in_addr* addr) { #if 0 /* net.route.0.inet.dump.0.0 ? */ int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_DUMP, 0, 0/*tableid*/}; #endif /* net.route.0.inet.flags.gateway */ - int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, - NET_RT_FLAGS, RTF_GATEWAY}; + int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_GATEWAY}; size_t l; - char * buf, * p; - struct rt_msghdr * rt; - struct sockaddr * sa; - struct sockaddr * sa_tab[RTAX_MAX]; + char *buf, *p; + struct rt_msghdr* rt; + struct sockaddr* sa; + struct sockaddr* sa_tab[RTAX_MAX]; int i; int r = FAILED; - if (sysctl(mib, sizeof(mib)/sizeof(int), 0, &l, 0, 0) < 0) { + if (sysctl(mib, sizeof(mib) / sizeof(int), 0, &l, 0, 0) < 0) { return FAILED; } - if (l>0) { + if (l > 0) { buf = malloc(l); - if (sysctl(mib, sizeof(mib)/sizeof(int), buf, &l, 0, 0) < 0) { + if (sysctl(mib, sizeof(mib) / sizeof(int), buf, &l, 0, 0) < 0) { free(buf); return FAILED; } - for(p=buf; prtm_msglen) { - rt = (struct rt_msghdr *)p; - sa = (struct sockaddr *)(rt + 1); - for(i=0; irtm_msglen) { + rt = (struct rt_msghdr*)p; + sa = (struct sockaddr*)(rt + 1); + for (i = 0; i < RTAX_MAX; i++) { if (rt->rtm_addrs & (1 << i)) { sa_tab[i] = sa; - sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len)); + sa = (struct sockaddr*)((char*)sa + ROUNDUP(sa->sa_len)); } else { sa_tab[i] = NULL; } } - if ( ((rt->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) - && sa_tab[RTAX_DST]->sa_family == AF_INET) { -// && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET) { - if (((struct sockaddr_in *)sa_tab[RTAX_DST])->sin_addr.s_addr == 0) { - *addr = ((struct sockaddr_in *)(sa_tab[RTAX_GATEWAY]))->sin_addr; + if (((rt->rtm_addrs & (RTA_DST | RTA_GATEWAY)) == (RTA_DST | RTA_GATEWAY)) + && sa_tab[RTAX_DST]->sa_family == AF_INET) { + // && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET) { + if (((struct sockaddr_in*)sa_tab[RTAX_DST])->sin_addr.s_addr == 0) { + *addr = ((struct sockaddr_in*)(sa_tab[RTAX_GATEWAY]))->sin_addr; r = SUCCESS; break; } @@ -193,43 +191,41 @@ int getdefaultgateway(struct in_addr * addr) return r; } -int getdefaultgateway6(struct in6_addr * addr) -{ +int getdefaultgateway6(struct in6_addr* addr) { /* net.route.0.inet6.flags.gateway */ - int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET6, - NET_RT_FLAGS, RTF_GATEWAY}; + int mib[] = {CTL_NET, PF_ROUTE, 0, AF_INET6, NET_RT_FLAGS, RTF_GATEWAY}; size_t l; - char * buf, * p; - struct rt_msghdr * rt; - struct sockaddr * sa; - struct sockaddr * sa_tab[RTAX_MAX]; + char *buf, *p; + struct rt_msghdr* rt; + struct sockaddr* sa; + struct sockaddr* sa_tab[RTAX_MAX]; int i; int r = FAILED; - if (sysctl(mib, sizeof(mib)/sizeof(int), 0, &l, 0, 0) < 0) { + if (sysctl(mib, sizeof(mib) / sizeof(int), 0, &l, 0, 0) < 0) { return FAILED; } - if (l>0) { + if (l > 0) { buf = malloc(l); - if (sysctl(mib, sizeof(mib)/sizeof(int), buf, &l, 0, 0) < 0) { + if (sysctl(mib, sizeof(mib) / sizeof(int), buf, &l, 0, 0) < 0) { free(buf); return FAILED; } - for(p=buf; prtm_msglen) { - rt = (struct rt_msghdr *)p; - sa = (struct sockaddr *)(rt + 1); - for(i=0; irtm_msglen) { + rt = (struct rt_msghdr*)p; + sa = (struct sockaddr*)(rt + 1); + for (i = 0; i < RTAX_MAX; i++) { if (rt->rtm_addrs & (1 << i)) { sa_tab[i] = sa; - sa = (struct sockaddr *)((char *)sa + ROUNDUP(sa->sa_len)); + sa = (struct sockaddr*)((char*)sa + ROUNDUP(sa->sa_len)); } else { sa_tab[i] = NULL; } } - if ( ((rt->rtm_addrs & (RTA_DST|RTA_GATEWAY)) == (RTA_DST|RTA_GATEWAY)) - && sa_tab[RTAX_DST]->sa_family == AF_INET6) { -// && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET6) { - if (IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)sa_tab[RTAX_DST])->sin6_addr)) { - *addr = ((struct sockaddr_in6 *)(sa_tab[RTAX_GATEWAY]))->sin6_addr; + if (((rt->rtm_addrs & (RTA_DST | RTA_GATEWAY)) == (RTA_DST | RTA_GATEWAY)) + && sa_tab[RTAX_DST]->sa_family == AF_INET6) { + // && sa_tab[RTAX_GATEWAY]->sa_family == AF_INET6) { + if (IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6*)sa_tab[RTAX_DST])->sin6_addr)) { + *addr = ((struct sockaddr_in6*)(sa_tab[RTAX_GATEWAY]))->sin6_addr; r = SUCCESS; break; } @@ -241,94 +237,92 @@ int getdefaultgateway6(struct in6_addr * addr) } #endif /* #ifdef USE_SYSCTL_NET_ROUTE */ - #ifdef USE_SOCKET_ROUTE /* Thanks to Darren Kenny for this code */ -#define NEXTADDR(w, u) \ - if (rtm_addrs & (w)) {\ - l = sizeof(struct sockaddr); memmove(cp, &(u), l); cp += l;\ - } +#define NEXTADDR(w, u) \ + if (rtm_addrs & (w)) { \ + l = sizeof(struct sockaddr); \ + memmove(cp, &(u), l); \ + cp += l; \ + } #define rtm m_rtmsg.m_rtm struct { - struct rt_msghdr m_rtm; - char m_space[512]; + struct rt_msghdr m_rtm; + char m_space[512]; } m_rtmsg; -int getdefaultgateway(in_addr_t *addr) -{ - int s, seq, l, rtm_addrs, i; - pid_t pid; - struct sockaddr so_dst, so_mask; - char *cp = m_rtmsg.m_space; - struct sockaddr *gate = NULL, *sa; - struct rt_msghdr *msg_hdr; - - pid = getpid(); - seq = 0; - rtm_addrs = RTA_DST | RTA_NETMASK; - - memset(&so_dst, 0, sizeof(so_dst)); - memset(&so_mask, 0, sizeof(so_mask)); - memset(&rtm, 0, sizeof(struct rt_msghdr)); - - rtm.rtm_type = RTM_GET; - rtm.rtm_flags = RTF_UP | RTF_GATEWAY; - rtm.rtm_version = RTM_VERSION; - rtm.rtm_seq = ++seq; - rtm.rtm_addrs = rtm_addrs; - - so_dst.sa_family = AF_INET; - so_mask.sa_family = AF_INET; - - NEXTADDR(RTA_DST, so_dst); - NEXTADDR(RTA_NETMASK, so_mask); - - rtm.rtm_msglen = l = cp - (char *)&m_rtmsg; - - s = socket(PF_ROUTE, SOCK_RAW, 0); - - if (write(s, (char *)&m_rtmsg, l) < 0) { - close(s); - return FAILED; - } - - do { - l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm.rtm_seq != seq || rtm.rtm_pid != pid)); - - close(s); - - msg_hdr = &rtm; - - cp = ((char *)(msg_hdr + 1)); - if (msg_hdr->rtm_addrs) { - for (i = 1; i; i <<= 1) - if (i & msg_hdr->rtm_addrs) { - sa = (struct sockaddr *)cp; - if (i == RTA_GATEWAY ) - gate = sa; - - cp += sizeof(struct sockaddr); - } - } else { - return FAILED; - } - - - if (gate != NULL ) { - *addr = ((struct sockaddr_in *)gate)->sin_addr.s_addr; - return SUCCESS; - } else { - return FAILED; - } +int getdefaultgateway(in_addr_t* addr) { + int s, seq, l, rtm_addrs, i; + pid_t pid; + struct sockaddr so_dst, so_mask; + char* cp = m_rtmsg.m_space; + struct sockaddr *gate = NULL, *sa; + struct rt_msghdr* msg_hdr; + + pid = getpid(); + seq = 0; + rtm_addrs = RTA_DST | RTA_NETMASK; + + memset(&so_dst, 0, sizeof(so_dst)); + memset(&so_mask, 0, sizeof(so_mask)); + memset(&rtm, 0, sizeof(struct rt_msghdr)); + + rtm.rtm_type = RTM_GET; + rtm.rtm_flags = RTF_UP | RTF_GATEWAY; + rtm.rtm_version = RTM_VERSION; + rtm.rtm_seq = ++seq; + rtm.rtm_addrs = rtm_addrs; + + so_dst.sa_family = AF_INET; + so_mask.sa_family = AF_INET; + + NEXTADDR(RTA_DST, so_dst); + NEXTADDR(RTA_NETMASK, so_mask); + + rtm.rtm_msglen = l = cp - (char*)&m_rtmsg; + + s = socket(PF_ROUTE, SOCK_RAW, 0); + + if (write(s, (char*)&m_rtmsg, l) < 0) { + close(s); + return FAILED; + } + + do { + l = read(s, (char*)&m_rtmsg, sizeof(m_rtmsg)); + } while (l > 0 && (rtm.rtm_seq != seq || rtm.rtm_pid != pid)); + + close(s); + + msg_hdr = &rtm; + + cp = ((char*)(msg_hdr + 1)); + if (msg_hdr->rtm_addrs) { + for (i = 1; i; i <<= 1) + if (i & msg_hdr->rtm_addrs) { + sa = (struct sockaddr*)cp; + if (i == RTA_GATEWAY) + gate = sa; + + cp += sizeof(struct sockaddr); + } + } else { + return FAILED; + } + + if (gate != NULL) { + *addr = ((struct sockaddr_in*)gate)->sin_addr.s_addr; + return SUCCESS; + } else { + return FAILED; + } } #endif /* #ifdef USE_SOCKET_ROUTE */ #ifdef USE_WIN32_CODE -int getdefaultgateway(in_addr_t * addr) -{ +int getdefaultgateway(in_addr_t* addr) { HKEY networkCardsKey; HKEY networkCardKey; HKEY interfacesKey; @@ -344,13 +338,13 @@ int getdefaultgateway(in_addr_t * addr) DWORD gatewayValueLength = MAX_VALUE_LENGTH; DWORD gatewayValueType = REG_MULTI_SZ; int done = 0; - + char networkCardsPath[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards"; char interfacesPath[] = "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces"; - + // The windows registry lists its primary network devices in the following location: // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards - // + // // Each network device has its own subfolder, named with an index, with various properties: // -NetworkCards // -5 @@ -359,10 +353,10 @@ int getdefaultgateway(in_addr_t * addr) // -8 // -Description = Marvell Yukon 88E8058 PCI-E Gigabit Ethernet Controller // -ServiceName = {86226414-5545-4335-A9D1-5BD7120119AD} - // + // // The above service name is the name of a subfolder within: // HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces - // + // // There may be more subfolders in this interfaces path than listed in the network cards path above: // -Interfaces // -{3a539854-6a70-11db-887c-806e6f6e6963} @@ -376,79 +370,80 @@ int getdefaultgateway(in_addr_t * addr) // -DhcpIpAddress = 10.0.1.5 // -DhcpDefaultGateay = 10.0.1.1 // -[more] - // + // // In order to extract this information, we enumerate each network card, and extract the ServiceName value. // This is then used to open the interface subfolder, and attempt to extract a DhcpDefaultGateway value. // Once one is found, we're done. - // + // // It may be possible to simply enumerate the interface folders until we find one with a DhcpDefaultGateway value. // However, the technique used is the technique most cited on the web, and we assume it to be more correct. - - if (ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, // Open registry key or predifined key - networkCardsPath, // Name of registry subkey to open - 0, // Reserved - must be zero - KEY_READ, // Mask - desired access rights - &networkCardsKey)) // Pointer to output key + + if (ERROR_SUCCESS + != RegOpenKeyEx(HKEY_LOCAL_MACHINE, // Open registry key or predifined key + networkCardsPath, // Name of registry subkey to open + 0, // Reserved - must be zero + KEY_READ, // Mask - desired access rights + &networkCardsKey)) // Pointer to output key { // Unable to open network cards keys return -1; } - - if (ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, // Open registry key or predefined key - interfacesPath, // Name of registry subkey to open - 0, // Reserved - must be zero - KEY_READ, // Mask - desired access rights - &interfacesKey)) // Pointer to output key + + if (ERROR_SUCCESS + != RegOpenKeyEx(HKEY_LOCAL_MACHINE, // Open registry key or predefined key + interfacesPath, // Name of registry subkey to open + 0, // Reserved - must be zero + KEY_READ, // Mask - desired access rights + &interfacesKey)) // Pointer to output key { // Unable to open interfaces key RegCloseKey(networkCardsKey); return -1; } - + // Figure out how many subfolders are within the NetworkCards folder RegQueryInfoKey(networkCardsKey, NULL, NULL, NULL, &numSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - //printf( "Number of subkeys: %u\n", (unsigned int)numSubKeys); - + + // printf( "Number of subkeys: %u\n", (unsigned int)numSubKeys); + // Enumrate through each subfolder within the NetworkCards folder - for(i = 0; i < numSubKeys && !done; i++) - { + for (i = 0; i < numSubKeys && !done; i++) { keyNameLength = MAX_KEY_LENGTH; - if (ERROR_SUCCESS == RegEnumKeyEx(networkCardsKey, // Open registry key - i, // Index of subkey to retrieve - keyName, // Buffer that receives the name of the subkey - &keyNameLength, // Variable that receives the size of the above buffer - NULL, // Reserved - must be NULL - NULL, // Buffer that receives the class string - NULL, // Variable that receives the size of the above buffer - NULL)) // Variable that receives the last write time of subkey + if (ERROR_SUCCESS + == RegEnumKeyEx(networkCardsKey, // Open registry key + i, // Index of subkey to retrieve + keyName, // Buffer that receives the name of the subkey + &keyNameLength, // Variable that receives the size of the above buffer + NULL, // Reserved - must be NULL + NULL, // Buffer that receives the class string + NULL, // Variable that receives the size of the above buffer + NULL)) // Variable that receives the last write time of subkey { - if (RegOpenKeyEx(networkCardsKey, keyName, 0, KEY_READ, &networkCardKey) == ERROR_SUCCESS) - { + if (RegOpenKeyEx(networkCardsKey, keyName, 0, KEY_READ, &networkCardKey) == ERROR_SUCCESS) { keyValueLength = MAX_VALUE_LENGTH; - if (ERROR_SUCCESS == RegQueryValueEx(networkCardKey, // Open registry key - "ServiceName", // Name of key to query - NULL, // Reserved - must be NULL - &keyValueType, // Receives value type - keyValue, // Receives value - &keyValueLength)) // Receives value length in bytes + if (ERROR_SUCCESS + == RegQueryValueEx(networkCardKey, // Open registry key + "ServiceName", // Name of key to query + NULL, // Reserved - must be NULL + &keyValueType, // Receives value type + keyValue, // Receives value + &keyValueLength)) // Receives value length in bytes { - //printf("keyValue: %s\n", keyValue); - - if (RegOpenKeyEx(interfacesKey, keyValue, 0, KEY_READ, &interfaceKey) == ERROR_SUCCESS) - { + // printf("keyValue: %s\n", keyValue); + + if (RegOpenKeyEx(interfacesKey, keyValue, 0, KEY_READ, &interfaceKey) == ERROR_SUCCESS) { gatewayValueLength = MAX_VALUE_LENGTH; - if (ERROR_SUCCESS == RegQueryValueEx(interfaceKey, // Open registry key - "DhcpDefaultGateway", // Name of key to query - NULL, // Reserved - must be NULL - &gatewayValueType, // Receives value type - gatewayValue, // Receives value - &gatewayValueLength)) // Receives value length in bytes + if (ERROR_SUCCESS + == RegQueryValueEx(interfaceKey, // Open registry key + "DhcpDefaultGateway", // Name of key to query + NULL, // Reserved - must be NULL + &gatewayValueType, // Receives value type + gatewayValue, // Receives value + &gatewayValueLength)) // Receives value length in bytes { // Check to make sure it's a string - if (gatewayValueType == REG_MULTI_SZ || gatewayValueType == REG_SZ) - { - //printf("gatewayValue: %s\n", gatewayValue); + if (gatewayValueType == REG_MULTI_SZ || gatewayValueType == REG_SZ) { + // printf("gatewayValue: %s\n", gatewayValue); done = 1; } } @@ -459,17 +454,28 @@ int getdefaultgateway(in_addr_t * addr) } } } - + RegCloseKey(interfacesKey); RegCloseKey(networkCardsKey); - - if (done) - { + + if (done) { *addr = inet_addr(gatewayValue); return 0; } - + return -1; } + +int getdefaultgateway6(struct in6_addr* addr) { + return FAILED; +} #endif /* #ifdef USE_WIN32_CODE */ +#ifdef USE_DUMMY_CODE +int getdefaultgateway(struct in_addr*) { + return -1; +} +int getdefaultgateway6(struct in6_addr*) { + return -1; +} +#endif diff --git a/mars/comm/network/getgateway.h b/mars/comm/network/getgateway.h index 3681da26f..9ecdbeec2 100644 --- a/mars/comm/network/getgateway.h +++ b/mars/comm/network/getgateway.h @@ -28,8 +28,8 @@ extern "C" { * return value : * 0 : success * -1 : failure */ -int getdefaultgateway(struct in_addr * addr); -int getdefaultgateway6(struct in6_addr * addr); +int getdefaultgateway(struct in_addr* addr); +int getdefaultgateway6(struct in6_addr* addr); #ifdef __cplusplus } diff --git a/mars/comm/network/getifaddrs.cc b/mars/comm/network/getifaddrs.cc index abbb6f7f7..28ed6540f 100644 --- a/mars/comm/network/getifaddrs.cc +++ b/mars/comm/network/getifaddrs.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -19,32 +19,39 @@ #include "comm/network/getifaddrs.h" -#if !UWP +#include "mars/comm/xlogger/xlogger.h" + +#if (!UWP && !WIN32) #include -#include #include +#include -#ifdef ANDROID +#if defined(__ANDROID__) #include "comm/jni/ifaddrs.h" #else #include #endif bool getifaddrs_ipv4(std::vector& _addrs) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in* sa = (struct sockaddr_in*) ifa->ifa_addr; + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; - if (NULL == sa) continue; + if (NULL == sa) + continue; if (ifa->ifa_addr->sa_family == AF_INET && 0 == (ifa->ifa_flags & IFF_LOOPBACK)) { ifaddrinfo_ipv4_t addr; addr.ifa_name = ifa->ifa_name; addr.ifa_ip = sa->sin_addr.s_addr; - inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); + inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); _addrs.push_back(addr); } @@ -55,19 +62,24 @@ bool getifaddrs_ipv4(std::vector& _addrs) { } bool getifaddrs_ipv4(ifaddrinfo_ipv4_t& _addr) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in* sa = (struct sockaddr_in*) ifa->ifa_addr; + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; - if (NULL == sa) continue; + if (NULL == sa) + continue; if (ifa->ifa_addr->sa_family == AF_INET && 0 == (ifa->ifa_flags & IFF_LOOPBACK)) { _addr.ifa_name = ifa->ifa_name; _addr.ifa_ip = sa->sin_addr.s_addr; - inet_ntop(sa->sin_family, &(sa->sin_addr), _addr.ip, sizeof(_addr.ip)); + inet_ntop(sa->sin_family, &(sa->sin_addr), _addr.ip, sizeof(_addr.ip)); freeifaddrs(ifap); return true; @@ -79,23 +91,29 @@ bool getifaddrs_ipv4(ifaddrinfo_ipv4_t& _addr) { } bool getifaddrs_ipv4_lan(ifaddrinfo_ipv4_t& _addr) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in* sa = (struct sockaddr_in*) ifa->ifa_addr; + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; - if (NULL == sa) continue; + if (NULL == sa) + continue; - if (ifa->ifa_addr->sa_family == AF_INET - && !(ifa->ifa_flags & IFF_LOOPBACK) - && !(ifa->ifa_flags & IFF_POINTOPOINT) - && (ifa->ifa_flags & IFF_BROADCAST) - && (ifa->ifa_flags & IFF_RUNNING)) { + if (ifa->ifa_addr->sa_family == AF_INET && !(ifa->ifa_flags & IFF_LOOPBACK) + && !(ifa->ifa_flags & IFF_POINTOPOINT) && (ifa->ifa_flags & IFF_BROADCAST) + && (ifa->ifa_flags & IFF_RUNNING)) { _addr.ifa_name = ifa->ifa_name; _addr.ifa_ip = sa->sin_addr.s_addr; - inet_ntop(sa->sin_family, &(sa->sin_addr), _addr.ip, sizeof(_addr.ip)); + inet_ntop(sa->sin_family, &(sa->sin_addr), _addr.ip, sizeof(_addr.ip)); + if (strncmp(_addr.ip, "169.254.", 8) == 0) { + continue; + } freeifaddrs(ifap); return true; @@ -107,26 +125,114 @@ bool getifaddrs_ipv4_lan(ifaddrinfo_ipv4_t& _addr) { } bool getifaddrs_ipv4_lan(std::vector& _addrs) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in* sa = (struct sockaddr_in*) ifa->ifa_addr; + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; - if (NULL == sa) continue; + if (NULL == sa) + continue; - if (ifa->ifa_addr->sa_family == AF_INET - && !(ifa->ifa_flags & IFF_LOOPBACK) - && !(ifa->ifa_flags & IFF_POINTOPOINT) - && (ifa->ifa_flags & IFF_BROADCAST) - && (ifa->ifa_flags & IFF_RUNNING)) { + if (ifa->ifa_addr->sa_family == AF_INET && !(ifa->ifa_flags & IFF_LOOPBACK) + && !(ifa->ifa_flags & IFF_POINTOPOINT) && (ifa->ifa_flags & IFF_BROADCAST) + && (ifa->ifa_flags & IFF_RUNNING)) { ifaddrinfo_ipv4_t addr; addr.ifa_name = ifa->ifa_name; addr.ifa_ip = sa->sin_addr.s_addr; - inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); + inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); + // iOS 14.5 return: + // 1. en2 169.254.x.x invalid + // 2. en0 192.168.x.x + // 169.254.0.0/16 - This is the "link local" block. As described in + // [RFC3927], it is allocated for communication between hosts on a + // single link. Hosts obtain these addresses by auto-configuration, + // such as when a DHCP server cannot be found. + if (strncmp(addr.ip, "169.254.", 8) == 0) { + continue; + } + _addrs.push_back(addr); + } + } + + freeifaddrs(ifap); + return !_addrs.empty(); +} + +bool getifaddrs_ip_lan(std::vector& _addrs) { + struct ifaddrs *ifap, *ifa; + + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; + + if (NULL == sa) + continue; + + if (ifa->ifa_addr->sa_family == AF_INET && !(ifa->ifa_flags & IFF_LOOPBACK) + && !(ifa->ifa_flags & IFF_POINTOPOINT) && (ifa->ifa_flags & IFF_BROADCAST) + && (ifa->ifa_flags & IFF_RUNNING)) { + ifaddrinfo_ip_t addr; + + addr.ifa_family = AF_INET; + addr.ifa_name = ifa->ifa_name; + memcpy(addr.ifa_ip, &sa->sin_addr, sizeof(addr.ifa_ip)); + addr.ifa_flags = ifa->ifa_flags; + inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); + // iOS 14.5 return: + // 1. en2 169.254.x.x invalid + // 2. en0 192.168.x.x + // 169.254.0.0/16 - This is the "link local" block. As described in + // [RFC3927], it is allocated for communication between hosts on a + // single link. Hosts obtain these addresses by auto-configuration, + // such as when a DHCP server cannot be found. + if (strncmp(addr.ip, "169.254.", 8) == 0) { + continue; + } + _addrs.push_back(addr); + } + } + + for (ifa = ifap; ifa; ifa = ifa->ifa_next) { + if (ifa->ifa_addr == nullptr) { + continue; + } + if (ifa->ifa_addr->sa_family == AF_INET6 && !(ifa->ifa_flags & IFF_LOOPBACK) + && !(ifa->ifa_flags & IFF_POINTOPOINT) && (ifa->ifa_flags & IFF_BROADCAST) + && (ifa->ifa_flags & IFF_RUNNING)) { + sockaddr_in6* sa = (struct sockaddr_in6*)ifa->ifa_addr; + + if (NULL == sa) + continue; + + ifaddrinfo_ip_t addr; + + addr.ifa_family = AF_INET6; + addr.ifa_name = ifa->ifa_name; + memcpy(addr.ifa_ip, &sa->sin6_addr, sizeof(addr.ifa_ip)); + addr.ifa_flags = ifa->ifa_flags; + inet_ntop(sa->sin6_family, &(sa->sin6_addr), addr.ip, sizeof(addr.ip)); + // iOS 14.5 return: + // 1. en2 169.254.x.x invalid + // 2. en0 192.168.x.x + // fe80::/10 - This is the "link local" block. As described in + // [RFC3927], it is allocated for communication between hosts on a + // single link. Hosts obtain these addresses by auto-configuration, + // such as when a DHCP server cannot be found. + if (strncmp(addr.ip, "fe80::", 6) == 0) { + continue; + } _addrs.push_back(addr); } } @@ -136,26 +242,28 @@ bool getifaddrs_ipv4_lan(std::vector& _addrs) { } bool getifaddrs_ipv4_filter(std::vector& _addrs, unsigned int _flags_filter) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in* sa = (struct sockaddr_in*) ifa->ifa_addr; - - if (NULL == sa) continue; + sockaddr_in* sa = (struct sockaddr_in*)ifa->ifa_addr; - if (ifa->ifa_addr->sa_family == AF_INET - && 0 == (ifa->ifa_flags & IFF_LOOPBACK) - && (ifa->ifa_flags & IFF_RUNNING) - && _flags_filter == (_flags_filter & ifa->ifa_flags)) { + if (NULL == sa) + continue; + if (ifa->ifa_addr->sa_family == AF_INET && 0 == (ifa->ifa_flags & IFF_LOOPBACK) + && (ifa->ifa_flags & IFF_RUNNING) && _flags_filter == (_flags_filter & ifa->ifa_flags)) { ifaddrinfo_ip_t addr; addr.ifa_family = AF_INET; addr.ifa_name = ifa->ifa_name; addr.ifa_ip[0] = sa->sin_addr.s_addr; addr.ifa_flags = ifa->ifa_flags; - inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); + inet_ntop(sa->sin_family, &(sa->sin_addr), addr.ip, sizeof(addr.ip)); _addrs.push_back(addr); } @@ -166,26 +274,28 @@ bool getifaddrs_ipv4_filter(std::vector& _addrs, unsigned int _ } bool getifaddrs_ipv6_filter(std::vector& _addrs, unsigned int _flags_filter) { - struct ifaddrs* ifap, *ifa; + struct ifaddrs *ifap, *ifa; - getifaddrs(&ifap); + int rv = getifaddrs(&ifap); + if (rv != 0) { + xerror2(TSF "getifaddrs return:%_, errno:%_", rv, errno); + return false; + } for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - sockaddr_in6* sa = (struct sockaddr_in6*) ifa->ifa_addr; - - if (NULL == sa) continue; + sockaddr_in6* sa = (struct sockaddr_in6*)ifa->ifa_addr; - if (ifa->ifa_addr->sa_family == AF_INET6 - && 0 == (ifa->ifa_flags & IFF_LOOPBACK) - && (ifa->ifa_flags & IFF_RUNNING) - && _flags_filter == (_flags_filter & ifa->ifa_flags)) { + if (NULL == sa) + continue; + if (ifa->ifa_addr->sa_family == AF_INET6 && 0 == (ifa->ifa_flags & IFF_LOOPBACK) + && (ifa->ifa_flags & IFF_RUNNING) && _flags_filter == (_flags_filter & ifa->ifa_flags)) { ifaddrinfo_ip_t addr; addr.ifa_family = AF_INET6; addr.ifa_name = ifa->ifa_name; memcpy(addr.ifa_ip, &sa->sin6_addr, sizeof(addr.ifa_ip)); addr.ifa_flags = ifa->ifa_flags; - inet_ntop(sa->sin6_family, &(sa->sin6_addr), addr.ip, sizeof(addr.ip)); + inet_ntop(sa->sin6_family, &(sa->sin6_addr), addr.ip, sizeof(addr.ip)); _addrs.push_back(addr); } @@ -194,28 +304,87 @@ bool getifaddrs_ipv6_filter(std::vector& _addrs, unsigned int _ freeifaddrs(ifap); return !_addrs.empty(); } -#else -bool getifaddrs_ipv4(std::vector& _addrs){ - return false; +#else // #if (!UWP && !WIN32) +#ifdef WIN32 +#include +#include + +#include "../socket/unix_socket.h" +#pragma comment(lib, "wsock32.lib") +#endif // WIN32 + +bool getifaddrs_ipv4(std::vector& _addrs) { + return false; } bool getifaddrs_ipv4(ifaddrinfo_ipv4_t& _addr) { - return false; + return false; } bool getifaddrs_ipv4_lan(ifaddrinfo_ipv4_t& _addr) { - return false; + return false; } bool getifaddrs_ipv4_lan(std::vector& _addrs) { - return false; + ULONG outBufLen = 0; + GetAdaptersAddresses(AF_INET, 0, NULL, NULL, &outBufLen); + + PIP_ADAPTER_ADDRESSES pAddresses = (IP_ADAPTER_ADDRESSES*)malloc(outBufLen); + if (pAddresses == NULL) { + return false; + } + + if (GetAdaptersAddresses(AF_INET, GAA_FLAG_SKIP_ANYCAST, NULL, pAddresses, &outBufLen) != ERROR_SUCCESS) { + free(pAddresses); + return false; + } + + PIP_ADAPTER_ADDRESSES pCurrAddresses = NULL; + PIP_ADAPTER_UNICAST_ADDRESS pUnicast = NULL; + LPSOCKADDR addr = NULL; + pCurrAddresses = pAddresses; + + ifaddrinfo_ipv4_t addr_t; + while (pCurrAddresses) { + if (pCurrAddresses->OperStatus != IfOperStatusUp) { + pCurrAddresses = pCurrAddresses->Next; + continue; + } + pUnicast = pCurrAddresses->FirstUnicastAddress; + + while (pUnicast) { + addr = pUnicast->Address.lpSockaddr; + if (addr->sa_family == AF_INET && pCurrAddresses->IfType != MIB_IF_TYPE_LOOPBACK) { + sockaddr_in* sa_in = (sockaddr_in*)addr; + char* strIP = ::inet_ntoa((sa_in->sin_addr)); + addr_t.ifa_name = strIP; + addr_t.ifa_ip = sa_in->sin_addr.S_un.S_addr; + socket_inet_ntop(sa_in->sin_family, &(sa_in->sin_addr), addr_t.ip, sizeof(addr_t.ip)); + if (pCurrAddresses->IfType == IF_TYPE_IEEE80211) { + _addrs.insert(_addrs.begin(), addr_t); + } else { + _addrs.push_back(addr_t); + } + } + pUnicast = pUnicast->Next; + } + pCurrAddresses = pCurrAddresses->Next; + } + free(pAddresses); + return !_addrs.empty(); } bool getifaddrs_ipv4_filter(std::vector& _addrs, unsigned int _flags_filter) { - return false; + // TODO + return false; } bool getifaddrs_ipv6_filter(std::vector& _addrs, unsigned int _flags_filter) { - return false; + // TODO + return false; } -#endif +bool getifaddrs_ip_lan(std::vector& _addrs) { + // TODO + return false; +} +#endif // #if (!UWP && !WIN32) else diff --git a/mars/comm/network/getifaddrs.h b/mars/comm/network/getifaddrs.h index dd60de5a0..1996d8520 100644 --- a/mars/comm/network/getifaddrs.h +++ b/mars/comm/network/getifaddrs.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -20,38 +20,35 @@ #ifndef __comm__ifaddr__ #define __comm__ifaddr__ +#include + #include #include -struct ifaddrinfo_ipv4_t -{ - ifaddrinfo_ipv4_t() - { +struct ifaddrinfo_ipv4_t { + ifaddrinfo_ipv4_t() { ifa_ip = 0; memset(ip, 0, sizeof(ip)); } - - std::string ifa_name; - uint32_t ifa_ip; - char ip[16]; + + std::string ifa_name; + uint32_t ifa_ip; + char ip[16]; }; -struct ifaddrinfo_ip_t -{ - ifaddrinfo_ip_t() - { +struct ifaddrinfo_ip_t { + ifaddrinfo_ip_t() { ifa_family = 0; memset(ifa_ip, 0, sizeof(ifa_ip)); memset(ip, 0, sizeof(ip)); ifa_flags = 0; } - uint8_t ifa_family; - std::string ifa_name; - uint32_t ifa_ip[4]; - char ip[64]; + uint8_t ifa_family; + std::string ifa_name; + uint32_t ifa_ip[4]; + char ip[64]; unsigned int ifa_flags; - }; bool getifaddrs_ipv4(std::vector& _addrs); @@ -60,9 +57,10 @@ bool getifaddrs_ipv4(ifaddrinfo_ipv4_t& _addr); bool getifaddrs_ipv4_lan(ifaddrinfo_ipv4_t& _addr); bool getifaddrs_ipv4_lan(std::vector& _addrs); +bool getifaddrs_ip_lan(std::vector& _addrs); -#define IFF_BROADCAST_FILTER 0x2 -#define IFF_POINTOPOINT_FILTER 0x10 +#define IFF_BROADCAST_FILTER 0x2 +#define IFF_POINTOPOINT_FILTER 0x10 bool getifaddrs_ipv4_filter(std::vector& _addrs, unsigned int _flags_filter); bool getifaddrs_ipv6_filter(std::vector& _addrs, unsigned int _flags_filter); diff --git a/mars/comm/network/local_routetable.cc b/mars/comm/network/local_routetable.cc new file mode 100644 index 000000000..07a608245 --- /dev/null +++ b/mars/comm/network/local_routetable.cc @@ -0,0 +1,526 @@ +// +// routequery.cpp +// sdt +// +// Created by perryzhou on 23/05/2018. +// Copyright © 2018 Tencent. All rights reserved. +// + +#include "local_routetable.h" + +#include +#include +#include + +#include "comm/xlogger/xlogger.h" + +#if defined(__ANDROID__) +std::string get_local_route_table() { + const char* cmd = "ip route list table all"; + xinfo2(TSF "popen cmd=%_", cmd); + + std::string result; + FILE* pp = popen(cmd, "r"); + if (!pp) { + xerror2(TSF "popen error:%_", strerror(errno)); + return result; + } + + char line[1024]; + while (fgets(line, sizeof(line), pp) != NULL) { + result.append(line, strlen(line)); + } + pclose(pp); + + return result; +} +#elif defined(__APPLE__) + +// code modified from https://opensource.apple.com/source/network_cmds/network_cmds-457/netstat.tproj/route.c +// output like `netstat -nlr` + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* alignment constraint for routing socket */ +#define ROUNDUP(a) ((a) > 0 ? (1 + (((a)-1) | (sizeof(uint32_t) - 1))) : sizeof(uint32_t)) +#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) + +/* + * Definitions for showing gateway flags. + */ +struct bits { + uint32_t b_mask; + char b_val; +} bits[] = {{RTF_UP, 'U'}, {RTF_GATEWAY, 'G'}, + {RTF_HOST, 'H'}, {RTF_REJECT, 'R'}, + {RTF_DYNAMIC, 'D'}, {RTF_MODIFIED, 'M'}, + {RTF_MULTICAST, 'm'}, {RTF_DONE, 'd'}, /* Completed -- for routing messages only */ + {RTF_CLONING, 'C'}, {RTF_XRESOLVE, 'X'}, + {RTF_LLINFO, 'L'}, {RTF_STATIC, 'S'}, + {RTF_PROTO1, '1'}, {RTF_PROTO2, '2'}, + {RTF_WASCLONED, 'W'}, {RTF_PRCLONING, 'c'}, + {RTF_PROTO3, '3'}, {RTF_BLACKHOLE, 'B'}, + {RTF_BROADCAST, 'b'}, {RTF_IFSCOPE, 'I'}, + {RTF_IFREF, 'i'}, {RTF_PROXY, 'Y'}, + {RTF_ROUTER, 'r'}, {0}}; + +typedef union { + uint32_t dummy; /* Helps align structure. */ + struct sockaddr u_sa; + u_short u_data[128]; +} sa_u; + +static std::string np_rtentry __P((struct rt_msghdr2*)); +static std::string p_sockaddr __P((struct sockaddr*, struct sockaddr*, int, int)); +static std::string p_flags __P((int, const char*)); +static uint32_t forgemask __P((uint32_t)); +static void domask __P((char*, uint32_t, uint32_t)); + +static std::string p_flags(int f, const char* format) { + char line[256]; + char name[33], *flags; + struct bits* p = bits; + + for (flags = name; p->b_mask; p++) + if (p->b_mask & f) + *flags++ = p->b_val; + *flags = '\0'; + snprintf(line, sizeof(line), format, name); + return line; +} + +std::string routename(uint32_t in) { + char line[MAXHOSTNAMELEN]; +#define C(x) ((x)&0xff) + in = ntohl(in); + snprintf(line, sizeof(line), "%u.%u.%u.%u", C(in >> 24), C(in >> 16), C(in >> 8), C(in)); + return (line); +} + +static uint32_t forgemask(uint32_t a) { + uint32_t m; + + if (IN_CLASSA(a)) + m = IN_CLASSA_NET; + else if (IN_CLASSB(a)) + m = IN_CLASSB_NET; + else + m = IN_CLASSC_NET; + return (m); +} + +static void domask(char* dst, uint32_t addr, uint32_t mask) { + int b, i; + + if (!mask || (forgemask(addr) == mask)) { + *dst = '\0'; + return; + } + i = 0; + for (b = 0; b < 32; b++) + if (mask & (1 << b)) { + int bb; + + i = b; + for (bb = b + 1; bb < 32; bb++) + if (!(mask & (1 << bb))) { + i = -1; /* noncontig */ + break; + } + break; + } + if (i == -1) + snprintf(dst, sizeof(dst), "&0x%x", mask); + else + snprintf(dst, sizeof(dst), "/%d", 32 - i); +} + +/* + * Return the name of the network whose address is given. + * The address is assumed to be that of a net or subnet, not a host. + */ +std::string netname(uint32_t in, uint32_t mask) { + char line[MAXHOSTNAMELEN]; + uint32_t omask, dmask; + uint32_t i; + + i = ntohl(in); + dmask = forgemask(i); + omask = mask; + + switch (dmask) { + case IN_CLASSA_NET: + if ((i & IN_CLASSA_HOST) == 0) { + snprintf(line, sizeof(line), "%u", C(i >> 24)); + break; + } + /* FALLTHROUGH */ + case IN_CLASSB_NET: + if ((i & IN_CLASSB_HOST) == 0) { + snprintf(line, sizeof(line), "%u.%u", C(i >> 24), C(i >> 16)); + break; + } + /* FALLTHROUGH */ + case IN_CLASSC_NET: + if ((i & IN_CLASSC_HOST) == 0) { + snprintf(line, sizeof(line), "%u.%u.%u", C(i >> 24), C(i >> 16), C(i >> 8)); + break; + } + /* FALLTHROUGH */ + default: + snprintf(line, sizeof(line), "%u.%u.%u.%u", C(i >> 24), C(i >> 16), C(i >> 8), C(i)); + break; + } + domask(line + strlen(line), i, omask); + return (line); +} + +std::string netname6(struct sockaddr_in6* sa6, struct sockaddr* sam) { + char line[MAXHOSTNAMELEN]; + u_char* lim; + int masklen, illegal = 0, flag = NI_WITHSCOPEID; + struct in6_addr* mask = sam ? &((struct sockaddr_in6*)sam)->sin6_addr : 0; + + if (sam && sam->sa_len == 0) { + masklen = 0; + } else if (mask) { + u_char* p = (u_char*)mask; + for (masklen = 0, lim = p + 16; p < lim; p++) { + switch (*p) { + case 0xff: + masklen += 8; + break; + case 0xfe: + masklen += 7; + break; + case 0xfc: + masklen += 6; + break; + case 0xf8: + masklen += 5; + break; + case 0xf0: + masklen += 4; + break; + case 0xe0: + masklen += 3; + break; + case 0xc0: + masklen += 2; + break; + case 0x80: + masklen += 1; + break; + case 0x00: + break; + default: + illegal++; + break; + } + } + } else { + masklen = 128; + } + if (masklen == 0 && IN6_IS_ADDR_UNSPECIFIED(&sa6->sin6_addr)) + return ("default"); + + flag |= NI_NUMERICHOST; + getnameinfo((struct sockaddr*)sa6, sa6->sin6_len, line, sizeof(line), NULL, 0, flag); + + snprintf(&line[strlen(line)], sizeof(line) - strlen(line), "/%d", masklen); + + return line; +} + +std::string routename6(struct sockaddr_in6* sa6) { + char line[MAXHOSTNAMELEN]; + int flag = NI_WITHSCOPEID; + /* use local variable for safety */ + struct sockaddr_in6 sa6_local = { + sizeof(sa6_local), + AF_INET6, + }; + + sa6_local.sin6_addr = sa6->sin6_addr; + sa6_local.sin6_scope_id = sa6->sin6_scope_id; + + flag |= NI_NUMERICHOST; + + getnameinfo((struct sockaddr*)&sa6_local, sa6_local.sin6_len, line, sizeof(line), NULL, 0, flag); + + return line; +} + +void upHex(char* p0) { + char* p = p0; + + for (; *p; p++) + switch (*p) { + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + *p += ('A' - 'a'); + break; + } +} + +/* + * Print address family header before a section of the routing table. + */ +std::string pr_family(int af) { + char line[64]; + const char* afname; + switch (af) { + case AF_INET: + afname = "Internet"; + break; + case AF_INET6: + afname = "Internet6"; + break; + case AF_IPX: + afname = "IPX"; + break; + default: + afname = NULL; + break; + } + if (afname) + snprintf(line, sizeof(line), "\n%s:\n", afname); + else + snprintf(line, sizeof(line), "\nProtocol Family %d:\n", af); + + return line; +} + +/* column widths; each followed by one space */ +#define WID_DST(af) ((af) == AF_INET6 ? (true ? 39 : (true ? 39 : 18)) : 18) +#define WID_GW(af) ((af) == AF_INET6 ? (true ? 31 : (true ? 31 : 18)) : 18) +#define WID_IF(af) ((af) == AF_INET6 ? 8 : 7) + +/* + * Print header for routing table columns. + */ +std::string pr_rthdr(int af) { + char line[256]; + + snprintf(line, sizeof(line), "%-8.8s ", "Address"); + if (af == AF_INET) + snprintf(line, + sizeof(line), + "%-*.*s %-*.*s %-10.10s %6.6s %8.8s %6.6s %*.*s %6s\n", + WID_DST(af), + WID_DST(af), + "Destination", + WID_GW(af), + WID_GW(af), + "Gateway", + "Flags", + "Refs", + "Use", + "Mtu", + WID_IF(af), + WID_IF(af), + "Netif", + "Expire"); + return line; +} + +/* + * Print routing tables. + */ +std::string get_local_route_table() { + std::string result; + + size_t needed = 0; + int mib[6] = {0}; + mib[0] = CTL_NET; + mib[1] = PF_ROUTE; + mib[2] = 0; + mib[3] = 0; + mib[4] = NET_RT_DUMP2; + mib[5] = 0; + if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { + result = "fail: sysctl: net.route.0.0.dump estimate"; + return result; + } + + char* buf = nullptr; + if ((buf = (char*)malloc(needed)) == 0) { + result = "fail: malloc fail"; + return result; + } + if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + result = "fail: sysctl: net.route.0.0.dump"; + free(buf); + return result; + } + + const char* lim = buf + needed; + const char* next = buf; + while (next < lim) { + struct rt_msghdr2* rtm = (struct rt_msghdr2*)next; + result += np_rtentry(rtm); + next += rtm->rtm_msglen; + } + free(buf); + return result; +} + +static void get_rtaddrs(int addrs, struct sockaddr* sa, struct sockaddr** rti_info) { + int i; + + for (i = 0; i < RTAX_MAX; i++) { + if (addrs & (1 << i)) { + rti_info[i] = sa; + sa = (struct sockaddr*)(ROUNDUP(sa->sa_len) + (char*)sa); + } else { + rti_info[i] = NULL; + } + } +} + +static std::string np_rtentry(struct rt_msghdr2* rtm) { + std::string result; + char line[256] = {0}; + + struct sockaddr* sa = (struct sockaddr*)(rtm + 1); + struct sockaddr* rti_info[RTAX_MAX]; + static int old_fam; + int fam = 0; + u_short lastindex = 0xffff; + static char ifname[IFNAMSIZ + 1]; + sa_u addr, mask; + + /* + * Don't print protocol-cloned routes unless -a. + */ + if ((rtm->rtm_flags & RTF_WASCLONED) && (rtm->rtm_parentflags & RTF_PRCLONING)) { + return ""; + } + + fam = sa->sa_family; + if (fam != old_fam) { + result += pr_family(fam); + result += pr_rthdr(fam); + old_fam = fam; + } + get_rtaddrs(rtm->rtm_addrs, sa, rti_info); + bzero(&addr, sizeof(addr)); + if ((rtm->rtm_addrs & RTA_DST)) + bcopy(rti_info[RTAX_DST], &addr, rti_info[RTAX_DST]->sa_len); + bzero(&mask, sizeof(mask)); + if ((rtm->rtm_addrs & RTA_NETMASK)) + bcopy(rti_info[RTAX_NETMASK], &mask, rti_info[RTAX_NETMASK]->sa_len); + result += p_sockaddr(&addr.u_sa, &mask.u_sa, rtm->rtm_flags, WID_DST(addr.u_sa.sa_family)); + + result += p_sockaddr(rti_info[RTAX_GATEWAY], NULL, RTF_HOST, WID_GW(addr.u_sa.sa_family)); + + result += p_flags(rtm->rtm_flags, "%-10.10s "); + + if (addr.u_sa.sa_family == AF_INET) { + snprintf(line, sizeof(line), "%6u %8u ", rtm->rtm_refcnt, (unsigned int)rtm->rtm_use); + result += line; + if (rtm->rtm_rmx.rmx_mtu != 0) { + snprintf(line, sizeof(line), "%6u ", rtm->rtm_rmx.rmx_mtu); + result += line; + } + } + if (rtm->rtm_index != lastindex) { + if_indextoname(rtm->rtm_index, ifname); + lastindex = rtm->rtm_index; + } + snprintf(line, sizeof(line), "%*.*s", WID_IF(addr.u_sa.sa_family), WID_IF(addr.u_sa.sa_family), ifname); + result += line; + + if (rtm->rtm_rmx.rmx_expire) { + time_t expire_time; + + if ((expire_time = rtm->rtm_rmx.rmx_expire - time((time_t*)0)) > 0) { + snprintf(line, sizeof(line), " %6d", (int)expire_time); + result += line; + } + } + result += "\n"; + + return result; +} + +std::string p_sockaddr(struct sockaddr* sa, struct sockaddr* mask, int flags, int width) { + std::string result; + + switch (sa->sa_family) { + case AF_INET: { + struct sockaddr_in* sin = (struct sockaddr_in*)sa; + + if ((sin->sin_addr.s_addr == INADDR_ANY) && mask + && (ntohl(((struct sockaddr_in*)mask)->sin_addr.s_addr) == 0L || mask->sa_len == 0)) + result = "default"; + else if (flags & RTF_HOST) + result = routename(sin->sin_addr.s_addr); + else if (mask) + result = netname(sin->sin_addr.s_addr, ntohl(((struct sockaddr_in*)mask)->sin_addr.s_addr)); + else + result = netname(sin->sin_addr.s_addr, 0L); + break; + } + + case AF_INET6: { + struct sockaddr_in6* sa6 = (struct sockaddr_in6*)sa; + struct in6_addr* in6 = &sa6->sin6_addr; + + /* + * XXX: This is a special workaround for KAME kernels. + * sin6_scope_id field of SA should be set in the future. + */ + if (IN6_IS_ADDR_LINKLOCAL(in6) || IN6_IS_ADDR_MC_NODELOCAL(in6) || IN6_IS_ADDR_MC_LINKLOCAL(in6)) { + /* XXX: override is ok? */ + sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short*)&in6->s6_addr[2]); + *(u_short*)&in6->s6_addr[2] = 0; + } + + if (flags & RTF_HOST) + result = routename6(sa6); + else if (mask) + result = netname6(sa6, mask); + else + result = netname6(sa6, NULL); + break; + } + } + + char line[256] = {0}; + if (width < 0) { + snprintf(line, sizeof(line), "%s ", result.c_str()); + } else { + snprintf(line, sizeof(line), "%-*s ", width, result.c_str()); + } + + return line; +} + +#else +std::string get_local_route_table() { + return "*** NOT IMPL ***"; +} +#endif diff --git a/mars/comm/network/local_routetable.h b/mars/comm/network/local_routetable.h new file mode 100644 index 000000000..f2968957f --- /dev/null +++ b/mars/comm/network/local_routetable.h @@ -0,0 +1,15 @@ +// +// routequery.hpp +// sdt +// +// Created by perryzhou on 23/05/2018. +// Copyright © 2018 Tencent. All rights reserved. +// + +#ifndef routequery_hpp +#define routequery_hpp +#include + +std::string get_local_route_table(); + +#endif /* routequery_hpp */ diff --git a/mars/comm/network/netinfo_util.cc b/mars/comm/network/netinfo_util.cc index 77c54aa4c..960f9d374 100644 --- a/mars/comm/network/netinfo_util.cc +++ b/mars/comm/network/netinfo_util.cc @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -16,102 +16,201 @@ * Created on: Dec 19, 2016 * Author: wutianqiang */ +#include "netinfo_util.h" + #include -#include "comm/xlogger/xlogger.h" -#include "comm/socket/local_ipstack.h" -#include "comm/platform_comm.h" -#include "comm/network/getgateway.h" #include "comm/network/getdnssvraddrs.h" +#include "comm/network/getgateway.h" #include "comm/network/getifaddrs.h" -#include "comm/socket/unix_socket.h" +#include "comm/network/local_routetable.h" +#include "comm/platform_comm.h" +#include "comm/socket/local_ipstack.h" #include "comm/socket/socket_address.h" +#include "comm/socket/unix_socket.h" +#include "comm/xlogger/xlogger.h" +#include "mars/comm/network/getaddrinfo_with_timeout.h" + +using namespace mars::comm; + +NetworkType GetNetworkType() { + NetworkType network_type = kNetworkTypeUnknown; + int netinfo = getNetInfo(); + + if (kWifi == netinfo) { + network_type = kNetworkTypeWiFi; + } else if (kMobile == netinfo) { + RadioAccessNetworkInfo ran; + getCurRadioAccessNetworkInfo(ran); + + if (ran.Is2G()) + network_type = kNetworkType2G; + else if (ran.Is3G()) + network_type = kNetworkType3G; + else if (ran.Is4G()) + network_type = kNetworkType4G; + } else if (kNoNet == netinfo) { + network_type = kNetworkTypeNoNet; + } + return network_type; +} + +std::string GetDetailNetInfo(bool _need_wifi_ssid) { + XMessage detail_net_info; + // 1.网络信息 + switch (::getNetInfo()) { + case kNoNet: + detail_net_info << "current network:no network, ipstack:" << TLocalIPStackStr[local_ipstack_detect()] + << "\n"; + break; + + case kWifi: { + if (_need_wifi_ssid) { + WifiInfo info; + getCurWifiInfo(info); + detail_net_info << "current network:wifi, ssid:" << info.ssid + << ",ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; + } else { + detail_net_info << "current network:wifi, no ssid, ipstack:" << TLocalIPStackStr[local_ipstack_detect()] + << "\n"; + } + } break; + + case kMobile: { + SIMInfo info; + getCurSIMInfo(info); + RadioAccessNetworkInfo raninfo; + getCurRadioAccessNetworkInfo(raninfo); + detail_net_info << "current network:mobile, ispname:" << info.isp_name << ", info.isp_code" + << info.isp_code; + detail_net_info << ", ran:" << raninfo.radio_access_network + << ",ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; + } break; + + case kOtherNet: + detail_net_info << "current network:other, ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; + break; + + default: + xassert2(false); + break; + } + + detail_net_info << "--------NetConfig Info----------" + << "\n"; + // 2.网络配置信息(默认网关、dns svr、路由表) + in6_addr addr6_gateway; + memset(&addr6_gateway, 0, sizeof(addr6_gateway)); + + if (0 == getdefaultgateway6(&addr6_gateway)) { + detail_net_info << "getdefaultgateway6:" << socket_address(addr6_gateway).ipv6() << "\n"; + } else { + detail_net_info << "getdefaultgateway6:" + << "failed. "; + } + in_addr addr_gateway; + memset(&addr_gateway, 0, sizeof(addr_gateway)); + if (0 == getdefaultgateway(&addr_gateway)) { + detail_net_info << "getdefaultgateway:" << socket_address(addr_gateway).ip() << "\n"; + } else { + detail_net_info << "getdefaultgateway:" + << "failed. "; + } + + std::vector dnssvraddrs; + mars::comm::getdnssvraddrs(dnssvraddrs); + if (!dnssvraddrs.empty()) { + for (size_t i = 0; i < dnssvraddrs.size(); ++i) { + if (AF_INET == dnssvraddrs[i].address().sa_family) { + detail_net_info << "dns server" << i << ":AF_INET, " << dnssvraddrs[i].ip() << "\n"; + } + if (AF_INET6 == dnssvraddrs[i].address().sa_family) { + detail_net_info << "dns server" << i << ":AF_INET6, " << dnssvraddrs[i].ipv6() << "\n"; + } + } + } else { + detail_net_info << "dns server: empty." + << "\n"; + } + +#ifndef WIN32 + //路由表信息 + detail_net_info << "----------route table----------\n"; + detail_net_info << get_local_route_table(); +#endif + + // 3.网卡信息 + detail_net_info << "----------NIC Info-----------" + << "\n"; + std::vector v4_addrs; + if (getifaddrs_ipv4_filter(v4_addrs, 0)) { + for (size_t i = 0; i < v4_addrs.size(); ++i) { + detail_net_info << "interface name:" << v4_addrs[i].ifa_name << ", " + << (v4_addrs[i].ifa_family == AF_INET ? "AF_INET" : "XX_INET") << ", ip:" << v4_addrs[i].ip + << "\n"; + } + } else { + detail_net_info << "getifaddrs_ipv4_filter:false" + << "\n"; + } + std::vector v6_addrs; + if (getifaddrs_ipv6_filter(v6_addrs, 0)) { + for (size_t i = 0; i < v6_addrs.size(); ++i) { + detail_net_info << "interface name:" << v6_addrs[i].ifa_name << ", " + << (v6_addrs[i].ifa_family == AF_INET6 ? "AF_INET6" : "XX_INET") + << ", ip:" << v6_addrs[i].ip << "\n"; + } + } else { + detail_net_info << "getifaddrs_ipv6_filter:false" + << "\n"; + } + return detail_net_info.Message(); +} + +int get_local_ip(std::vector& ips) { + // 获取主机名 + char hostname[256]; + if (gethostname(hostname, sizeof(hostname)) == -1) { + xerror2(TSF "gethostname failed"); + return -1; + } + struct addrinfo hints, *single, *res; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; // 允许IPv4和IPv6 + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + + bool is_timeout = false; + if (getaddrinfo_with_timeout(hostname, NULL, &hints, &res, is_timeout, 2000) != 0) { + xerror2(TSF "getaddrinfo failed"); + return -1; + } + + for (single = res; single; single = single->ai_next) { + // In Indonesia, if there is no ipv6's ip, operators return 0.0.0.0. + if (PF_INET == single->ai_family) { + sockaddr_in* addr_in = (sockaddr_in*)single->ai_addr; + // struct in_addr convertAddr; + /*need no filter + if (INADDR_ANY == addr_in->sin_addr.s_addr || INADDR_NONE == addr_in->sin_addr.s_addr) { + xwarn2(TSF "hehe, addr_in->sin_addr.s_addr:%0", addr_in->sin_addr.s_addr); + continue; + }*/ + } + + socket_address sock_addr(single->ai_addr); + const char* ip = sock_addr.ip(); + + /*need no filter + if (!socket_address(ip, 0).valid_server_address(false, true)) { + xerror2(TSF "ip is invalid, ip:%0", ip); + continue; + } + */ + + ips.push_back(ip); + } -std::string GetDetailNetInfo() { - XMessage detail_net_info; - //1.网络信息 - switch (::getNetInfo()) { - case kNoNet: - detail_net_info << "current network:no network, ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; - break; - - case kWifi: { - WifiInfo info; - getCurWifiInfo(info); - detail_net_info << "current network:wifi, ssid:" << info.ssid << ",ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; - } - break; - - case kMobile: { - SIMInfo info; - getCurSIMInfo(info); - RadioAccessNetworkInfo raninfo; - getCurRadioAccessNetworkInfo(raninfo); - detail_net_info << "current network:mobile, ispname:" << info.isp_name << ", info.isp_code" << info.isp_code; - detail_net_info << ", ran:" << raninfo.radio_access_network << ",ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; - } - break; - - case kOtherNet: - detail_net_info << "current network:other, ipstack:" << TLocalIPStackStr[local_ipstack_detect()] << "\n"; - break; - - default: - xassert2(false); - break; - } - detail_net_info << "--------NetConfig Info----------"<< "\n"; - //2.网络配置信息(默认网关、dns svr、路由表) - in6_addr addr6_gateway; - memset(&addr6_gateway, 0, sizeof(addr6_gateway)); - if (0 == getdefaultgateway6(&addr6_gateway)) { - detail_net_info << "getdefaultgateway6:" << socket_address(addr6_gateway).ipv6() << "\n"; - } else { - detail_net_info << "getdefaultgateway6:" << "failed. "; - } - in_addr addr_gateway; - memset(&addr_gateway, 0, sizeof(addr_gateway)); - if (0 == getdefaultgateway(&addr_gateway)) { - detail_net_info << "getdefaultgateway:" << socket_address(addr_gateway).ip() << "\n"; - } else { - detail_net_info << "getdefaultgateway:" << "failed. "; - } - - std::vector dnssvraddrs; - getdnssvraddrs(dnssvraddrs); - if (!dnssvraddrs.empty()) { - for (size_t i = 0; i < dnssvraddrs.size(); ++i) { - if (AF_INET == dnssvraddrs[i].address().sa_family) { - detail_net_info << "dns server" << i << ":AF_INET, " << dnssvraddrs[i].ip() << "\n"; - } - if (AF_INET6 == dnssvraddrs[i].address().sa_family) { - detail_net_info << "dns server" << i << ":AF_INET6, " << dnssvraddrs[i].ipv6() << "\n"; - } - } - } else { - detail_net_info << "dns server: empty." << "\n"; - } - //TODO 路由表信息 - - //3.网卡信息 - detail_net_info << "----------NIC Info-----------" << "\n"; - std::vector v4_addrs; - if (getifaddrs_ipv4_filter(v4_addrs, 0)) { - for (size_t i = 0; i < v4_addrs.size(); ++i) { - detail_net_info << "interface name:"< v6_addrs; - if (getifaddrs_ipv6_filter(v6_addrs, 0)) { - for (size_t i = 0; i < v6_addrs.size(); ++i) { - detail_net_info << "interface name:"< -std::string GetDetailNetInfo(); +#include +typedef enum { + kNetworkTypeUnknown, + kNetworkTypeNoNet, + kNetworkTypeWiFi, + kNetworkType2G, + kNetworkType3G, + kNetworkType4G, +} NetworkType; +NetworkType GetNetworkType(); +std::string GetDetailNetInfo(bool _need_wifi_ssid = true); +int get_local_ip(std::vector& ips); #endif /* SRC_NETINFO_UTIL_H_ */ diff --git a/mars/comm/objc/Reachability.h b/mars/comm/objc/Reachability.h index 1b0f4f046..648ad46ff 100644 --- a/mars/comm/objc/Reachability.h +++ b/mars/comm/objc/Reachability.h @@ -1,16 +1,16 @@ /* - + File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. - + Version: 2.2 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to @@ -26,13 +26,13 @@ including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -40,21 +40,17 @@ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + Copyright (C) 2010 Apple Inc. All Rights Reserved. - + */ #import -typedef enum { - NotReachable = 0, - ReachableViaWiFi, - ReachableViaWWAN -} MarsNetworkStatus; +typedef enum { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN } MarsNetworkStatus; #if TARGET_OS_WATCH -//nothing +// nothing #else #import @@ -62,32 +58,31 @@ typedef enum { #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" -@interface MarsReachability: NSObject -{ +@interface MarsReachability : NSObject { BOOL localWiFiRef; SCNetworkReachabilityRef reachabilityRef; } -// reachabilityWithHostName- Use to check the reachability of a particular host name. -+ (MarsReachability*) reachabilityWithHostName: (NSString*) hostName; +// reachabilityWithHostName- Use to check the reachability of a particular host name. ++ (MarsReachability*)reachabilityWithHostName:(NSString*)hostName; -// reachabilityWithAddress- Use to check the reachability of a particular IP address. -+ (MarsReachability*) reachabilityWithAddress: (const struct sockaddr*) hostAddress; +// reachabilityWithAddress- Use to check the reachability of a particular IP address. ++ (MarsReachability*)reachabilityWithAddress:(const struct sockaddr*)hostAddress; -// reachabilityForInternetConnection- checks whether the default route is available. +// reachabilityForInternetConnection- checks whether the default route is available. // Should be used by applications that do not connect to a particular host -+ (MarsReachability*) reachabilityForInternetConnection; ++ (MarsReachability*)reachabilityForInternetConnection; // reachabilityForLocalWiFi- checks whether a local wifi connection is available. -+ (MarsReachability*) reachabilityForLocalWiFi; ++ (MarsReachability*)reachabilityForLocalWiFi; -+ (MarsNetworkStatus) getCacheReachabilityStatus:(BOOL) flash; ++ (MarsNetworkStatus)getCacheReachabilityStatus:(BOOL)flash; // Start listening for reachability notifications on the current run loop -- (BOOL) MarsstartNotifier; -- (void) MarsstopNotifier; +- (BOOL)MarsstartNotifier; +- (void)MarsstopNotifier; -- (MarsNetworkStatus) currentReachabilityStatus; +- (MarsNetworkStatus)currentReachabilityStatus; // WWAN may be available, but not active until a connection has been established. // WiFi may require a connection for VPN on Demand. @@ -95,4 +90,3 @@ typedef enum { @end #endif - diff --git a/mars/comm/objc/Reachability.mm b/mars/comm/objc/Reachability.mm index 8e4ff4579..e974026ac 100644 --- a/mars/comm/objc/Reachability.mm +++ b/mars/comm/objc/Reachability.mm @@ -1,16 +1,16 @@ /* - + File: Reachability.m Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. - + Version: 2.2 - + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - + In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to @@ -26,13 +26,13 @@ including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -40,120 +40,114 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - + Copyright (C) 2010 Apple Inc. All Rights Reserved. - + */ -#import -#import -#import #import #import #import +#import +#import +#import #import #import "comm/objc/Reachability.h" - #if TARGET_OS_WATCH -//nothing +// nothing #else #define kShouldPrintReachabilityFlags 0 -static MarsReachability* gs_MarsnetReach = [[MarsReachability reachabilityForInternetConnection] retain]; +static MarsReachability* gs_MarsnetReach = + [[MarsReachability reachabilityForInternetConnection] retain]; static BOOL gs_Marsstartnotify = [gs_MarsnetReach MarsstartNotifier]; static MarsNetworkStatus gs_Marsstatus = [gs_MarsnetReach currentReachabilityStatus]; -static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) -{ +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) { #if kShouldPrintReachabilityFlags -#if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', #else NSLog(@"Reachability Flag Status: %c %c%c%c%c%c%c%c %s\n", #endif - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', - comment - ); + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', comment); #endif } - + @implementation MarsReachability -static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) -{ - #pragma unused (target, flags) +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, + void* info) { +#pragma unused(target, flags) NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); - NSCAssert([(NSObject*) info isKindOfClass: [MarsReachability class]], @"info was wrong class in ReachabilityCallback"); + NSCAssert([(NSObject*)info isKindOfClass:[MarsReachability class]], + @"info was wrong class in ReachabilityCallback"); - //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively + // We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively // in case someon uses the Reachablity object in a different thread. NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; - - MarsReachability* noteObject = (MarsReachability*) info; + + MarsReachability* noteObject = (MarsReachability*)info; gs_Marsstatus = [noteObject currentReachabilityStatus]; - + // Post a notification to notify the client that the network reachability changed. - [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; - + [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification + object:noteObject]; + [myPool release]; } - -- (BOOL) MarsstartNotifier -{ +- (BOOL)MarsstartNotifier { BOOL retVal = NO; - SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; - if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) - { - //use CFRunLoopGetMain instead of CFRunLoopGetCurrent, because threads created by pthread do not have runloop - if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetMain(), kCFRunLoopDefaultMode)) - { + SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; + if (SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) { + // use CFRunLoopGetMain instead of CFRunLoopGetCurrent, because threads created by pthread + // do not have runloop + if (SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetMain(), + kCFRunLoopDefaultMode)) { retVal = YES; } } return retVal; } -- (void) MarsstopNotifier -{ - if(reachabilityRef!= NULL) - { - //use CFRunLoopGetMain instead of CFRunLoopGetCurrent, because threads created by pthread do not have runloop - SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetMain(), kCFRunLoopDefaultMode); +- (void)MarsstopNotifier { + if (reachabilityRef != NULL) { + // use CFRunLoopGetMain instead of CFRunLoopGetCurrent, because threads created by pthread + // do not have runloop + SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetMain(), + kCFRunLoopDefaultMode); } } -- (void) dealloc -{ +- (void)dealloc { [self MarsstopNotifier]; - if(reachabilityRef!= NULL) - { + if (reachabilityRef != NULL) { CFRelease(reachabilityRef); } [super dealloc]; } -+ (MarsReachability*) reachabilityWithHostName: (NSString*) hostName; ++ (MarsReachability*)reachabilityWithHostName:(NSString*)hostName; { MarsReachability* retVal = NULL; - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); - if(reachability!= NULL) - { - retVal= [[[self alloc] init] autorelease]; - if(retVal!= NULL) - { + SCNetworkReachabilityRef reachability = + SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if (reachability != NULL) { + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) { retVal->reachabilityRef = reachability; retVal->localWiFiRef = NO; } @@ -161,15 +155,14 @@ + (MarsReachability*) reachabilityWithHostName: (NSString*) hostName; return retVal; } -+ (MarsReachability*) reachabilityWithAddress: (const struct sockaddr*) hostAddress; ++ (MarsReachability*)reachabilityWithAddress:(const struct sockaddr*)hostAddress; { - SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress( + kCFAllocatorDefault, (const struct sockaddr*)hostAddress); MarsReachability* retVal = NULL; - if(reachability!= NULL) - { - retVal= [[[self alloc] init] autorelease]; - if(retVal!= NULL) - { + if (reachability != NULL) { + retVal = [[[self alloc] init] autorelease]; + if (retVal != NULL) { retVal->reachabilityRef = reachability; retVal->localWiFiRef = NO; } @@ -177,25 +170,26 @@ + (MarsReachability*) reachabilityWithAddress: (const struct sockaddr*) hostAddr return retVal; } -+ (MarsReachability*) reachabilityForInternetConnection; ++ (MarsReachability*)reachabilityForInternetConnection; { struct sockaddr_in zeroAddress; bzero(&zeroAddress, sizeof(zeroAddress)); zeroAddress.sin_len = sizeof(zeroAddress); zeroAddress.sin_family = AF_INET; - - MarsReachability* netReach = [self reachabilityWithAddress: (const struct sockaddr*)&zeroAddress]; + + MarsReachability* netReach = + [self reachabilityWithAddress:(const struct sockaddr*)&zeroAddress]; if (NotReachable != [netReach currentReachabilityStatus]) return netReach; - + struct sockaddr_in6 zeroAddress6; bzero(&zeroAddress6, sizeof(zeroAddress6)); zeroAddress6.sin6_len = sizeof(zeroAddress6); zeroAddress6.sin6_family = AF_INET6; - - return [self reachabilityWithAddress: (const struct sockaddr*)&zeroAddress6]; + + return [self reachabilityWithAddress:(const struct sockaddr*)&zeroAddress6]; } -+ (MarsReachability*) reachabilityForLocalWiFi; ++ (MarsReachability*)reachabilityForLocalWiFi; { struct sockaddr_in localWifiAddress; bzero(&localWifiAddress, sizeof(localWifiAddress)); @@ -203,69 +197,60 @@ + (MarsReachability*) reachabilityForLocalWiFi; localWifiAddress.sin_family = AF_INET; // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); - MarsReachability* retVal = [self reachabilityWithAddress: (const struct sockaddr*)&localWifiAddress]; - if(retVal!= NULL) - { + MarsReachability* retVal = + [self reachabilityWithAddress:(const struct sockaddr*)&localWifiAddress]; + if (retVal != NULL) { retVal->localWiFiRef = YES; } return retVal; } - -+ (MarsNetworkStatus) getCacheReachabilityStatus:(BOOL) flash -{ - if(!flash) return gs_Marsstatus; + ++ (MarsNetworkStatus)getCacheReachabilityStatus:(BOOL)flash { + if (!flash) return gs_Marsstatus; gs_Marsstatus = [[self reachabilityForInternetConnection] currentReachabilityStatus]; return gs_Marsstatus; } #pragma mark Network Flag Handling -- (MarsNetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags -{ +- (MarsNetworkStatus)localWiFiStatusForFlags:(SCNetworkReachabilityFlags)flags { PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); MarsNetworkStatus retVal = NotReachable; - if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) - { - retVal = ReachableViaWiFi; + if ((flags & kSCNetworkReachabilityFlagsReachable) && + (flags & kSCNetworkReachabilityFlagsIsDirect)) { + retVal = ReachableViaWiFi; } return retVal; } -- (MarsNetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags -{ +- (MarsNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags { PrintReachabilityFlags(flags, "networkStatusForFlags"); - if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) - { + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) { // if target host is not reachable return NotReachable; } MarsNetworkStatus retVal = NotReachable; - - if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) - { + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) { // if target host is reachable and no connection is required // then we'll assume (for now) that your on Wi-Fi retVal = ReachableViaWiFi; } - - - if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) - { - // ... and the connection is on-demand (or on-traffic) if the - // calling application is using the CFSocketStream or higher APIs - - if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) - { - // ... and no [user] intervention is needed - retVal = ReachableViaWiFi; - } + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) { + // ... and the connection is on-demand (or on-traffic) if the + // calling application is using the CFSocketStream or higher APIs + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) { + // ... and no [user] intervention is needed + retVal = ReachableViaWiFi; } + } #if TARGET_OS_IPHONE - if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) - { + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) { // ... but WWAN connections are OK if the calling application // is using the CFNetwork (CFSocketStream?) APIs. retVal = ReachableViaWWAN; @@ -274,31 +259,25 @@ - (MarsNetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags return retVal; } -- (BOOL) connectionRequired; +- (BOOL)connectionRequired; { NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { return (flags & kSCNetworkReachabilityFlagsConnectionRequired); } return NO; } -- (MarsNetworkStatus) currentReachabilityStatus -{ +- (MarsNetworkStatus)currentReachabilityStatus { NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); MarsNetworkStatus retVal = NotReachable; SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) - { - if(localWiFiRef) - { - retVal = [self localWiFiStatusForFlags: flags]; - } - else - { - retVal = [self networkStatusForFlags: flags]; + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) { + if (localWiFiRef) { + retVal = [self localWiFiStatusForFlags:flags]; + } else { + retVal = [self networkStatusForFlags:flags]; } } return retVal; @@ -306,8 +285,5 @@ - (MarsNetworkStatus) currentReachabilityStatus @end #endif - -void comm_export_symbols_2(){} - - - + +void comm_export_symbols_2() {} diff --git a/mars/comm/objc/ThreadOperationQueue.h b/mars/comm/objc/ThreadOperationQueue.h index 5160d25ec..1b9162235 100644 --- a/mars/comm/objc/ThreadOperationQueue.h +++ b/mars/comm/objc/ThreadOperationQueue.h @@ -1,14 +1,14 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // // ThreadOperationQueue.h @@ -22,15 +22,13 @@ #import -@interface ThreadQueue : NSObject -{} +@interface ThreadQueue : NSObject { +} -+(BOOL) RunWithTarget:(id)target selector:(SEL)sel object:(id)arg; ++ (BOOL)RunWithTarget:(id)target selector:(SEL)sel object:(id)arg; @end - extern "C" BOOL RunWithTarget(void (*_funp)(void*), void* _arg); extern "C" BOOL RunWithTargetNoParam(void (*_fun)()); - #endif /* defined(__MicroMessenger__ThreadOperationQueue__) */ diff --git a/mars/comm/objc/ThreadOperationQueue.mm b/mars/comm/objc/ThreadOperationQueue.mm index 4ed636014..4ffd256e7 100644 --- a/mars/comm/objc/ThreadOperationQueue.mm +++ b/mars/comm/objc/ThreadOperationQueue.mm @@ -1,3 +1,15 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. + // // ThreadOperationQueue.mm // MicroMessenger @@ -9,35 +21,30 @@ #import "comm/objc/scope_autoreleasepool.h" -static class __ThreadRunOnStart -{ -public: - __ThreadRunOnStart() - { +static class __ThreadRunOnStart { + public: + __ThreadRunOnStart() { m_operationQueue = [[NSOperationQueue alloc] init]; assert(m_operationQueue); } - ~__ThreadRunOnStart() - { + ~__ThreadRunOnStart() { [m_operationQueue release]; m_operationQueue = nil; } - + NSOperationQueue* m_operationQueue; } gs_threadrunonstart; -@interface __CThreadWarp : NSObject -{ +@interface __CThreadWarp : NSObject { void (*m_funp)(void*); void* m_arg; void (*m_fun)(); - } --(void) Run; -@property (nonatomic, assign) void (*m_funp)(void*); -@property (nonatomic, assign) void (*m_fun)(); -@property (nonatomic, assign) void* m_arg; +- (void)Run; +@property(nonatomic, assign) void (*m_funp)(void*); +@property(nonatomic, assign) void (*m_fun)(); +@property(nonatomic, assign) void* m_arg; @end @implementation __CThreadWarp @@ -46,41 +53,36 @@ @implementation __CThreadWarp @synthesize m_fun; @synthesize m_arg; --(id) init -{ +- (id)init { if (self = [super init]) { m_funp = nil; m_arg = nil; m_fun = nil; } - + return self; } --(void) Run -{ +- (void)Run { SCOPE_POOL(); - assert(nil!=m_funp || nil!=m_fun); - if (nil!=m_funp) + assert(nil != m_funp || nil != m_fun); + if (nil != m_funp) m_funp(m_arg); else m_fun(); - } @end - -@interface __ThreadWarp : NSObject -{ +@interface __ThreadWarp : NSObject { id m_target; SEL m_sel; id m_arg; } --(void) Run; -@property (nonatomic, retain) id m_target; -@property (nonatomic, assign) SEL m_sel; -@property (nonatomic, retain) id m_arg; +- (void)Run; +@property(nonatomic, retain) id m_target; +@property(nonatomic, assign) SEL m_sel; +@property(nonatomic, retain) id m_arg; @end @implementation __ThreadWarp @@ -89,14 +91,13 @@ @implementation __ThreadWarp @synthesize m_sel; @synthesize m_arg; --(id) init -{ +- (id)init { if (self = [super init]) { m_target = nil; m_sel = 0; m_arg = nil; } - + return self; } @@ -106,8 +107,7 @@ - (void)dealloc { [super dealloc]; } --(void) Run -{ +- (void)Run { SCOPE_POOL(); [m_target performSelector:m_sel withObject:m_arg]; } @@ -115,22 +115,21 @@ -(void) Run @implementation ThreadQueue -+(BOOL) RunWithTarget:(id)target selector:(SEL)sel object:(id)arg -{ ++ (BOOL)RunWithTarget:(id)target selector:(SEL)sel object:(id)arg { SCOPE_POOL(); __ThreadWarp* warp = [[__ThreadWarp alloc] init]; - warp.m_target= target; - warp.m_sel= sel; + warp.m_target = target; + warp.m_sel = sel; warp.m_arg = arg; - - NSInvocationOperation* invocation = [[NSInvocationOperation alloc] - initWithTarget:warp selector:@selector(Run) object:nil]; - if (nil==invocation) - { + + NSInvocationOperation* invocation = [[NSInvocationOperation alloc] initWithTarget:warp + selector:@selector(Run) + object:nil]; + if (nil == invocation) { [warp release]; return NO; } - + [gs_threadrunonstart.m_operationQueue addOperation:invocation]; [invocation release]; [warp release]; @@ -139,45 +138,43 @@ +(BOOL) RunWithTarget:(id)target selector:(SEL)sel object:(id)arg @end -extern "C" BOOL RunWithTarget(void (*_funp)(void*), void* _arg) -{ +extern "C" BOOL RunWithTarget(void (*_funp)(void*), void* _arg) { SCOPE_POOL(); __CThreadWarp* warp = [[__CThreadWarp alloc] init]; warp.m_funp = _funp; warp.m_arg = _arg; - - NSInvocationOperation* invocation = [[NSInvocationOperation alloc] - initWithTarget:warp selector:@selector(Run) object:nil]; - if (nil==invocation) - { + + NSInvocationOperation* invocation = [[NSInvocationOperation alloc] initWithTarget:warp + selector:@selector(Run) + object:nil]; + if (nil == invocation) { [warp release]; return NO; } - + [gs_threadrunonstart.m_operationQueue addOperation:invocation]; [invocation release]; [warp release]; return YES; } -extern "C" BOOL RunWithTargetNoParam(void (*_fun)()) -{ +extern "C" BOOL RunWithTargetNoParam(void (*_fun)()) { SCOPE_POOL(); __CThreadWarp* warp = [[__CThreadWarp alloc] init]; warp.m_fun = _fun; - - NSInvocationOperation* invocation = [[NSInvocationOperation alloc] - initWithTarget:warp selector:@selector(Run) object:nil]; - if (nil==invocation) - { + + NSInvocationOperation* invocation = [[NSInvocationOperation alloc] initWithTarget:warp + selector:@selector(Run) + object:nil]; + if (nil == invocation) { [warp release]; return NO; } - + [gs_threadrunonstart.m_operationQueue addOperation:invocation]; [invocation release]; [warp release]; return YES; } -void comm_export_symbols_4(){} +void comm_export_symbols_4() {} diff --git a/mars/comm/objc/data_protect_attr.h b/mars/comm/objc/data_protect_attr.h index ffce296d3..650120634 100644 --- a/mars/comm/objc/data_protect_attr.h +++ b/mars/comm/objc/data_protect_attr.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -22,7 +22,4 @@ bool setAttrProtectionNone(const char* _path); - #endif /* file_protect_attr_h */ - - diff --git a/mars/comm/objc/data_protect_attr.mm b/mars/comm/objc/data_protect_attr.mm index d3119309a..04e995704 100644 --- a/mars/comm/objc/data_protect_attr.mm +++ b/mars/comm/objc/data_protect_attr.mm @@ -5,10 +5,10 @@ // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT -// Unless required by applicable law or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -// either express or implied. See the License for the specific language governing permissions and -// limitations under the License. +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // // data_protect_attr.m @@ -24,27 +24,32 @@ #import #endif - +// If '_path' is directory, the function has effect on new file but ignores existed file. bool setAttrProtectionNone(const char* _path) { - #if !TARGET_OS_IPHONE return true; #else - - NSString* path = [[NSString alloc] initWithUTF8String:_path]; - NSFileManager* fileManager = [NSFileManager defaultManager]; - if (![fileManager fileExistsAtPath:path]) { + + @autoreleasepool { + NSString* path = [[NSString alloc] initWithUTF8String:_path]; + NSFileManager* fileManager = [NSFileManager defaultManager]; + if (![fileManager fileExistsAtPath:path]) { + [path release]; + return false; + } + + BOOL ret = YES; + NSDictionary* old_attr = [[NSFileManager defaultManager] attributesOfItemAtPath:path + error:NULL]; + NSString* protection = [old_attr valueForKey:NSFileProtectionKey]; + if ([protection isEqualToString:NSFileProtectionNone] == NO) { + NSDictionary* attr = [NSDictionary dictionaryWithObject:NSFileProtectionNone + forKey:NSFileProtectionKey]; + ret = [fileManager setAttributes:attr ofItemAtPath:path error:nil]; + } [path release]; - return false; + + return ret; } - - NSDictionary* attr = [NSDictionary dictionaryWithObject:NSFileProtectionNone forKey:NSFileProtectionKey]; - - BOOL ret = [fileManager setAttributes:attr ofItemAtPath:path error:nil]; - - [path release]; - - return ret; #endif - } diff --git a/mars/comm/objc/ip_icmp.h b/mars/comm/objc/ip_icmp.h index 9000aa7fd..05e1adb33 100644 --- a/mars/comm/objc/ip_icmp.h +++ b/mars/comm/objc/ip_icmp.h @@ -2,7 +2,7 @@ * Copyright (c) 2008-2013 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,7 +22,7 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* @@ -82,15 +82,15 @@ struct icmp_ra_addr { * Structure of an icmp header. */ struct icmp { - u_char icmp_type; /* type of message, see below */ - u_char icmp_code; /* type sub code */ - u_short icmp_cksum; /* ones complement cksum of struct */ + u_char icmp_type; /* type of message, see below */ + u_char icmp_code; /* type sub code */ + u_short icmp_cksum; /* ones complement cksum of struct */ union { - u_char ih_pptr; /* ICMP_PARAMPROB */ - struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ + u_char ih_pptr; /* ICMP_PARAMPROB */ + struct in_addr ih_gwaddr; /* ICMP_REDIRECT */ struct ih_idseq { - n_short icd_id; - n_short icd_seq; + n_short icd_id; + n_short icd_seq; } ih_idseq; int ih_void; @@ -106,37 +106,37 @@ struct icmp { u_int16_t irt_lifetime; } ih_rtradv; } icmp_hun; -#define icmp_pptr icmp_hun.ih_pptr -#define icmp_gwaddr icmp_hun.ih_gwaddr -#define icmp_id icmp_hun.ih_idseq.icd_id -#define icmp_seq icmp_hun.ih_idseq.icd_seq -#define icmp_void icmp_hun.ih_void -#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void -#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu -#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs -#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa -#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime +#define icmp_pptr icmp_hun.ih_pptr +#define icmp_gwaddr icmp_hun.ih_gwaddr +#define icmp_id icmp_hun.ih_idseq.icd_id +#define icmp_seq icmp_hun.ih_idseq.icd_seq +#define icmp_void icmp_hun.ih_void +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime union { struct id_ts { n_time its_otime; n_time its_rtime; n_time its_ttime; } id_ts; - struct id_ip { + struct id_ip { struct ip idi_ip; /* options and then 64 bits of data */ } id_ip; struct icmp_ra_addr id_radv; u_int32_t id_mask; - char id_data[1]; + char id_data[1]; } icmp_dun; -#define icmp_otime icmp_dun.id_ts.its_otime -#define icmp_rtime icmp_dun.id_ts.its_rtime -#define icmp_ttime icmp_dun.id_ts.its_ttime -#define icmp_ip icmp_dun.id_ip.idi_ip -#define icmp_radv icmp_dun.id_radv -#define icmp_mask icmp_dun.id_mask -#define icmp_data icmp_dun.id_data +#define icmp_otime icmp_dun.id_ts.its_otime +#define icmp_rtime icmp_dun.id_ts.its_rtime +#define icmp_ttime icmp_dun.id_ts.its_ttime +#define icmp_ip icmp_dun.id_ip.idi_ip +#define icmp_radv icmp_dun.id_radv +#define icmp_mask icmp_dun.id_mask +#define icmp_data icmp_dun.id_data }; /* @@ -147,84 +147,82 @@ struct icmp { * data have been returned, since we need to check the returned * ip header length. */ -#define ICMP_MINLEN 8 /* abs minimum */ -#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */ -#define ICMP_MASKLEN 12 /* address mask */ -#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */ +#define ICMP_MINLEN 8 /* abs minimum */ +#define ICMP_TSLEN (8 + 3 * sizeof(n_time)) /* timestamp */ +#define ICMP_MASKLEN 12 /* address mask */ +#define ICMP_ADVLENMIN (8 + sizeof(struct ip) + 8) /* min */ #ifndef _IP_VHL -#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) - /* N.B.: must separately check that ip_hl >= 5 */ +#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8) +/* N.B.: must separately check that ip_hl >= 5 */ #else -#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8) - /* N.B.: must separately check that header length >= 5 */ +#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8) +/* N.B.: must separately check that header length >= 5 */ #endif /* * Definition of type and code field values. */ -#define ICMP_ECHOREPLY 0 /* echo reply */ -#define ICMP_UNREACH 3 /* dest unreachable, codes: */ -#define ICMP_UNREACH_NET 0 /* bad net */ -#define ICMP_UNREACH_HOST 1 /* bad host */ -#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ -#define ICMP_UNREACH_PORT 3 /* bad port */ -#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ -#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ -#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ -#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ -#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ -#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ -#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ -#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ -#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ -#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */ -#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */ -#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */ -#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ -#define ICMP_REDIRECT 5 /* shorter route, codes: */ -#define ICMP_REDIRECT_NET 0 /* for network */ -#define ICMP_REDIRECT_HOST 1 /* for host */ -#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ -#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ -#define ICMP_ALTHOSTADDR 6 /* alternate host address */ -#define ICMP_ECHO 8 /* echo service */ -#define ICMP_ROUTERADVERT 9 /* router advertisement */ -#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */ -#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */ -#define ICMP_ROUTERSOLICIT 10 /* router solicitation */ -#define ICMP_TIMXCEED 11 /* time exceeded, code: */ -#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ -#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ -#define ICMP_PARAMPROB 12 /* ip header bad */ -#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */ -#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ -#define ICMP_PARAMPROB_LENGTH 2 /* bad length */ -#define ICMP_TSTAMP 13 /* timestamp request */ -#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ -#define ICMP_IREQ 15 /* information request */ -#define ICMP_IREQREPLY 16 /* information reply */ -#define ICMP_MASKREQ 17 /* address mask request */ -#define ICMP_MASKREPLY 18 /* address mask reply */ -#define ICMP_TRACEROUTE 30 /* traceroute */ -#define ICMP_DATACONVERR 31 /* data conversion error */ -#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ -#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ -#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ -#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */ -#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ -#define ICMP_SKIP 39 /* SKIP */ -#define ICMP_PHOTURIS 40 /* Photuris */ -#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */ -#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */ -#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ +#define ICMP_ECHOREPLY 0 /* echo reply */ +#define ICMP_UNREACH 3 /* dest unreachable, codes: */ +#define ICMP_UNREACH_NET 0 /* bad net */ +#define ICMP_UNREACH_HOST 1 /* bad host */ +#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */ +#define ICMP_UNREACH_PORT 3 /* bad port */ +#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */ +#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */ +#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */ +#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */ +#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */ +#define ICMP_UNREACH_NET_PROHIB 9 /* prohibited access */ +#define ICMP_UNREACH_HOST_PROHIB 10 /* ditto */ +#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */ +#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */ +#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */ +#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */ +#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */ +#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */ +#define ICMP_REDIRECT 5 /* shorter route, codes: */ +#define ICMP_REDIRECT_NET 0 /* for network */ +#define ICMP_REDIRECT_HOST 1 /* for host */ +#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */ +#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */ +#define ICMP_ALTHOSTADDR 6 /* alternate host address */ +#define ICMP_ECHO 8 /* echo service */ +#define ICMP_ROUTERADVERT 9 /* router advertisement */ +#define ICMP_ROUTERADVERT_NORMAL 0 /* normal advertisement */ +#define ICMP_ROUTERADVERT_NOROUTE_COMMON 16 /* selective routing */ +#define ICMP_ROUTERSOLICIT 10 /* router solicitation */ +#define ICMP_TIMXCEED 11 /* time exceeded, code: */ +#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */ +#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */ +#define ICMP_PARAMPROB 12 /* ip header bad */ +#define ICMP_PARAMPROB_ERRATPTR 0 /* error at param ptr */ +#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */ +#define ICMP_PARAMPROB_LENGTH 2 /* bad length */ +#define ICMP_TSTAMP 13 /* timestamp request */ +#define ICMP_TSTAMPREPLY 14 /* timestamp reply */ +#define ICMP_IREQ 15 /* information request */ +#define ICMP_IREQREPLY 16 /* information reply */ +#define ICMP_MASKREQ 17 /* address mask request */ +#define ICMP_MASKREPLY 18 /* address mask reply */ +#define ICMP_TRACEROUTE 30 /* traceroute */ +#define ICMP_DATACONVERR 31 /* data conversion error */ +#define ICMP_MOBILE_REDIRECT 32 /* mobile host redirect */ +#define ICMP_IPV6_WHEREAREYOU 33 /* IPv6 where-are-you */ +#define ICMP_IPV6_IAMHERE 34 /* IPv6 i-am-here */ +#define ICMP_MOBILE_REGREQUEST 35 /* mobile registration req */ +#define ICMP_MOBILE_REGREPLY 36 /* mobile registration reply */ +#define ICMP_SKIP 39 /* SKIP */ +#define ICMP_PHOTURIS 40 /* Photuris */ +#define ICMP_PHOTURIS_UNKNOWN_INDEX 1 /* unknown sec index */ +#define ICMP_PHOTURIS_AUTH_FAILED 2 /* auth failed */ +#define ICMP_PHOTURIS_DECRYPT_FAILED 3 /* decrypt failed */ -#define ICMP_MAXTYPE 40 +#define ICMP_MAXTYPE 40 -#define ICMP_INFOTYPE(type) \ - ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \ - (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \ - (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ - (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ - (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) +#define ICMP_INFOTYPE(type) \ + ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT \ + || (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY \ + || (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY) #endif /* _NETINET_IP_ICMP_H_ */ diff --git a/mars/comm/objc/objc_timer.h b/mars/comm/objc/objc_timer.h index 9e57318b0..8398264a6 100644 --- a/mars/comm/objc/objc_timer.h +++ b/mars/comm/objc/objc_timer.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT diff --git a/mars/comm/objc/objc_timer.mm b/mars/comm/objc/objc_timer.mm index 7adcb1b37..b6967608a 100644 --- a/mars/comm/objc/objc_timer.mm +++ b/mars/comm/objc/objc_timer.mm @@ -1,3 +1,14 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // // objc_timer.cpp // MicroMessenger @@ -9,56 +20,51 @@ #import #include -#include "comm/thread/lock.h" #include "comm/alarm.h" +#include "comm/thread/lock.h" +#include "mars/comm/macro.h" +using namespace mars::comm; -void onAlarm(long long _id) -{ -// Alarm::OnAlarm(reinterpret_cast(_id)); +void onAlarm(long long _id) { + // Alarm::OnAlarm(reinterpret_cast(_id)); } @interface TimerRuner : NSObject --(void) Run:(NSTimer*)timer; +- (void)Run:(NSTimer*)timer; @end -struct TimerRecord -{ - TimerRecord() - { +struct TimerRecord { + TimerRecord() { id_ = 0; timer = nil; timer_runer = nil; } - + long long id_; NSTimer* timer; TimerRuner* timer_runer; }; -static std::list gs_lst_timer_record; -static Mutex gs_mutex; +NO_DESTROY static std::list gs_lst_timer_record; +NO_DESTROY static Mutex gs_mutex; @implementation TimerRuner --(void) Run:(NSTimer*)timer -{ +- (void)Run:(NSTimer*)timer { ScopedLock lock(gs_mutex); - for (std::list::iterator it = gs_lst_timer_record.begin(); it!=gs_lst_timer_record.end(); ++it) - { - if (timer==it->timer) - { - if (nil!=it->timer) - { + for (std::list::iterator it = gs_lst_timer_record.begin(); + it != gs_lst_timer_record.end(); ++it) { + if (timer == it->timer) { + if (nil != it->timer) { [it->timer invalidate]; [it->timer release]; it->timer = nil; } - if (nil!=it->timer_runer) - { + if (nil != it->timer_runer) { [it->timer_runer release]; it->timer_runer = nil; } - + long long id_ = it->id_; gs_lst_timer_record.erase(it); @@ -70,41 +76,40 @@ -(void) Run:(NSTimer*)timer @end -bool StartAlarm(long long _id, int after) -{ +bool StartAlarm(long long _id, int after) { ScopedLock lock(gs_mutex); - for (std::list::iterator it = gs_lst_timer_record.begin(); it!=gs_lst_timer_record.end(); ++it) - { - if (_id==it->id_) return false; + for (std::list::iterator it = gs_lst_timer_record.begin(); + it != gs_lst_timer_record.end(); ++it) { + if (_id == it->id_) return false; } - - NSTimeInterval interval = (NSTimeInterval)after/1000; - NSRunLoop *runLoop = [NSRunLoop mainRunLoop]; + + NSTimeInterval interval = (NSTimeInterval)after / 1000; + NSRunLoop* runLoop = [NSRunLoop mainRunLoop]; TimerRecord tr; tr.id_ = _id; tr.timer_runer = [[TimerRuner alloc] init]; - tr.timer = [NSTimer timerWithTimeInterval:interval target:tr.timer_runer selector:@selector(Run:) userInfo:tr.timer repeats:NO]; + tr.timer = [NSTimer timerWithTimeInterval:interval + target:tr.timer_runer + selector:@selector(Run:) + userInfo:tr.timer + repeats:NO]; [tr.timer retain]; [runLoop addTimer:tr.timer forMode:NSDefaultRunLoopMode]; gs_lst_timer_record.push_back(tr); return true; } -bool StopAlarm(long long _id) -{ +bool StopAlarm(long long _id) { ScopedLock lock(gs_mutex); - for (std::list::iterator it = gs_lst_timer_record.begin(); it!=gs_lst_timer_record.end(); ++it) - { - if (_id==it->id_) - { - if (nil!=it->timer) - { + for (std::list::iterator it = gs_lst_timer_record.begin(); + it != gs_lst_timer_record.end(); ++it) { + if (_id == it->id_) { + if (nil != it->timer) { [it->timer invalidate]; [it->timer release]; it->timer = nil; } - if (nil!=it->timer_runer) - { + if (nil != it->timer_runer) { [it->timer_runer release]; it->timer_runer = nil; } @@ -115,4 +120,4 @@ bool StopAlarm(long long _id) return false; } -void comm_export_symbols_0(){} +void comm_export_symbols_0() {} diff --git a/mars/comm/objc/platform_comm.mm b/mars/comm/objc/platform_comm.mm index d4d73846c..408e9ec1a 100644 --- a/mars/comm/objc/platform_comm.mm +++ b/mars/comm/objc/platform_comm.mm @@ -1,400 +1,599 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. + /** * created on : 2012-11-28 * author : yerungui */ #include "comm/platform_comm.h" +#import +#import +#import +#import +#import +#import +#include "mars/comm/macro.h" -#include "comm/xlogger/xlogger.h" -#include "comm/xlogger/loginfo_extract.h" #import "comm/objc/scope_autoreleasepool.h" +#include "comm/xlogger/loginfo_extract.h" +#include "comm/xlogger/xlogger.h" #import #if !TARGET_OS_WATCH -#import #import +#import #endif #if TARGET_OS_IPHONE && !TARGET_OS_WATCH -#import -#import #import +#import #import +#import #endif #if !TARGET_OS_IPHONE #import -#import +#import #endif #include +#include -#include "comm/objc/objc_timer.h" #import "comm/objc/Reachability.h" +#include "comm/objc/objc_timer.h" -#include "comm/thread/lock.h" #include "comm/network/getifaddrs.h" +#include "comm/thread/lock.h" +#include "comm/thread/mutex.h" #if !TARGET_OS_IPHONE static float __GetSystemVersion() { // float system_version = [UIDevice currentDevice].systemVersion.floatValue; // return system_version; - NSString *versionString; - NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; - if (nil != sv){ + NSString* versionString; + NSDictionary* sv = [NSDictionary + dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; + if (nil != sv) { versionString = [sv objectForKey:@"ProductVersion"]; return versionString != nil ? versionString.floatValue : 0; } - + return 0; } #endif -static MarsNetworkStatus __GetNetworkStatus() -{ +static MarsNetworkStatus __GetNetworkStatus(BOOL realtime = NO) { #if TARGET_OS_WATCH return ReachableViaWiFi; #else - return [MarsReachability getCacheReachabilityStatus:NO]; + return [MarsReachability getCacheReachabilityStatus:realtime]; #endif } +NO_DESTROY static mars::comm::WifiInfo sg_wifiinfo; +NO_DESTROY static mars::comm::Mutex sg_wifiinfo_mutex; + +namespace mars { +namespace comm { + +NO_DESTROY static std::function g_new_wifi_id_cb; +NO_DESTROY static mars::comm::Mutex wifi_id_mutex; + +std::function SetWiFiIdCallBack(std::function _cb) { + mars::comm::ScopedLock lock(wifi_id_mutex); + std::function old = g_new_wifi_id_cb; + g_new_wifi_id_cb = std::move(_cb); + return old; +} +void ResetWiFiIdCallBack() { + mars::comm::ScopedLock lock(wifi_id_mutex); + g_new_wifi_id_cb = nullptr; +} +bool IsWiFiIdCallBackExists() { + mars::comm::ScopedLock lock(wifi_id_mutex); + return g_new_wifi_id_cb != nullptr; +} + void FlushReachability() { - [MarsReachability getCacheReachabilityStatus:YES]; +#if !TARGET_OS_WATCH + [MarsReachability getCacheReachabilityStatus:YES]; + mars::comm::ScopedLock lock(sg_wifiinfo_mutex); + sg_wifiinfo.ssid.clear(); + sg_wifiinfo.bssid.clear(); +#endif } float publiccomponent_GetSystemVersion() { - // float system_version = [UIDevice currentDevice].systemVersion.floatValue; - // return system_version; - NSString *versionString; - NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; - if (nil != sv){ + SCOPE_POOL(); + NSString* versionString; + NSDictionary* sv = [NSDictionary + dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; + if (nil != sv) { versionString = [sv objectForKey:@"ProductVersion"]; return versionString != nil ? versionString.floatValue : 0; } - + return 0; } -bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) -{ +bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { xverbose_function(); - + #if TARGET_OS_WATCH return false; - + #else SCOPE_POOL(); - NSDictionary *proxySettings = [NSMakeCollectable((NSDictionary *)CFNetworkCopySystemProxySettings()) autorelease]; - if (nil==proxySettings) return false; - - CFURLRef url = (CFURLRef)[NSURL URLWithString: [NSString stringWithUTF8String:(_host.c_str())]]; - -// CFURLRef url = (CFURLRef)[NSURL URLWithString: @"http://www.google.com"]; - - - NSArray *proxies = [NSMakeCollectable((NSArray *)CFNetworkCopyProxiesForURL(url, (CFDictionaryRef)proxySettings)) autorelease]; - - if (nil==proxies || 0==[proxies count]) return false; - - NSDictionary *settings = [proxies objectAtIndex:0]; - CFStringRef http_proxy = (CFStringRef)[settings objectForKey:(NSString *)kCFProxyHostNameKey]; - CFNumberRef http_port = (CFNumberRef)[settings objectForKey:(NSString *)kCFProxyPortNumberKey]; - CFStringRef http_type = (CFStringRef)[settings objectForKey:(NSString *)kCFProxyTypeKey]; - - if (0==CFStringCompare(http_type, kCFProxyTypeAutoConfigurationURL, 0)) - { - CFErrorRef error = nil; - CFStringRef proxyAutoConfigurationScript = (CFStringRef)[settings objectForKey:(NSString *)kCFProxyAutoConfigurationURLKey]; - if (nil==proxyAutoConfigurationScript) return false; - - proxies = [NSMakeCollectable((NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript(proxyAutoConfigurationScript, url, &error)) autorelease]; - - if (nil!=error) return false; - - - if (nil==proxies || 0==[proxies count]) return false; - settings = [proxies objectAtIndex:0]; - - http_proxy = (CFStringRef)[settings objectForKey:(NSString *)kCFProxyHostNameKey]; - http_port = (CFNumberRef)[settings objectForKey:(NSString *)kCFProxyPortNumberKey]; - } - - if (nil==http_proxy || nil==http_port) return false; - + NSDictionary* proxySettings = + [NSMakeCollectable((NSDictionary*)CFNetworkCopySystemProxySettings()) autorelease]; + if (nil == proxySettings) return false; + + CFURLRef url = (CFURLRef)[NSURL URLWithString:[NSString stringWithUTF8String:(_host.c_str())]]; + + // CFURLRef url = (CFURLRef)[NSURL URLWithString: @"http://www.google.com"]; + + NSArray* proxies = [NSMakeCollectable( + (NSArray*)CFNetworkCopyProxiesForURL(url, (CFDictionaryRef)proxySettings)) autorelease]; + + if (nil == proxies || 0 == [proxies count]) return false; + + NSDictionary* settings = [proxies objectAtIndex:0]; + CFStringRef http_proxy = (CFStringRef)[settings objectForKey:(NSString*)kCFProxyHostNameKey]; + CFNumberRef http_port = (CFNumberRef)[settings objectForKey:(NSString*)kCFProxyPortNumberKey]; + CFStringRef http_type = (CFStringRef)[settings objectForKey:(NSString*)kCFProxyTypeKey]; + + if (0 == CFStringCompare(http_type, kCFProxyTypeAutoConfigurationURL, 0)) { + CFErrorRef error = nil; + CFStringRef proxyAutoConfigurationScript = + (CFStringRef)[settings objectForKey:(NSString*)kCFProxyAutoConfigurationURLKey]; + if (nil == proxyAutoConfigurationScript) return false; + + proxies = [NSMakeCollectable((NSArray*)CFNetworkCopyProxiesForAutoConfigurationScript( + proxyAutoConfigurationScript, url, &error)) autorelease]; + + if (nil != error) return false; + + if (nil == proxies || 0 == [proxies count]) return false; + settings = [proxies objectAtIndex:0]; + + http_proxy = (CFStringRef)[settings objectForKey:(NSString*)kCFProxyHostNameKey]; + http_port = (CFNumberRef)[settings objectForKey:(NSString*)kCFProxyPortNumberKey]; + } + + if (nil == http_proxy || nil == http_port) return false; + char tmp_proxy[128] = {0}; int tmp_port = 0; - - if (!CFStringGetCString(http_proxy, tmp_proxy, sizeof(tmp_proxy), kCFStringEncodingASCII) - || !CFNumberGetValue(http_port, kCFNumberSInt32Type, &tmp_port)) - { - xerror2(TSF"convert error"); + if (!CFStringGetCString(http_proxy, tmp_proxy, sizeof(tmp_proxy), kCFStringEncodingASCII) || + !CFNumberGetValue(http_port, kCFNumberSInt32Type, &tmp_port)) { + xerror2(TSF "convert error"); return false; } strProxy = tmp_proxy; port = tmp_port; - xdebug2(TSF"%0:%1", strProxy, port); + xdebug2(TSF "%0:%1", strProxy, port); return true; #endif } -int getNetInfo() { +void OnPlatformNetworkChange() {} + +NetType getNetInfo(bool realtime /*=false*/) { xverbose_function(); SCOPE_POOL(); - -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_WATCH - return kWifi; + +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_WATCH || UNITTEST + return mars::comm::kWifi; #endif - switch (__GetNetworkStatus()) - { + switch (__GetNetworkStatus(realtime)) { case NotReachable: - return kNoNet; + return mars::comm::kNoNet; case ReachableViaWiFi: - return kWifi; + return mars::comm::kWifi; case ReachableViaWWAN: - return kMobile; + return mars::comm::kMobile; default: - return kNoNet; + return mars::comm::kNoNet; } } -unsigned int getSignal(bool isWifi){ - xverbose_function(); - SCOPE_POOL(); - return (unsigned int)0; -} +NetTypeForStatistics getNetTypeForStatistics() { + NetType type = getNetInfo(false); + if (mars::comm::kWifi == type) { + return mars::comm::NetTypeForStatistics::NETTYPE_WIFI; + } + if (mars::comm::kNoNet == type) { + return mars::comm::NetTypeForStatistics::NETTYPE_NON; + } + mars::comm::RadioAccessNetworkInfo rani; + if (!getCurRadioAccessNetworkInfo(rani)) { + return mars::comm::NetTypeForStatistics::NETTYPE_NON; + } + if (rani.Is2G()) { + return mars::comm::NetTypeForStatistics::NETTYPE_2G; + } else if (rani.Is3G()) { + return mars::comm::NetTypeForStatistics::NETTYPE_3G; + } else if (rani.Is4G()) { + return mars::comm::NetTypeForStatistics::NETTYPE_4G; + } else if (rani.IsNR()) { + return mars::comm::NetTypeForStatistics::NETTYPE_5G; + } + return mars::comm::NetTypeForStatistics::NETTYPE_NON; +} -void ConsoleLog(const XLoggerInfo* _info, const char* _log) -{ +unsigned int getSignal(bool isWifi) { + xverbose_function(); SCOPE_POOL(); - - if (NULL==_info || NULL==_log) return; - - static const char* levelStrings[] = { - "V", - "D", // debug - "I", // info - "W", // warn - "E", // error - "F" // fatal - }; - - char strFuncName[128] = {0}; - ExtractFunctionName(_info->func_name, strFuncName, sizeof(strFuncName)); - - const char* file_name = ExtractFileName(_info->filename); - - char log[16 * 1024] = {0}; - snprintf(log, sizeof(log), "[%s][%s][%s, %s, %d][%s", levelStrings[_info->level], NULL == _info->tag ? "" : _info->tag, file_name, strFuncName, _info->line, _log); - - - NSLog(@"%@", [NSString stringWithUTF8String:log]); + return (unsigned int)0; } -bool isNetworkConnected() -{ - SCOPE_POOL(); - switch (__GetNetworkStatus()) - { +bool isNetworkConnected() { + SCOPE_POOL(); + switch (__GetNetworkStatus()) { case NotReachable: return false; case ReachableViaWiFi: return true; case ReachableViaWWAN: -return true; + return true; default: return false; } } +int getNetworkIDLabel(std::string& netInfo) { + netInfo = mars::comm::kMarsDefaultNetLabel; + int nettype = getNetInfo(false); + { + mars::comm::ScopedLock lock(wifi_id_mutex); + if (g_new_wifi_id_cb && g_new_wifi_id_cb(netInfo) && !netInfo.empty()) { + return nettype; + } + } + + // fallback + return getCurrNetLabel(netInfo); +} + #define SIMULATOR_NET_INFO "SIMULATOR" #define IWATCH_NET_INFO "IWATCH" -#define USE_WIRED "wired" +#define USE_WIRED "wired" + +static bool __WiFiInfoIsValid(const mars::comm::WifiInfo& _wifi_info) { + // CNCopyCurrentNetworkInfo is now only available to your app in three cases: + // * Apps with permission to access location + // * Your app is the currently enabled VPN app + // * Your app configured the WiFi network the device is currently using via + // NEHotspotConfiguration otherwise return nil. But if you use 'NEHotspotConfiguration' and + // without permission to access location Instead, the information returned by default will be: + // * SSID: “Wi-Fi” or “WLAN” (“WLAN" will be returned for the China SKU) + // * BSSID: "00:00:00:00:00:00" + static const std::string kConstBSSID = "00:00:00:00:00:00"; + return !_wifi_info.bssid.empty() && kConstBSSID != _wifi_info.bssid; +} -bool getCurWifiInfo(WifiInfo& wifiInfo) -{ +bool getCurWifiInfo(mars::comm::WifiInfo& wifiInfo, bool _force_refresh) { SCOPE_POOL(); - + #if TARGET_IPHONE_SIMULATOR wifiInfo.ssid = SIMULATOR_NET_INFO; wifiInfo.bssid = SIMULATOR_NET_INFO; return true; -#elif !TARGET_OS_IPHONE - - static CWInterface* info = nil; //CWInterface can reused - - if (nil == info) { - if (__GetSystemVersion() < 10.10){ - info = [CWInterface interface]; - }else{ - CWWiFiClient* wificlient = [CWWiFiClient sharedWiFiClient]; - if (nil != wificlient) info = [wificlient interface]; - } - } - - if (nil == info) return false; - if (info.ssid) { - wifiInfo.ssid = [info.ssid UTF8String]; - //wifiInfo.bssid = [info.bssid UTF8String]; - } else { - wifiInfo.ssid = USE_WIRED; - wifiInfo.bssid = USE_WIRED; - } - return true; - +// #elif !TARGET_OS_IPHONE +// +// NO_DESTROY static mars::comm::Mutex mutex; +// mars::comm::ScopedLock lock(mutex); +// +// static float version = 0.0; +// +// CWInterface* info = nil; +// +// if (version < 0.1) { +// version = __GetSystemVersion(); +// } +// +// if (version < 10.10) { +// static CWInterface* s_info = [[CWInterface interface] retain]; +// info = s_info; +// } else { +// CWWiFiClient* wificlient = [CWWiFiClient sharedWiFiClient]; +// if (nil != wificlient) info = [wificlient interface]; +// } +// +// if (nil == info) return false; +// if (info.ssid != nil) { +// const char* ssid = [info.ssid UTF8String]; +// if (NULL != ssid) wifiInfo.ssid.assign(ssid, strnlen(ssid, 32)); +// // wifiInfo.bssid = [info.bssid UTF8String]; +// } else { +// wifiInfo.ssid = USE_WIRED; +// wifiInfo.bssid = USE_WIRED; +// } +// return true; +// #elif TARGET_OS_WATCH wifiInfo.ssid = IWATCH_NET_INFO; wifiInfo.bssid = IWATCH_NET_INFO; return true; #else - static Mutex mutex; - NSArray *ifs = nil; - { - ScopedLock lock(mutex); + wifiInfo.ssid = "WiFi"; + wifiInfo.bssid = "WiFi"; + + mars::comm::ScopedLock wifi_id_lock(wifi_id_mutex); + if (!g_new_wifi_id_cb) { + xwarn2("g_new_wifi_id_cb is null"); + } + xdebug2(TSF "_force_refresh %_", _force_refresh); + // 来自mars的调用全部使用新的netid, 并且 _force_refresh = false + // 来自业务调用的全部 _force_refresh = true + if (g_new_wifi_id_cb && !_force_refresh) { + std::string newid = "no_ssid_wifi"; + if (g_new_wifi_id_cb(newid)) { + wifiInfo.ssid = newid; + wifiInfo.bssid = newid; + return true; + } + return false; + } + wifi_id_lock.unlock(); + +#if TARGET_OS_IPHONE + if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) { + return false; + } +#endif + + mars::comm::ScopedLock lock(sg_wifiinfo_mutex); + if (__WiFiInfoIsValid(sg_wifiinfo) && !_force_refresh) { + wifiInfo = sg_wifiinfo; + return true; + } + + wifi_id_lock.lock(); + // g_new_wifi_id_cb表示来自微信的调用, 而非外部开源调用,只有微信会设置g_new_wifi_id_cb + // 为了减少定位图片的出现次数: + // 微信逻辑改为_force_refresh = true并且sg_wifiinfo没有设置的情况下才强制获取一次 + if (_force_refresh && g_new_wifi_id_cb) { + if (__WiFiInfoIsValid(sg_wifiinfo)) { + wifiInfo = sg_wifiinfo; + return true; + } + } + wifi_id_lock.unlock(); + lock.unlock(); + +#if TARGET_OS_IPHONE + NSArray* ifs = nil; + @synchronized(@"CNCopySupportedInterfaces") { ifs = (id)CNCopySupportedInterfaces(); } + if (ifs == nil) { + return false; + } - if (ifs == nil) return false; - id info = nil; - for (NSString *ifnam in ifs) { + for (NSString* ifnam in ifs) { info = (id)CNCopyCurrentNetworkInfo((CFStringRef)ifnam); if (info && [info count] && info[@"SSID"]) { break; } - - if (nil!=info) { + + if (nil != info) { CFRelease(info); info = nil; } } - + if (info == nil) { CFRelease(ifs); return false; } - + const char* ssid_cstr = [[info objectForKey:@"SSID"] UTF8String]; const char* bssid_cstr = [[info objectForKey:@"BSSID"] UTF8String]; if (NULL != ssid_cstr) { wifiInfo.ssid = ssid_cstr; } - + if (NULL != bssid_cstr) { wifiInfo.bssid = bssid_cstr; } CFRelease(info); CFRelease(ifs); - - return true; +#else + CWWiFiClient* wificlient = [CWWiFiClient sharedWiFiClient]; + if (wificlient == nil) { + return false; + } + CWInterface* info = [wificlient interface]; + if (info == nil) { + return false; + } + + wifiInfo.ssid = USE_WIRED; + wifiInfo.bssid = USE_WIRED; + + if (info.ssid != nil) { + const char* ssid = [info.ssid UTF8String]; + if (NULL != ssid) { + wifiInfo.ssid.assign(ssid, strnlen(ssid, 32)); + } + } + if (info.bssid != nil) { + const char* bssid = [info.bssid UTF8String]; + if (NULL != bssid) { + wifiInfo.bssid.assign(bssid, strnlen(bssid, 32)); + } + } +#endif + + // CNCopyCurrentNetworkInfo is now only available to your app in three cases: + // * Apps with permission to access location + // * Your app is the currently enabled VPN app + // * Your app configured the WiFi network the device is currently using via + // NEHotspotConfiguration otherwise return nil. But if you use 'NEHotspotConfiguration' and + // without permission to access location Instead, the information returned by default will be: + // * SSID: “Wi-Fi” or “WLAN” (“WLAN" will be returned for the China SKU) + // * BSSID: "00:00:00:00:00:00" + lock.lock(); + sg_wifiinfo = wifiInfo; + xinfo2(TSF "get wifi info:%_", sg_wifiinfo.ssid); + + return __WiFiInfoIsValid(wifiInfo); #endif } #if TARGET_OS_IPHONE && !TARGET_OS_WATCH -bool getCurSIMInfo(SIMInfo& simInfo) -{ - static Mutex mutex; - ScopedLock lock(mutex); - +bool getCurSIMInfo(mars::comm::SIMInfo& simInfo, bool /* realtime = false*/) { + NO_DESTROY static mars::comm::Mutex mutex; + mars::comm::ScopedLock lock(mutex); + SCOPE_POOL(); static CTTelephonyNetworkInfo* s_networkinfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier* carrier = s_networkinfo.subscriberCellularProvider; - - if (nil == carrier) - { + + if (nil == carrier) { return false; } - - if (nil == carrier.mobileCountryCode || nil == carrier.mobileNetworkCode) - { + + if (nil == carrier.mobileCountryCode || nil == carrier.mobileNetworkCode) { return false; } simInfo.isp_code += [carrier.mobileCountryCode UTF8String]; simInfo.isp_code += [carrier.mobileNetworkCode UTF8String]; - xverbose2(TSF"isp_code:%0", simInfo.isp_code); + xverbose2(TSF "isp_code:%0", simInfo.isp_code); return true; } #else -bool getCurSIMInfo(SIMInfo& simInfo) -{ - return false; -} +bool getCurSIMInfo(mars::comm::SIMInfo& simInfo, bool /* realtime = false*/) { return false; } #endif -bool getAPNInfo(APNInfo& info) -{ - RadioAccessNetworkInfo raninfo; - if (kMobile != getNetInfo()) return false; - if (!getCurRadioAccessNetworkInfo(raninfo)) return false; - - info.nettype = kMobile; +bool getAPNInfo(mars::comm::APNInfo& info) { + mars::comm::RadioAccessNetworkInfo raninfo; + if (mars::comm::kMobile != getNetInfo(false)) return false; + if (!mars::comm::getCurRadioAccessNetworkInfo(raninfo)) return false; + + info.nettype = mars::comm::kMobile; info.extra_info = raninfo.radio_access_network; return true; } -bool getifaddrs_ipv4_hotspot(std::string& _ifname, std::string& _ifip) -{ +bool getifaddrs_ipv4_hotspot(std::string& _ifname, std::string& _ifip) { std::vector addrs; if (!getifaddrs_ipv4_lan(addrs)) return false; - - for (auto it=addrs.begin(); it!=addrs.end(); ++it) - { - if (std::string::npos != it->ifa_name.find("bridge")) - { + + for (auto it = addrs.begin(); it != addrs.end(); ++it) { + if (std::string::npos != it->ifa_name.find("bridge")) { _ifname = it->ifa_name; _ifip = it->ip; return true; } } - + return false; } /** CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new]; NSLog(@"Current Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology); -[NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification - object:nil - queue:nil - usingBlock:^(NSNotification *note) +[NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification + object:nil + queue:nil + usingBlock:^(NSNotification *note) { NSLog(@"New Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology); }]; **/ #if TARGET_OS_IPHONE && !TARGET_OS_WATCH -bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo) -{ +bool getCurRadioAccessNetworkInfo(mars::comm::RadioAccessNetworkInfo& _raninfo) { + if (publiccomponent_GetSystemVersion() < 7.0) { + return false; + } + SCOPE_POOL(); - - if (!([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)) { return false;} static CTTelephonyNetworkInfo* s_networkinfo = [[CTTelephonyNetworkInfo alloc] init]; - - NSString *currentRadioAccessTechnology = s_networkinfo.currentRadioAccessTechnology; - if (!currentRadioAccessTechnology) { return false;} - - _raninfo.radio_access_network = [currentRadioAccessTechnology UTF8String]; + + NSString* currentRadioAccessTechnology = s_networkinfo.currentRadioAccessTechnology; + if (!currentRadioAccessTechnology) { + return false; + } + + _raninfo.radio_access_network = [currentRadioAccessTechnology UTF8String]; _raninfo.radio_access_network.erase(0, strlen("CTRadioAccessTechnology")); - - xassert2(!_raninfo.radio_access_network.empty(), "%s", [currentRadioAccessTechnology UTF8String]); - + + xassert2(!_raninfo.radio_access_network.empty(), "%s", + [currentRadioAccessTechnology UTF8String]); + return true; } + #else -bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo) -{ - return false; -} +bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _raninfo) { return false; } #endif -void comm_export_symbols_1(){} +static void ReleaseSecData(const void* secdata, void*) { CFRelease(secdata); } +int OSVerifyCertificate(const std::string& hostname, const std::vector& certschain) { + CFMutableArrayRef certlist = + CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + for (int i = 0; i < certschain.size(); i++) { + CFDataRef dataref = + CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, (const uint8_t*)certschain[i].data(), + certschain[i].size(), kCFAllocatorNull); + SecCertificateRef certref = SecCertificateCreateWithData(nullptr, dataref); + CFRelease(dataref); + CFArrayAppendValue(certlist, certref); + } + + CFStringRef label = CFStringCreateWithCString(NULL, hostname.c_str(), kCFStringEncodingUTF8); + SecPolicyRef policy = SecPolicyCreateSSL(true, label); + CFRelease(label); + + SecTrustRef trustref; + OSStatus status = SecTrustCreateWithCertificates(certlist, policy, &trustref); + if (0 != status) { + CFArrayApplyFunction(certlist, CFRangeMake(0, CFArrayGetCount(certlist)), ReleaseSecData, + nullptr); + CFRelease(certlist); + CFRelease(policy); + return -1; + } + + SecTrustResultType result = kSecTrustResultInvalid; + status = SecTrustEvaluate(trustref, &result); + CFArrayApplyFunction(certlist, CFRangeMake(0, CFArrayGetCount(certlist)), ReleaseSecData, + nullptr); + CFRelease(certlist); + CFRelease(policy); + CFRelease(trustref); + + int rv = -2; + if (0 == status) { + rv = (kSecTrustResultUnspecified == result || kSecTrustResultProceed == result) ? 0 : -3; + } + return rv; +} + +} // namespace comm +} // namespace mars +void comm_export_symbols_1() {} diff --git a/mars/comm/objc/route.h b/mars/comm/objc/route.h index e8827c669..88ded45a2 100644 --- a/mars/comm/objc/route.h +++ b/mars/comm/objc/route.h @@ -62,187 +62,183 @@ */ #ifndef _NET_ROUTE_H_ -#define _NET_ROUTE_H_ -#include +#define _NET_ROUTE_H_ #include -#include +#include #include +#include /* * These numbers are used by reliable protocols for determining * retransmission behavior and are included in the routing structure. */ struct rt_metrics { - u_int32_t rmx_locks; /* Kernel leaves these values alone */ - u_int32_t rmx_mtu; /* MTU for this path */ - u_int32_t rmx_hopcount; /* max hops expected */ - int32_t rmx_expire; /* lifetime for route, e.g. redirect */ - u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ - u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ - u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ - u_int32_t rmx_rtt; /* estimated round trip time */ - u_int32_t rmx_rttvar; /* estimated rtt variance */ - u_int32_t rmx_pksent; /* packets sent using this route */ - u_int32_t rmx_filler[4]; /* will be used for T/TCP later */ + u_int32_t rmx_locks; /* Kernel leaves these values alone */ + u_int32_t rmx_mtu; /* MTU for this path */ + u_int32_t rmx_hopcount; /* max hops expected */ + int32_t rmx_expire; /* lifetime for route, e.g. redirect */ + u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ + u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ + u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ + u_int32_t rmx_rtt; /* estimated round trip time */ + u_int32_t rmx_rttvar; /* estimated rtt variance */ + u_int32_t rmx_pksent; /* packets sent using this route */ + u_int32_t rmx_filler[4]; /* will be used for T/TCP later */ }; /* * rmx_rtt and rmx_rttvar are stored as microseconds; */ -#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ - - - -#define RTF_UP 0x1 /* route usable */ -#define RTF_GATEWAY 0x2 /* destination is a gateway */ -#define RTF_HOST 0x4 /* host entry (net otherwise) */ -#define RTF_REJECT 0x8 /* host or net unreachable */ -#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ -#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ -#define RTF_DONE 0x40 /* message confirmed */ -#define RTF_DELCLONE 0x80 /* delete cloned route */ -#define RTF_CLONING 0x100 /* generate new routes on use */ -#define RTF_XRESOLVE 0x200 /* external daemon resolves name */ -#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */ -#define RTF_STATIC 0x800 /* manually added */ -#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ -#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ -#define RTF_PROTO2 0x4000 /* protocol specific routing flag */ -#define RTF_PROTO1 0x8000 /* protocol specific routing flag */ - -#define RTF_PRCLONING 0x10000 /* protocol requires cloning */ -#define RTF_WASCLONED 0x20000 /* route generated through cloning */ -#define RTF_PROTO3 0x40000 /* protocol specific routing flag */ +#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ + +#define RTF_UP 0x1 /* route usable */ +#define RTF_GATEWAY 0x2 /* destination is a gateway */ +#define RTF_HOST 0x4 /* host entry (net otherwise) */ +#define RTF_REJECT 0x8 /* host or net unreachable */ +#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ +#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ +#define RTF_DONE 0x40 /* message confirmed */ +#define RTF_DELCLONE 0x80 /* delete cloned route */ +#define RTF_CLONING 0x100 /* generate new routes on use */ +#define RTF_XRESOLVE 0x200 /* external daemon resolves name */ +#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */ +#define RTF_STATIC 0x800 /* manually added */ +#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ +#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ +#define RTF_PROTO2 0x4000 /* protocol specific routing flag */ +#define RTF_PROTO1 0x8000 /* protocol specific routing flag */ + +#define RTF_PRCLONING 0x10000 /* protocol requires cloning */ +#define RTF_WASCLONED 0x20000 /* route generated through cloning */ +#define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ -#define RTF_PINNED 0x100000 /* future use */ -#define RTF_LOCAL 0x200000 /* route represents a local address */ -#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ -#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ -#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ -#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ -#define RTF_IFREF 0x4000000 /* route holds a ref to interface */ -#define RTF_PROXY 0x8000000 /* proxying, no interface scope */ -#define RTF_ROUTER 0x10000000 /* host is a router */ +#define RTF_PINNED 0x100000 /* future use */ +#define RTF_LOCAL 0x200000 /* route represents a local address */ +#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ +#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ +#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ +#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ +#define RTF_IFREF 0x4000000 /* route holds a ref to interface */ +#define RTF_PROXY 0x8000000 /* proxying, no interface scope */ +#define RTF_ROUTER 0x10000000 /* host is a router */ /* 0x20000000 and up unassigned */ -#define RTF_BITS \ - "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ - "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ - "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ +#define RTF_BITS \ + "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ + "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ + "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ "\33IFREF\34PROXY\35ROUTER" /* * Routing statistics. */ -struct rtstat { - short rts_badredirect; /* bogus redirect calls */ - short rts_dynamic; /* routes created by redirects */ - short rts_newgateway; /* routes modified by redirects */ - short rts_unreach; /* lookups which failed */ - short rts_wildcard; /* lookups satisfied by a wildcard */ +struct rtstat { + short rts_badredirect; /* bogus redirect calls */ + short rts_dynamic; /* routes created by redirects */ + short rts_newgateway; /* routes modified by redirects */ + short rts_unreach; /* lookups which failed */ + short rts_wildcard; /* lookups satisfied by a wildcard */ }; /* * Structures for routing messages. */ struct rt_msghdr { - u_short rtm_msglen; /* to skip over non-understood messages */ - u_char rtm_version; /* future binary compatibility */ - u_char rtm_type; /* message type */ - u_short rtm_index; /* index for associated ifp */ - int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ - int rtm_addrs; /* bitmask identifying sockaddrs in msg */ - pid_t rtm_pid; /* identify sender */ - int rtm_seq; /* for sender to identify action */ - int rtm_errno; /* why failed */ - int rtm_use; /* from rtentry */ - u_int32_t rtm_inits; /* which metrics we are initializing */ + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + pid_t rtm_pid; /* identify sender */ + int rtm_seq; /* for sender to identify action */ + int rtm_errno; /* why failed */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ struct rt_metrics rtm_rmx; /* metrics themselves */ }; struct rt_msghdr2 { - u_short rtm_msglen; /* to skip over non-understood messages */ - u_char rtm_version; /* future binary compatibility */ - u_char rtm_type; /* message type */ - u_short rtm_index; /* index for associated ifp */ - int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ - int rtm_addrs; /* bitmask identifying sockaddrs in msg */ - int32_t rtm_refcnt; /* reference count */ - int rtm_parentflags; /* flags of the parent route */ - int rtm_reserved; /* reserved field set to 0 */ - int rtm_use; /* from rtentry */ - u_int32_t rtm_inits; /* which metrics we are initializing */ + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + int32_t rtm_refcnt; /* reference count */ + int rtm_parentflags; /* flags of the parent route */ + int rtm_reserved; /* reserved field set to 0 */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ struct rt_metrics rtm_rmx; /* metrics themselves */ }; - -#define RTM_VERSION 5 /* Up the ante and ignore older versions */ +#define RTM_VERSION 5 /* Up the ante and ignore older versions */ /* * Message types. */ -#define RTM_ADD 0x1 /* Add Route */ -#define RTM_DELETE 0x2 /* Delete Route */ -#define RTM_CHANGE 0x3 /* Change Metrics or flags */ -#define RTM_GET 0x4 /* Report Metrics */ -#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ -#define RTM_REDIRECT 0x6 /* Told to use different route */ -#define RTM_MISS 0x7 /* Lookup failed on this address */ -#define RTM_LOCK 0x8 /* fix specified metrics */ -#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ -#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ -#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ -#define RTM_NEWADDR 0xc /* address being added to iface */ -#define RTM_DELADDR 0xd /* address being removed from iface */ -#define RTM_IFINFO 0xe /* iface going up/down etc. */ -#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ -#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ -#define RTM_IFINFO2 0x12 /* */ -#define RTM_NEWMADDR2 0x13 /* */ -#define RTM_GET2 0x14 /* */ +#define RTM_ADD 0x1 /* Add Route */ +#define RTM_DELETE 0x2 /* Delete Route */ +#define RTM_CHANGE 0x3 /* Change Metrics or flags */ +#define RTM_GET 0x4 /* Report Metrics */ +#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ +#define RTM_REDIRECT 0x6 /* Told to use different route */ +#define RTM_MISS 0x7 /* Lookup failed on this address */ +#define RTM_LOCK 0x8 /* fix specified metrics */ +#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ +#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ +#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ +#define RTM_NEWADDR 0xc /* address being added to iface */ +#define RTM_DELADDR 0xd /* address being removed from iface */ +#define RTM_IFINFO 0xe /* iface going up/down etc. */ +#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ +#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ +#define RTM_IFINFO2 0x12 /* */ +#define RTM_NEWMADDR2 0x13 /* */ +#define RTM_GET2 0x14 /* */ /* * Bitmask values for rtm_inits and rmx_locks. */ -#define RTV_MTU 0x1 /* init or lock _mtu */ -#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ -#define RTV_EXPIRE 0x4 /* init or lock _expire */ -#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ -#define RTV_SPIPE 0x10 /* init or lock _sendpipe */ -#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ -#define RTV_RTT 0x40 /* init or lock _rtt */ -#define RTV_RTTVAR 0x80 /* init or lock _rttvar */ +#define RTV_MTU 0x1 /* init or lock _mtu */ +#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ +#define RTV_EXPIRE 0x4 /* init or lock _expire */ +#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ +#define RTV_SPIPE 0x10 /* init or lock _sendpipe */ +#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ +#define RTV_RTT 0x40 /* init or lock _rtt */ +#define RTV_RTTVAR 0x80 /* init or lock _rttvar */ /* * Bitmask values for rtm_addrs. */ -#define RTA_DST 0x1 /* destination sockaddr present */ -#define RTA_GATEWAY 0x2 /* gateway sockaddr present */ -#define RTA_NETMASK 0x4 /* netmask sockaddr present */ -#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ -#define RTA_IFP 0x10 /* interface name sockaddr present */ -#define RTA_IFA 0x20 /* interface addr sockaddr present */ -#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ -#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ +#define RTA_DST 0x1 /* destination sockaddr present */ +#define RTA_GATEWAY 0x2 /* gateway sockaddr present */ +#define RTA_NETMASK 0x4 /* netmask sockaddr present */ +#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ +#define RTA_IFP 0x10 /* interface name sockaddr present */ +#define RTA_IFA 0x20 /* interface addr sockaddr present */ +#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ +#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ /* * Index offsets for sockaddr array for alternate internal encoding. */ -#define RTAX_DST 0 /* destination sockaddr present */ -#define RTAX_GATEWAY 1 /* gateway sockaddr present */ -#define RTAX_NETMASK 2 /* netmask sockaddr present */ -#define RTAX_GENMASK 3 /* cloning mask sockaddr present */ -#define RTAX_IFP 4 /* interface name sockaddr present */ -#define RTAX_IFA 5 /* interface addr sockaddr present */ -#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ -#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ -#define RTAX_MAX 8 /* size of array to allocate */ +#define RTAX_DST 0 /* destination sockaddr present */ +#define RTAX_GATEWAY 1 /* gateway sockaddr present */ +#define RTAX_NETMASK 2 /* netmask sockaddr present */ +#define RTAX_GENMASK 3 /* cloning mask sockaddr present */ +#define RTAX_IFP 4 /* interface name sockaddr present */ +#define RTAX_IFA 5 /* interface addr sockaddr present */ +#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ +#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ +#define RTAX_MAX 8 /* size of array to allocate */ struct rt_addrinfo { - int rti_addrs; - struct sockaddr* rti_info[RTAX_MAX]; + int rti_addrs; + struct sockaddr* rti_info[RTAX_MAX]; }; - #endif /* _NET_ROUTE_H_ */ diff --git a/mars/comm/objc/scope_autoreleasepool.h b/mars/comm/objc/scope_autoreleasepool.h index 51e6c39d4..34d95d9f6 100644 --- a/mars/comm/objc/scope_autoreleasepool.h +++ b/mars/comm/objc/scope_autoreleasepool.h @@ -1,7 +1,7 @@ // Tencent is pleased to support the open source community by making Mars available. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. -// Licensed under the MIT License (the "License"); you may not use this file except in +// Licensed under the MIT License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://opensource.org/licenses/MIT @@ -21,15 +21,15 @@ #define __MicroMessenger__scope_autoreleasepool__ class Scope_AutoReleasePool { - public: + public: Scope_AutoReleasePool(); ~Scope_AutoReleasePool(); - private: + private: Scope_AutoReleasePool(const Scope_AutoReleasePool&); Scope_AutoReleasePool& operator=(const Scope_AutoReleasePool&); - private: + private: id m_pool; }; diff --git a/mars/comm/objc/scope_autoreleasepool.mm b/mars/comm/objc/scope_autoreleasepool.mm index 8ac5c8ac3..7c55a9757 100644 --- a/mars/comm/objc/scope_autoreleasepool.mm +++ b/mars/comm/objc/scope_autoreleasepool.mm @@ -1,3 +1,14 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // // scope_autoreleasepool.cpp // MicroMessenger @@ -8,14 +19,8 @@ #include "comm/objc/scope_autoreleasepool.h" #import -Scope_AutoReleasePool::Scope_AutoReleasePool() -: m_pool([[NSAutoreleasePool alloc] init]) -{ -} +Scope_AutoReleasePool::Scope_AutoReleasePool() : m_pool([[NSAutoreleasePool alloc] init]) {} -Scope_AutoReleasePool::~Scope_AutoReleasePool() -{ - [m_pool drain]; -} +Scope_AutoReleasePool::~Scope_AutoReleasePool() { [m_pool drain]; } -void comm_export_symbols_3(){} +void comm_export_symbols_3() {} diff --git a/mars/comm/objc/xlogger_threadinfo.mm b/mars/comm/objc/xlogger_threadinfo.mm index afa2cde68..bfce98f1e 100644 --- a/mars/comm/objc/xlogger_threadinfo.mm +++ b/mars/comm/objc/xlogger_threadinfo.mm @@ -1,3 +1,14 @@ +// Tencent is pleased to support the open source community by making Mars available. +// Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. + +// Licensed under the MIT License (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://opensource.org/licenses/MIT + +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // // xloggr_threadinfo.m // MicroMessenger @@ -7,27 +18,32 @@ #import +#include #include -extern "C" -{ - -intmax_t xlogger_pid() -{ +extern "C" { +static pthread_t s_mainpthread = pthread_self(); + +intmax_t xlogger_pid() { static intmax_t pid = getpid(); return pid; } -intmax_t xlogger_tid() -{ - return (intmax_t)[NSThread currentThread]; +intmax_t xlogger_tid() { + uint64_t tid = 0; + pthread_threadid_np(nullptr, &tid); + return static_cast(tid); } -intmax_t xlogger_maintid() -{ - return (intmax_t)[NSThread mainThread]; +intmax_t xlogger_maintid() { + static intmax_t s_maintid = 0; + if (s_maintid == 0) { + uint64_t tid = 0; + pthread_threadid_np(s_mainpthread, &tid); + s_maintid = static_cast(tid); + } + return s_maintid; } - } -void comm_export_symbols_5(){} +void comm_export_symbols_5() {} diff --git a/mars/comm/ohos/platform_comm.cc b/mars/comm/ohos/platform_comm.cc new file mode 100644 index 000000000..ec29ed0c1 --- /dev/null +++ b/mars/comm/ohos/platform_comm.cc @@ -0,0 +1,63 @@ +// +// Created by gjt on 10/18/24. +// +#include "mars/comm/platform_comm.h" + +namespace mars { +namespace comm { +namespace { +std::shared_ptr s_default_network_cb = std::make_shared(); +std::weak_ptr s_network_cb; + +std::shared_ptr getNetworkInfoCallback() { + auto cb = s_network_cb.lock(); + if (cb) { + return cb; + } + return s_default_network_cb; +} +} // namespace + +void SetNetworkInfoCallback(const std::shared_ptr& _cb) { + s_network_cb = _cb; +} +bool getProxyInfo(int& port, std::string& strProxy, const std::string& _host) { + return getNetworkInfoCallback()->getProxyInfo(port, strProxy, _host); +} +bool getAPNInfo(APNInfo& info) { + return getNetworkInfoCallback()->getAPNInfo(info); +} +NetType getNetInfo(bool realtime) { + return getNetworkInfoCallback()->getNetInfo(realtime); +} +NetTypeForStatistics getNetTypeForStatistics() { + return getNetworkInfoCallback()->getNetTypeForStatistics(); +} +bool getCurRadioAccessNetworkInfo(RadioAccessNetworkInfo& _info) { + return getNetworkInfoCallback()->getCurRadioAccessNetworkInfo(_info); +} +bool getCurWifiInfo(WifiInfo& _wifi_info, bool _force_refresh) { + return getNetworkInfoCallback()->getCurWifiInfo(_wifi_info, _force_refresh); +} +bool getCurSIMInfo(SIMInfo& _sim_info, bool realtime) { + return getNetworkInfoCallback()->getCurSIMInfo(_sim_info, realtime); +} +uint32_t getSignal(bool isWifi) { + return getNetworkInfoCallback()->getSignal(isWifi); +} +bool isNetworkConnected() { + return getNetworkInfoCallback()->isNetworkConnected(); +} +bool getifaddrs_ipv4_hotspot(std::string& _ifname, std::string& _ifip) { + return getNetworkInfoCallback()->getIfAddrsIpv4HotSpot(_ifname, _ifip); +} +void OnPlatformNetworkChange() { + // do nothing +} + +int OSVerifyCertificate(const std::string& hostname, const std::vector& certschain) { + // todo tiemuhuaguo 证书校验 + return 0; +} +} // namespace comm +} // namespace mars \ No newline at end of file diff --git a/mars/comm/ohos/sys/cdefs.h b/mars/comm/ohos/sys/cdefs.h new file mode 100644 index 000000000..fd1252058 --- /dev/null +++ b/mars/comm/ohos/sys/cdefs.h @@ -0,0 +1,10 @@ +#ifndef CDEFS_H +#define CDEFS_H +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif +#endif \ No newline at end of file diff --git a/mars/comm/owl/mpl/preprocessor.h b/mars/comm/owl/mpl/preprocessor.h new file mode 100644 index 000000000..7c252b600 --- /dev/null +++ b/mars/comm/owl/mpl/preprocessor.h @@ -0,0 +1,565 @@ +/* + * Tencent is pleased to support the open source community by making owl available. + * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the MIT License (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +#ifndef _MPL_PREPROCESSOR_H_ +#define _MPL_PREPROCESSOR_H_ + +#define PP_EMPTY() +#define PP_COMMA() , + +// PP_CAT +#define PP_CAT(x, y) PP_CAT_I(x, y) +#define PP_CAT_I(x, y) x##y + +// PP_EXPAND +// FXXK: MSVC doesn't expand __VA_ARGS__ correctly +#define PP_EXPAND(...) __VA_ARGS__ + +// PP_S +// FXXK: PP_S() should expanded to "", but expanded to nothing in MSVC +#if 1 +#define PP_S(...) PP_S_I(__VA_ARGS__) +#define PP_S_I(...) PP_IF(PP_SIZE(__VA_ARGS__), PP_S_II(__VA_ARGS__), "") +#define PP_S_II(...) #__VA_ARGS__ +#else +#define PP_S(macro) PP_S_I(macro) +#define PP_S_I(macro) #macro +#endif + +// PP_ERROR +#define PP_ERROR(code) PP_CAT(PP_ERROR_, code) +#define PP_ERROR_0x0000 PP_INDEX_OUT_OF_BOUNDS +#define PP_ERROR_0x0001 PP_PP_WHILE_OVERFLOW +#define PP_ERROR_0x0002 PP_FOR_OVERFLOW +#define PP_ERROR_0x0003 PP_REPEAT_OVERFLOW +#define PP_ERROR_0x0004 PP_ARITHMETIC_OVERFLOW +#define PP_ERROR_0x0005 PP_ARITHMETIC_UNDERFLOW +#define PP_ERROR_0x0006 PP_DIVISION_BY_ZERO + +// PP_MAX_VALUE +#define PP_MAX_VALUE 20 + +// PP_IS_MAX +#define PP_BOOL_PP_ARITHMETIC_OVERFLOW 0 +#define PP_IS_MAX(x) PP_ZERO(PP_INC(x)) + +// PP_BOOL +#define PP_BOOL(x) PP_BOOL_I(x) +#define PP_BOOL_I(x) PP_BOOL_##x + +#define PP_BOOL_0 0 +#define PP_BOOL_1 1 +#define PP_BOOL_2 1 +#define PP_BOOL_3 1 +#define PP_BOOL_4 1 +#define PP_BOOL_5 1 +#define PP_BOOL_6 1 +#define PP_BOOL_7 1 +#define PP_BOOL_8 1 +#define PP_BOOL_9 1 +#define PP_BOOL_10 1 +#define PP_BOOL_11 1 +#define PP_BOOL_12 1 +#define PP_BOOL_13 1 +#define PP_BOOL_14 1 +#define PP_BOOL_15 1 +#define PP_BOOL_16 1 +#define PP_BOOL_17 1 +#define PP_BOOL_18 1 +#define PP_BOOL_19 1 +#define PP_BOOL_20 1 + +// PP_ZERO +#define PP_ZERO PP_NOT + +// PP_NOT_ZERO +#define PP_NOT_ZERO PP_BOOL + +// PP_BITNOT +#define PP_BITNOT(x) PP_BITNOT_I(x) +#define PP_BITNOT_I(x) PP_NOT_##x + +#define PP_NOT_0 1 +#define PP_NOT_1 0 + +// PP_BITAND +#define PP_BITAND(x, y) PP_BITAND_I(x, y) +#define PP_BITAND_I(x, y) PP_BITAND_##x##y + +#define PP_BITAND_00 0 +#define PP_BITAND_01 0 +#define PP_BITAND_10 0 +#define PP_BITAND_11 1 + +// PP_BITOR +#define PP_BITOR(x, y) PP_BITOR_I(x, y) +#define PP_BITOR_I(x, y) PP_BITOR_##x##y + +#define PP_BITOR_00 0 +#define PP_BITOR_01 1 +#define PP_BITOR_10 1 +#define PP_BITOR_11 1 + +// PP_BITXOR +#define PP_BITXOR(x, y) PP_BITXOR_I(x, y) +#define PP_BITXOR_I(x, y) PP_BITXOR_##x##y + +#define PP_BITXOR_00 0 +#define PP_BITXOR_01 1 +#define PP_BITXOR_10 1 +#define PP_BITXOR_11 0 + +// PP_NOT +#define PP_NOT(x) PP_BITNOT(PP_BOOL(x)) + +// PP_AND +#define PP_AND(p, q) PP_BITAND(PP_BOOL(p), PP_BOOL(q)) + +// PP_OR +#define PP_OR(p, q) PP_BITOR(PP_BOOL(p), PP_BOOL(q)) + +// PP_XOR +#define PP_XOR(p, q) PP_BITXOR(PP_BOOL(p), PP_BOOL(q)) + +// PP_IF +#define PP_IF(c, t, f) PP_IF_I(PP_BOOL(c))(t, f) +#define PP_IF_I(b) PP_IF_II(b) +#define PP_IF_II(b) PP_IF_##b + +#define PP_IF_0(t, f) f +#define PP_IF_1(t, f) t + +// PP_COMMA_IF +#define PP_COMMA_IF(c) PP_IF(c, PP_COMMA, PP_EMPTY)() + +// PP_CALL +#define PP_CALL(f, arg) f arg + +//@see https://github.com/swansontec/map-macro +#define PP_EVAL(...) PP_EVAL1(PP_EVAL1(PP_EVAL1(__VA_ARGS__))) +#define PP_EVAL1(...) PP_EVAL2(PP_EVAL2(PP_EVAL2(__VA_ARGS__))) +#define PP_EVAL2(...) __VA_ARGS__ + +// PP_SIZE +#ifdef _WIN32 +#define PP_SIZE(...) PP_CALL(PP_SIZE_, (, __VA_ARGS__)) +#else +// @see https://stackoverflow.com/questions/5588855/standard-alternative-to-gccs-va-args-trick +#define PP_COMMA_IF_FIRST_EMPTY(x, ...) PP_CALL0 x(PP_COMMA) +#define PP_CALL0(x) x() + +#define PP_COMMA_IF_EMPTY(...) \ + PP_REMOVE_FIRST(PP_COMMA_IF_FIRST_EMPTY(__VA_ARGS__) PP_COMMA_IF_EMPTY_OR_SINGLE(__VA_ARGS__)) +#define PP_REMOVE_FIRST(...) PP_REMOVE_FIRST_I(__VA_ARGS__) +#define PP_REMOVE_FIRST_I(x, ...) __VA_ARGS__ + +#define PP_COMMA_IF_EMPTY_OR_SINGLE(...) PP_COMMA_IF_EMPTY_OR_SINGLE_I(__VA_ARGS__, PP_COMMA) +#define PP_COMMA_IF_EMPTY_OR_SINGLE_I(x, y, ...) PP_REMOVE_FIRST(y(), ) + +#define PP_COMMA_IF_NOT_EMPTY(...) PP_CALL1(PP_COMMA_IF_EMPTY(__VA_ARGS__) PP_REMOVE_FIRST_I, PP_COMMA) +#define PP_CALL1(...) PP_CALL1_I(__VA_ARGS__) +#define PP_CALL1_I(x, y, ...) y() + +// some compiler can not use GNU C ##__VA_ARGS__ extension when using -std=c++11 +//#define PP_SIZE(...) PP_CALL(PP_SIZE_, (, ##__VA_ARGS__)) +#define PP_SIZE(...) PP_CALL(PP_SIZE_, (PP_COMMA_IF_NOT_EMPTY(__VA_ARGS__) __VA_ARGS__)) +#endif +//#define PP_SIZE(...) PP_SIZE_I(_, ##__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, +// 7, 6, 5, 4, 3, 2, 1, 0) +#define PP_SIZE_(...) \ + PP_EXPAND(PP_SIZE_I(__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)) +#define PP_SIZE_I(_0, \ + _1, \ + _2, \ + _3, \ + _4, \ + _5, \ + _6, \ + _7, \ + _8, \ + _9, \ + _10, \ + _11, \ + _12, \ + _13, \ + _14, \ + _15, \ + _16, \ + _17, \ + _18, \ + _19, \ + _20, \ + N, \ + ...) \ + N + +// @deprecated, use PP_SIZE instead +#define PP_NUM_PARAMS PP_SIZE +#define PP_VARIADIC_SIZE PP_SIZE + +// PP_ENUM +#define PP_ENUM(count, param) PP_REPEAT(count, PP_ENUM_M, param) +#define PP_ENUM_M(n, text) PP_COMMA_IF(n) text + +// PP_ENUM_PARAMS +#define PP_ENUM_PARAMS(count, param) PP_REPEAT(count, PP_ENUM_PARAMS_M, param) +#define PP_ENUM_PARAMS_M(n, text) PP_COMMA_IF(n) text##n + +// PP_ENUM_BINARY_PARAMS +#define PP_ENUM_BINARY_PARAMS(count, a, b) PP_BINARY_REPEAT(count, PP_ENUM_BINARY_PARAMS_M, a, b) +#define PP_ENUM_BINARY_PARAMS_M(n, a, b) PP_COMMA_IF(n) a##n b##n + +// PP_ENUM_TRAILING +#define PP_ENUM_TRAILING(count, param) PP_REPEAT(count, PP_ENUM_TRAILING_M, param) +#define PP_ENUM_TRAILING_M(n, text) , text + +// PP_ENUM_TRAILING_PARAMS +#define PP_ENUM_TRAILING_PARAMS(count, param) PP_REPEAT(count, PP_ENUM_TRAILING_PARAMS_M, param) +#define PP_ENUM_TRAILING_PARAMS_M(n, text) , text##n + +// PP_ENUM_TRAILING_BINARY_PARAMS +#define PP_ENUM_TRAILING_BINARY_PARAMS(count, a, b) PP_BINARY_REPEAT(count, PP_ENUM_TRAILING_BINARY_PARAMS_M, a, b) +#define PP_ENUM_TRAILING_BINARY_PARAMS_M(n, a, b) , a##n b##n + +// PP_REPEAT +#define PP_REPEAT(count, macro, data) PP_REPEAT_I(count, macro, data) +#define PP_REPEAT_I(count, macro, data) PP_REPEAT_##count(macro, data) + +#define PP_REPEAT_0(macro, data) +#define PP_REPEAT_1(macro, data) PP_REPEAT_0(macro, data) macro(0, data) +#define PP_REPEAT_2(macro, data) PP_REPEAT_1(macro, data) macro(1, data) +#define PP_REPEAT_3(macro, data) PP_REPEAT_2(macro, data) macro(2, data) +#define PP_REPEAT_4(macro, data) PP_REPEAT_3(macro, data) macro(3, data) +#define PP_REPEAT_5(macro, data) PP_REPEAT_4(macro, data) macro(4, data) +#define PP_REPEAT_6(macro, data) PP_REPEAT_5(macro, data) macro(5, data) +#define PP_REPEAT_7(macro, data) PP_REPEAT_6(macro, data) macro(6, data) +#define PP_REPEAT_8(macro, data) PP_REPEAT_7(macro, data) macro(7, data) +#define PP_REPEAT_9(macro, data) PP_REPEAT_8(macro, data) macro(8, data) +#define PP_REPEAT_10(macro, data) PP_REPEAT_9(macro, data) macro(9, data) +#define PP_REPEAT_11(macro, data) PP_REPEAT_10(macro, data) macro(10, data) +#define PP_REPEAT_12(macro, data) PP_REPEAT_11(macro, data) macro(11, data) +#define PP_REPEAT_13(macro, data) PP_REPEAT_12(macro, data) macro(12, data) +#define PP_REPEAT_14(macro, data) PP_REPEAT_13(macro, data) macro(13, data) +#define PP_REPEAT_15(macro, data) PP_REPEAT_14(macro, data) macro(14, data) +#define PP_REPEAT_16(macro, data) PP_REPEAT_15(macro, data) macro(15, data) +#define PP_REPEAT_17(macro, data) PP_REPEAT_16(macro, data) macro(16, data) +#define PP_REPEAT_18(macro, data) PP_REPEAT_17(macro, data) macro(17, data) +#define PP_REPEAT_19(macro, data) PP_REPEAT_18(macro, data) macro(18, data) +#define PP_REPEAT_20(macro, data) PP_REPEAT_19(macro, data) macro(19, data) + +// PP_BINARY_REPEAT +#define PP_BINARY_REPEAT(count, macro, data1, data2) PP_BINARY_REPEAT_I(count, macro, data1, data2) +//#define PP_BINARY_REPEAT_I(count, macro, data1, data2) PP_BINARY_REPEAT_##count(macro, data1, data2) +#define PP_BINARY_REPEAT_I(count, macro, data1, data2) PP_CAT(PP_BINARY_REPEAT_, count)(macro, data1, data2) + +#define PP_BINARY_REPEAT_0(macro, data1, data2) +#define PP_BINARY_REPEAT_1(macro, data1, data2) PP_BINARY_REPEAT_0(macro, data1, data2) macro(0, data1, data2) +#define PP_BINARY_REPEAT_2(macro, data1, data2) PP_BINARY_REPEAT_1(macro, data1, data2) macro(1, data1, data2) +#define PP_BINARY_REPEAT_3(macro, data1, data2) PP_BINARY_REPEAT_2(macro, data1, data2) macro(2, data1, data2) +#define PP_BINARY_REPEAT_4(macro, data1, data2) PP_BINARY_REPEAT_3(macro, data1, data2) macro(3, data1, data2) +#define PP_BINARY_REPEAT_5(macro, data1, data2) PP_BINARY_REPEAT_4(macro, data1, data2) macro(4, data1, data2) +#define PP_BINARY_REPEAT_6(macro, data1, data2) PP_BINARY_REPEAT_5(macro, data1, data2) macro(5, data1, data2) +#define PP_BINARY_REPEAT_7(macro, data1, data2) PP_BINARY_REPEAT_6(macro, data1, data2) macro(6, data1, data2) +#define PP_BINARY_REPEAT_8(macro, data1, data2) PP_BINARY_REPEAT_7(macro, data1, data2) macro(7, data1, data2) +#define PP_BINARY_REPEAT_9(macro, data1, data2) PP_BINARY_REPEAT_8(macro, data1, data2) macro(8, data1, data2) +#define PP_BINARY_REPEAT_10(macro, data1, data2) PP_BINARY_REPEAT_9(macro, data1, data2) macro(9, data1, data2) +#define PP_BINARY_REPEAT_11(macro, data1, data2) PP_BINARY_REPEAT_10(macro, data1, data2) macro(10, data1, data2) +#define PP_BINARY_REPEAT_12(macro, data1, data2) PP_BINARY_REPEAT_11(macro, data1, data2) macro(11, data1, data2) +#define PP_BINARY_REPEAT_13(macro, data1, data2) PP_BINARY_REPEAT_12(macro, data1, data2) macro(12, data1, data2) +#define PP_BINARY_REPEAT_14(macro, data1, data2) PP_BINARY_REPEAT_13(macro, data1, data2) macro(13, data1, data2) +#define PP_BINARY_REPEAT_15(macro, data1, data2) PP_BINARY_REPEAT_14(macro, data1, data2) macro(14, data1, data2) +#define PP_BINARY_REPEAT_16(macro, data1, data2) PP_BINARY_REPEAT_15(macro, data1, data2) macro(15, data1, data2) +#define PP_BINARY_REPEAT_17(macro, data1, data2) PP_BINARY_REPEAT_16(macro, data1, data2) macro(16, data1, data2) +#define PP_BINARY_REPEAT_18(macro, data1, data2) PP_BINARY_REPEAT_17(macro, data1, data2) macro(17, data1, data2) +#define PP_BINARY_REPEAT_19(macro, data1, data2) PP_BINARY_REPEAT_18(macro, data1, data2) macro(18, data1, data2) +#define PP_BINARY_REPEAT_20(macro, data1, data2) PP_BINARY_REPEAT_19(macro, data1, data2) macro(19, data1, data2) + +// PP_INC +#define PP_INC(x) PP_INC_I(x) +#define PP_INC_I(x) PP_INC_##x + +#define PP_INC_0 1 +#define PP_INC_1 2 +#define PP_INC_2 3 +#define PP_INC_3 4 +#define PP_INC_4 5 +#define PP_INC_5 6 +#define PP_INC_6 7 +#define PP_INC_7 8 +#define PP_INC_8 9 +#define PP_INC_9 10 +#define PP_INC_10 11 +#define PP_INC_11 12 +#define PP_INC_12 13 +#define PP_INC_13 14 +#define PP_INC_14 15 +#define PP_INC_15 16 +#define PP_INC_16 17 +#define PP_INC_17 18 +#define PP_INC_18 19 +#define PP_INC_19 20 +#define PP_INC_20 PP_ERROR(0x0004) + +// PP_DEC +#define PP_DEC(x) PP_DEC_I(x) +#define PP_DEC_I(x) PP_DEC_##x + +#define PP_DEC_0 PP_ERROR(0x0005) +#define PP_DEC_1 0 +#define PP_DEC_2 1 +#define PP_DEC_3 2 +#define PP_DEC_4 3 +#define PP_DEC_5 4 +#define PP_DEC_6 5 +#define PP_DEC_7 6 +#define PP_DEC_8 7 +#define PP_DEC_9 8 +#define PP_DEC_10 9 +#define PP_DEC_11 10 +#define PP_DEC_12 11 +#define PP_DEC_13 12 +#define PP_DEC_14 13 +#define PP_DEC_15 14 +#define PP_DEC_16 15 +#define PP_DEC_17 16 +#define PP_DEC_18 17 +#define PP_DEC_19 18 +#define PP_DEC_20 19 + +// PP_WHILE +#define PP_WHILE(p, o, s) PP_WHILE_0(p, o, s) + +#define PP_WHILE__(p, o, s) s +#define PP_WHILE_0(p, o, s) PP_WHILE_N(1, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_1(p, o, s) PP_WHILE_N(2, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_2(p, o, s) PP_WHILE_N(3, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_3(p, o, s) PP_WHILE_N(4, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_4(p, o, s) PP_WHILE_N(5, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_5(p, o, s) PP_WHILE_N(6, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_6(p, o, s) PP_WHILE_N(7, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_7(p, o, s) PP_WHILE_N(8, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_8(p, o, s) PP_WHILE_N(9, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_9(p, o, s) PP_WHILE_N(10, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_10(p, o, s) PP_WHILE_N(11, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_11(p, o, s) PP_WHILE_N(12, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_12(p, o, s) PP_WHILE_N(13, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_13(p, o, s) PP_WHILE_N(14, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_14(p, o, s) PP_WHILE_N(15, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_15(p, o, s) PP_WHILE_N(16, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_16(p, o, s) PP_WHILE_N(17, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_17(p, o, s) PP_WHILE_N(18, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_18(p, o, s) PP_WHILE_N(19, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_19(p, o, s) PP_WHILE_N(20, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_20(p, o, s) PP_WHILE_N(21, p, s)(p, o, PP_WHILE_S(p, o, s)) +#define PP_WHILE_21(p, o, s) PP_ERROR(0x0001) + +#define PP_WHILE_N(n, p, s) PP_CAT(PP_WHILE_, PP_IF(p(s), n, _)) +#define PP_WHILE_S(p, o, s) PP_IF(p(s), o(s), s) + +// PP_TUPLE +#define PP_TUPLE(...) (__VA_ARGS__) + +// PP_TUPLE_SIZE +#define PP_TUPLE_SIZE(tuple) PP_EXPAND(PP_SIZE tuple) + +// PP_TUPLE_EAT +#define PP_TUPLE_EAT(...) + +// PP_TUPLE_REM +#define PP_TUPLE_REM(tuple) PP_EXPAND(PP_TUPLE_REM_I tuple) +#define PP_TUPLE_REM_I(...) __VA_ARGS__ + +// PP_TUPLE_AT +#define PP_TUPLE_AT(i, tuple) PP_AT(i, PP_TUPLE_REM(tuple)) + +#define PP_AT(i, ...) PP_AT_I(i, __VA_ARGS__) +#define PP_AT_I(i, ...) PP_EXPAND(PP_CAT(PP_AT_I_, i)(__VA_ARGS__, )) + +#define PP_AT_I_0(_0, ...) _0 +#define PP_AT_I_1(_0, _1, ...) _1 +#define PP_AT_I_2(_0, _1, _2, ...) _2 +#define PP_AT_I_3(_0, _1, _2, _3, ...) _3 +#define PP_AT_I_4(_0, _1, _2, _3, _4, ...) _4 +#define PP_AT_I_5(_0, _1, _2, _3, _4, _5, ...) _5 +#define PP_AT_I_6(_0, _1, _2, _3, _4, _5, _6, ...) _6 +#define PP_AT_I_7(_0, _1, _2, _3, _4, _5, _6, _7, ...) _7 +#define PP_AT_I_8(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) _8 +#define PP_AT_I_9(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) _9 +#define PP_AT_I_10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, ...) _10 +#define PP_AT_I_11(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) _11 +#define PP_AT_I_12(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, ...) _12 +#define PP_AT_I_13(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, ...) _13 +#define PP_AT_I_14(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, ...) _14 +#define PP_AT_I_15(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) _15 +#define PP_AT_I_16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, ...) _16 +#define PP_AT_I_17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, ...) _17 +#define PP_AT_I_18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, ...) _18 +#define PP_AT_I_19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, ...) _19 +#define PP_AT_I_20(...) PP_ERROR(0x0000) + +// PP_TUPLE_REPEAT +#define PP_TUPLE_REPEAT(macro, tuple) PP_TUPLE_REPEAT_I(macro, PP_TUPLE_SIZE(tuple), tuple) +#define PP_TUPLE_REPEAT_I(macro, count, tuple) PP_REPEAT(count, macro, tuple) + +// PP_TUPLE_FOREACH +#define PP_TUPLE_FOREACH(macro, tuple) PP_TUPLE_FOREACH_I(macro, tuple) +#define PP_TUPLE_FOREACH_I(macro, tuple) PP_BINARY_REPEAT(PP_TUPLE_SIZE(tuple), PP_TUPLE_FOREACH_M, macro, tuple) +#define PP_TUPLE_FOREACH_M(i, macro, tuple) macro(i, PP_TUPLE_AT(i, tuple)) + +// PP_FOREACH +#define PP_FOREACH(macro, ...) PP_TUPLE_FOREACH(macro, PP_TUPLE(__VA_ARGS__)) + +// PP_ADD +#define PP_ADD(x, y) PP_ADD_1(PP_SAFE_ADD_I(x, y)) +#define PP_ADD_1(ab) PP_EXPAND(PP_ADD_2 ab) +#define PP_ADD_2(a, b) PP_IF(b, PP_ERROR(0x0004), a) + +// PP_SAFE_ADD +// +// if x + y <= 20 return (x + y, 0) else return (20, x + y - 20) +// eg: +// PP_SAFE_ADD_I(2, 2) -> (4, 0) +// PP_SAFE_ADD_I(10, 11) -> (20, 1) +// PP_SAFE_ADD_I(20, 11) -> (20, 11) +// +#define PP_SAFE_ADD_I(x, y) PP_WHILE(PP_SAFE_ADD_P, PP_SAFE_ADD_O, (x, y)) +#define PP_SAFE_ADD_P(xy) PP_SAFE_ADD_P_I xy +#define PP_SAFE_ADD_P_I(x, y) PP_AND(PP_NOT(PP_IS_MAX(x)), y) +#define PP_SAFE_ADD_O(xy) PP_SAFE_ADD_O_I xy +#define PP_SAFE_ADD_O_I(x, y) (PP_INC(x), PP_DEC(y)) + +// PP_SUB +#define PP_SUB(x, y) PP_SUB_1(PP_SAFE_SUB_I(x, y)) +#define PP_SUB_1(ab) PP_EXPAND(PP_SUB_2 ab) +#define PP_SUB_2(a, b) PP_IF(b, PP_ERROR(0x0005), a) + +// PP_SAFE_SUB +// +// if x < y return (0, y - x) else return (y - x, 0) +// eg: +// PP_SAFE_SUB_I(2, 2) -> (0, 0) +// PP_SAFE_SUB_I(2, 5) -> (0, 3) +// PP_SAFE_SUB_I(5, 2) -> (3, 0) +// +#define PP_SAFE_SUB_I(x, y) PP_WHILE(PP_SAFE_SUB_P, PP_SAFE_SUB_O, (x, y)) +#define PP_SAFE_SUB_P(xy) PP_SAFE_SUB_P_I xy +#define PP_SAFE_SUB_P_I(x, y) PP_AND(x, y) +#define PP_SAFE_SUB_O(xy) PP_SAFE_SUB_O_I xy +#define PP_SAFE_SUB_O_I(x, y) (PP_DEC(x), PP_DEC(y)) + +// PP_ABS_SUB +// +// return abs(x - y) +// eg: +// PP_ABS_SUB(2, 5) -> 3 +// PP_ABS_SUB(5, 2) -> 3 +// +#define PP_ABS_SUB(x, y) PP_EVAL(PP_ABS_SUB_I(PP_SAFE_SUB_I(x, y))) +#define PP_ABS_SUB_I(xy) PP_ABS_SUB_II xy +#define PP_ABS_SUB_II(x, y) PP_IF(PP_TUPLE_AT(0, (x, y)), x, y) + +// PP_NE +#define PP_NE(x, y) PP_NOT_ZERO(PP_ABS_SUB(x, y)) + +// PP_EQ +#define PP_EQ(x, y) PP_NOT(PP_NE(x, y)) + +// PP_LT +#define PP_LT(x, y) PP_NOT_ZERO(PP_TUPLE_AT(1, PP_SAFE_SUB_I(x, y))) + +// PP_GT +#define PP_GT(x, y) PP_NOT_ZERO(PP_TUPLE_AT(0, PP_SAFE_SUB_I(x, y))) + +// PP_LE +#define PP_LE(x, y) PP_NOT(PP_GT(x, y)) + +// PP_GE +#define PP_GE(x, y) PP_NOT(PP_LT(x, y)) + +// PP_MIN +#define PP_MIN(x, y) PP_IF(PP_GT(x, y), y, x) + +// PP_MAX +#define PP_MAX(x, y) PP_IF(PP_GT(x, y), x, y) + +// PP_MUL +#define PP_MUL(x, y) PP_ADD_V(PP_REPEAT(x, PP_MUL_M, y)) +#define PP_MUL_M(i, y) PP_COMMA_IF(i) y + +#define PP_ADD_V(...) PP_ADD_V_I(PP_EVAL(PP_SIZE(__VA_ARGS__)), PP_TUPLE(__VA_ARGS__)) +#define PP_ADD_V_I(n, tuple) PP_ADD_I(n, tuple) +#define PP_ADD_I(n, tuple) PP_ADD_I_##n tuple +#define PP_ADD_I_20(_1, ...) PP_ADD(_1, PP_ADD_I_19(__VA_ARGS__)) +#define PP_ADD_I_19(_1, ...) PP_ADD(_1, PP_ADD_I_18(__VA_ARGS__)) +#define PP_ADD_I_18(_1, ...) PP_ADD(_1, PP_ADD_I_17(__VA_ARGS__)) +#define PP_ADD_I_17(_1, ...) PP_ADD(_1, PP_ADD_I_16(__VA_ARGS__)) +#define PP_ADD_I_16(_1, ...) PP_ADD(_1, PP_ADD_I_15(__VA_ARGS__)) +#define PP_ADD_I_15(_1, ...) PP_ADD(_1, PP_ADD_I_14(__VA_ARGS__)) +#define PP_ADD_I_14(_1, ...) PP_ADD(_1, PP_ADD_I_13(__VA_ARGS__)) +#define PP_ADD_I_13(_1, ...) PP_ADD(_1, PP_ADD_I_12(__VA_ARGS__)) +#define PP_ADD_I_12(_1, ...) PP_ADD(_1, PP_ADD_I_11(__VA_ARGS__)) +#define PP_ADD_I_11(_1, ...) PP_ADD(_1, PP_ADD_I_10(__VA_ARGS__)) +#define PP_ADD_I_10(_1, ...) PP_ADD(_1, PP_ADD_I_9(__VA_ARGS__)) +#define PP_ADD_I_9(_1, ...) PP_ADD(_1, PP_ADD_I_8(__VA_ARGS__)) +#define PP_ADD_I_8(_1, ...) PP_ADD(_1, PP_ADD_I_7(__VA_ARGS__)) +#define PP_ADD_I_7(_1, ...) PP_ADD(_1, PP_ADD_I_6(__VA_ARGS__)) +#define PP_ADD_I_6(_1, ...) PP_ADD(_1, PP_ADD_I_5(__VA_ARGS__)) +#define PP_ADD_I_5(_1, ...) PP_ADD(_1, PP_ADD_I_4(__VA_ARGS__)) +#define PP_ADD_I_4(_1, ...) PP_ADD(_1, PP_ADD_I_3(__VA_ARGS__)) +#define PP_ADD_I_3(_1, ...) PP_ADD(_1, PP_ADD_I_2(__VA_ARGS__)) +#define PP_ADD_I_2(_1, _2) PP_ADD(_1, _2) +#define PP_ADD_I_1(_1) _1 +#define PP_ADD_I_0() 0 + +// PP_RANGE +// +// eg: +// PP_RANGE(0, 0) -> EMPTY +// PP_RANGE(0, 1) -> 0 +// PP_RANGE(0, 2) -> 0, 1 +// PP_RANGE(0, 3) -> 0, 1, 2 +// PP_RANGE(1, 0) -> 1 +// PP_RANGE(2, 0) -> 2, 1 +// PP_RANGE(3, 0) -> 3, 2, 1 +// +// PP_RANGE_UNTIL(0, 0) -> 0 +// PP_RANGE_UNTIL(0, 1) -> 0, 1 +// PP_RANGE_UNTIL(0, 2) -> 0, 1, 2 +// PP_RANGE_UNTIL(0, 3) -> 0, 1, 2, 3 +// PP_RANGE_UNTIL(1, 0) -> 1, 0 +// PP_RANGE_UNTIL(2, 0) -> 2, 1, 0 +// PP_RANGE_UNTIL(3, 0) -> 3, 2, 1, 0 +// +#define PP_RANGE(begin, end) PP_IF(PP_LE(begin, end), PP_RANGE_N, PP_RANGE_R)(begin, end) +#define PP_RANGE_UNTIL(begin, end) PP_IF(PP_LE(begin, end), PP_RANGE_UNTIL_N, PP_RANGE_UNTIL_R)(begin, end) + +#define PP_RANGE_N(begin, end) PP_RANGE_N_I(begin, end) +#define PP_RANGE_N_I(begin, end) PP_REPEAT(PP_SUB(end, begin), PP_RANGE_N_M, begin) +#define PP_RANGE_N_M(i, begin) PP_COMMA_IF(i) PP_ADD(begin, i) + +#define PP_RANGE_R(end, begin) PP_RANGE_R_I(end, begin) +#define PP_RANGE_R_I(end, begin) PP_REPEAT(PP_SUB(end, begin), PP_RANGE_R_M, end) +#define PP_RANGE_R_M(i, end) PP_COMMA_IF(i) PP_SUB(end, i) + +#define PP_RANGE_UNTIL_N(begin, end) PP_RANGE_UNTIL_N_I(begin, end) +#define PP_RANGE_UNTIL_N_I(begin, end) PP_REPEAT(PP_INC(PP_SUB(end, begin)), PP_RANGE_N_M, begin) + +#define PP_RANGE_UNTIL_R(end, begin) PP_RANGE_UNTIL_R_I(end, begin) +#define PP_RANGE_UNTIL_R_I(end, begin) PP_REPEAT(PP_INC(PP_SUB(end, begin)), PP_RANGE_R_M, end) + +// PP_LINE_VAR +#define PP_LINE_VAR(x) PP_CAT(x, __LINE__) + +#endif /* _MPL_PREPROCESSOR_H_ */ diff --git a/mars/comm/owl/mpl/typelist.h b/mars/comm/owl/mpl/typelist.h new file mode 100644 index 000000000..05a2f9dcb --- /dev/null +++ b/mars/comm/owl/mpl/typelist.h @@ -0,0 +1,249 @@ +/* + * Tencent is pleased to support the open source community by making owl available. + * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the MIT License (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +#ifndef _MPL_TYPE_LIST_H_ +#define _MPL_TYPE_LIST_H_ + +#include +#include +#include + +namespace owl { + +struct null_t {}; + +template +struct typelist { + using Head = H; + using Tail = T; +}; + +// make_typelist +template +struct make_typelist_; + +template +using make_typelist = typename make_typelist_::type; + +template <> +struct make_typelist_<> { + using type = null_t; +}; + +template +struct make_typelist_ { + using type = typelist::type>; +}; + +// typelist_size +template +struct typelist_size; + +template <> +struct typelist_size { + enum { value = 0 }; +}; + +template +struct typelist_size> { + enum { value = typelist_size::value + 1 }; +}; + +// typelist_find +template +struct typelist_find; + +template +struct typelist_find { + enum { value = -1 }; +}; + +template +struct typelist_find, T> { + enum { value = 0 }; +}; + +template +struct typelist_find, T> { + enum { next_value = typelist_find::value }; + enum { value = next_value == -1 ? -1 : next_value + 1 }; +}; + +// typelist_find_if +template class Predicate> +struct typelist_find_if_; + +template