├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── build.gradle ├── gradle.properties ├── gradle ├── WeChatNativeDepend.gradle ├── WeChatPublish.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libapp2sys ├── .gitignore ├── CMakeLists.txt ├── build.gradle ├── gradle.properties ├── prebuilt │ ├── arm64-v8a │ │ └── libprotobuf-lite.a │ ├── armeabi-v7a │ │ └── libprotobuf-lite.a │ ├── include │ │ └── google │ │ │ └── protobuf │ │ │ ├── any.h │ │ │ ├── any.pb.h │ │ │ ├── any.proto │ │ │ ├── api.pb.h │ │ │ ├── api.proto │ │ │ ├── arena.h │ │ │ ├── arenastring.h │ │ │ ├── compiler │ │ │ ├── code_generator.h │ │ │ ├── command_line_interface.h │ │ │ ├── cpp │ │ │ │ └── cpp_generator.h │ │ │ ├── csharp │ │ │ │ ├── csharp_generator.h │ │ │ │ └── csharp_names.h │ │ │ ├── importer.h │ │ │ ├── java │ │ │ │ ├── java_generator.h │ │ │ │ └── java_names.h │ │ │ ├── javanano │ │ │ │ └── javanano_generator.h │ │ │ ├── js │ │ │ │ └── js_generator.h │ │ │ ├── objectivec │ │ │ │ ├── objectivec_generator.h │ │ │ │ └── objectivec_helpers.h │ │ │ ├── parser.h │ │ │ ├── php │ │ │ │ └── php_generator.h │ │ │ ├── plugin.h │ │ │ ├── plugin.pb.h │ │ │ ├── plugin.proto │ │ │ ├── python │ │ │ │ └── python_generator.h │ │ │ └── ruby │ │ │ │ └── ruby_generator.h │ │ │ ├── descriptor.h │ │ │ ├── descriptor.pb.h │ │ │ ├── descriptor.proto │ │ │ ├── descriptor_database.h │ │ │ ├── duration.pb.h │ │ │ ├── duration.proto │ │ │ ├── dynamic_message.h │ │ │ ├── empty.pb.h │ │ │ ├── empty.proto │ │ │ ├── extension_set.h │ │ │ ├── field_mask.pb.h │ │ │ ├── field_mask.proto │ │ │ ├── generated_enum_reflection.h │ │ │ ├── generated_enum_util.h │ │ │ ├── generated_message_reflection.h │ │ │ ├── generated_message_util.h │ │ │ ├── has_bits.h │ │ │ ├── io │ │ │ ├── coded_stream.h │ │ │ ├── gzip_stream.h │ │ │ ├── printer.h │ │ │ ├── strtod.h │ │ │ ├── tokenizer.h │ │ │ ├── zero_copy_stream.h │ │ │ ├── zero_copy_stream_impl.h │ │ │ └── zero_copy_stream_impl_lite.h │ │ │ ├── map.h │ │ │ ├── map_entry.h │ │ │ ├── map_entry_lite.h │ │ │ ├── map_field.h │ │ │ ├── map_field_inl.h │ │ │ ├── map_field_lite.h │ │ │ ├── map_type_handler.h │ │ │ ├── message.h │ │ │ ├── message_lite.h │ │ │ ├── metadata.h │ │ │ ├── reflection.h │ │ │ ├── reflection_ops.h │ │ │ ├── repeated_field.h │ │ │ ├── service.h │ │ │ ├── source_context.pb.h │ │ │ ├── source_context.proto │ │ │ ├── struct.pb.h │ │ │ ├── struct.proto │ │ │ ├── stubs │ │ │ ├── atomic_sequence_num.h │ │ │ ├── atomicops.h │ │ │ ├── atomicops_internals_arm64_gcc.h │ │ │ ├── atomicops_internals_arm_gcc.h │ │ │ ├── atomicops_internals_arm_qnx.h │ │ │ ├── atomicops_internals_atomicword_compat.h │ │ │ ├── atomicops_internals_generic_gcc.h │ │ │ ├── atomicops_internals_macosx.h │ │ │ ├── atomicops_internals_mips_gcc.h │ │ │ ├── atomicops_internals_pnacl.h │ │ │ ├── atomicops_internals_power.h │ │ │ ├── atomicops_internals_ppc_gcc.h │ │ │ ├── atomicops_internals_solaris.h │ │ │ ├── atomicops_internals_tsan.h │ │ │ ├── atomicops_internals_x86_gcc.h │ │ │ ├── atomicops_internals_x86_msvc.h │ │ │ ├── bytestream.h │ │ │ ├── callback.h │ │ │ ├── casts.h │ │ │ ├── common.h │ │ │ ├── fastmem.h │ │ │ ├── hash.h │ │ │ ├── logging.h │ │ │ ├── macros.h │ │ │ ├── mutex.h │ │ │ ├── once.h │ │ │ ├── platform_macros.h │ │ │ ├── port.h │ │ │ ├── scoped_ptr.h │ │ │ ├── shared_ptr.h │ │ │ ├── singleton.h │ │ │ ├── status.h │ │ │ ├── stl_util.h │ │ │ ├── stringpiece.h │ │ │ ├── template_util.h │ │ │ └── type_traits.h │ │ │ ├── text_format.h │ │ │ ├── timestamp.pb.h │ │ │ ├── timestamp.proto │ │ │ ├── type.pb.h │ │ │ ├── type.proto │ │ │ ├── unknown_field_set.h │ │ │ ├── util │ │ │ ├── field_comparator.h │ │ │ ├── field_mask_util.h │ │ │ ├── json_util.h │ │ │ ├── message_differencer.h │ │ │ ├── time_util.h │ │ │ ├── type_resolver.h │ │ │ └── type_resolver_util.h │ │ │ ├── wire_format.h │ │ │ ├── wire_format_lite.h │ │ │ ├── wire_format_lite_inl.h │ │ │ ├── wrappers.pb.h │ │ │ └── wrappers.proto │ └── protoc │ │ ├── darwin │ │ └── protoc │ │ ├── linux-amd64 │ │ └── protoc │ │ ├── linux-x86 │ │ └── protoc │ │ ├── win32-amd64 │ │ └── protoc.exe │ │ └── win32-x86 │ │ └── protoc.exe ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── cpp │ ├── c2java.h │ ├── cjson │ │ ├── cJSON.c │ │ └── cJSON.h │ ├── client.h │ ├── com_tencent_mm_hardcoder_HardCoderJNI.cpp │ ├── com_tencent_mm_hardcoder_HardCoderJNI.h │ ├── header.h │ ├── localsocket.h │ ├── procutil.h │ ├── protocol.h │ ├── server.cpp │ ├── server.h │ ├── udp.h │ └── util.h │ ├── java │ └── com │ │ └── tencent │ │ └── mm │ │ └── hardcoder │ │ ├── HCPerfManager.java │ │ ├── HCPerfStatThread.java │ │ ├── HardCoderCallback.java │ │ ├── HardCoderJNI.java │ │ ├── HardCoderLog.java │ │ ├── HardCoderReporter.java │ │ └── HardCoderUtil.java │ ├── proto │ └── amc.proto │ └── res │ └── values │ └── strings.xml ├── settings.gradle └── testapp ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src └── main ├── AndroidManifest.xml ├── java └── com │ └── tencent │ └── mm │ └── hardcoder │ └── testapp │ ├── QuickStart.java │ ├── TestAPIs.java │ ├── TestVideo.java │ └── TestWebView.java └── res ├── layout ├── quick_start.xml ├── test_apis.xml ├── test_video.xml └── test_webview.xml ├── mipmap-hdpi └── ic_launcher.png ├── mipmap-mdpi └── ic_launcher.png ├── mipmap-xhdpi └── ic_launcher.png ├── mipmap-xxhdpi └── ic_launcher.png ├── mipmap-xxxhdpi └── ic_launcher.png ├── raw └── hardcoder_video.mp4 ├── values-w820dp └── dimens.xml └── values ├── colors.xml ├── dimens.xml ├── strings.xml └── styles.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle/ 3 | /local.properties 4 | /local.gradle 5 | .idea/ 6 | .vscode/ 7 | .DS_Store 8 | build/ 9 | /captures/ 10 | .externalNativeBuild/ 11 | .project 12 | .classpath 13 | .settings/ 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Tencent is pleased to support the open source community by making Hardcoder available. 2 | 3 | Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 | 5 | Hardcoder is licensed under the BSD 3-Clause License, except for the third-party components listed below which may be subject to thier corresponding license terms. 6 | 7 | A copy of the BSD 3-Clause License is included in this file. 8 | 9 | Other dependencies and licenses: 10 | 11 | Open Source Software Licensed Under the MIT License: 12 | -------------------------------------------------------------------- 13 | 1. cJSON 1.7.11 14 | Copyright (c) 2009-2017 Dave Gamble and cJSON contributors 15 | 16 | 17 | Terms of the MIT License: 18 | --------------------------------------------------- 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | 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. 24 | 25 | 26 | Open Source Software Licensed Under the BSD 3-Clause License: 27 | -------------------------------------------------------------------- 28 | 1. protobuf 3.8.0 29 | Copyright 2008 Google Inc. 30 | All rights reserved. 31 | 32 | 33 | Terms of the BSD 3-Clause License: 34 | -------------------------------------------------------------------- 35 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 36 | 37 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 38 | 39 | 2. 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. 40 | 41 | 3. Neither the name of the above copyright owners/THL A29 Limited nor the names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. 42 | 43 | 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. 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hardcoder 2 | 3 | [![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/tinker/blob/master/LICENSE)[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/tinker/pulls) 4 | 5 | 6 | 7 | 中文版请见[这里](https://github.com/Tencent/Hardcoder/wiki/Home)。 8 | 9 | 10 | 11 | **Hardcoder is a solution which allows Android APP and Android System to communicate with each other directly, solving the problem that Android APP could only use system standard API rather than the hardware resources of the system. Through Hardcoder, Android APP can make good use of mobile phones hardware resources such as CPU frequency, Large Core, and the GPU to improve APP performance. Hardcoder allows Android system to get more information from APP in order to better provide system resources to Android APP. At the same time, for lack of implementation by the standard interface, the APP and the system can also realize the model adaptation and function expansion through the framework.** 12 | 13 | 14 | 15 | Hardcoder framework can averagely optimize the performance of Wechat by 10%-30% in terms of Wechat startup, video delivery, mini program startup, and other highly-loaded scenes. Furthermore, it could also averagely optimize the performance of Mobile QQ by 10%-50% in terms of mobile QQ startup, chatting Initialization, picture delivery, and other highly-loaded scenes. The framework now has been applied to mobile brands such as OPPO, vivo, Huawei, XIAOMI, Samsung, Meizu, etc and covers more than 460 millions devices. 16 | 17 | ![readme](https://github.com/Tencent/Hardcoder/wiki/images/readme.jpg) 18 | 19 | 20 | 21 | ## Getting started 22 | 23 | 1. Read “[Product introduction of Hardcoder](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-产品方案介绍)” to learn about Hardcoder. 24 | 25 | 2. Read “[Technical introduction of Hardcoder](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-技术方案介绍)” to know the implementation philosophy and technical framework. 26 | 27 | 3. Use the testapp to quickly verify the performance of Hardcoder. For the further detail, please check ”[Hardcoder testapp testing instruction](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Testapp测试指南)“ and “[Hardcoder Benchmark](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Benchmark)”. 28 | 29 | 4. Please check the “[Hardcoder Application Instruction](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-接入指南)” to learn how to use Hardcoder. 30 | 31 | 1. Download Hardcoder repo and compline Hardcoder aar. 32 | 2. Apply Hardcoder aar to “build.gradle”. 33 | 3. Call initHardCoder to establish socket connection when process initializes (Generally, it needs to request resource when process initializes. That is the reason why to call initHardCoder when process initializes). Every process is individual and they all need to call initHardCoder to establish socket connection. Every process keeps a socket after the connection and the socket will disconnect if the process quits. 34 | 4. Call checkPermission after the success of InitHardCoder call-back and transfer authentication values which are applied from different mobile brands by APP. 35 | 5. Call startPerformance under the condition of resource request scenes and transfer parameters that request resource. If the scene is in the stage of process initiation, for example APP startup, startPerformance should not be called until it successfully calls back initHardCoder or it needs to verify whether socket is connected by examining isConnect() of HardCoderJNI. 36 | 6. Actively call stopPerformance when scene stops and it needs to transfer the “hashCode" corresponding to the startPerformance in order to identify the corresponding scene. Then it can stop this request. 37 | 7. Test the performance. To do the comparison between the situation in which “Hardcoder is on and off”. 38 | 39 | 5. Apply the authentication from mobile brands. For the further detail, please check [FAQ](https://github.com/Tencent/Hardcoder/wiki/FAQ). 40 | 41 | 6. Launch APP which has involved Hardcoder. 42 | 43 | 44 | 45 | ## Document Support 46 | 47 | 1. Product introduction of Hardcoder——[https://github.com/Tencent/Hardcoder/wiki/Hardcoder-产品方案介绍](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-产品方案介绍) 48 | 2. Technical introduction of Hardcoder——[https://github.com/Tencent/Hardcoder/wiki/Hardcoder-技术方案介绍](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-技术方案介绍) 49 | 3. Hardcoder testapp testing instruction——[https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Testapp测试指南](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Testapp测试指南) 50 | 4. Hardcoder Application Instruction——[https://github.com/Tencent/Hardcoder/wiki/Hardcoder-接入指南](https://github.com/Tencent/Hardcoder/wiki/Hardcoder-接入指南) 51 | 5. FAQ——https://github.com/Tencent/Hardcoder/wiki/FAQ 52 | 6. Hardcoder for Android API References——https://tencent.github.io/Hardcoder/ 53 | 7. Hardcoder Benchmark——https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Benchmark 54 | 55 | 56 | 57 | 58 | ## License 59 | 60 | Hardcoder is under the BSD license. See the [LICENSE](https://github.com/Tencent/Hardcoder/blob/master/LICENSE) file for details. 61 | 62 | 63 | ## Personal Information Protection Rules 64 | 65 | https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/kGLpLlCX1Vkskw7U 66 | 67 | 68 | If you have any questions,welcome to join QQ group to contact us. 69 | 70 | ![qqgroup_qrcode.png](https://github.com/Tencent/Hardcoder/wiki/images/qqgroup_qrcode.png) 71 | 72 | 73 | 74 | ## 信息公示 75 | 76 | - SDK 名称:Hardcoder 77 | - 版本号:v1.0.0 78 | - 开发者:深圳市腾讯计算机系统有限公司 79 | - 主要功能:Hardcoder 是一套 Android APP 与系统间的通信解决方案,突破了 APP 只能调用系统标准 API,无法直接调用系统底层硬件资源的问题,让 Android APP 和系统能实时通信。 80 | - [Hardcoder SDK 使用说明](https://github.com/Tencent/Hardcoder/wiki) 81 | - [Hardcoder SDK 个人信息保护规则](https://support.weixin.qq.com/cgi-bin/mmsupportacctnodeweb-bin/pages/kGLpLlCX1Vkskw7U) 82 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | mavenLocal() 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.2.1' 11 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | google() 19 | jcenter() 20 | } 21 | } 22 | 23 | ext { 24 | GROUP = 'com.tencent.mm.hardcoder' 25 | VERSION_NAME = "${HC_VERSION_NAME}" 26 | 27 | POM_PACKAGING = "pom" 28 | POM_DESCRIPTION = "WeChat Hardcoder Project." 29 | 30 | POM_DEVELOPER_ID = "Tencent Wechat" 31 | POM_DEVELOPER_NAME = "Tencent Wechat, Inc." 32 | } 33 | 34 | task clean(type: Delete) { 35 | delete rootProject.buildDir 36 | } 37 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Thu Jul 19 14:50:09 CST 2018 16 | org.gradle.jvmargs=-Xmx1536m 17 | 18 | HC_VERSION_NAME=1.0.0 19 | 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Apr 25 18:19:58 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /libapp2sys/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/gen -------------------------------------------------------------------------------- /libapp2sys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | 4 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-unused -ffunction-sections -fdata-sections -fvisibility=hidden") 5 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-unused -ffunction-sections -fdata-sections -fvisibility=hidden") 6 | 7 | add_library(cJSON STATIC 8 | src/main/cpp/cjson/cJSON.c 9 | ) 10 | target_include_directories(cJSON 11 | INTERFACE ${PROJECT_SOURCE_DIR}/src/main/cpp/cjson 12 | ) 13 | 14 | add_library(amc_proto STATIC 15 | build/generated/source/proto/cpp/amc.pb.cc 16 | ) 17 | target_include_directories(amc_proto 18 | INTERFACE ${PROJECT_SOURCE_DIR}/build/generated/source/proto/cpp 19 | PUBLIC ${PROJECT_SOURCE_DIR}/prebuilt/include 20 | ) 21 | target_link_libraries(amc_proto 22 | PUBLIC ${PROJECT_SOURCE_DIR}/prebuilt/${ANDROID_ABI}/libprotobuf-lite.a 23 | ) 24 | 25 | add_library(hardcoder SHARED 26 | src/main/cpp/com_tencent_mm_hardcoder_HardCoderJNI.cpp 27 | ) 28 | target_link_libraries(hardcoder cJSON amc_proto log) 29 | target_compile_definitions(hardcoder PRIVATE ANDROID_NDK DISABLE_IMPORTGL) 30 | 31 | add_executable(server 32 | src/main/cpp/server.cpp 33 | ) 34 | target_link_libraries(server cJSON amc_proto log) 35 | target_compile_definitions(server PRIVATE ANDROID_NDK DISABLE_IMPORTGL) 36 | 37 | #INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/main/cpp) 38 | #INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/protobuf) 39 | #INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/protobuf/google) 40 | #INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/build/gen/cpp) 41 | 42 | #set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib_output) // 如果单独编译so请开启这个设置,开启后test项目会没有so 43 | 44 | 45 | #"arm64-v8a" 46 | #add_executable(server 47 | # build/gen/cpp/amc.pb.cc 48 | # src/main/cpp/server.cpp 49 | # src/main/cjson/cJSON.c) 50 | # 51 | #if(${ANDROID_ABI} STREQUAL "armeabi-v7a" OR ${ANDROID_ABI} STREQUAL "armeabi") 52 | # add_library(hardcoder SHARED 53 | # build/gen/cpp/amc.pb.cc 54 | # src/main/cpp/com_tencent_mm_hardcoder_HardCoderJNI.cpp 55 | # src/main/cjson/cJSON.c 56 | # ) 57 | # 58 | # 59 | # add_custom_command(TARGET hardcoder POST_BUILD 60 | # COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/build/intermediates/cmake/debug/obj/${ANDROID_ABI}/libhardcoder.so 61 | # ${PROJECT_SOURCE_DIR}/lib_output/${ANDROID_ABI}/libhardcoder.so) 62 | # 63 | #endif() 64 | 65 | #ADD_DEFINITIONS( 66 | # -Wall -Werror -fPIE -DANDROID_NDK -DDISABLE_IMPORTGL -fvisibility=hidden -fPIC -fno-exceptions -Wno-multichar -fno-strict-aliasing -fstack-protector-strong -ffunction-sections -fdata-sections -funwind-tables -Wa,--noexecstack -Werror=format-security -fno-short-enums -no-canonical-prefixes -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast -Werror=implicit-function-declaration -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Wstrict-aliasing=2 -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -fvisibility-inlines-hidden -Wsign-promo -Wno-inconsistent-missing-override -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=null-dereference -Werror=return-type 67 | # 68 | #) 69 | -------------------------------------------------------------------------------- /libapp2sys/build.gradle: -------------------------------------------------------------------------------- 1 | import org.gradle.internal.os.OperatingSystem 2 | 3 | apply plugin: 'com.android.library' 4 | apply from: rootProject.file('gradle/WeChatPublish.gradle') 5 | apply from: rootProject.file('gradle/WeChatNativeDepend.gradle') 6 | 7 | version rootProject.ext.VERSION_NAME 8 | group rootProject.ext.GROUP 9 | artifactId = 'app2sys' 10 | 11 | android { 12 | compileSdkVersion 28 13 | 14 | defaultConfig { 15 | minSdkVersion 17 16 | targetSdkVersion 28 17 | 18 | //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 19 | 20 | externalNativeBuild { 21 | cmake { 22 | targets 'hardcoder', 'server' 23 | abiFilters 'arm64-v8a', 'armeabi-v7a' 24 | arguments '-DANDROID_STL=c++_shared' 25 | } 26 | } 27 | } 28 | 29 | buildTypes { 30 | release { 31 | minifyEnabled false 32 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 33 | } 34 | debug { 35 | debuggable true 36 | jniDebuggable true 37 | } 38 | } 39 | 40 | externalNativeBuild { 41 | cmake { 42 | path 'CMakeLists.txt' 43 | } 44 | } 45 | 46 | lintOptions { 47 | abortOnError false 48 | } 49 | } 50 | 51 | def generateProtoSources() { 52 | def protoFiles = fileTree(dir: 'src/main/proto', include: '*.proto') 53 | def archDir 54 | def os = OperatingSystem.current() 55 | if (os.isLinux()) { 56 | switch (os.arch) { 57 | case "i386": 58 | case "x86": 59 | archDir = "linux-x86"; break 60 | default: 61 | archDir = "linux-amd64"; break 62 | } 63 | } else { 64 | archDir = os.nativePrefix 65 | } 66 | 67 | def exePath = "${projectDir}/prebuilt/protoc/${archDir}/protoc${os.executableSuffix}" 68 | def outputDir = file("${buildDir}/generated/source/proto/cpp") 69 | outputDir.mkdirs() 70 | 71 | def cmdProc = ("${exePath} --cpp_out=${outputDir} " + 72 | "${protoFiles.collect({it.name}).join(' ')}").execute(null, file('src/main/proto')) 73 | cmdProc.waitForProcessOutput(System.out, System.err) 74 | if (cmdProc.exitValue() != 0) { 75 | throw new GradleException() 76 | } 77 | } 78 | 79 | afterEvaluate { 80 | def protoFiles = fileTree('src/main/proto') { include '*.proto' } 81 | def prebuildTask = project.tasks.findByName('preBuild') 82 | 83 | def generatorTask = project.task('generateProto') { 84 | inputs.files(protoFiles) 85 | }.configure { 86 | // Manually trigger sync procedure should always cause regenerating. 87 | if (project.hasProperty('android.injected.build.model.only')) { 88 | generateProtoSources() 89 | } 90 | }.doLast { 91 | generateProtoSources() 92 | } 93 | 94 | prebuildTask.dependsOn generatorTask 95 | } 96 | 97 | dependencies { 98 | testImplementation 'junit:junit:4.12' 99 | androidTestImplementation 'com.android.support.test:rules:1.0.2' 100 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 101 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 102 | } 103 | 104 | apply plugin: 'com.jfrog.bintray' 105 | 106 | wechatPublish { 107 | publishAllVariants true 108 | 109 | publishToBintray { 110 | userOrg = 'wemobiledev' 111 | repo = 'maven' 112 | name = 'com.tencent.mm.hardcoder:app2sys' 113 | desc = '' 114 | websiteUrl = 'https://github.com/Tencent/Hardcoder' 115 | issueTrackerUrl = 'https://github.com/Tencent/Hardcoder/issues' 116 | vcsUrl = 'https://github.com/Tencent/Hardcoder.git' 117 | licenses = ['BSD 3-Clause'] 118 | } 119 | } -------------------------------------------------------------------------------- /libapp2sys/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=app2sys 2 | POM_NAME=Hardcoder App2Sys Library. 3 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/arm64-v8a/libprotobuf-lite.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/arm64-v8a/libprotobuf-lite.a -------------------------------------------------------------------------------- /libapp2sys/prebuilt/armeabi-v7a/libprotobuf-lite.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/armeabi-v7a/libprotobuf-lite.a -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/any.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_ANY_H__ 32 | #define GOOGLE_PROTOBUF_ANY_H__ 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace google { 42 | namespace protobuf { 43 | namespace internal { 44 | 45 | // Helper class used to implement google::protobuf::Any. 46 | class LIBPROTOBUF_EXPORT AnyMetadata { 47 | typedef ArenaStringPtr UrlType; 48 | typedef ArenaStringPtr ValueType; 49 | public: 50 | // AnyMetadata does not take ownership of "type_url" and "value". 51 | AnyMetadata(UrlType* type_url, ValueType* value); 52 | 53 | // Packs a message using the default type URL prefix: "type.googleapis.com". 54 | // The resulted type URL will be "type.googleapis.com/". 55 | void PackFrom(const Message& message); 56 | // Packs a message using the given type URL prefix. The type URL will be 57 | // constructed by concatenating the message type's full name to the prefix 58 | // with an optional "/" separator if the prefix doesn't already end up "/". 59 | // For example, both PackFrom(message, "type.googleapis.com") and 60 | // PackFrom(message, "type.googleapis.com/") yield the same result type 61 | // URL: "type.googleapis.com/". 62 | void PackFrom(const Message& message, const string& type_url_prefix); 63 | 64 | // Unpacks the payload into the given message. Returns false if the message's 65 | // type doesn't match the type specified in the type URL (i.e., the full 66 | // name after the last "/" of the type URL doesn't match the message's actaul 67 | // full name) or parsing the payload has failed. 68 | bool UnpackTo(Message* message) const; 69 | 70 | // Checks whether the type specified in the type URL matches the given type. 71 | // A type is consdiered matching if its full name matches the full name after 72 | // the last "/" in the type URL. 73 | template 74 | bool Is() const { 75 | return InternalIs(T::default_instance().GetDescriptor()); 76 | } 77 | 78 | private: 79 | bool InternalIs(const Descriptor* message) const; 80 | 81 | UrlType* type_url_; 82 | ValueType* value_; 83 | 84 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AnyMetadata); 85 | }; 86 | 87 | extern const char kAnyFullTypeName[]; // "google.protobuf.Any". 88 | extern const char kTypeGoogleApisComPrefix[]; // "type.googleapis.com/". 89 | extern const char kTypeGoogleProdComPrefix[]; // "type.googleprod.com/". 90 | 91 | // Get the proto type name from Any::type_url value. For example, passing 92 | // "type.googleapis.com/rpc.QueryOrigin" will return "rpc.QueryOrigin" in 93 | // *full_type_name. Returns false if type_url does not start with 94 | // "type.googleapis.com" or "type.googleprod.com". 95 | bool ParseAnyTypeUrl(const string& type_url, string* full_type_name); 96 | 97 | // See if message is of type google.protobuf.Any, if so, return the descriptors 98 | // for "type_url" and "value" fields. 99 | bool GetAnyFieldDescriptors(const Message& message, 100 | const FieldDescriptor** type_url_field, 101 | const FieldDescriptor** value_field); 102 | 103 | } // namespace internal 104 | } // namespace protobuf 105 | 106 | } // namespace google 107 | #endif // GOOGLE_PROTOBUF_ANY_H__ 108 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/any.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option go_package = "github.com/golang/protobuf/ptypes/any"; 37 | option java_package = "com.google.protobuf"; 38 | option java_outer_classname = "AnyProto"; 39 | option java_multiple_files = true; 40 | option objc_class_prefix = "GPB"; 41 | 42 | // `Any` contains an arbitrary serialized protocol buffer message along with a 43 | // URL that describes the type of the serialized message. 44 | // 45 | // Protobuf library provides support to pack/unpack Any values in the form 46 | // of utility functions or additional generated methods of the Any type. 47 | // 48 | // Example 1: Pack and unpack a message in C++. 49 | // 50 | // Foo foo = ...; 51 | // Any any; 52 | // any.PackFrom(foo); 53 | // ... 54 | // if (any.UnpackTo(&foo)) { 55 | // ... 56 | // } 57 | // 58 | // Example 2: Pack and unpack a message in Java. 59 | // 60 | // Foo foo = ...; 61 | // Any any = Any.pack(foo); 62 | // ... 63 | // if (any.is(Foo.class)) { 64 | // foo = any.unpack(Foo.class); 65 | // } 66 | // 67 | // Example 3: Pack and unpack a message in Python. 68 | // 69 | // foo = Foo(...) 70 | // any = Any() 71 | // any.Pack(foo) 72 | // ... 73 | // if any.Is(Foo.DESCRIPTOR): 74 | // any.Unpack(foo) 75 | // ... 76 | // 77 | // The pack methods provided by protobuf library will by default use 78 | // 'type.googleapis.com/full.type.name' as the type URL and the unpack 79 | // methods only use the fully qualified type name after the last '/' 80 | // in the type URL, for example "foo.bar.com/x/y.z" will yield type 81 | // name "y.z". 82 | // 83 | // 84 | // JSON 85 | // ==== 86 | // The JSON representation of an `Any` value uses the regular 87 | // representation of the deserialized, embedded message, with an 88 | // additional field `@type` which contains the type URL. Example: 89 | // 90 | // package google.profile; 91 | // message Person { 92 | // string first_name = 1; 93 | // string last_name = 2; 94 | // } 95 | // 96 | // { 97 | // "@type": "type.googleapis.com/google.profile.Person", 98 | // "firstName": , 99 | // "lastName": 100 | // } 101 | // 102 | // If the embedded message type is well-known and has a custom JSON 103 | // representation, that representation will be embedded adding a field 104 | // `value` which holds the custom JSON in addition to the `@type` 105 | // field. Example (for message [google.protobuf.Duration][]): 106 | // 107 | // { 108 | // "@type": "type.googleapis.com/google.protobuf.Duration", 109 | // "value": "1.212s" 110 | // } 111 | // 112 | message Any { 113 | // A URL/resource name whose content describes the type of the 114 | // serialized protocol buffer message. 115 | // 116 | // For URLs which use the scheme `http`, `https`, or no scheme, the 117 | // following restrictions and interpretations apply: 118 | // 119 | // * If no scheme is provided, `https` is assumed. 120 | // * The last segment of the URL's path must represent the fully 121 | // qualified name of the type (as in `path/google.protobuf.Duration`). 122 | // The name should be in a canonical form (e.g., leading "." is 123 | // not accepted). 124 | // * An HTTP GET on the URL must yield a [google.protobuf.Type][] 125 | // value in binary format, or produce an error. 126 | // * Applications are allowed to cache lookup results based on the 127 | // URL, or have them precompiled into a binary to avoid any 128 | // lookup. Therefore, binary compatibility needs to be preserved 129 | // on changes to types. (Use versioned type names to manage 130 | // breaking changes.) 131 | // 132 | // Schemes other than `http`, `https` (or the empty scheme) might be 133 | // used with implementation specific semantics. 134 | // 135 | string type_url = 1; 136 | 137 | // Must be a valid serialized protocol buffer of the above specified type. 138 | bytes value = 2; 139 | } 140 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/cpp/cpp_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // Generates C++ code for a given .proto file. 36 | 37 | #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ 38 | #define GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ 39 | 40 | #include 41 | #include 42 | 43 | namespace google { 44 | namespace protobuf { 45 | namespace compiler { 46 | namespace cpp { 47 | 48 | // CodeGenerator implementation which generates a C++ source file and 49 | // header. If you create your own protocol compiler binary and you want 50 | // it to support C++ output, you can do so by registering an instance of this 51 | // CodeGenerator with the CommandLineInterface in your main() function. 52 | class LIBPROTOC_EXPORT CppGenerator : public CodeGenerator { 53 | public: 54 | CppGenerator(); 55 | ~CppGenerator(); 56 | 57 | // implements CodeGenerator ---------------------------------------- 58 | bool Generate(const FileDescriptor* file, 59 | const string& parameter, 60 | GeneratorContext* generator_context, 61 | string* error) const; 62 | 63 | private: 64 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CppGenerator); 65 | }; 66 | 67 | } // namespace cpp 68 | } // namespace compiler 69 | } // namespace protobuf 70 | 71 | } // namespace google 72 | #endif // GOOGLE_PROTOBUF_COMPILER_CPP_GENERATOR_H__ 73 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/csharp/csharp_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Generates C# code for a given .proto file. 32 | 33 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 34 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace compiler { 43 | namespace csharp { 44 | 45 | // CodeGenerator implementation which generates a C# source file and 46 | // header. If you create your own protocol compiler binary and you want 47 | // it to support C# output, you can do so by registering an instance of this 48 | // CodeGenerator with the CommandLineInterface in your main() function. 49 | class LIBPROTOC_EXPORT Generator 50 | : public google::protobuf::compiler::CodeGenerator { 51 | virtual bool Generate( 52 | const FileDescriptor* file, 53 | const string& parameter, 54 | GeneratorContext* generator_context, 55 | string* error) const; 56 | }; 57 | 58 | } // namespace csharp 59 | } // namespace compiler 60 | } // namespace protobuf 61 | } // namespace google 62 | 63 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 64 | 65 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/csharp/csharp_names.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // Provides a mechanism for mapping a descriptor to the 36 | // fully-qualified name of the corresponding C# class. 37 | 38 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ 39 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ 40 | 41 | #include 42 | 43 | namespace google { 44 | namespace protobuf { 45 | 46 | class Descriptor; 47 | class EnumDescriptor; 48 | class FileDescriptor; 49 | class ServiceDescriptor; 50 | 51 | namespace compiler { 52 | namespace csharp { 53 | 54 | // Requires: 55 | // descriptor != NULL 56 | // 57 | // Returns: 58 | // The namespace to use for given file descriptor. 59 | string GetFileNamespace(const FileDescriptor* descriptor); 60 | 61 | // Requires: 62 | // descriptor != NULL 63 | // 64 | // Returns: 65 | // The fully-qualified C# class name. 66 | string GetClassName(const Descriptor* descriptor); 67 | 68 | // Requires: 69 | // descriptor != NULL 70 | // 71 | // Returns: 72 | // The fully-qualified name of the C# class that provides 73 | // access to the file descriptor. Proto compiler generates 74 | // such class for each .proto file processed. 75 | string GetReflectionClassName(const FileDescriptor* descriptor); 76 | 77 | // Generates output file name for given file descriptor. If generate_directories 78 | // is true, the output file will be put under directory corresponding to file's 79 | // namespace. base_namespace can be used to strip some of the top level 80 | // directories. E.g. for file with namespace "Bar.Foo" and base_namespace="Bar", 81 | // the resulting file will be put under directory "Foo" (and not "Bar/Foo"). 82 | // 83 | // Requires: 84 | // descriptor != NULL 85 | // error != NULL 86 | // 87 | // Returns: 88 | // The file name to use as output file for given file descriptor. In case 89 | // of failure, this function will return empty string and error parameter 90 | // will contain the error message. 91 | string GetOutputFile( 92 | const google::protobuf::FileDescriptor* descriptor, 93 | const string file_extension, 94 | const bool generate_directories, 95 | const string base_namespace, 96 | string* error); 97 | 98 | } // namespace csharp 99 | } // namespace compiler 100 | } // namespace protobuf 101 | } // namespace google 102 | 103 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_NAMES_H__ 104 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/java/java_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // Generates Java code for a given .proto file. 36 | 37 | #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ 38 | #define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ 39 | 40 | #include 41 | #include 42 | 43 | namespace google { 44 | namespace protobuf { 45 | namespace compiler { 46 | namespace java { 47 | 48 | // CodeGenerator implementation which generates Java code. If you create your 49 | // own protocol compiler binary and you want it to support Java output, you 50 | // can do so by registering an instance of this CodeGenerator with the 51 | // CommandLineInterface in your main() function. 52 | class LIBPROTOC_EXPORT JavaGenerator : public CodeGenerator { 53 | public: 54 | JavaGenerator(); 55 | ~JavaGenerator(); 56 | 57 | // implements CodeGenerator ---------------------------------------- 58 | bool Generate(const FileDescriptor* file, 59 | const string& parameter, 60 | GeneratorContext* context, 61 | string* error) const; 62 | 63 | private: 64 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaGenerator); 65 | }; 66 | 67 | } // namespace java 68 | } // namespace compiler 69 | } // namespace protobuf 70 | 71 | } // namespace google 72 | #endif // GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__ 73 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/java/java_names.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // Provides a mechanism for mapping a descriptor to the 36 | // fully-qualified name of the corresponding Java class. 37 | 38 | #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ 39 | #define GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ 40 | 41 | #include 42 | 43 | namespace google { 44 | namespace protobuf { 45 | 46 | class Descriptor; 47 | class EnumDescriptor; 48 | class FileDescriptor; 49 | class ServiceDescriptor; 50 | 51 | namespace compiler { 52 | namespace java { 53 | 54 | // Requires: 55 | // descriptor != NULL 56 | // 57 | // Returns: 58 | // The fully-qualified Java class name. 59 | string ClassName(const Descriptor* descriptor); 60 | 61 | // Requires: 62 | // descriptor != NULL 63 | // 64 | // Returns: 65 | // The fully-qualified Java class name. 66 | string ClassName(const EnumDescriptor* descriptor); 67 | 68 | // Requires: 69 | // descriptor != NULL 70 | // 71 | // Returns: 72 | // The fully-qualified Java class name. 73 | string ClassName(const FileDescriptor* descriptor); 74 | 75 | // Requires: 76 | // descriptor != NULL 77 | // 78 | // Returns: 79 | // The fully-qualified Java class name. 80 | string ClassName(const ServiceDescriptor* descriptor); 81 | 82 | } // namespace java 83 | } // namespace compiler 84 | } // namespace protobuf 85 | } // namespace google 86 | 87 | #endif // GOOGLE_PROTOBUF_COMPILER_JAVA_NAMES_H__ 88 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/javanano/javanano_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // http://code.google.com/p/protobuf/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // Generates Java nano code for a given .proto file. 36 | 37 | #ifndef GOOGLE_PROTOBUF_COMPILER_JAVANANO_NANO_GENERATOR_H__ 38 | #define GOOGLE_PROTOBUF_COMPILER_JAVANANO_NANO_GENERATOR_H__ 39 | 40 | #include 41 | #include 42 | 43 | namespace google { 44 | namespace protobuf { 45 | namespace compiler { 46 | namespace javanano { 47 | 48 | // CodeGenerator implementation which generates Java nano code. If you create your 49 | // own protocol compiler binary and you want it to support Java output for the 50 | // nano runtime, you can do so by registering an instance of this CodeGenerator with 51 | // the CommandLineInterface in your main() function. 52 | class LIBPROTOC_EXPORT JavaNanoGenerator : public CodeGenerator { 53 | public: 54 | JavaNanoGenerator(); 55 | ~JavaNanoGenerator(); 56 | 57 | // implements CodeGenerator ---------------------------------------- 58 | bool Generate(const FileDescriptor* file, 59 | const string& parameter, 60 | GeneratorContext* output_directory, 61 | string* error) const; 62 | 63 | private: 64 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(JavaNanoGenerator); 65 | }; 66 | 67 | } // namespace javanano 68 | } // namespace compiler 69 | } // namespace protobuf 70 | 71 | } // namespace google 72 | #endif // GOOGLE_PROTOBUF_COMPILER_JAVANANO_NANO_GENERATOR_H__ 73 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/objectivec/objectivec_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Generates ObjectiveC code for a given .proto file. 32 | 33 | #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ 34 | #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ 35 | 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace compiler { 42 | namespace objectivec { 43 | 44 | // CodeGenerator implementation which generates a ObjectiveC source file and 45 | // header. If you create your own protocol compiler binary and you want it to 46 | // support ObjectiveC output, you can do so by registering an instance of this 47 | // CodeGenerator with the CommandLineInterface in your main() function. 48 | class LIBPROTOC_EXPORT ObjectiveCGenerator : public CodeGenerator { 49 | public: 50 | ObjectiveCGenerator(); 51 | ~ObjectiveCGenerator(); 52 | 53 | // implements CodeGenerator ---------------------------------------- 54 | bool HasGenerateAll() const; 55 | bool Generate(const FileDescriptor* file, 56 | const string& parameter, 57 | GeneratorContext* context, 58 | string* error) const; 59 | bool GenerateAll(const vector& files, 60 | const string& parameter, 61 | GeneratorContext* context, 62 | string* error) const; 63 | 64 | private: 65 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectiveCGenerator); 66 | }; 67 | 68 | } // namespace objectivec 69 | } // namespace compiler 70 | } // namespace protobuf 71 | } // namespace google 72 | #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_GENERATOR_H__ 73 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/php/php_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 33 | 34 | #include 35 | 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace compiler { 41 | namespace php { 42 | 43 | class LIBPROTOC_EXPORT Generator 44 | : public google::protobuf::compiler::CodeGenerator { 45 | virtual bool Generate( 46 | const FileDescriptor* file, 47 | const string& parameter, 48 | GeneratorContext* generator_context, 49 | string* error) const; 50 | }; 51 | 52 | } // namespace php 53 | } // namespace compiler 54 | } // namespace protobuf 55 | } // namespace google 56 | 57 | #endif // GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 58 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/plugin.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // 33 | // Front-end for protoc code generator plugins written in C++. 34 | // 35 | // To implement a protoc plugin in C++, simply write an implementation of 36 | // CodeGenerator, then create a main() function like: 37 | // int main(int argc, char* argv[]) { 38 | // MyCodeGenerator generator; 39 | // return google::protobuf::compiler::PluginMain(argc, argv, &generator); 40 | // } 41 | // You must link your plugin against libprotobuf and libprotoc. 42 | // 43 | // The core part of PluginMain is to invoke the given CodeGenerator on a 44 | // CodeGeneratorRequest to generate a CodeGeneratorResponse. This part is 45 | // abstracted out and made into function GenerateCode so that it can be reused, 46 | // for example, to implement a variant of PluginMain that does some 47 | // preprocessing on the input CodeGeneratorRequest before feeding the request 48 | // to the given code generator. 49 | // 50 | // To get protoc to use the plugin, do one of the following: 51 | // * Place the plugin binary somewhere in the PATH and give it the name 52 | // "protoc-gen-NAME" (replacing "NAME" with the name of your plugin). If you 53 | // then invoke protoc with the parameter --NAME_out=OUT_DIR (again, replace 54 | // "NAME" with your plugin's name), protoc will invoke your plugin to generate 55 | // the output, which will be placed in OUT_DIR. 56 | // * Place the plugin binary anywhere, with any name, and pass the --plugin 57 | // parameter to protoc to direct it to your plugin like so: 58 | // protoc --plugin=protoc-gen-NAME=path/to/mybinary --NAME_out=OUT_DIR 59 | // On Windows, make sure to include the .exe suffix: 60 | // protoc --plugin=protoc-gen-NAME=path/to/mybinary.exe --NAME_out=OUT_DIR 61 | 62 | #ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ 63 | #define GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ 64 | 65 | #include 66 | 67 | #include 68 | namespace google { 69 | namespace protobuf { 70 | namespace compiler { 71 | 72 | class CodeGenerator; // code_generator.h 73 | class CodeGeneratorRequest; 74 | class CodeGeneratorResponse; 75 | 76 | // Implements main() for a protoc plugin exposing the given code generator. 77 | LIBPROTOC_EXPORT int PluginMain(int argc, char* argv[], const CodeGenerator* generator); 78 | 79 | // Generates code using the given code generator. Returns true if the code 80 | // generation is successful. If the code geneartion fails, error_msg may be 81 | // populated to describe the failure cause. 82 | bool GenerateCode(const CodeGeneratorRequest& request, 83 | const CodeGenerator& generator, CodeGeneratorResponse* response, 84 | string* error_msg); 85 | 86 | } // namespace compiler 87 | } // namespace protobuf 88 | 89 | } // namespace google 90 | #endif // GOOGLE_PROTOBUF_COMPILER_PLUGIN_H__ 91 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/compiler/ruby/ruby_generator.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Generates Ruby code for a given .proto file. 32 | 33 | #ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 34 | #define GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace compiler { 43 | namespace ruby { 44 | 45 | // CodeGenerator implementation for generated Ruby protocol buffer classes. 46 | // If you create your own protocol compiler binary and you want it to support 47 | // Ruby output, you can do so by registering an instance of this 48 | // CodeGenerator with the CommandLineInterface in your main() function. 49 | class LIBPROTOC_EXPORT Generator 50 | : public google::protobuf::compiler::CodeGenerator { 51 | virtual bool Generate( 52 | const FileDescriptor* file, 53 | const string& parameter, 54 | GeneratorContext* generator_context, 55 | string* error) const; 56 | }; 57 | 58 | } // namespace ruby 59 | } // namespace compiler 60 | } // namespace protobuf 61 | } // namespace google 62 | 63 | #endif // GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 64 | 65 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/duration.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option cc_enable_arenas = true; 37 | option go_package = "github.com/golang/protobuf/ptypes/duration"; 38 | option java_package = "com.google.protobuf"; 39 | option java_outer_classname = "DurationProto"; 40 | option java_multiple_files = true; 41 | option objc_class_prefix = "GPB"; 42 | 43 | // A Duration represents a signed, fixed-length span of time represented 44 | // as a count of seconds and fractions of seconds at nanosecond 45 | // resolution. It is independent of any calendar and concepts like "day" 46 | // or "month". It is related to Timestamp in that the difference between 47 | // two Timestamp values is a Duration and it can be added or subtracted 48 | // from a Timestamp. Range is approximately +-10,000 years. 49 | // 50 | // Example 1: Compute Duration from two Timestamps in pseudo code. 51 | // 52 | // Timestamp start = ...; 53 | // Timestamp end = ...; 54 | // Duration duration = ...; 55 | // 56 | // duration.seconds = end.seconds - start.seconds; 57 | // duration.nanos = end.nanos - start.nanos; 58 | // 59 | // if (duration.seconds < 0 && duration.nanos > 0) { 60 | // duration.seconds += 1; 61 | // duration.nanos -= 1000000000; 62 | // } else if (durations.seconds > 0 && duration.nanos < 0) { 63 | // duration.seconds -= 1; 64 | // duration.nanos += 1000000000; 65 | // } 66 | // 67 | // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. 68 | // 69 | // Timestamp start = ...; 70 | // Duration duration = ...; 71 | // Timestamp end = ...; 72 | // 73 | // end.seconds = start.seconds + duration.seconds; 74 | // end.nanos = start.nanos + duration.nanos; 75 | // 76 | // if (end.nanos < 0) { 77 | // end.seconds -= 1; 78 | // end.nanos += 1000000000; 79 | // } else if (end.nanos >= 1000000000) { 80 | // end.seconds += 1; 81 | // end.nanos -= 1000000000; 82 | // } 83 | // 84 | // Example 3: Compute Duration from datetime.timedelta in Python. 85 | // 86 | // td = datetime.timedelta(days=3, minutes=10) 87 | // duration = Duration() 88 | // duration.FromTimedelta(td) 89 | // 90 | // 91 | message Duration { 92 | 93 | // Signed seconds of the span of time. Must be from -315,576,000,000 94 | // to +315,576,000,000 inclusive. 95 | int64 seconds = 1; 96 | 97 | // Signed fractions of a second at nanosecond resolution of the span 98 | // of time. Durations less than one second are represented with a 0 99 | // `seconds` field and a positive or negative `nanos` field. For durations 100 | // of one second or more, a non-zero value for the `nanos` field must be 101 | // of the same sign as the `seconds` field. Must be from -999,999,999 102 | // to +999,999,999 inclusive. 103 | int32 nanos = 2; 104 | } 105 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/empty.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: google/protobuf/empty.proto 3 | 4 | #ifndef PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED 5 | #define PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3001000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | // @@protoc_insertion_point(includes) 31 | 32 | namespace google { 33 | namespace protobuf { 34 | 35 | // Internal implementation detail -- do not call these. 36 | void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto(); 37 | void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto(); 38 | void protobuf_AssignDesc_google_2fprotobuf_2fempty_2eproto(); 39 | void protobuf_ShutdownFile_google_2fprotobuf_2fempty_2eproto(); 40 | 41 | class Empty; 42 | 43 | // =================================================================== 44 | 45 | class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.protobuf.Empty) */ { 46 | public: 47 | Empty(); 48 | virtual ~Empty(); 49 | 50 | Empty(const Empty& from); 51 | 52 | inline Empty& operator=(const Empty& from) { 53 | CopyFrom(from); 54 | return *this; 55 | } 56 | 57 | inline ::google::protobuf::Arena* GetArena() const { return GetArenaNoVirtual(); } 58 | inline void* GetMaybeArenaPointer() const { 59 | return MaybeArenaPtr(); 60 | } 61 | static const ::google::protobuf::Descriptor* descriptor(); 62 | static const Empty& default_instance(); 63 | 64 | static const Empty* internal_default_instance(); 65 | 66 | void UnsafeArenaSwap(Empty* other); 67 | void Swap(Empty* other); 68 | 69 | // implements Message ---------------------------------------------- 70 | 71 | inline Empty* New() const { return New(NULL); } 72 | 73 | Empty* New(::google::protobuf::Arena* arena) const; 74 | void CopyFrom(const ::google::protobuf::Message& from); 75 | void MergeFrom(const ::google::protobuf::Message& from); 76 | void CopyFrom(const Empty& from); 77 | void MergeFrom(const Empty& from); 78 | void Clear(); 79 | bool IsInitialized() const; 80 | 81 | size_t ByteSizeLong() const; 82 | bool MergePartialFromCodedStream( 83 | ::google::protobuf::io::CodedInputStream* input); 84 | void SerializeWithCachedSizes( 85 | ::google::protobuf::io::CodedOutputStream* output) const; 86 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 87 | bool deterministic, ::google::protobuf::uint8* output) const; 88 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 89 | return InternalSerializeWithCachedSizesToArray(false, output); 90 | } 91 | int GetCachedSize() const { return _cached_size_; } 92 | private: 93 | void SharedCtor(); 94 | void SharedDtor(); 95 | void SetCachedSize(int size) const; 96 | void InternalSwap(Empty* other); 97 | void UnsafeMergeFrom(const Empty& from); 98 | protected: 99 | explicit Empty(::google::protobuf::Arena* arena); 100 | private: 101 | static void ArenaDtor(void* object); 102 | inline void RegisterArenaDtor(::google::protobuf::Arena* arena); 103 | private: 104 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 105 | return _internal_metadata_.arena(); 106 | } 107 | inline void* MaybeArenaPtr() const { 108 | return _internal_metadata_.raw_arena_ptr(); 109 | } 110 | public: 111 | 112 | ::google::protobuf::Metadata GetMetadata() const; 113 | 114 | // nested types ---------------------------------------------------- 115 | 116 | // accessors ------------------------------------------------------- 117 | 118 | // @@protoc_insertion_point(class_scope:google.protobuf.Empty) 119 | private: 120 | 121 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 122 | friend class ::google::protobuf::Arena; 123 | typedef void InternalArenaConstructable_; 124 | typedef void DestructorSkippable_; 125 | mutable int _cached_size_; 126 | friend void LIBPROTOBUF_EXPORT protobuf_InitDefaults_google_2fprotobuf_2fempty_2eproto_impl(); 127 | friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fempty_2eproto_impl(); 128 | friend void protobuf_AssignDesc_google_2fprotobuf_2fempty_2eproto(); 129 | friend void protobuf_ShutdownFile_google_2fprotobuf_2fempty_2eproto(); 130 | 131 | void InitAsDefaultInstance(); 132 | }; 133 | extern ::google::protobuf::internal::ExplicitlyConstructed Empty_default_instance_; 134 | 135 | // =================================================================== 136 | 137 | 138 | // =================================================================== 139 | 140 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 141 | // Empty 142 | 143 | inline const Empty* Empty::internal_default_instance() { 144 | return &Empty_default_instance_.get(); 145 | } 146 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 147 | 148 | // @@protoc_insertion_point(namespace_scope) 149 | 150 | } // namespace protobuf 151 | } // namespace google 152 | 153 | // @@protoc_insertion_point(global_scope) 154 | 155 | #endif // PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED 156 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/empty.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option go_package = "github.com/golang/protobuf/ptypes/empty"; 37 | option java_package = "com.google.protobuf"; 38 | option java_outer_classname = "EmptyProto"; 39 | option java_multiple_files = true; 40 | option objc_class_prefix = "GPB"; 41 | option cc_enable_arenas = true; 42 | 43 | // A generic empty message that you can re-use to avoid defining duplicated 44 | // empty messages in your APIs. A typical example is to use it as the request 45 | // or the response type of an API method. For instance: 46 | // 47 | // service Foo { 48 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 49 | // } 50 | // 51 | // The JSON representation for `Empty` is empty JSON object `{}`. 52 | message Empty {} 53 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/generated_enum_reflection.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: jasonh@google.com (Jason Hsueh) 32 | // 33 | // This header is logically internal, but is made public because it is used 34 | // from protocol-compiler-generated code, which may reside in other components. 35 | // It provides reflection support for generated enums, and is included in 36 | // generated .pb.h files and should have minimal dependencies. The methods are 37 | // implemented in generated_message_reflection.cc. 38 | 39 | #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__ 40 | #define GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__ 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | namespace google { 48 | namespace protobuf { 49 | class EnumDescriptor; 50 | } // namespace protobuf 51 | 52 | namespace protobuf { 53 | 54 | // Returns the EnumDescriptor for enum type E, which must be a 55 | // proto-declared enum type. Code generated by the protocol compiler 56 | // will include specializations of this template for each enum type declared. 57 | template 58 | const EnumDescriptor* GetEnumDescriptor(); 59 | 60 | namespace internal { 61 | 62 | // Helper for EnumType_Parse functions: try to parse the string 'name' as an 63 | // enum name of the given type, returning true and filling in value on success, 64 | // or returning false and leaving value unchanged on failure. 65 | LIBPROTOBUF_EXPORT bool ParseNamedEnum(const EnumDescriptor* descriptor, 66 | const string& name, 67 | int* value); 68 | 69 | template 70 | bool ParseNamedEnum(const EnumDescriptor* descriptor, 71 | const string& name, 72 | EnumType* value) { 73 | int tmp; 74 | if (!ParseNamedEnum(descriptor, name, &tmp)) return false; 75 | *value = static_cast(tmp); 76 | return true; 77 | } 78 | 79 | // Just a wrapper around printing the name of a value. The main point of this 80 | // function is not to be inlined, so that you can do this without including 81 | // descriptor.h. 82 | LIBPROTOBUF_EXPORT const string& NameOfEnum(const EnumDescriptor* descriptor, int value); 83 | 84 | } // namespace internal 85 | } // namespace protobuf 86 | 87 | } // namespace google 88 | #endif // GOOGLE_PROTOBUF_GENERATED_ENUM_REFLECTION_H__ 89 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/generated_enum_util.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 32 | #define GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 33 | 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | 39 | // This type trait can be used to cause templates to only match proto2 enum 40 | // types. 41 | template struct is_proto_enum : ::google::protobuf::internal::false_type {}; 42 | 43 | } // namespace protobuf 44 | 45 | } // namespace google 46 | #endif // GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 47 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/has_bits.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_HAS_BITS_H__ 32 | #define GOOGLE_PROTOBUF_HAS_BITS_H__ 33 | 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | namespace internal { 39 | 40 | template 41 | class HasBits { 42 | public: 43 | HasBits() GOOGLE_ATTRIBUTE_ALWAYS_INLINE { Clear(); } 44 | 45 | void Clear() GOOGLE_ATTRIBUTE_ALWAYS_INLINE { 46 | memset(has_bits_, 0, sizeof(has_bits_)); 47 | } 48 | 49 | ::google::protobuf::uint32& operator[](int index) GOOGLE_ATTRIBUTE_ALWAYS_INLINE { 50 | return has_bits_[index]; 51 | } 52 | 53 | const ::google::protobuf::uint32& operator[](int index) const GOOGLE_ATTRIBUTE_ALWAYS_INLINE { 54 | return has_bits_[index]; 55 | } 56 | 57 | bool operator==(const HasBits& rhs) const { 58 | return memcmp(has_bits_, rhs.has_bits_, sizeof(has_bits_)) == 0; 59 | } 60 | 61 | bool operator!=(const HasBits& rhs) const { 62 | return !(*this == rhs); 63 | } 64 | private: 65 | ::google::protobuf::uint32 has_bits_[doublewords]; 66 | }; 67 | 68 | } // namespace internal 69 | } // namespace protobuf 70 | 71 | } // namespace google 72 | #endif // GOOGLE_PROTOBUF_HAS_BITS_H__ 73 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/io/strtod.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // A locale-independent version of strtod(), used to parse floating 32 | // point default values in .proto files, where the decimal separator 33 | // is always a dot. 34 | 35 | #ifndef GOOGLE_PROTOBUF_IO_STRTOD_H__ 36 | #define GOOGLE_PROTOBUF_IO_STRTOD_H__ 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace io { 41 | 42 | // A locale-independent version of the standard strtod(), which always 43 | // uses a dot as the decimal separator. 44 | double NoLocaleStrtod(const char* str, char** endptr); 45 | 46 | // Casts a double value to a float value. If the value is outside of the 47 | // representable range of float, it will be converted to positive or negative 48 | // infinity. 49 | float SafeDoubleToFloat(double value); 50 | 51 | } // namespace io 52 | } // namespace protobuf 53 | 54 | } // namespace google 55 | #endif // GOOGLE_PROTOBUF_IO_STRTOD_H__ 56 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/reflection_ops.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // This header is logically internal, but is made public because it is used 36 | // from protocol-compiler-generated code, which may reside in other components. 37 | 38 | #ifndef GOOGLE_PROTOBUF_REFLECTION_OPS_H__ 39 | #define GOOGLE_PROTOBUF_REFLECTION_OPS_H__ 40 | 41 | #include 42 | #include 43 | 44 | namespace google { 45 | namespace protobuf { 46 | namespace internal { 47 | 48 | // Basic operations that can be performed using reflection. 49 | // These can be used as a cheap way to implement the corresponding 50 | // methods of the Message interface, though they are likely to be 51 | // slower than implementations tailored for the specific message type. 52 | // 53 | // This class should stay limited to operations needed to implement 54 | // the Message interface. 55 | // 56 | // This class is really a namespace that contains only static methods. 57 | class LIBPROTOBUF_EXPORT ReflectionOps { 58 | public: 59 | static void Copy(const Message& from, Message* to); 60 | static void Merge(const Message& from, Message* to); 61 | static void Clear(Message* message); 62 | static bool IsInitialized(const Message& message); 63 | static void DiscardUnknownFields(Message* message); 64 | 65 | // Finds all unset required fields in the message and adds their full 66 | // paths (e.g. "foo.bar[5].baz") to *names. "prefix" will be attached to 67 | // the front of each name. 68 | static void FindInitializationErrors(const Message& message, 69 | const string& prefix, 70 | std::vector* errors); 71 | 72 | private: 73 | // All methods are static. No need to construct. 74 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ReflectionOps); 75 | }; 76 | 77 | } // namespace internal 78 | } // namespace protobuf 79 | 80 | } // namespace google 81 | #endif // GOOGLE_PROTOBUF_REFLECTION_OPS_H__ 82 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/source_context.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option java_package = "com.google.protobuf"; 37 | option java_outer_classname = "SourceContextProto"; 38 | option java_multiple_files = true; 39 | option objc_class_prefix = "GPB"; 40 | 41 | // `SourceContext` represents information about the source of a 42 | // protobuf element, like the file in which it is defined. 43 | message SourceContext { 44 | // The path-qualified name of the .proto file that contained the associated 45 | // protobuf element. For example: `"google/protobuf/source_context.proto"`. 46 | string file_name = 1; 47 | } 48 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/struct.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option cc_enable_arenas = true; 37 | option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; 38 | option java_package = "com.google.protobuf"; 39 | option java_outer_classname = "StructProto"; 40 | option java_multiple_files = true; 41 | option objc_class_prefix = "GPB"; 42 | 43 | 44 | // `Struct` represents a structured data value, consisting of fields 45 | // which map to dynamically typed values. In some languages, `Struct` 46 | // might be supported by a native representation. For example, in 47 | // scripting languages like JS a struct is represented as an 48 | // object. The details of that representation are described together 49 | // with the proto support for the language. 50 | // 51 | // The JSON representation for `Struct` is JSON object. 52 | message Struct { 53 | // Unordered map of dynamically typed values. 54 | map fields = 1; 55 | } 56 | 57 | // `Value` represents a dynamically typed value which can be either 58 | // null, a number, a string, a boolean, a recursive struct value, or a 59 | // list of values. A producer of value is expected to set one of that 60 | // variants, absence of any variant indicates an error. 61 | // 62 | // The JSON representation for `Value` is JSON value. 63 | message Value { 64 | // The kind of value. 65 | oneof kind { 66 | // Represents a null value. 67 | NullValue null_value = 1; 68 | // Represents a double value. 69 | double number_value = 2; 70 | // Represents a string value. 71 | string string_value = 3; 72 | // Represents a boolean value. 73 | bool bool_value = 4; 74 | // Represents a structured value. 75 | Struct struct_value = 5; 76 | // Represents a repeated `Value`. 77 | ListValue list_value = 6; 78 | } 79 | } 80 | 81 | // `NullValue` is a singleton enumeration to represent the null value for the 82 | // `Value` type union. 83 | // 84 | // The JSON representation for `NullValue` is JSON `null`. 85 | enum NullValue { 86 | // Null value. 87 | NULL_VALUE = 0; 88 | } 89 | 90 | // `ListValue` is a wrapper around a repeated field of values. 91 | // 92 | // The JSON representation for `ListValue` is JSON array. 93 | message ListValue { 94 | // Repeated field of dynamically typed values. 95 | repeated Value values = 1; 96 | } 97 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomic_sequence_num.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2014 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | #ifndef GOOGLE_PROTOBUF_ATOMIC_SEQUENCE_NUM_H_ 31 | #define GOOGLE_PROTOBUF_ATOMIC_SEQUENCE_NUM_H_ 32 | 33 | #include 34 | 35 | namespace google { 36 | namespace protobuf { 37 | namespace internal { 38 | 39 | class SequenceNumber { 40 | public: 41 | SequenceNumber() : word_(0) {} 42 | 43 | AtomicWord GetNext() { 44 | return NoBarrier_AtomicIncrement(&word_, 1) - 1; 45 | } 46 | private: 47 | AtomicWord word_; 48 | }; 49 | 50 | } // namespace internal 51 | } // namespace protobuf 52 | } // namespace google 53 | 54 | #endif // GOOGLE_PROTOBUF_ATOMIC_SEQUENCE_NUM_H_ 55 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomicops_internals_arm_gcc.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2012 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // This file is an internal atomic implementation, use atomicops.h instead. 32 | // 33 | // LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears. 34 | 35 | #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_ 36 | #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_ 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace internal { 41 | 42 | // 0xffff0fc0 is the hard coded address of a function provided by 43 | // the kernel which implements an atomic compare-exchange. On older 44 | // ARM architecture revisions (pre-v6) this may be implemented using 45 | // a syscall. This address is stable, and in active use (hard coded) 46 | // by at least glibc-2.7 and the Android C library. 47 | typedef Atomic32 (*LinuxKernelCmpxchgFunc)(Atomic32 old_value, 48 | Atomic32 new_value, 49 | volatile Atomic32* ptr); 50 | LinuxKernelCmpxchgFunc pLinuxKernelCmpxchg __attribute__((weak)) = 51 | (LinuxKernelCmpxchgFunc) 0xffff0fc0; 52 | 53 | typedef void (*LinuxKernelMemoryBarrierFunc)(void); 54 | LinuxKernelMemoryBarrierFunc pLinuxKernelMemoryBarrier __attribute__((weak)) = 55 | (LinuxKernelMemoryBarrierFunc) 0xffff0fa0; 56 | 57 | 58 | inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, 59 | Atomic32 old_value, 60 | Atomic32 new_value) { 61 | Atomic32 prev_value = *ptr; 62 | do { 63 | if (!pLinuxKernelCmpxchg(old_value, new_value, 64 | const_cast(ptr))) { 65 | return old_value; 66 | } 67 | prev_value = *ptr; 68 | } while (prev_value == old_value); 69 | return prev_value; 70 | } 71 | 72 | inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, 73 | Atomic32 new_value) { 74 | Atomic32 old_value; 75 | do { 76 | old_value = *ptr; 77 | } while (pLinuxKernelCmpxchg(old_value, new_value, 78 | const_cast(ptr))); 79 | return old_value; 80 | } 81 | 82 | inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, 83 | Atomic32 increment) { 84 | return Barrier_AtomicIncrement(ptr, increment); 85 | } 86 | 87 | inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, 88 | Atomic32 increment) { 89 | for (;;) { 90 | // Atomic exchange the old value with an incremented one. 91 | Atomic32 old_value = *ptr; 92 | Atomic32 new_value = old_value + increment; 93 | if (pLinuxKernelCmpxchg(old_value, new_value, 94 | const_cast(ptr)) == 0) { 95 | // The exchange took place as expected. 96 | return new_value; 97 | } 98 | // Otherwise, *ptr changed mid-loop and we need to retry. 99 | } 100 | } 101 | 102 | inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, 103 | Atomic32 old_value, 104 | Atomic32 new_value) { 105 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 106 | } 107 | 108 | inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, 109 | Atomic32 old_value, 110 | Atomic32 new_value) { 111 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 112 | } 113 | 114 | inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { 115 | *ptr = value; 116 | } 117 | 118 | inline void MemoryBarrier() { 119 | pLinuxKernelMemoryBarrier(); 120 | } 121 | 122 | inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { 123 | *ptr = value; 124 | MemoryBarrier(); 125 | } 126 | 127 | inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { 128 | MemoryBarrier(); 129 | *ptr = value; 130 | } 131 | 132 | inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { 133 | return *ptr; 134 | } 135 | 136 | inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { 137 | Atomic32 value = *ptr; 138 | MemoryBarrier(); 139 | return value; 140 | } 141 | 142 | inline Atomic32 Release_Load(volatile const Atomic32* ptr) { 143 | MemoryBarrier(); 144 | return *ptr; 145 | } 146 | 147 | } // namespace internal 148 | } // namespace protobuf 149 | } // namespace google 150 | 151 | #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_GCC_H_ 152 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomicops_internals_arm_qnx.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2012 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // This file is an internal atomic implementation, use atomicops.h instead. 32 | 33 | #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ 34 | #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ 35 | 36 | // For _smp_cmpxchg() 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace internal { 42 | 43 | inline Atomic32 QNXCmpxchg(Atomic32 old_value, 44 | Atomic32 new_value, 45 | volatile Atomic32* ptr) { 46 | return static_cast( 47 | _smp_cmpxchg((volatile unsigned *)ptr, 48 | (unsigned)old_value, 49 | (unsigned)new_value)); 50 | } 51 | 52 | 53 | inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, 54 | Atomic32 old_value, 55 | Atomic32 new_value) { 56 | Atomic32 prev_value = *ptr; 57 | do { 58 | if (!QNXCmpxchg(old_value, new_value, 59 | const_cast(ptr))) { 60 | return old_value; 61 | } 62 | prev_value = *ptr; 63 | } while (prev_value == old_value); 64 | return prev_value; 65 | } 66 | 67 | inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, 68 | Atomic32 new_value) { 69 | Atomic32 old_value; 70 | do { 71 | old_value = *ptr; 72 | } while (QNXCmpxchg(old_value, new_value, 73 | const_cast(ptr))); 74 | return old_value; 75 | } 76 | 77 | inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, 78 | Atomic32 increment) { 79 | return Barrier_AtomicIncrement(ptr, increment); 80 | } 81 | 82 | inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, 83 | Atomic32 increment) { 84 | for (;;) { 85 | // Atomic exchange the old value with an incremented one. 86 | Atomic32 old_value = *ptr; 87 | Atomic32 new_value = old_value + increment; 88 | if (QNXCmpxchg(old_value, new_value, 89 | const_cast(ptr)) == 0) { 90 | // The exchange took place as expected. 91 | return new_value; 92 | } 93 | // Otherwise, *ptr changed mid-loop and we need to retry. 94 | } 95 | } 96 | 97 | inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, 98 | Atomic32 old_value, 99 | Atomic32 new_value) { 100 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 101 | } 102 | 103 | inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, 104 | Atomic32 old_value, 105 | Atomic32 new_value) { 106 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 107 | } 108 | 109 | inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { 110 | *ptr = value; 111 | } 112 | 113 | inline void MemoryBarrier() { 114 | __sync_synchronize(); 115 | } 116 | 117 | inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { 118 | *ptr = value; 119 | MemoryBarrier(); 120 | } 121 | 122 | inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { 123 | MemoryBarrier(); 124 | *ptr = value; 125 | } 126 | 127 | inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { 128 | return *ptr; 129 | } 130 | 131 | inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { 132 | Atomic32 value = *ptr; 133 | MemoryBarrier(); 134 | return value; 135 | } 136 | 137 | inline Atomic32 Release_Load(volatile const Atomic32* ptr) { 138 | MemoryBarrier(); 139 | return *ptr; 140 | } 141 | 142 | } // namespace internal 143 | } // namespace protobuf 144 | } // namespace google 145 | 146 | #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM_QNX_H_ 147 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomicops_internals_atomicword_compat.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2012 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // This file is an internal atomic implementation, use atomicops.h instead. 32 | 33 | #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ 34 | #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ 35 | 36 | // AtomicWord is a synonym for intptr_t, and Atomic32 is a synonym for int32, 37 | // which in turn means int. On some LP32 platforms, intptr_t is an int, but 38 | // on others, it's a long. When AtomicWord and Atomic32 are based on different 39 | // fundamental types, their pointers are incompatible. 40 | // 41 | // This file defines function overloads to allow both AtomicWord and Atomic32 42 | // data to be used with this interface. 43 | // 44 | // On LP64 platforms, AtomicWord and Atomic64 are both always long, 45 | // so this problem doesn't occur. 46 | 47 | #if !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) 48 | 49 | namespace google { 50 | namespace protobuf { 51 | namespace internal { 52 | 53 | inline AtomicWord NoBarrier_CompareAndSwap(volatile AtomicWord* ptr, 54 | AtomicWord old_value, 55 | AtomicWord new_value) { 56 | return NoBarrier_CompareAndSwap( 57 | reinterpret_cast(ptr), old_value, new_value); 58 | } 59 | 60 | inline AtomicWord NoBarrier_AtomicExchange(volatile AtomicWord* ptr, 61 | AtomicWord new_value) { 62 | return NoBarrier_AtomicExchange( 63 | reinterpret_cast(ptr), new_value); 64 | } 65 | 66 | inline AtomicWord NoBarrier_AtomicIncrement(volatile AtomicWord* ptr, 67 | AtomicWord increment) { 68 | return NoBarrier_AtomicIncrement( 69 | reinterpret_cast(ptr), increment); 70 | } 71 | 72 | inline AtomicWord Barrier_AtomicIncrement(volatile AtomicWord* ptr, 73 | AtomicWord increment) { 74 | return Barrier_AtomicIncrement( 75 | reinterpret_cast(ptr), increment); 76 | } 77 | 78 | inline AtomicWord Acquire_CompareAndSwap(volatile AtomicWord* ptr, 79 | AtomicWord old_value, 80 | AtomicWord new_value) { 81 | return Acquire_CompareAndSwap( 82 | reinterpret_cast(ptr), old_value, new_value); 83 | } 84 | 85 | inline AtomicWord Release_CompareAndSwap(volatile AtomicWord* ptr, 86 | AtomicWord old_value, 87 | AtomicWord new_value) { 88 | return Release_CompareAndSwap( 89 | reinterpret_cast(ptr), old_value, new_value); 90 | } 91 | 92 | inline void NoBarrier_Store(volatile AtomicWord *ptr, AtomicWord value) { 93 | NoBarrier_Store(reinterpret_cast(ptr), value); 94 | } 95 | 96 | inline void Acquire_Store(volatile AtomicWord* ptr, AtomicWord value) { 97 | return Acquire_Store(reinterpret_cast(ptr), value); 98 | } 99 | 100 | inline void Release_Store(volatile AtomicWord* ptr, AtomicWord value) { 101 | return Release_Store(reinterpret_cast(ptr), value); 102 | } 103 | 104 | inline AtomicWord NoBarrier_Load(volatile const AtomicWord *ptr) { 105 | return NoBarrier_Load(reinterpret_cast(ptr)); 106 | } 107 | 108 | inline AtomicWord Acquire_Load(volatile const AtomicWord* ptr) { 109 | return Acquire_Load(reinterpret_cast(ptr)); 110 | } 111 | 112 | inline AtomicWord Release_Load(volatile const AtomicWord* ptr) { 113 | return Release_Load(reinterpret_cast(ptr)); 114 | } 115 | 116 | } // namespace internal 117 | } // namespace protobuf 118 | } // namespace google 119 | 120 | #endif // !defined(GOOGLE_PROTOBUF_ARCH_64_BIT) 121 | 122 | #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_ 123 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomicops_internals_ppc_gcc.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2015 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Author: ogabbay@advaoptical.com (Oded Gabbay) 32 | // Cleaned up by: bsilver16384@gmail.com (Brian Silverman) 33 | // 34 | // This file is an internal atomic implementation, use atomicops.h instead. 35 | 36 | #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_ 37 | #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_ 38 | 39 | #define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory") 40 | 41 | namespace google { 42 | namespace protobuf { 43 | namespace internal { 44 | 45 | inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr, 46 | Atomic32 old_value, 47 | Atomic32 new_value) { 48 | Atomic32 prev; 49 | 50 | __asm__ __volatile__( 51 | "0: \n\t" 52 | "lwarx %[prev],0,%[ptr] \n\t" 53 | "cmpw 0,%[prev],%[old_value] \n\t" 54 | "bne- 1f \n\t" 55 | "stwcx. %[new_value],0,%[ptr] \n\t" 56 | "bne- 0b \n\t" 57 | "1: \n\t" 58 | : [prev] "=&r"(prev), "+m"(*ptr) 59 | : [ptr] "r"(ptr), [old_value] "r"(old_value), [new_value] "r"(new_value) 60 | : "cc", "memory"); 61 | 62 | return prev; 63 | } 64 | 65 | inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr, 66 | Atomic32 new_value) { 67 | Atomic32 old; 68 | 69 | __asm__ __volatile__( 70 | "0: \n\t" 71 | "lwarx %[old],0,%[ptr] \n\t" 72 | "stwcx. %[new_value],0,%[ptr] \n\t" 73 | "bne- 0b \n\t" 74 | : [old] "=&r"(old), "+m"(*ptr) 75 | : [ptr] "r"(ptr), [new_value] "r"(new_value) 76 | : "cc", "memory"); 77 | 78 | return old; 79 | } 80 | 81 | inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr, 82 | Atomic32 increment) { 83 | Atomic32 temp; 84 | 85 | __asm__ __volatile__( 86 | "0: \n\t" 87 | "lwarx %[temp],0,%[ptr] \n\t" 88 | "add %[temp],%[increment],%[temp] \n\t" 89 | "stwcx. %[temp],0,%[ptr] \n\t" 90 | "bne- 0b \n\t" 91 | : [temp] "=&r"(temp) 92 | : [increment] "r"(increment), [ptr] "r"(ptr) 93 | : "cc", "memory"); 94 | 95 | return temp; 96 | } 97 | 98 | inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr, 99 | Atomic32 increment) { 100 | MemoryBarrier(); 101 | Atomic32 res = NoBarrier_AtomicIncrement(ptr, increment); 102 | MemoryBarrier(); 103 | return res; 104 | } 105 | 106 | inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr, 107 | Atomic32 old_value, Atomic32 new_value) { 108 | Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value); 109 | MemoryBarrier(); 110 | return res; 111 | } 112 | 113 | inline Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr, 114 | Atomic32 old_value, Atomic32 new_value) { 115 | MemoryBarrier(); 116 | Atomic32 res = NoBarrier_CompareAndSwap(ptr, old_value, new_value); 117 | return res; 118 | } 119 | 120 | inline void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value) { 121 | *ptr = value; 122 | } 123 | 124 | inline void MemoryBarrier() { __asm__ __volatile__("sync" : : : "memory"); } 125 | 126 | inline void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value) { 127 | *ptr = value; 128 | MemoryBarrier(); 129 | } 130 | 131 | inline void Release_Store(volatile Atomic32 *ptr, Atomic32 value) { 132 | MemoryBarrier(); 133 | *ptr = value; 134 | } 135 | 136 | inline Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr) { return *ptr; } 137 | 138 | inline Atomic32 Acquire_Load(volatile const Atomic32 *ptr) { 139 | Atomic32 value = *ptr; 140 | MemoryBarrier(); 141 | return value; 142 | } 143 | 144 | inline Atomic32 Release_Load(volatile const Atomic32 *ptr) { 145 | MemoryBarrier(); 146 | return *ptr; 147 | } 148 | 149 | } // namespace internal 150 | } // namespace protobuf 151 | } // namespace google 152 | 153 | #undef ATOMICOPS_COMPILER_BARRIER 154 | 155 | #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_PPC_GCC_H_ 156 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/atomicops_internals_x86_msvc.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2012 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // This file is an internal atomic implementation, use atomicops.h instead. 32 | 33 | #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ 34 | #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ 35 | 36 | namespace google { 37 | namespace protobuf { 38 | namespace internal { 39 | 40 | inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, 41 | Atomic32 increment) { 42 | return Barrier_AtomicIncrement(ptr, increment); 43 | } 44 | 45 | #if !(defined(_MSC_VER) && _MSC_VER >= 1400) 46 | #error "We require at least vs2005 for MemoryBarrier" 47 | #endif 48 | 49 | inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, 50 | Atomic32 old_value, 51 | Atomic32 new_value) { 52 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 53 | } 54 | 55 | inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, 56 | Atomic32 old_value, 57 | Atomic32 new_value) { 58 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 59 | } 60 | 61 | inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { 62 | *ptr = value; 63 | } 64 | 65 | inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { 66 | NoBarrier_AtomicExchange(ptr, value); 67 | // acts as a barrier in this implementation 68 | } 69 | 70 | inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { 71 | *ptr = value; // works w/o barrier for current Intel chips as of June 2005 72 | // See comments in Atomic64 version of Release_Store() below. 73 | } 74 | 75 | inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { 76 | return *ptr; 77 | } 78 | 79 | inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { 80 | Atomic32 value = *ptr; 81 | return value; 82 | } 83 | 84 | inline Atomic32 Release_Load(volatile const Atomic32* ptr) { 85 | MemoryBarrier(); 86 | return *ptr; 87 | } 88 | 89 | #if defined(_WIN64) 90 | 91 | // 64-bit low-level operations on 64-bit platform. 92 | 93 | inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, 94 | Atomic64 increment) { 95 | return Barrier_AtomicIncrement(ptr, increment); 96 | } 97 | 98 | inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { 99 | *ptr = value; 100 | } 101 | 102 | inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { 103 | NoBarrier_AtomicExchange(ptr, value); 104 | // acts as a barrier in this implementation 105 | } 106 | 107 | inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { 108 | *ptr = value; // works w/o barrier for current Intel chips as of June 2005 109 | 110 | // When new chips come out, check: 111 | // IA-32 Intel Architecture Software Developer's Manual, Volume 3: 112 | // System Programming Guide, Chatper 7: Multiple-processor management, 113 | // Section 7.2, Memory Ordering. 114 | // Last seen at: 115 | // http://developer.intel.com/design/pentium4/manuals/index_new.htm 116 | } 117 | 118 | inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { 119 | return *ptr; 120 | } 121 | 122 | inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { 123 | Atomic64 value = *ptr; 124 | return value; 125 | } 126 | 127 | inline Atomic64 Release_Load(volatile const Atomic64* ptr) { 128 | MemoryBarrier(); 129 | return *ptr; 130 | } 131 | 132 | inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, 133 | Atomic64 old_value, 134 | Atomic64 new_value) { 135 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 136 | } 137 | 138 | inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, 139 | Atomic64 old_value, 140 | Atomic64 new_value) { 141 | return NoBarrier_CompareAndSwap(ptr, old_value, new_value); 142 | } 143 | 144 | #endif // defined(_WIN64) 145 | 146 | } // namespace internal 147 | } // namespace protobuf 148 | } // namespace google 149 | 150 | #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ 151 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/casts.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2014 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_CASTS_H__ 32 | #define GOOGLE_PROTOBUF_CASTS_H__ 33 | 34 | #include 35 | #include 36 | 37 | namespace google { 38 | namespace protobuf { 39 | namespace internal { 40 | // Use implicit_cast as a safe version of static_cast or const_cast 41 | // for upcasting in the type hierarchy (i.e. casting a pointer to Foo 42 | // to a pointer to SuperclassOfFoo or casting a pointer to Foo to 43 | // a const pointer to Foo). 44 | // When you use implicit_cast, the compiler checks that the cast is safe. 45 | // Such explicit implicit_casts are necessary in surprisingly many 46 | // situations where C++ demands an exact type match instead of an 47 | // argument type convertable to a target type. 48 | // 49 | // The From type can be inferred, so the preferred syntax for using 50 | // implicit_cast is the same as for static_cast etc.: 51 | // 52 | // implicit_cast(expr) 53 | // 54 | // implicit_cast would have been part of the C++ standard library, 55 | // but the proposal was submitted too late. It will probably make 56 | // its way into the language in the future. 57 | template 58 | inline To implicit_cast(From const &f) { 59 | return f; 60 | } 61 | 62 | // When you upcast (that is, cast a pointer from type Foo to type 63 | // SuperclassOfFoo), it's fine to use implicit_cast<>, since upcasts 64 | // always succeed. When you downcast (that is, cast a pointer from 65 | // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because 66 | // how do you know the pointer is really of type SubclassOfFoo? It 67 | // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, 68 | // when you downcast, you should use this macro. In debug mode, we 69 | // use dynamic_cast<> to double-check the downcast is legal (we die 70 | // if it's not). In normal mode, we do the efficient static_cast<> 71 | // instead. Thus, it's important to test in debug mode to make sure 72 | // the cast is legal! 73 | // This is the only place in the code we should use dynamic_cast<>. 74 | // In particular, you SHOULDN'T be using dynamic_cast<> in order to 75 | // do RTTI (eg code like this: 76 | // if (dynamic_cast(foo)) HandleASubclass1Object(foo); 77 | // if (dynamic_cast(foo)) HandleASubclass2Object(foo); 78 | // You should design the code some other way not to need this. 79 | 80 | template // use like this: down_cast(foo); 81 | inline To down_cast(From* f) { // so we only accept pointers 82 | // Ensures that To is a sub-type of From *. This test is here only 83 | // for compile-time type checking, and has no overhead in an 84 | // optimized build at run-time, as it will be optimized away 85 | // completely. 86 | if (false) { 87 | implicit_cast(0); 88 | } 89 | 90 | #if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI) 91 | assert(f == NULL || dynamic_cast(f) != NULL); // RTTI: debug mode only! 92 | #endif 93 | return static_cast(f); 94 | } 95 | 96 | template // use like this: down_cast(foo); 97 | inline To down_cast(From& f) { 98 | typedef typename remove_reference::type* ToAsPointer; 99 | // Ensures that To is a sub-type of From *. This test is here only 100 | // for compile-time type checking, and has no overhead in an 101 | // optimized build at run-time, as it will be optimized away 102 | // completely. 103 | if (false) { 104 | implicit_cast(0); 105 | } 106 | 107 | #if !defined(NDEBUG) && !defined(GOOGLE_PROTOBUF_NO_RTTI) 108 | // RTTI: debug mode only! 109 | assert(dynamic_cast(&f) != NULL); 110 | #endif 111 | return *static_cast(&f); 112 | } 113 | 114 | template 115 | inline To bit_cast(const From& from) { 116 | GOOGLE_COMPILE_ASSERT(sizeof(From) == sizeof(To), 117 | bit_cast_with_different_sizes); 118 | To dest; 119 | memcpy(&dest, &from, sizeof(dest)); 120 | return dest; 121 | } 122 | 123 | } // namespace internal 124 | 125 | // We made these internal so that they would show up as such in the docs, 126 | // but we don't want to stick "internal::" in front of them everywhere. 127 | using internal::implicit_cast; 128 | using internal::down_cast; 129 | using internal::bit_cast; 130 | 131 | } // namespace protobuf 132 | } // namespace google 133 | #endif // GOOGLE_PROTOBUF_CASTS_H__ 134 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/mutex.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_ 31 | #define GOOGLE_PROTOBUF_STUBS_MUTEX_H_ 32 | 33 | #ifdef GOOGLE_PROTOBUF_NO_THREADLOCAL 34 | #include 35 | #endif 36 | 37 | #include 38 | 39 | // =================================================================== 40 | // emulates google3/base/mutex.h 41 | namespace google { 42 | namespace protobuf { 43 | namespace internal { 44 | 45 | // A Mutex is a non-reentrant (aka non-recursive) mutex. At most one thread T 46 | // may hold a mutex at a given time. If T attempts to Lock() the same Mutex 47 | // while holding it, T will deadlock. 48 | class LIBPROTOBUF_EXPORT Mutex { 49 | public: 50 | // Create a Mutex that is not held by anybody. 51 | Mutex(); 52 | 53 | // Destructor 54 | ~Mutex(); 55 | 56 | // Block if necessary until this Mutex is free, then acquire it exclusively. 57 | void Lock(); 58 | 59 | // Release this Mutex. Caller must hold it exclusively. 60 | void Unlock(); 61 | 62 | // Crash if this Mutex is not held exclusively by this thread. 63 | // May fail to crash when it should; will never crash when it should not. 64 | void AssertHeld(); 65 | 66 | private: 67 | struct Internal; 68 | Internal* mInternal; 69 | 70 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Mutex); 71 | }; 72 | 73 | // Undefine the macros to workaround the conflicts with Google internal 74 | // MutexLock implementation. 75 | // TODO(liujisi): Remove the undef once internal macros are removed. 76 | #undef MutexLock 77 | #undef ReaderMutexLock 78 | #undef WriterMutexLock 79 | #undef MutexLockMaybe 80 | 81 | // MutexLock(mu) acquires mu when constructed and releases it when destroyed. 82 | class LIBPROTOBUF_EXPORT MutexLock { 83 | public: 84 | explicit MutexLock(Mutex *mu) : mu_(mu) { this->mu_->Lock(); } 85 | ~MutexLock() { this->mu_->Unlock(); } 86 | private: 87 | Mutex *const mu_; 88 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLock); 89 | }; 90 | 91 | // TODO(kenton): Implement these? Hard to implement portably. 92 | typedef MutexLock ReaderMutexLock; 93 | typedef MutexLock WriterMutexLock; 94 | 95 | // MutexLockMaybe is like MutexLock, but is a no-op when mu is NULL. 96 | class LIBPROTOBUF_EXPORT MutexLockMaybe { 97 | public: 98 | explicit MutexLockMaybe(Mutex *mu) : 99 | mu_(mu) { if (this->mu_ != NULL) { this->mu_->Lock(); } } 100 | ~MutexLockMaybe() { if (this->mu_ != NULL) { this->mu_->Unlock(); } } 101 | private: 102 | Mutex *const mu_; 103 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MutexLockMaybe); 104 | }; 105 | 106 | #if defined(GOOGLE_PROTOBUF_NO_THREADLOCAL) 107 | template 108 | class ThreadLocalStorage { 109 | public: 110 | ThreadLocalStorage() { 111 | pthread_key_create(&key_, &ThreadLocalStorage::Delete); 112 | } 113 | ~ThreadLocalStorage() { 114 | pthread_key_delete(key_); 115 | } 116 | T* Get() { 117 | T* result = static_cast(pthread_getspecific(key_)); 118 | if (result == NULL) { 119 | result = new T(); 120 | pthread_setspecific(key_, result); 121 | } 122 | return result; 123 | } 124 | private: 125 | static void Delete(void* value) { 126 | delete static_cast(value); 127 | } 128 | pthread_key_t key_; 129 | 130 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ThreadLocalStorage); 131 | }; 132 | #endif 133 | 134 | } // namespace internal 135 | 136 | // We made these internal so that they would show up as such in the docs, 137 | // but we don't want to stick "internal::" in front of them everywhere. 138 | using internal::Mutex; 139 | using internal::MutexLock; 140 | using internal::ReaderMutexLock; 141 | using internal::WriterMutexLock; 142 | using internal::MutexLockMaybe; 143 | 144 | 145 | } // namespace protobuf 146 | } // namespace google 147 | 148 | #endif // GOOGLE_PROTOBUF_STUBS_MUTEX_H_ 149 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/platform_macros.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2012 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | #ifndef GOOGLE_PROTOBUF_PLATFORM_MACROS_H_ 32 | #define GOOGLE_PROTOBUF_PLATFORM_MACROS_H_ 33 | 34 | #define GOOGLE_PROTOBUF_PLATFORM_ERROR \ 35 | #error "Host platform was not detected as supported by protobuf" 36 | 37 | // Processor architecture detection. For more info on what's defined, see: 38 | // http://msdn.microsoft.com/en-us/library/b0084kay.aspx 39 | // http://www.agner.org/optimize/calling_conventions.pdf 40 | // or with gcc, run: "echo | gcc -E -dM -" 41 | #if defined(_M_X64) || defined(__x86_64__) 42 | #define GOOGLE_PROTOBUF_ARCH_X64 1 43 | #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 44 | #elif defined(_M_IX86) || defined(__i386__) 45 | #define GOOGLE_PROTOBUF_ARCH_IA32 1 46 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 47 | #elif defined(__QNX__) 48 | #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1 49 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 50 | #elif defined(__ARMEL__) 51 | #define GOOGLE_PROTOBUF_ARCH_ARM 1 52 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 53 | #elif defined(__aarch64__) 54 | #define GOOGLE_PROTOBUF_ARCH_AARCH64 1 55 | #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 56 | #elif defined(__MIPSEL__) 57 | #if defined(__LP64__) 58 | #define GOOGLE_PROTOBUF_ARCH_MIPS64 1 59 | #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 60 | #else 61 | #define GOOGLE_PROTOBUF_ARCH_MIPS 1 62 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 63 | #endif 64 | #elif defined(__pnacl__) 65 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 66 | #elif defined(sparc) 67 | #define GOOGLE_PROTOBUF_ARCH_SPARC 1 68 | #if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__) 69 | #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 70 | #else 71 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 72 | #endif 73 | #elif defined(_POWER) || defined(__powerpc64__) || defined(__PPC64__) 74 | #define GOOGLE_PROTOBUF_ARCH_POWER 1 75 | #define GOOGLE_PROTOBUF_ARCH_64_BIT 1 76 | #elif defined(__PPC__) 77 | #define GOOGLE_PROTOBUF_ARCH_PPC 1 78 | #define GOOGLE_PROTOBUF_ARCH_32_BIT 1 79 | #elif defined(__GNUC__) 80 | # if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)) 81 | // We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h 82 | # elif defined(__clang__) 83 | # if !__has_extension(c_atomic) 84 | GOOGLE_PROTOBUF_PLATFORM_ERROR 85 | # endif 86 | // We fallback to the generic Clang/GCC >= 4.7 implementation in atomicops.h 87 | # endif 88 | # if __LP64__ 89 | # define GOOGLE_PROTOBUF_ARCH_64_BIT 1 90 | # else 91 | # define GOOGLE_PROTOBUF_ARCH_32_BIT 1 92 | # endif 93 | #else 94 | GOOGLE_PROTOBUF_PLATFORM_ERROR 95 | #endif 96 | 97 | #if defined(__APPLE__) 98 | #define GOOGLE_PROTOBUF_OS_APPLE 99 | #include 100 | #if TARGET_OS_IPHONE 101 | #define GOOGLE_PROTOBUF_OS_IPHONE 102 | #endif 103 | #elif defined(__EMSCRIPTEN__) 104 | #define GOOGLE_PROTOBUF_OS_EMSCRIPTEN 105 | #elif defined(__native_client__) 106 | #define GOOGLE_PROTOBUF_OS_NACL 107 | #elif defined(sun) 108 | #define GOOGLE_PROTOBUF_OS_SOLARIS 109 | #elif defined(_AIX) 110 | #define GOOGLE_PROTOBUF_OS_AIX 111 | #elif defined(__ANDROID__) 112 | #define GOOGLE_PROTOBUF_OS_ANDROID 113 | #endif 114 | 115 | #undef GOOGLE_PROTOBUF_PLATFORM_ERROR 116 | 117 | #if defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) 118 | // Android ndk does not support the __thread keyword very well yet. Here 119 | // we use pthread_key_create()/pthread_getspecific()/... methods for 120 | // TLS support on android. 121 | // iOS also does not support the __thread keyword. 122 | #define GOOGLE_PROTOBUF_NO_THREADLOCAL 123 | #endif 124 | 125 | #endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_ 126 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/singleton.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2014 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | #ifndef GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 31 | #define GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace google { 38 | namespace protobuf { 39 | namespace internal { 40 | template 41 | class Singleton { 42 | public: 43 | static T* get() { 44 | GoogleOnceInit(&once_, &Singleton::Init); 45 | return instance_; 46 | } 47 | static void ShutDown() { 48 | delete instance_; 49 | instance_ = NULL; 50 | } 51 | private: 52 | static void Init() { 53 | instance_ = new T(); 54 | } 55 | static ProtobufOnceType once_; 56 | static T* instance_; 57 | }; 58 | 59 | template 60 | ProtobufOnceType Singleton::once_; 61 | 62 | template 63 | T* Singleton::instance_ = NULL; 64 | } // namespace internal 65 | } // namespace protobuf 66 | } // namespace google 67 | 68 | #endif // GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 69 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/status.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | #ifndef GOOGLE_PROTOBUF_STUBS_STATUS_H_ 31 | #define GOOGLE_PROTOBUF_STUBS_STATUS_H_ 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace util { 42 | namespace error { 43 | // These values must match error codes defined in google/rpc/code.proto. 44 | enum Code { 45 | OK = 0, 46 | CANCELLED = 1, 47 | UNKNOWN = 2, 48 | INVALID_ARGUMENT = 3, 49 | DEADLINE_EXCEEDED = 4, 50 | NOT_FOUND = 5, 51 | ALREADY_EXISTS = 6, 52 | PERMISSION_DENIED = 7, 53 | UNAUTHENTICATED = 16, 54 | RESOURCE_EXHAUSTED = 8, 55 | FAILED_PRECONDITION = 9, 56 | ABORTED = 10, 57 | OUT_OF_RANGE = 11, 58 | UNIMPLEMENTED = 12, 59 | INTERNAL = 13, 60 | UNAVAILABLE = 14, 61 | DATA_LOSS = 15, 62 | }; 63 | } // namespace error 64 | 65 | class LIBPROTOBUF_EXPORT Status { 66 | public: 67 | // Creates a "successful" status. 68 | Status(); 69 | 70 | // Create a status in the canonical error space with the specified 71 | // code, and error message. If "code == 0", error_message is 72 | // ignored and a Status object identical to Status::OK is 73 | // constructed. 74 | Status(error::Code error_code, StringPiece error_message); 75 | Status(const Status&); 76 | Status& operator=(const Status& x); 77 | ~Status() {} 78 | 79 | // Some pre-defined Status objects 80 | static const Status OK; // Identical to 0-arg constructor 81 | static const Status CANCELLED; 82 | static const Status UNKNOWN; 83 | 84 | // Accessor 85 | bool ok() const { 86 | return error_code_ == error::OK; 87 | } 88 | int error_code() const { 89 | return error_code_; 90 | } 91 | StringPiece error_message() const { 92 | return error_message_; 93 | } 94 | 95 | bool operator==(const Status& x) const; 96 | bool operator!=(const Status& x) const { 97 | return !operator==(x); 98 | } 99 | 100 | // Return a combination of the error code name and message. 101 | string ToString() const; 102 | 103 | private: 104 | error::Code error_code_; 105 | string error_message_; 106 | }; 107 | 108 | // Prints a human-readable representation of 'x' to 'os'. 109 | LIBPROTOBUF_EXPORT ostream& operator<<(ostream& os, const Status& x); 110 | 111 | #define EXPECT_OK(value) EXPECT_TRUE((value).ok()) 112 | 113 | } // namespace util 114 | } // namespace protobuf 115 | } // namespace google 116 | #endif // GOOGLE_PROTOBUF_STUBS_STATUS_H_ 117 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/stl_util.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // from google3/util/gtl/stl_util.h 32 | 33 | #ifndef GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__ 34 | #define GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__ 35 | 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | 41 | // STLDeleteContainerPointers() 42 | // For a range within a container of pointers, calls delete 43 | // (non-array version) on these pointers. 44 | // NOTE: for these three functions, we could just implement a DeleteObject 45 | // functor and then call for_each() on the range and functor, but this 46 | // requires us to pull in all of algorithm.h, which seems expensive. 47 | // For hash_[multi]set, it is important that this deletes behind the iterator 48 | // because the hash_set may call the hash function on the iterator when it is 49 | // advanced, which could result in the hash function trying to deference a 50 | // stale pointer. 51 | template 52 | void STLDeleteContainerPointers(ForwardIterator begin, 53 | ForwardIterator end) { 54 | while (begin != end) { 55 | ForwardIterator temp = begin; 56 | ++begin; 57 | delete *temp; 58 | } 59 | } 60 | 61 | // Inside Google, this function implements a horrible, disgusting hack in which 62 | // we reach into the string's private implementation and resize it without 63 | // initializing the new bytes. In some cases doing this can significantly 64 | // improve performance. However, since it's totally non-portable it has no 65 | // place in open source code. Feel free to fill this function in with your 66 | // own disgusting hack if you want the perf boost. 67 | inline void STLStringResizeUninitialized(string* s, size_t new_size) { 68 | s->resize(new_size); 69 | } 70 | 71 | // Return a mutable char* pointing to a string's internal buffer, 72 | // which may not be null-terminated. Writing through this pointer will 73 | // modify the string. 74 | // 75 | // string_as_array(&str)[i] is valid for 0 <= i < str.size() until the 76 | // next call to a string method that invalidates iterators. 77 | // 78 | // As of 2006-04, there is no standard-blessed way of getting a 79 | // mutable reference to a string's internal buffer. However, issue 530 80 | // (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530) 81 | // proposes this as the method. According to Matt Austern, this should 82 | // already work on all current implementations. 83 | inline char* string_as_array(string* str) { 84 | // DO NOT USE const_cast(str->data())! See the unittest for why. 85 | return str->empty() ? NULL : &*str->begin(); 86 | } 87 | 88 | // STLDeleteElements() deletes all the elements in an STL container and clears 89 | // the container. This function is suitable for use with a vector, set, 90 | // hash_set, or any other STL container which defines sensible begin(), end(), 91 | // and clear() methods. 92 | // 93 | // If container is NULL, this function is a no-op. 94 | // 95 | // As an alternative to calling STLDeleteElements() directly, consider 96 | // ElementDeleter (defined below), which ensures that your container's elements 97 | // are deleted when the ElementDeleter goes out of scope. 98 | template 99 | void STLDeleteElements(T *container) { 100 | if (!container) return; 101 | STLDeleteContainerPointers(container->begin(), container->end()); 102 | container->clear(); 103 | } 104 | 105 | // Given an STL container consisting of (key, value) pairs, STLDeleteValues 106 | // deletes all the "value" components and clears the container. Does nothing 107 | // in the case it's given a NULL pointer. 108 | 109 | template 110 | void STLDeleteValues(T *v) { 111 | if (!v) return; 112 | for (typename T::iterator i = v->begin(); i != v->end(); ++i) { 113 | delete i->second; 114 | } 115 | v->clear(); 116 | } 117 | 118 | } // namespace protobuf 119 | } // namespace google 120 | 121 | #endif // GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__ 122 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/stubs/template_util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005 Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // ---- 31 | // Author: lar@google.com (Laramie Leavitt) 32 | // 33 | // Template metaprogramming utility functions. 34 | // 35 | // This code is compiled directly on many platforms, including client 36 | // platforms like Windows, Mac, and embedded systems. Before making 37 | // any changes here, make sure that you're not breaking any platforms. 38 | // 39 | // 40 | // The names chosen here reflect those used in tr1 and the boost::mpl 41 | // library, there are similar operations used in the Loki library as 42 | // well. I prefer the boost names for 2 reasons: 43 | // 1. I think that portions of the Boost libraries are more likely to 44 | // be included in the c++ standard. 45 | // 2. It is not impossible that some of the boost libraries will be 46 | // included in our own build in the future. 47 | // Both of these outcomes means that we may be able to directly replace 48 | // some of these with boost equivalents. 49 | // 50 | #ifndef GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_ 51 | #define GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_ 52 | 53 | namespace google { 54 | namespace protobuf { 55 | namespace internal { 56 | 57 | // Types small_ and big_ are guaranteed such that sizeof(small_) < 58 | // sizeof(big_) 59 | typedef char small_; 60 | 61 | struct big_ { 62 | char dummy[2]; 63 | }; 64 | 65 | // Identity metafunction. 66 | template 67 | struct identity_ { 68 | typedef T type; 69 | }; 70 | 71 | // integral_constant, defined in tr1, is a wrapper for an integer 72 | // value. We don't really need this generality; we could get away 73 | // with hardcoding the integer type to bool. We use the fully 74 | // general integer_constant for compatibility with tr1. 75 | 76 | template 77 | struct integral_constant { 78 | static const T value = v; 79 | typedef T value_type; 80 | typedef integral_constant type; 81 | }; 82 | 83 | template const T integral_constant::value; 84 | 85 | 86 | // Abbreviations: true_type and false_type are structs that represent boolean 87 | // true and false values. Also define the boost::mpl versions of those names, 88 | // true_ and false_. 89 | typedef integral_constant true_type; 90 | typedef integral_constant false_type; 91 | typedef true_type true_; 92 | typedef false_type false_; 93 | 94 | // if_ is a templatized conditional statement. 95 | // if_ is a compile time evaluation of cond. 96 | // if_<>::type contains A if cond is true, B otherwise. 97 | template 98 | struct if_{ 99 | typedef A type; 100 | }; 101 | 102 | template 103 | struct if_ { 104 | typedef B type; 105 | }; 106 | 107 | 108 | // type_equals_ is a template type comparator, similar to Loki IsSameType. 109 | // type_equals_::value is true iff "A" is the same type as "B". 110 | // 111 | // New code should prefer base::is_same, defined in base/type_traits.h. 112 | // It is functionally identical, but is_same is the standard spelling. 113 | template 114 | struct type_equals_ : public false_ { 115 | }; 116 | 117 | template 118 | struct type_equals_ : public true_ { 119 | }; 120 | 121 | // and_ is a template && operator. 122 | // and_::value evaluates "A::value && B::value". 123 | template 124 | struct and_ : public integral_constant { 125 | }; 126 | 127 | // or_ is a template || operator. 128 | // or_::value evaluates "A::value || B::value". 129 | template 130 | struct or_ : public integral_constant { 131 | }; 132 | 133 | 134 | } // namespace internal 135 | } // namespace protobuf 136 | } // namespace google 137 | 138 | #endif // GOOGLE_PROTOBUF_TEMPLATE_UTIL_H_ 139 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/timestamp.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option cc_enable_arenas = true; 37 | option go_package = "github.com/golang/protobuf/ptypes/timestamp"; 38 | option java_package = "com.google.protobuf"; 39 | option java_outer_classname = "TimestampProto"; 40 | option java_multiple_files = true; 41 | option objc_class_prefix = "GPB"; 42 | 43 | // A Timestamp represents a point in time independent of any time zone 44 | // or calendar, represented as seconds and fractions of seconds at 45 | // nanosecond resolution in UTC Epoch time. It is encoded using the 46 | // Proleptic Gregorian Calendar which extends the Gregorian calendar 47 | // backwards to year one. It is encoded assuming all minutes are 60 48 | // seconds long, i.e. leap seconds are "smeared" so that no leap second 49 | // table is needed for interpretation. Range is from 50 | // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. 51 | // By restricting to that range, we ensure that we can convert to 52 | // and from RFC 3339 date strings. 53 | // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). 54 | // 55 | // Example 1: Compute Timestamp from POSIX `time()`. 56 | // 57 | // Timestamp timestamp; 58 | // timestamp.set_seconds(time(NULL)); 59 | // timestamp.set_nanos(0); 60 | // 61 | // Example 2: Compute Timestamp from POSIX `gettimeofday()`. 62 | // 63 | // struct timeval tv; 64 | // gettimeofday(&tv, NULL); 65 | // 66 | // Timestamp timestamp; 67 | // timestamp.set_seconds(tv.tv_sec); 68 | // timestamp.set_nanos(tv.tv_usec * 1000); 69 | // 70 | // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. 71 | // 72 | // FILETIME ft; 73 | // GetSystemTimeAsFileTime(&ft); 74 | // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; 75 | // 76 | // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z 77 | // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. 78 | // Timestamp timestamp; 79 | // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); 80 | // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); 81 | // 82 | // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. 83 | // 84 | // long millis = System.currentTimeMillis(); 85 | // 86 | // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) 87 | // .setNanos((int) ((millis % 1000) * 1000000)).build(); 88 | // 89 | // 90 | // Example 5: Compute Timestamp from current time in Python. 91 | // 92 | // timestamp = Timestamp() 93 | // timestamp.GetCurrentTime() 94 | // 95 | // 96 | message Timestamp { 97 | 98 | // Represents seconds of UTC time since Unix epoch 99 | // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 100 | // 9999-12-31T23:59:59Z inclusive. 101 | int64 seconds = 1; 102 | 103 | // Non-negative fractions of a second at nanosecond resolution. Negative 104 | // second values with fractions must still have non-negative nanos values 105 | // that count forward in time. Must be from 0 to 999,999,999 106 | // inclusive. 107 | int32 nanos = 2; 108 | } 109 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/util/type_resolver.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Defines a TypeResolver for the Any message. 32 | 33 | #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 34 | #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | 42 | namespace google { 43 | namespace protobuf { 44 | class Type; 45 | class Enum; 46 | } // namespace protobuf 47 | 48 | 49 | namespace protobuf { 50 | class DescriptorPool; 51 | namespace util { 52 | 53 | // Abstract interface for a type resovler. 54 | // 55 | // Implementations of this interface must be thread-safe. 56 | class LIBPROTOBUF_EXPORT TypeResolver { 57 | public: 58 | TypeResolver() {} 59 | virtual ~TypeResolver() {} 60 | 61 | // Resolves a type url for a message type. 62 | virtual util::Status ResolveMessageType( 63 | const string& type_url, google::protobuf::Type* message_type) = 0; 64 | 65 | // Resolves a type url for an enum type. 66 | virtual util::Status ResolveEnumType(const string& type_url, 67 | google::protobuf::Enum* enum_type) = 0; 68 | 69 | private: 70 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeResolver); 71 | }; 72 | 73 | } // namespace util 74 | } // namespace protobuf 75 | 76 | } // namespace google 77 | #endif // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 78 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/util/type_resolver_util.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Defines utilities for the TypeResolver. 32 | 33 | #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 34 | #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 35 | 36 | #include 37 | 38 | #include 39 | namespace google { 40 | namespace protobuf { 41 | class DescriptorPool; 42 | namespace util { 43 | class TypeResolver; 44 | 45 | // Creates a TypeResolver that serves type information in the given descriptor 46 | // pool. Caller takes ownership of the returned TypeResolver. 47 | LIBPROTOBUF_EXPORT TypeResolver* NewTypeResolverForDescriptorPool( 48 | const string& url_prefix, const DescriptorPool* pool); 49 | 50 | } // namespace util 51 | } // namespace protobuf 52 | 53 | } // namespace google 54 | #endif // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 55 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/include/google/protobuf/wrappers.proto: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2008 Google Inc. All rights reserved. 3 | // https://developers.google.com/protocol-buffers/ 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are 7 | // met: 8 | // 9 | // * Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // * Redistributions in binary form must reproduce the above 12 | // copyright notice, this list of conditions and the following disclaimer 13 | // in the documentation and/or other materials provided with the 14 | // distribution. 15 | // * Neither the name of Google Inc. nor the names of its 16 | // contributors may be used to endorse or promote products derived from 17 | // this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | // Wrappers for primitive (non-message) types. These types are useful 32 | // for embedding primitives in the `google.protobuf.Any` type and for places 33 | // where we need to distinguish between the absence of a primitive 34 | // typed field and its default value. 35 | 36 | syntax = "proto3"; 37 | 38 | package google.protobuf; 39 | 40 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 41 | option cc_enable_arenas = true; 42 | option go_package = "github.com/golang/protobuf/ptypes/wrappers"; 43 | option java_package = "com.google.protobuf"; 44 | option java_outer_classname = "WrappersProto"; 45 | option java_multiple_files = true; 46 | option objc_class_prefix = "GPB"; 47 | 48 | // Wrapper message for `double`. 49 | // 50 | // The JSON representation for `DoubleValue` is JSON number. 51 | message DoubleValue { 52 | // The double value. 53 | double value = 1; 54 | } 55 | 56 | // Wrapper message for `float`. 57 | // 58 | // The JSON representation for `FloatValue` is JSON number. 59 | message FloatValue { 60 | // The float value. 61 | float value = 1; 62 | } 63 | 64 | // Wrapper message for `int64`. 65 | // 66 | // The JSON representation for `Int64Value` is JSON string. 67 | message Int64Value { 68 | // The int64 value. 69 | int64 value = 1; 70 | } 71 | 72 | // Wrapper message for `uint64`. 73 | // 74 | // The JSON representation for `UInt64Value` is JSON string. 75 | message UInt64Value { 76 | // The uint64 value. 77 | uint64 value = 1; 78 | } 79 | 80 | // Wrapper message for `int32`. 81 | // 82 | // The JSON representation for `Int32Value` is JSON number. 83 | message Int32Value { 84 | // The int32 value. 85 | int32 value = 1; 86 | } 87 | 88 | // Wrapper message for `uint32`. 89 | // 90 | // The JSON representation for `UInt32Value` is JSON number. 91 | message UInt32Value { 92 | // The uint32 value. 93 | uint32 value = 1; 94 | } 95 | 96 | // Wrapper message for `bool`. 97 | // 98 | // The JSON representation for `BoolValue` is JSON `true` and `false`. 99 | message BoolValue { 100 | // The bool value. 101 | bool value = 1; 102 | } 103 | 104 | // Wrapper message for `string`. 105 | // 106 | // The JSON representation for `StringValue` is JSON string. 107 | message StringValue { 108 | // The string value. 109 | string value = 1; 110 | } 111 | 112 | // Wrapper message for `bytes`. 113 | // 114 | // The JSON representation for `BytesValue` is JSON string. 115 | message BytesValue { 116 | // The bytes value. 117 | bytes value = 1; 118 | } 119 | -------------------------------------------------------------------------------- /libapp2sys/prebuilt/protoc/darwin/protoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/protoc/darwin/protoc -------------------------------------------------------------------------------- /libapp2sys/prebuilt/protoc/linux-amd64/protoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/protoc/linux-amd64/protoc -------------------------------------------------------------------------------- /libapp2sys/prebuilt/protoc/linux-x86/protoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/protoc/linux-x86/protoc -------------------------------------------------------------------------------- /libapp2sys/prebuilt/protoc/win32-amd64/protoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/protoc/win32-amd64/protoc.exe -------------------------------------------------------------------------------- /libapp2sys/prebuilt/protoc/win32-x86/protoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/libapp2sys/prebuilt/protoc/win32-x86/protoc.exe -------------------------------------------------------------------------------- /libapp2sys/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/guang_hik/android-sdks/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /libapp2sys/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /libapp2sys/src/main/cpp/c2java.h: -------------------------------------------------------------------------------- 1 | /** 2 | * C to Java interface 3 | */ 4 | 5 | #ifndef HARDCODER_C2JAVA_H 6 | #define HARDCODER_C2JAVA_H 7 | 8 | #include 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | JavaVM *g_jvm = NULL; 15 | jclass g_classUdpEngine; 16 | 17 | jint JNI_OnLoad(JavaVM *vm, void *reserved) { 18 | UNUSED(reserved); 19 | 20 | JNIEnv *env = NULL; 21 | jint result = JNI_ERR; 22 | g_jvm = vm; 23 | 24 | if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK) { 25 | return result; 26 | } 27 | 28 | jclass clazz = env->FindClass("com/tencent/mm/hardcoder/HardCoderJNI"); 29 | g_classUdpEngine = (jclass) env->NewGlobalRef(clazz); 30 | env->DeleteLocalRef(clazz); 31 | 32 | return JNI_VERSION_1_6; 33 | } 34 | 35 | void c2Java_OnData(JNIEnv *envCThread, int callbackType, uint64_t requestid, uint64_t timestamp, int errCode, int funcid, int dataType, uint8_t *data, int len) { 36 | if (!envCThread) { 37 | perr("Not init env"); 38 | return; 39 | } 40 | 41 | jmethodID methodId = envCThread->GetStaticMethodID(g_classUdpEngine, "onData", "(IJJIII[B)V"); 42 | 43 | if (methodId == NULL) { 44 | perr("methodId is null"); 45 | return; 46 | } 47 | 48 | jbyteArray jBuff = envCThread->NewByteArray(len); 49 | envCThread->SetByteArrayRegion(jBuff, 0, len, (jbyte *) data); 50 | 51 | envCThread->CallStaticVoidMethod(g_classUdpEngine, methodId, callbackType, (jlong)requestid, (jlong)timestamp, errCode, 52 | funcid, dataType, jBuff); 53 | 54 | envCThread->DeleteLocalRef(jBuff); 55 | } 56 | 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif //HARDCODER_C2JAVA_H 63 | -------------------------------------------------------------------------------- /libapp2sys/src/main/cpp/com_tencent_mm_hardcoder_HardCoderJNI.h: -------------------------------------------------------------------------------- 1 | #ifndef _Included_com_tencent_mm_hardcoder_HardCoderJNI 2 | #define _Included_com_tencent_mm_hardcoder_HardCoderJNI 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /********************************************* 11 | * JNI method 12 | *********************************************/ 13 | 14 | JNIEXPORT jint JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_initHardCoder(JNIEnv *env, jclass jcls, 15 | jstring remote, jint port, jstring local); 16 | 17 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_checkPermission(JNIEnv *env, jclass jcls, 18 | jobjectArray manufactures, jobjectArray certs, jint pid, jint uid, jint tid, jlong timestamp); 19 | 20 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestCpuHighFreq(JNIEnv *env, jclass jcls, 21 | jint scene, jlong action, jint level, jint timeout, jint tid, jlong timestamp); 22 | 23 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_cancelCpuHighFreq(JNIEnv *env, jclass jcls, 24 | jint tid, jlong timestamp); 25 | 26 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestGpuHighFreq(JNIEnv *env, jclass jcls, 27 | jint scene, jlong action, jint level, jint timeout, jint tid, jlong timestamp); 28 | 29 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_cancelGpuHighFreq(JNIEnv *env, jclass jcls, 30 | jint tid, jlong timestamp); 31 | 32 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestCpuCoreForThread(JNIEnv *env, jclass jcls, 33 | jint scene, jlong action, jintArray bindtids, jint timeoutms, jint tid, jlong timestamp); 34 | 35 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_cancelCpuCoreForThread(JNIEnv *env, jclass jcls, 36 | jintArray bindtids, jint tid, jlong timestamp); 37 | 38 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestHighIOFreq(JNIEnv *env, jclass jcls, 39 | jint scene, jlong action, jint level, jint timeoutms, jint tid, jlong timestamp); 40 | 41 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_cancelHighIOFreq(JNIEnv *env, jclass jcls, 42 | jint tid, jlong timestamp); 43 | 44 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestScreenResolution(JNIEnv *env, jclass jcls, 45 | jint level, jstring uiname, jint tid, jlong timestamp); 46 | 47 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_resetScreenResolution(JNIEnv *env, jclass jcls, 48 | jint tid, jlong timestamp); 49 | 50 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_registerANRCallback(JNIEnv *env, jclass jcls, 51 | jint tid, jlong timestamp); 52 | 53 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_registerSystemEventCallback(JNIEnv *env, jclass jcls, 54 | jint tid, jlong timestamp); 55 | 56 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_registerBootPreloadResource(JNIEnv *env, jclass jcls, 57 | jobjectArray files, jint tid, jlong timestamp); 58 | 59 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_terminateApp(JNIEnv *env, jclass jcls, 60 | jint tid, jlong timestamp); 61 | 62 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_requestUnifyCpuIOThreadCoreGpu(JNIEnv *env, jclass jcls, 63 | jint scene, jlong action, jint cpulevel, jint gpulevel, jint iolevel, jintArray bindtids, jint timeout, jint tid, jlong timestamp); 64 | 65 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_cancelUnifyCpuIOThreadCoreGpu(JNIEnv *env, jclass jcls, 66 | jboolean cancelcpu, jboolean cancelgpu, jboolean cancelio, jboolean cancelthread, jintArray bindtids, jint tid, jlong timestamp); 67 | 68 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_configure(JNIEnv *env, jclass jcls, 69 | jbyteArray data, jint tid, jlong timestamp); 70 | 71 | JNIEXPORT jlong JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_getParameters(JNIEnv *env, jclass jcls, 72 | jbyteArray data, jint tid, jlong timestamp); 73 | 74 | JNIEXPORT void JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_setHCEnable(JNIEnv *env, jclass jcls, jboolean enable); 75 | 76 | JNIEXPORT void JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_setRetryConnectInterval(JNIEnv *env, jclass jcls, jint interval); 77 | 78 | JNIEXPORT void JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_setDebug(JNIEnv *env, jclass jcls, jboolean debug); 79 | 80 | JNIEXPORT jint JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_isRunning(JNIEnv *env, jclass jcls); 81 | 82 | JNIEXPORT int JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_startTraceCpuLoad(JNIEnv *env, jclass jcls, 83 | jint linuxTid, jint sampleRate); 84 | 85 | JNIEXPORT int JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_stopTraceCpuLoad(JNIEnv *env, jclass jcls, jint id); 86 | 87 | JNIEXPORT int JNICALL Java_com_tencent_mm_hardcoder_HardCoderJNI_getTickRate(JNIEnv *env, jclass jcls); 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | #endif -------------------------------------------------------------------------------- /libapp2sys/src/main/java/com/tencent/mm/hardcoder/HardCoderCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 3 | * 4 | * Licensed under the BSD 3-Clause License. 5 | * 6 | * Terms of the BSD 3-Clause License: 7 | * -------------------------------------------------------------------- 8 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software 12 | * without specific prior written permission. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 16 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 17 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 | * 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. 19 | */ 20 | 21 | package com.tencent.mm.hardcoder; 22 | 23 | public class HardCoderCallback { 24 | 25 | /** 26 | * callback for localsocket connect status 27 | */ 28 | public interface ConnectStatusCallback { 29 | void onConnectStatus(boolean isConnect); 30 | } 31 | 32 | /** 33 | * callback for function id request 34 | */ 35 | public interface FuncRetCallback { 36 | void onFuncRet(final int callbackType, final long requestId, final int retCode, 37 | final int funcId, final int dataType, final byte[] buffer); 38 | } 39 | 40 | /** 41 | * callback for scene value 42 | */ 43 | public interface SceneReportCallback{ 44 | void sceneReport(int scene, long action); 45 | } 46 | 47 | /** 48 | * RequestStatus mark the request info when use startPerformance 49 | */ 50 | public static class RequestStatus { 51 | public int scene; 52 | public long action; 53 | public int cpulevel, gpulevel, iolevel; 54 | public int[] bindtids; 55 | 56 | public RequestStatus(int scene, long action, int cpulevel, 57 | int gpulevel, int iolevel, int[] bindtids) { 58 | this.scene = scene; 59 | this.action = action; 60 | this.cpulevel = cpulevel; 61 | this.gpulevel = gpulevel; 62 | this.iolevel = iolevel; 63 | this.bindtids = bindtids.clone(); 64 | } 65 | 66 | @Override 67 | public String toString() { 68 | StringBuilder stringBuilder = new StringBuilder("[RequestStatus, ") 69 | .append("scene:").append(scene) 70 | .append(", action:").append(action) 71 | .append(", cpulevel:").append(cpulevel) 72 | .append(", gpulevel:").append(gpulevel) 73 | .append(", iolevel:").append(iolevel) 74 | .append(", bindtids size:").append(bindtids.length); 75 | return stringBuilder.append("]").toString(); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /libapp2sys/src/main/java/com/tencent/mm/hardcoder/HardCoderLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 3 | * 4 | * Licensed under the BSD 3-Clause License. 5 | * 6 | * Terms of the BSD 3-Clause License: 7 | * -------------------------------------------------------------------- 8 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software 12 | * without specific prior written permission. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 16 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 17 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 | * 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. 19 | */ 20 | 21 | package com.tencent.mm.hardcoder; 22 | 23 | import android.util.Log; 24 | 25 | 26 | /** 27 | * If app wants to use customized Log, use setLog. 28 | * Otherwise just use the system default Log. 29 | */ 30 | public class HardCoderLog { 31 | private static ILog iLog = null; 32 | public interface ILog{ 33 | void i(String tag, String msg); 34 | void d(String tag, String msg); 35 | void e(String tag, String msg); 36 | void printErrStackTrace(String tag, Throwable tr, String format, Object... obj); 37 | } 38 | 39 | public static void setLog(ILog log){ 40 | iLog = log; 41 | } 42 | 43 | public static void i(final String tag, final String msg) { 44 | if(iLog == null) { 45 | Log.i(tag, msg); 46 | } else { 47 | iLog.i(tag, msg); 48 | } 49 | } 50 | 51 | public static void d(final String tag, final String msg) { 52 | if (HardCoderJNI.isHcDebug()) {//if only open debug log 53 | if (iLog == null) { 54 | Log.d(tag, msg); 55 | } else { 56 | iLog.d(tag, msg); 57 | } 58 | } 59 | } 60 | 61 | public static void e(final String tag, final String msg) { 62 | if(iLog == null) { 63 | Log.e(tag, msg); 64 | } else { 65 | iLog.e(tag, msg); 66 | } 67 | } 68 | 69 | public static void printErrStackTrace(String tag, Throwable throwable, final String format, final Object... obj) { 70 | if(iLog == null) { 71 | throwable.printStackTrace(); 72 | } else { 73 | iLog.printErrStackTrace(tag, throwable, format, obj); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /libapp2sys/src/main/proto/amc.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package amc; 4 | option optimize_for = LITE_RUNTIME; 5 | 6 | message CertTag { 7 | required string manufacture = 1; 8 | required bytes cert = 2; 9 | } 10 | 11 | message CheckPermission { 12 | repeated CertTag certTags = 1; 13 | } 14 | 15 | message RequestCPUHighFreq{ 16 | required int32 scene = 1; 17 | required int32 level = 2; 18 | required int32 timeoutMs = 3; 19 | required int64 action = 4; 20 | } 21 | 22 | message RequestGPUHighFreq{ 23 | required int32 scene = 1; 24 | required int32 level = 2; 25 | required int32 timeoutMs = 3; 26 | required int64 action = 4; 27 | } 28 | 29 | message RequestCPUCoreForThread{ 30 | required int32 scene = 1; 31 | repeated int32 bindtids = 2; 32 | required int32 timeoutMs = 3; 33 | required int64 action = 4; 34 | } 35 | 36 | message CancelCPUCoreForThread{ 37 | repeated int32 bindtids = 1; 38 | } 39 | 40 | message RequestHighIOFreq{ 41 | required int32 scene = 1; 42 | required int32 level = 2; 43 | required int32 timeoutMs = 3; 44 | required int64 action = 4; 45 | } 46 | 47 | message RequestScreenResolution{ 48 | required int32 level = 1; 49 | required string uiName = 2; 50 | } 51 | 52 | message RequestBootPreLoadResource{ 53 | repeated string filelist = 1; 54 | } 55 | 56 | message Configuration { 57 | required bytes data = 1; 58 | } 59 | 60 | message GetParameters { 61 | required bytes data = 1; 62 | } 63 | 64 | message RegisterCallback{ 65 | required int32 type = 1; 66 | required int32 uid = 2; 67 | required int32 pid = 3; 68 | } 69 | 70 | message DataCallback{ 71 | required int32 type = 1; 72 | required bytes data = 2; 73 | } 74 | 75 | message RequestUnifyCPUIOThreadCore{ 76 | required int32 scene = 1; 77 | required int32 cpulevel = 2; 78 | required int32 iolevel = 3; 79 | repeated int32 bindtids = 4; 80 | required int32 timeoutMs = 5; 81 | required int64 action = 6; 82 | optional int32 gpulevel = 7; 83 | } 84 | 85 | message CancelUnifyCPUIOThreadCore{ 86 | required int32 cancelcpu = 1; 87 | required int32 cancelio = 2; 88 | required int32 cancelthread = 3; 89 | repeated int32 bindtids = 4; 90 | optional int32 cancelgpu = 5; 91 | } 92 | -------------------------------------------------------------------------------- /libapp2sys/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | libapp2sys 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':libapp2sys', ':testapp' 2 | -------------------------------------------------------------------------------- /testapp/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /testapp/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "mm.tencent.com.comtencentmmhardcodertest" 7 | minSdkVersion 22 8 | targetSdkVersion 23 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | sourceSets { 20 | main { 21 | jniLibs { 22 | setSrcDirs(['src/main/libs'] as Set) 23 | } 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation project(':libapp2sys') 30 | 31 | testImplementation 'junit:junit:4.12' 32 | } 33 | -------------------------------------------------------------------------------- /testapp/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\android\tools\android-sdk-windows/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /testapp/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /testapp/src/main/java/com/tencent/mm/hardcoder/testapp/TestWebView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 3 | * 4 | * Licensed under the BSD 3-Clause License. 5 | * 6 | * Terms of the BSD 3-Clause License: 7 | * -------------------------------------------------------------------- 8 | * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software 12 | * without specific prior written permission. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 16 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 17 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 | * 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. 19 | */ 20 | 21 | package com.tencent.mm.hardcoder.testapp; 22 | 23 | import android.app.Activity; 24 | import android.content.Intent; 25 | import android.os.Bundle; 26 | import android.os.Handler; 27 | import android.view.KeyEvent; 28 | import android.webkit.WebSettings; 29 | import android.webkit.WebView; 30 | import android.webkit.WebViewClient; 31 | import android.widget.Toast; 32 | 33 | /** 34 | * test open webview 35 | */ 36 | public class TestWebView extends Activity { 37 | 38 | private final static String TAG = "Hardcoder.TestWebView"; 39 | 40 | public static long endTime = 0L; 41 | public final static int RESULT_CODE = 0; 42 | private static boolean isAuto = false; 43 | 44 | @Override 45 | protected void onCreate(Bundle savedInstanceState) { 46 | super.onCreate(savedInstanceState); 47 | setContentView(R.layout.test_webview); 48 | isAuto = getIntent().getBooleanExtra("isAuto", false); 49 | 50 | final WebView webview = (WebView) findViewById(R.id.open_webview); 51 | WebSettings webSettings = webview.getSettings(); 52 | webSettings.setJavaScriptEnabled(true); 53 | webSettings.setAllowFileAccess(true); 54 | webSettings.setBuiltInZoomControls(true); 55 | webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); 56 | 57 | webview.setWebViewClient(new WebViewClient() { 58 | @Override 59 | public void onPageFinished(WebView view, String url) { 60 | endTime = System.currentTimeMillis(); 61 | Toast.makeText(TestWebView.this, "Webview load finish, please goBack.", Toast.LENGTH_LONG).show(); 62 | if(isAuto){ 63 | new Handler().postDelayed(new Runnable(){ 64 | public void run() { 65 | exitWebview(); 66 | } 67 | }, 2000); 68 | } 69 | } 70 | }); 71 | webview.loadUrl("https://github.com/Tencent/Hardcoder"); 72 | } 73 | 74 | @Override 75 | public void onDestroy() { 76 | exitWebview(); 77 | super.onDestroy(); 78 | } 79 | 80 | @Override 81 | public boolean onKeyDown(int keyCode, KeyEvent event) { 82 | if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { 83 | exitWebview(); 84 | return true; 85 | } 86 | return super.onKeyDown(keyCode, event); 87 | } 88 | 89 | private void exitWebview(){ 90 | Intent intent = new Intent(); 91 | Bundle bundle = new Bundle(); 92 | bundle.putLong("endTime", endTime); 93 | setResult(RESULT_CODE, intent.putExtras(bundle)); 94 | finish(); 95 | android.os.Process.killProcess(android.os.Process.myPid()); 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /testapp/src/main/res/layout/test_video.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /testapp/src/main/res/layout/test_webview.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 15 | 16 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /testapp/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /testapp/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /testapp/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testapp/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testapp/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /testapp/src/main/res/raw/hardcoder_video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/Hardcoder/db2d61235182ba612f193901e4ebe968084008b8/testapp/src/main/res/raw/hardcoder_video.mp4 -------------------------------------------------------------------------------- /testapp/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /testapp/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /testapp/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /testapp/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Hardcoder testapp 3 | 4 | -------------------------------------------------------------------------------- /testapp/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | --------------------------------------------------------------------------------