├── .gitignore
├── README.md
├── android-config-for-curl.sh
├── android-config-for-nghttp2
├── android-config-for-openssl.sh
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── im
│ │ └── vinci
│ │ └── usecurl
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── cacert.pem
│ ├── java
│ │ ├── curl
│ │ │ └── ssl
│ │ │ │ └── CurlLib.java
│ │ └── im
│ │ │ └── vinci
│ │ │ └── usecurl
│ │ │ ├── Logger.java
│ │ │ ├── MainActivity.java
│ │ │ └── MyApplication.java
│ ├── jni
│ │ ├── Android.mk
│ │ ├── Application.mk
│ │ ├── curl
│ │ │ ├── Makefile
│ │ │ ├── Makefile.am
│ │ │ ├── Makefile.in
│ │ │ ├── curl.h
│ │ │ ├── curlbuild.h
│ │ │ ├── curlbuild.h.cmake
│ │ │ ├── curlbuild.h.in
│ │ │ ├── curlrules.h
│ │ │ ├── curlver.h
│ │ │ ├── easy.h
│ │ │ ├── mprintf.h
│ │ │ ├── multi.h
│ │ │ ├── stamp-h2
│ │ │ ├── stdcheaders.h
│ │ │ └── typecheck-gcc.h
│ │ ├── curl_lib.c
│ │ ├── curl_mgr.c
│ │ ├── curl_mgr.h
│ │ ├── curl_ssl_CurlLib.h
│ │ ├── logger.h
│ │ ├── srclib
│ │ │ ├── libcryptt.so
│ │ │ ├── libcurl.a
│ │ │ ├── libcurl.so
│ │ │ ├── libnghttp2.so
│ │ │ └── libsss.so
│ │ ├── util.c
│ │ └── util.h
│ ├── jniLibs
│ │ └── armeabi
│ │ │ ├── libcryptt.so
│ │ │ ├── libcurl.so
│ │ │ ├── libcurlwithssl.so
│ │ │ ├── libnghttp2.so
│ │ │ └── libsss.so
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── content_main.xml
│ │ ├── menu
│ │ └── menu_main.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
│ │ ├── values-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── im
│ └── vinci
│ └── usecurl
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | *.iml
4 | local.properties
5 | build
6 | app/build
7 | app/src/main/jni/toolchain
8 | .DS_Store
9 | *.seg
10 | app/src/main/libs
11 | app/src/main/obj
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 简介
2 |
3 | 本例主要是用于试用curl网络库,如接入方法,api使用方法等,学习使用。
4 |
5 | 另外一个重点,就是学习如何编译支持openssl和nghttp2的curl库。
6 |
7 |
8 |
9 | # 编译 curl + openssl + nghttp2
10 |
11 |
12 | ## 编译环境
13 |
14 |
15 |
16 | * #### Linux
17 | Linux ubuntu 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
18 |
19 |
20 | * #### ndk
21 | android-ndk-r11c
22 |
23 | * #### jdk
24 | jdk1.8.0_91
25 |
26 | * #### 环境变量
27 | export JAVA_HOME=/usr/local/java/jdk1.8.0_91
28 | export JRE_HOME=$JAVA_HOME/jre
29 | export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
30 | export ANDROID_NDK=/home/zhonglz/tools/android-ndk-r11c
31 | export ANDROID_SDK=/root/Android/Sdk
32 | export ANDROID_ABI=armeabi
33 |
34 | export CC=arm-linux-androideabi-gcc
35 | export ARM_GCC=/tmp/ndk/bin
36 | export LDFLAGS="-L$ANDROID_NDK/platforms/android-9/arch-arm/usr/lib"
37 | export CPPFLAGS="-I$ANDROID_NDK/platforms/android-9/arch-arm/usr/include"
38 |
39 | export PATH=$PATH:$JAVA_HOME/bin:$ANDROID_NDK:$ANDROID_SDK:$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/arm-linux-androideabi/bin:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin:$ARM_GCC
40 |
41 | * #### Linux执行编译时权限
42 | root
43 |
44 |
45 |
46 | ## 编译openssl
47 |
48 |
49 | * #### 下载并解压源码(本例使用openssl-1.0.1t)
50 | [download here](https://www.openssl.org/source/old)
51 | * #### 将编译脚本移至源码目录
52 | [android-config-for-openssl.sh](https://github.com/silo4/UseCurl/blob/master/android-config-for-openssl.sh)
53 |
54 | cp android-config-for-openssl.sh openssl-1.0.1t/
55 | * #### 配置脚本
56 | 将 [android-config-for-openssl.sh](https://github.com/silo4/UseCurl/blob/master/android-config-for-openssl.sh) 打开,对里面的参数进行相关配置,如下部分所示
57 |
58 | ANDROID_NDK_ROOT=$ANDROID_NDK
59 |
60 | _ANDROID_NDK="android-ndk-r11c"
61 |
62 | _ANDROID_EABI="arm-linux-androideabi-4.9"
63 |
64 | _ANDROID_ARCH=arch-arm
65 |
66 | _ANDROID_API="android-9"
67 |
68 | * #### 执行脚本
69 | ./android-config-for-openssl.sh.sh
70 |
71 | * #### 执行成功后
72 | 这时在/usr/local/ssl/里有android-9文件夹生成,所需的libssl.so libcrypto.so 等动态库、静态库和include 头文件均在这里生成
73 |
74 | ## 编译nghttp2
75 |
76 | * #### 下载并解压源码(本例使用nghttp2-1.13.0)
77 | [download here](http://www.nghttp2.org/)
78 | * #### 将编译脚本移至源码目录
79 | [android-config-for-nghttp2.sh](https://github.com/silo4/UseCurl/blob/master/android-config-for-nghttp2)
80 |
81 | cp android-config-for-nghttp2.sh nghttp2-1.13.0/
82 |
83 | * #### 执行脚本
84 | ./android-config-for-nghttp2.sh
85 |
86 | * #### 执行成功后
87 | 没有指定路径,所以默认在/usr/local/lib里生成库文件libnghttp2.so, libnghttp2.a, 头文件则在/usr/loca/include/nghttp2里
88 |
89 | ## 编译curl
90 |
91 |
92 | * #### 下载并解压源码(本例使用curl-7.50.1)
93 | [download here](https://curl.haxx.se/download.html)
94 | * #### 将编译脚本移至源码目录
95 | [android-config-for-curl.sh](https://github.com/silo4/UseCurl/blob/master/android-config-for-curl.sh)
96 |
97 | cp android-config-for-curl.sh curl-7.50.1/
98 |
99 | * #### 执行脚本
100 | 注意:由于要让curl支持 ssl 和 nghttp2,所以编译时要打开开关,并指定相应的库路径,如下部分所示
101 |
102 | ./configure --host=arm-linux-androideabi \
103 |
104 | --with-ssl=/usr/local/ssl/android-9\
105 |
106 | --with-nghttp2=/usr/local \
107 |
108 | --disable-ftp \
109 |
110 | --disable-gopher \
111 |
112 | --disable-file \
113 |
114 | 这也是脚本文件里的部分内容.
115 |
116 | 执行:
117 |
118 | ./android-config-for-curl.sh
119 |
120 |
121 | * #### 执行成功后
122 | 没有指定路径,所以默认在/usr/local/lib里生成库文件libcurl.so libcurl.a, 头文件则在/usr/loca/include/curl里;
123 | 或者在当前目录即curl-7.50.1/lib/.libs 里也有;
124 |
125 | ## 使用注意
126 |
127 | ##### 说明
128 |
129 | * 编译完的curl库已经支持ssl和http2了,jni 将使用动态库是libcurl.so,头文件则是include/curl路径,由于是动态链接,使用时也需要将libssl.so, libcrypto.so和libnghttp2.so也一并拷贝.
130 |
131 | * Android 在调用 so 库时是用的System.loadLibrary(),由于libcurl.so与libssl.so,libcrypto.so,libnghttp2.so相关联,所以会libcurl.so被加载时,这些库也会被加载。
132 |
133 | * linux 编译动态库是会带版本号,如libssl.so.1.0.0 ,而名为libssl.so的文件其实是libssl.so.1.0.0的引用,也就是快捷方式。
134 |
135 | ##### 问题来了
136 |
137 | 1. 在加载so库的时候,会先去系统目录/system/lib下找寻,而恰巧里面有系统自带的libssl.so和libcrypto.so,这会导致崩溃,而且与我们需要的不一致(比如版本不一样)。这就使得我们必须去改变这些名字,好让加载so库时能加载到我们自己编译的版本而不是系统版本。
138 |
139 | 2. 带版本号的库libssl.so.1.0.0, 会使jni在加载so库时出现问题;
140 |
141 |
142 | ##### 下面两种方法可以解决上述问题(动态库静态库都一样改法,这里就讲动态库)
143 |
144 | ###### 1. 编译libssl.so libcrypto.so libnghttp2.so前,修改相关配置或脚本,让其生成指定的名字, 比如改为 libsss.so libccc.so 。然后,编译libcurl.so时,也要修改相关脚本或配置,使其依赖libsss.so libccc.so 这些库,而不是先前名字那些库;另外,也可以修改相关脚本或配置,使其编译时创建引用库和不出现版本号在.so后面,这样就能解决上述问题。
145 |
146 |
147 | ###### 2. 对so二进制文件进行修改以达到改名目的
148 |
149 | * 按前面的所说的方法进行编译,得到了libssl libcrypto libnghttp2等相关的库;
150 |
151 | * 使用命令 readelf -a libssl.so > ssl.txt ,打开ssl.txt分析so相关信息。
152 |
153 | so文件的.plt段记录了文件名称和依赖库名称,如 libssl.so库的.plt 字段可能有信息
154 |
155 | 0x00000001 (NEEDED) Shared library: [libcrypto.so]
156 |
157 | 0x00000001 (NEEDED) Shared library: [libdl.so]
158 |
159 | 0x00000001 (NEEDED) Shared library: [libc.so]
160 |
161 | 0x0000000e (SONAME) Library soname: [libssl.so]
162 |
163 |
164 | 其中(NEEDED)就是依赖的库,而(SONAME)就是自己的库名称。要修改库名和依赖库也就是对这些进行修改。
165 |
166 | 按这种方法分别对libcurl.so libssl.so libcrypto.so libnghttp2.so进行分析可以知道,
167 | 1. libcurl.so依赖 libssl.so, libcrypto.so, libnghttp2.so
168 | 2. libssl.so 依赖 libcrypto.so
169 | 3. 其他无相互依赖
170 |
171 | * 鉴于以上对依赖的分析,以及要解决名字问题,得出以下改so的方案
172 |
173 | 1. 修改libcrypto.so 的[SONAME] 为 libccc.so;
174 | 2. 修改libssl.so 的 [SONAME] 为 libsss.so, [NEEDED]的libcrypto.so改为libccc.so;
175 | 3. 修改libcurl.so的[NEEDED], libcrypto.so 改为 libccc.so, libssl.so 改为libsss.so
176 | 4. libnghttp2.so可以不做任何修改;
177 |
178 | * 修改so的工具,由于是二进制修改,可以搜到很多二进制文件修改工具。如高级到windowns版的IDA(高级反编译工具,这里也能使用),
179 |
180 | 简单到Mac版的Hex Fiend,甚至文本编辑器也可以,只要有二进制插件,并能找到要改的地方。这里主要说明Mac版的Hex Fiend工具.
181 |
182 | 拿libssl.so举例
183 |
184 | 1.用Hex Fiend打开libssl.so
185 | 2.Ctrl+F 进行Text查找 (工具支持Hex和Text查找), 查找libssl.so(这是文件名)
186 | 3.Hex Fiend显示是有左右两侧的,左侧是二进制内容,右侧就是Text内容,修改时对左侧进行修改,如右侧显示的libssl.so字符串,
187 | 左侧对应的二进制则是6C 69 62 73 73 6C 2E 73 6F,要改为libsss.so 只需将6C 改为 73即可。
188 | 若要名字改短,如改为libss.so,则去掉6C的同时,记得要在原末尾6F后面再补一个 00。
189 | 或要名字改长,自己再去琢磨吧,只要不影响其他地址即可。
190 | 4.改文件名搜libssl.so进行修改,改依赖库的名就搜libcrypto.so,修改方法是一样的。这样,就完成修改了。
191 |
192 | * 修改完成后就变成了
193 |
194 | 1. libcurl.so依赖 libsss.so, libccc.so, libnghttp2.so
195 | 2. libssl.so 改名为libsss.so, 并依赖的是 libccc.so
196 | 3. 其他不变;
197 |
198 |
199 |
200 | # 至此完工
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
--------------------------------------------------------------------------------
/android-config-for-curl.sh:
--------------------------------------------------------------------------------
1 | #/bin/sh
2 |
3 | ./configure --host=arm-linux-androideabi \
4 | --with-ssl=/usr/local/ssl/android-9\
5 | --with-nghttp2=/usr/local \
6 | --disable-ftp \
7 | --disable-gopher \
8 | --disable-file \
9 | --disable-imap \
10 | --disable-ldap \
11 | --disable-ldaps \
12 | --disable-pop3 \
13 | --disable-proxy \
14 | --disable-rtsp \
15 | --disable-smtp \
16 | --disable-telnet \
17 | --disable-tftp \
18 | --without-gnutls \
19 | --without-libidn \
20 | --without-librtmp \
21 | --disable-dict
22 |
--------------------------------------------------------------------------------
/android-config-for-nghttp2:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # nghttp2 - HTTP/2 C Library
4 | #
5 | # Copyright (c) 2013 Tatsuhiro Tsujikawa
6 | #
7 | # Permission is hereby granted, free of charge, to any person obtaining
8 | # a copy of this software and associated documentation files (the
9 | # "Software"), to deal in the Software without restriction, including
10 | # without limitation the rights to use, copy, modify, merge, publish,
11 | # distribute, sublicense, and/or sell copies of the Software, and to
12 | # permit persons to whom the Software is furnished to do so, subject to
13 | # the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be
16 | # included in all copies or substantial portions of the Software.
17 | #
18 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 |
26 |
27 | ./configure \
28 | --enable-shared \
29 | --enable-static \
30 | --host=arm-linux-androideabi
31 |
--------------------------------------------------------------------------------
/android-config-for-openssl.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Cross-compile environment for Android on ARMv7 and x86
3 | #
4 | # Contents licensed under the terms of the OpenSSL license
5 | # http://www.openssl.org/source/license.html
6 | #
7 | # See http://wiki.openssl.org/index.php/FIPS_Library_and_Android
8 | # and http://wiki.openssl.org/index.php/Android
9 |
10 | #####################################################################
11 |
12 | # Set ANDROID_NDK_ROOT to you NDK location. For example,
13 | # /opt/android-ndk-r8e or /opt/android-ndk-r9. This can be done in a
14 | # login script. If ANDROID_NDK_ROOT is not specified, the script will
15 | # try to pick it up with the value of _ANDROID_NDK_ROOT below. If
16 | ANDROID_NDK_ROOT=$ANDROID_NDK
17 | # _ANDROID_NDK="android-ndk-r8e"
18 | #_ANDROID_NDK="android-ndk-r9"
19 | _ANDROID_NDK="android-ndk-r11c"
20 |
21 | # Set _ANDROID_EABI to the EABI you want to use. You can find the
22 | # list in $ANDROID_NDK_ROOT/toolchains. This value is always used.
23 | # _ANDROID_EABI="x86-4.6"
24 | # _ANDROID_EABI="arm-linux-androideabi-4.6"
25 | _ANDROID_EABI="arm-linux-androideabi-4.9"
26 |
27 | # Set _ANDROID_ARCH to the architecture you are building for.
28 | # This value is always used.
29 | # _ANDROID_ARCH=arch-x86
30 | _ANDROID_ARCH=arch-arm
31 |
32 | # Set _ANDROID_API to the API you want to use. You should set it
33 | # to one of: android-14, android-9, android-8, android-14, android-5
34 | # android-4, or android-3. You can't set it to the latest (for
35 | # example, API-17) because the NDK does not supply the platform. At
36 | # Android 5.0, there will likely be another platform added (android-22?).
37 | # This value is always used.
38 | # _ANDROID_API="android-14"
39 | _ANDROID_API="android-9"
40 | # _ANDROID_API="android-19"
41 |
42 | #####################################################################
43 |
44 | # If the user did not specify the NDK location, try and pick it up.
45 | # We expect something like ANDROID_NDK_ROOT=/opt/android-ndk-r8e
46 | # or ANDROID_NDK_ROOT=/usr/local/android-ndk-r8e.
47 |
48 | if [ -z "$ANDROID_NDK_ROOT" ]; then
49 |
50 | _ANDROID_NDK_ROOT=""
51 | if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "/usr/local/$_ANDROID_NDK" ]; then
52 | _ANDROID_NDK_ROOT="/usr/local/$_ANDROID_NDK"
53 | fi
54 |
55 | if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "/opt/$_ANDROID_NDK" ]; then
56 | _ANDROID_NDK_ROOT="/opt/$_ANDROID_NDK"
57 | fi
58 |
59 | if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "$HOME/$_ANDROID_NDK" ]; then
60 | _ANDROID_NDK_ROOT="$HOME/$_ANDROID_NDK"
61 | fi
62 |
63 | if [ -z "$_ANDROID_NDK_ROOT" ] && [ -d "$PWD/$_ANDROID_NDK" ]; then
64 | _ANDROID_NDK_ROOT="$PWD/$_ANDROID_NDK"
65 | fi
66 |
67 | # If a path was set, then export it
68 | if [ ! -z "$_ANDROID_NDK_ROOT" ] && [ -d "$_ANDROID_NDK_ROOT" ]; then
69 | export ANDROID_NDK_ROOT="$_ANDROID_NDK_ROOT"
70 | fi
71 | fi
72 |
73 | # Error checking
74 | # ANDROID_NDK_ROOT should always be set by the user (even when not running this script)
75 | # http://groups.google.com/group/android-ndk/browse_thread/thread/a998e139aca71d77
76 | if [ -z "$ANDROID_NDK_ROOT" ] || [ ! -d "$ANDROID_NDK_ROOT" ]; then
77 | echo "Error: ANDROID_NDK_ROOT is not a valid path. Please edit this script."
78 | # echo "$ANDROID_NDK_ROOT"
79 | # exit 1
80 | fi
81 |
82 | # Error checking
83 | if [ ! -d "$ANDROID_NDK_ROOT/toolchains" ]; then
84 | echo "Error: ANDROID_NDK_ROOT/toolchains is not a valid path. Please edit this script."
85 | # echo "$ANDROID_NDK_ROOT/toolchains"
86 | # exit 1
87 | fi
88 |
89 | # Error checking
90 | if [ ! -d "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI" ]; then
91 | echo "Error: ANDROID_EABI is not a valid path. Please edit this script."
92 | # echo "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI"
93 | # exit 1
94 | fi
95 |
96 | #####################################################################
97 |
98 | # Based on ANDROID_NDK_ROOT, try and pick up the required toolchain. We expect something like:
99 | # /opt/android-ndk-r83/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin
100 | # Once we locate the toolchain, we add it to the PATH. Note: this is the 'hard way' of
101 | # doing things according to the NDK documentation for Ice Cream Sandwich.
102 | # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
103 |
104 | ANDROID_TOOLCHAIN=""
105 | for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86"
106 | do
107 | if [ -d "$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI/prebuilt/$host/bin" ]; then
108 | ANDROID_TOOLCHAIN="$ANDROID_NDK_ROOT/toolchains/$_ANDROID_EABI/prebuilt/$host/bin"
109 | break
110 | fi
111 | done
112 |
113 | # Error checking
114 | if [ -z "$ANDROID_TOOLCHAIN" ] || [ ! -d "$ANDROID_TOOLCHAIN" ]; then
115 | echo "Error: ANDROID_TOOLCHAIN is not valid. Please edit this script."
116 | # echo "$ANDROID_TOOLCHAIN"
117 | # exit 1
118 | fi
119 |
120 | case $_ANDROID_ARCH in
121 | arch-arm)
122 | ANDROID_TOOLS="arm-linux-androideabi-gcc arm-linux-androideabi-ranlib arm-linux-androideabi-ld"
123 | ;;
124 | arch-x86)
125 | ANDROID_TOOLS="i686-linux-android-gcc i686-linux-android-ranlib i686-linux-android-ld"
126 | ;;
127 | *)
128 | echo "ERROR ERROR ERROR"
129 | ;;
130 | esac
131 |
132 | for tool in $ANDROID_TOOLS
133 | do
134 | # Error checking
135 | if [ ! -e "$ANDROID_TOOLCHAIN/$tool" ]; then
136 | echo "Error: Failed to find $tool. Please edit this script."
137 | # echo "$ANDROID_TOOLCHAIN/$tool"
138 | # exit 1
139 | fi
140 | done
141 |
142 | # Only modify/export PATH if ANDROID_TOOLCHAIN good
143 | if [ ! -z "$ANDROID_TOOLCHAIN" ]; then
144 | export ANDROID_TOOLCHAIN="$ANDROID_TOOLCHAIN"
145 | export PATH="$ANDROID_TOOLCHAIN":"$PATH"
146 | fi
147 |
148 | #####################################################################
149 |
150 | # For the Android SYSROOT. Can be used on the command line with --sysroot
151 | # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
152 | export ANDROID_SYSROOT="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH"
153 | export SYSROOT="$ANDROID_SYSROOT"
154 | export NDK_SYSROOT="$ANDROID_SYSROOT"
155 |
156 | # Error checking
157 | if [ -z "$ANDROID_SYSROOT" ] || [ ! -d "$ANDROID_SYSROOT" ]; then
158 | echo "Error: ANDROID_SYSROOT is not valid. Please edit this script."
159 | # echo "$ANDROID_SYSROOT"
160 | # exit 1
161 | fi
162 |
163 | #####################################################################
164 |
165 | # If the user did not specify the FIPS_SIG location, try and pick it up
166 | # If the user specified a bad location, then try and pick it up too.
167 | if [ -z "$FIPS_SIG" ] || [ ! -e "$FIPS_SIG" ]; then
168 |
169 | # Try and locate it
170 | _FIPS_SIG=""
171 | if [ -d "/usr/local/ssl/$_ANDROID_API" ]; then
172 | _FIPS_SIG=`find "/usr/local/ssl/$_ANDROID_API" -name incore`
173 | fi
174 |
175 | if [ ! -e "$_FIPS_SIG" ]; then
176 | _FIPS_SIG=`find $PWD -name incore`
177 | fi
178 |
179 | # If a path was set, then export it
180 | if [ ! -z "$_FIPS_SIG" ] && [ -e "$_FIPS_SIG" ]; then
181 | export FIPS_SIG="$_FIPS_SIG"
182 | fi
183 | fi
184 |
185 | # Error checking. Its OK to ignore this if you are *not* building for FIPS
186 | if [ -z "$FIPS_SIG" ] || [ ! -e "$FIPS_SIG" ]; then
187 | echo "Error: FIPS_SIG does not specify incore module. Please edit this script."
188 | # echo "$FIPS_SIG"
189 | # exit 1
190 | fi
191 |
192 | #####################################################################
193 |
194 | # Most of these should be OK (MACHINE, SYSTEM, ARCH). RELEASE is ignored.
195 | export MACHINE=armv7
196 | export RELEASE=2.6.37
197 | export SYSTEM=android
198 | export ARCH=arm
199 | export CROSS_COMPILE="arm-linux-androideabi-"
200 |
201 | if [ "$_ANDROID_ARCH" == "arch-x86" ]; then
202 | export MACHINE=i686
203 | export RELEASE=2.6.37
204 | export SYSTEM=android
205 | export ARCH=x86
206 | export CROSS_COMPILE="i686-linux-android-"
207 | fi
208 |
209 | # For the Android toolchain
210 | # https://android.googlesource.com/platform/ndk/+/ics-mr0/docs/STANDALONE-TOOLCHAIN.html
211 | export ANDROID_SYSROOT="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH"
212 | export SYSROOT="$ANDROID_SYSROOT"
213 | export NDK_SYSROOT="$ANDROID_SYSROOT"
214 | export ANDROID_NDK_SYSROOT="$ANDROID_SYSROOT"
215 | export ANDROID_API="$_ANDROID_API"
216 |
217 | # CROSS_COMPILE and ANDROID_DEV are DFW (Don't Fiddle With). Its used by OpenSSL build system.
218 | # export CROSS_COMPILE="arm-linux-androideabi-"
219 | export ANDROID_DEV="$ANDROID_NDK_ROOT/platforms/$_ANDROID_API/$_ANDROID_ARCH/usr"
220 | export HOSTCC=gcc
221 |
222 | VERBOSE=1
223 | if [ ! -z "$VERBOSE" ] && [ "$VERBOSE" != "0" ]; then
224 | echo "ANDROID_NDK_ROOT: `echo $ANDROID_NDK_ROOT`"
225 | echo "ANDROID_ARCH: `echo $_ANDROID_ARCH`"
226 | echo "ANDROID_EABI: `echo $_ANDROID_EABI`"
227 | echo "ANDROID_API: `echo $ANDROID_API`"
228 | echo "ANDROID_SYSROOT: `echo $ANDROID_SYSROOT`"
229 | echo "ANDROID_TOOLCHAIN:`echo $ANDROID_TOOLCHAIN`"
230 | echo "FIPS_SIG: `echo $FIPS_SIG`"
231 | echo "CROSS_COMPILE: ` echo $CROSS_COMPILE`"
232 | echo "ANDROID_DEV: `echo $ANDROID_DEV`"
233 | fi
234 |
235 | cd openssl-1.0.1t
236 | make clean
237 | perl -pi -e 's/install: all install_docs install_sw/install: install_docs install_sw/g' Makefile.org
238 | ./config shared no-ssl2 no-ssl3 no-comp no-hw no-engine --openssldir=/usr/local/ssl/$ANDROID_API
239 |
240 | make depend
241 | make all
242 | sudo -E make install CC=$ANDROID_TOOLCHAIN/arm-linux-androideabi-gcc RANLIB=$ANDROID_TOOLCHAIN/arm-linux-androideabi-ranlib
243 |
244 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.3"
6 |
7 | defaultConfig {
8 | applicationId "im.vinci.usecurl"
9 | minSdkVersion 19
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | //禁用gradle对ndk的配置,使用自定义的Android.mk和Application.mk
22 | sourceSets {
23 | main {
24 | // jni.srcDirs = [] //编译时打开这个, 为了使用自定义的Android.mk和Application.mk
25 | jni.srcDirs = ['src/main/jni/'] //编写时打开这个, 方便关联和编写代码
26 | }
27 | }
28 | }
29 |
30 |
31 | dependencies {
32 | compile fileTree(dir: 'libs', include: ['*.jar'])
33 | testCompile 'junit:junit:4.12'
34 | compile 'com.android.support:appcompat-v7:23.4.0'
35 | compile 'com.android.support:design:23.4.0'
36 | }
37 |
--------------------------------------------------------------------------------
/app/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/zhonglz/Library/Android/sdk/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 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/im/vinci/usecurl/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package im.vinci.usecurl;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/java/curl/ssl/CurlLib.java:
--------------------------------------------------------------------------------
1 | package curl.ssl;
2 |
3 | /**
4 | * Created by zhonglz on 16/8/6.
5 | */
6 | public class CurlLib {
7 | private final static String TAG = CurlLib.class.getSimpleName();
8 |
9 | private static CurlLib sIns;
10 |
11 | private CurlLib(){
12 |
13 | }
14 |
15 | public static CurlLib getIns(){
16 | if (sIns == null){
17 | sIns = new CurlLib();
18 | }
19 | return sIns;
20 | }
21 |
22 |
23 |
24 |
25 | public native int init(String cert);
26 | public native byte[] testUrl(String url);
27 |
28 | static {
29 | System.loadLibrary("curlwithssl");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/im/vinci/usecurl/Logger.java:
--------------------------------------------------------------------------------
1 | package im.vinci.usecurl;
2 |
3 | import android.os.SystemClock;
4 | import android.util.Log;
5 |
6 | import java.util.Locale;
7 |
8 | public class Logger {
9 | private static final String PRE = "&";
10 | public static boolean sIsDebug = true;
11 |
12 | public static final String space = "----------------------------------------------------------------------------------------------------";
13 | private static boolean LOGV = true;
14 | private static boolean LOGD = true;
15 | private static boolean LOGI = true;
16 | private static boolean LOGW = true;
17 | private static boolean LOGE = true;
18 |
19 | public static void v(String tag, String format, Object... args) {
20 | if (LOGV) {
21 | Log.v(formartLength(PRE + tag, 28), buildMessage(format, args));
22 | }
23 | }
24 |
25 | public static void v(Throwable throwable, String tag, String format, Object... args) {
26 | if (LOGV) {
27 | Log.v(formartLength(PRE + tag, 28), buildMessage(format, args), throwable);
28 | }
29 | }
30 |
31 |
32 | public static void d(String tag, String format, Object... args) {
33 | if (LOGD) {
34 | Log.d(formartLength(PRE + tag, 28), buildMessage(format, args));
35 | }
36 | }
37 |
38 | public static void d(Throwable throwable, String tag, String format, Object... args) {
39 | if (LOGD) {
40 | Log.d(formartLength(PRE + tag, 28), buildMessage(format, args), throwable);
41 | }
42 | }
43 |
44 | public static void i(String tag, String format, Object... args) {
45 | if (LOGI) {
46 | Log.i(formartLength(PRE + tag, 28), buildMessage(format, args));
47 | }
48 | }
49 |
50 | public static void i(Throwable throwable, String tag, String format, Object... args) {
51 | if (LOGI) {
52 | Log.i(formartLength(PRE + tag, 28), buildMessage(format, args), throwable);
53 | }
54 | }
55 |
56 | public static void w(String tag, String format, Object... args) {
57 | if (LOGW) {
58 | Log.w(formartLength(PRE + tag, 28), buildMessage(format, args));
59 | }
60 | }
61 |
62 | public static void w(Throwable throwable, String tag, String format, Object... args) {
63 | if (LOGW) {
64 | Log.w(formartLength(PRE + tag, 28), buildMessage(format, args), throwable);
65 | }
66 | }
67 |
68 |
69 | public static void e(String tag, String format, Object... args) {
70 | if (LOGE) {
71 | Log.e(formartLength(PRE + tag, 28), buildMessage(format, args));
72 | }
73 | }
74 |
75 | public static void e(Throwable throwable, String tag, String format, Object... args) {
76 | if (LOGE) {
77 | Log.e(formartLength(PRE + tag, 28), buildMessage(format, args), throwable);
78 | }
79 | }
80 |
81 | private static String buildMessage(String format, Object[] args) {
82 | try {
83 | String msg = (args == null || args.length == 0) ? format : String.format(Locale.US, format, args);
84 | if (!sIsDebug) {
85 | return msg;
86 | }
87 | StackTraceElement[] trace = new Throwable().fillInStackTrace().getStackTrace();
88 | String caller = "";
89 | String callingClass = "";
90 | String callFile = "";
91 | int lineNumber = 0;
92 | for (int i = 2; i < trace.length; i++) {
93 | Class> clazz = trace[i].getClass();
94 | if (!clazz.equals(Logger.class)) {
95 | callingClass = trace[i].getClassName();
96 | callingClass = callingClass.substring(callingClass
97 | .lastIndexOf('.') + 1);
98 | caller = trace[i].getMethodName();
99 | callFile = trace[i].getFileName();
100 | lineNumber = trace[i].getLineNumber();
101 | break;
102 | }
103 | }
104 |
105 | String method = String.format(Locale.US, "[%03d] %s.%s(%s:%d)"
106 | , Thread.currentThread().getId(), callingClass, caller, callFile, lineNumber);
107 |
108 | return String.format(Locale.US, "%s> %s", formartLength(method, 93), msg);
109 | } catch (Exception e) {
110 | e.printStackTrace();
111 | }
112 | return "----->ERROR LOG STRING<------";
113 | }
114 |
115 | private static String formartLength(String src, int len) {
116 | StringBuilder sb = new StringBuilder();
117 | if (src.length() >= len) {
118 | sb.append(src);
119 | } else {
120 | sb.append(src);
121 | sb.append(space.substring(0, len - src.length()));
122 | }
123 | return sb.toString();
124 | }
125 |
126 | public static class XiaoCaiqi {
127 | long start;
128 |
129 | public XiaoCaiqi() {
130 | start = SystemClock.elapsedRealtime();
131 | }
132 |
133 | public long end() {
134 | return SystemClock.elapsedRealtime() - start;
135 | }
136 |
137 | }
138 |
139 | }
140 |
141 | /*
142 | ★
143 | /\
144 | / \
145 | /i⸛ \
146 | /。 i & \
147 | / i &⸛&⸛ \
148 | /⸮⁂ @⸮ ⸛\
149 | /。⸛ & &。 ⸮ \
150 | / ⸛ ⸮ 。⸮ ⸛\
151 | / ⁂。⸛@ 。 @⸛。 & \
152 | /⁂ @ @ ⸮ ⸛@ &\
153 | /@ 。 。& ⸮@ ⸛ & 。 \
154 | /i ⁂⁂ ⸮⸛i @⸛ ⁂ ⸛ \
155 | / ⸛ ⸮。。@。&& \
156 | / @⸮ 。 ⸛ ⁂ ⸮ \
157 | / &⸮。i ⸛。 。 & & i i\
158 | /⸛ i @ i @ @ i& &i⁂@ \
159 | /⸛@⸛i ⁂ ⁂ @ i & 。 ⸮⸮ & \
160 | /。i⸛ ⸮ ⸛ @& ⸮&⸮i⸛。⁂ 。@ 。⸮⸮\
161 | / & i ⸛&@ 。 ⸛ ⁂⸛ @ \
162 | /⁂ ⁂ ⁂ i & ⸮⸛⁂ & @。 。 \
163 | ^^^^^^^^^^^^^^^^^^^| |^^^^^^^^^^^^^^^^^^^
164 | | |
165 |
166 |
167 | */
--------------------------------------------------------------------------------
/app/src/main/java/im/vinci/usecurl/MainActivity.java:
--------------------------------------------------------------------------------
1 | package im.vinci.usecurl;
2 |
3 | import android.content.Context;
4 | import android.content.res.AssetManager;
5 | import android.os.Bundle;
6 | import android.support.design.widget.FloatingActionButton;
7 | import android.support.design.widget.Snackbar;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.support.v7.widget.Toolbar;
10 | import android.view.View;
11 | import android.view.Menu;
12 | import android.view.MenuItem;
13 |
14 | import java.io.File;
15 | import java.io.FileOutputStream;
16 | import java.io.IOException;
17 | import java.io.InputStream;
18 | import java.io.OutputStream;
19 | import java.io.UnsupportedEncodingException;
20 | import java.util.Arrays;
21 |
22 | import curl.ssl.CurlLib;
23 |
24 | public class MainActivity extends AppCompatActivity {
25 |
26 | private final static String TAG = MainActivity.class.getSimpleName();
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.activity_main);
32 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
33 | setSupportActionBar(toolbar);
34 |
35 | String pem = saveCertPemFile();
36 |
37 | CurlLib.getIns().init(pem);
38 |
39 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
40 | assert (fab != null);
41 | fab.setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View view) {
44 | // byte[] buffer = CurlLib.getIns().testUrl("https://avs-alexa-na.amazon.com");
45 | byte[] buffer = CurlLib.getIns().testUrl("https://baidu.com");
46 | if (buffer == null || buffer.length == 0){
47 | Logger.e(TAG, "buffer is empty");
48 | }else {
49 | try {
50 | String content = new String(buffer, "UTF-8");
51 | Logger.i(TAG, "[%s]", content);
52 | } catch (UnsupportedEncodingException e) {
53 | Logger.e(TAG, "buffer to string failed[%s]", e.getMessage());
54 | e.printStackTrace();
55 | }
56 | }
57 |
58 | }
59 | });
60 | }
61 |
62 | @Override
63 | public boolean onCreateOptionsMenu(Menu menu) {
64 | // Inflate the menu; this adds items to the action bar if it is present.
65 | getMenuInflater().inflate(R.menu.menu_main, menu);
66 | return true;
67 | }
68 |
69 | @Override
70 | public boolean onOptionsItemSelected(MenuItem item) {
71 | // Handle action bar item clicks here. The action bar will
72 | // automatically handle clicks on the Home/Up button, so long
73 | // as you specify a parent activity in AndroidManifest.xml.
74 | int id = item.getItemId();
75 |
76 | //noinspection SimplifiableIfStatement
77 | if (id == R.id.action_settings) {
78 | return true;
79 | }
80 |
81 | return super.onOptionsItemSelected(item);
82 | }
83 |
84 | private String saveCertPemFile()
85 | {
86 | Context context=getApplicationContext();
87 | String assetFileName="cacert.pem";
88 |
89 | if(context==null || !FileExistInAssets(assetFileName,context))
90 | {
91 | Logger.i(TAG, "Context is null or asset file doesnt exist");
92 | return null;
93 | }
94 | //destination path is data/data/packagename
95 | String destPath=getApplicationContext().getApplicationInfo().dataDir;
96 | String CertFilePath =destPath + "/" +assetFileName;
97 | File file = new File(CertFilePath);
98 | if(file.exists())
99 | {
100 | //delete file
101 | file.delete();
102 | }
103 | //copy to internal storage
104 | if(CopyAssets(context,assetFileName,CertFilePath)==1) return CertFilePath;
105 |
106 | return CertFilePath=null;
107 |
108 | }
109 |
110 | private int CopyAssets(Context context,String assetFileName, String toPath)
111 | {
112 | AssetManager assetManager = context.getAssets();
113 | InputStream in = null;
114 | OutputStream out = null;
115 | try {
116 | in = assetManager.open(assetFileName);
117 | new File(toPath).createNewFile();
118 | out = new FileOutputStream(toPath);
119 | byte[] buffer = new byte[1024];
120 | int read;
121 | while ((read = in.read(buffer)) != -1)
122 | {
123 | out.write(buffer, 0, read);
124 | }
125 | in.close();
126 | in = null;
127 | out.flush();
128 | out.close();
129 | out = null;
130 | return 1;
131 | } catch(Exception e) {
132 | Logger.e(TAG, "CopyAssets"+e.getMessage());
133 |
134 | }
135 | return 0;
136 |
137 | }
138 |
139 | private boolean FileExistInAssets(String fileName,Context context)
140 | {
141 | try {
142 | return Arrays.asList(context.getResources().getAssets().list("")).contains(fileName);
143 | } catch (IOException e) {
144 | // TODO Auto-generated catch block
145 |
146 | Logger.e(TAG, "FileExistInAssets"+e.getMessage());
147 |
148 | }
149 | return false;
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/app/src/main/java/im/vinci/usecurl/MyApplication.java:
--------------------------------------------------------------------------------
1 | package im.vinci.usecurl;
2 |
3 | import android.app.Application;
4 |
5 | import curl.ssl.CurlLib;
6 |
7 | /**
8 | * Created by zhonglz on 16/8/6.
9 | */
10 | public class MyApplication extends Application {
11 | private final static String TAG = MyApplication.class.getSimpleName();
12 |
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/main/jni/Android.mk:
--------------------------------------------------------------------------------
1 | ##################################
2 |
3 | LOCAL_PATH := $(call my-dir)
4 |
5 | include $(CLEAR_VARS)
6 |
7 | LOCAL_MODULE := curlwithssl
8 |
9 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/.
10 | LOCAL_C_INCLUDES += $(NDK_PATH)/platforms/$(TARGET_PLATFORM)/arch-$(TARGET_ARCH)/usr/include
11 | LOCAL_C_INCLUDES += curl
12 |
13 | LOCAL_SRC_FILES += curl_lib.c \
14 | curl_mgr.c \
15 | util.c
16 |
17 | LOCAL_LDLIBS := -llog
18 | LOCAL_LDLIBS += $(LOCAL_PATH)/srcLib/libcurl.so
19 |
20 | include $(BUILD_SHARED_LIBRARY)
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/jni/Application.mk:
--------------------------------------------------------------------------------
1 |
2 | APP_ABI := armeabi
--------------------------------------------------------------------------------
/app/src/main/jni/curl/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile.in generated by automake 1.15 from Makefile.am.
2 | # include/curl/Makefile. Generated from Makefile.in by configure.
3 |
4 | # Copyright (C) 1994-2014 Free Software Foundation, Inc.
5 |
6 | # This Makefile.in is free software; the Free Software Foundation
7 | # gives unlimited permission to copy and/or distribute it,
8 | # with or without modifications, as long as this notice is preserved.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 | # PARTICULAR PURPOSE.
14 |
15 |
16 |
17 |
18 | am__is_gnu_make = { \
19 | if test -z '$(MAKELEVEL)'; then \
20 | false; \
21 | elif test -n '$(MAKE_HOST)'; then \
22 | true; \
23 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
24 | true; \
25 | else \
26 | false; \
27 | fi; \
28 | }
29 | am__make_running_with_option = \
30 | case $${target_option-} in \
31 | ?) ;; \
32 | *) echo "am__make_running_with_option: internal error: invalid" \
33 | "target option '$${target_option-}' specified" >&2; \
34 | exit 1;; \
35 | esac; \
36 | has_opt=no; \
37 | sane_makeflags=$$MAKEFLAGS; \
38 | if $(am__is_gnu_make); then \
39 | sane_makeflags=$$MFLAGS; \
40 | else \
41 | case $$MAKEFLAGS in \
42 | *\\[\ \ ]*) \
43 | bs=\\; \
44 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
45 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
46 | esac; \
47 | fi; \
48 | skip_next=no; \
49 | strip_trailopt () \
50 | { \
51 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
52 | }; \
53 | for flg in $$sane_makeflags; do \
54 | test $$skip_next = yes && { skip_next=no; continue; }; \
55 | case $$flg in \
56 | *=*|--*) continue;; \
57 | -*I) strip_trailopt 'I'; skip_next=yes;; \
58 | -*I?*) strip_trailopt 'I';; \
59 | -*O) strip_trailopt 'O'; skip_next=yes;; \
60 | -*O?*) strip_trailopt 'O';; \
61 | -*l) strip_trailopt 'l'; skip_next=yes;; \
62 | -*l?*) strip_trailopt 'l';; \
63 | -[dEDm]) skip_next=yes;; \
64 | -[JT]) skip_next=yes;; \
65 | esac; \
66 | case $$flg in \
67 | *$$target_option*) has_opt=yes; break;; \
68 | esac; \
69 | done; \
70 | test $$has_opt = yes
71 | am__make_dryrun = (target_option=n; $(am__make_running_with_option))
72 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
73 | pkgdatadir = $(datadir)/curl
74 | pkglibdir = $(libdir)/curl
75 | pkglibexecdir = $(libexecdir)/curl
76 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
77 | install_sh_DATA = $(install_sh) -c -m 644
78 | install_sh_PROGRAM = $(install_sh) -c
79 | install_sh_SCRIPT = $(install_sh) -c
80 | INSTALL_HEADER = $(INSTALL_DATA)
81 | transform = $(program_transform_name)
82 | NORMAL_INSTALL = :
83 | PRE_INSTALL = :
84 | POST_INSTALL = :
85 | NORMAL_UNINSTALL = :
86 | PRE_UNINSTALL = :
87 | POST_UNINSTALL = :
88 | build_triplet = x86_64-pc-linux-gnu
89 | host_triplet = arm-unknown-linux-androideabi
90 | subdir = include/curl
91 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 | am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
93 | $(top_srcdir)/m4/curl-confopts.m4 \
94 | $(top_srcdir)/m4/curl-functions.m4 \
95 | $(top_srcdir)/m4/curl-openssl.m4 \
96 | $(top_srcdir)/m4/curl-override.m4 \
97 | $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
98 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
99 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
100 | $(top_srcdir)/m4/xc-am-iface.m4 \
101 | $(top_srcdir)/m4/xc-cc-check.m4 \
102 | $(top_srcdir)/m4/xc-lt-iface.m4 \
103 | $(top_srcdir)/m4/xc-translit.m4 \
104 | $(top_srcdir)/m4/xc-val-flgs.m4 \
105 | $(top_srcdir)/m4/zz40-xc-ovr.m4 \
106 | $(top_srcdir)/m4/zz50-xc-ovr.m4 \
107 | $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
108 | $(top_srcdir)/configure.ac
109 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
110 | $(ACLOCAL_M4)
111 | DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \
112 | $(am__DIST_COMMON)
113 | mkinstalldirs = $(install_sh) -d
114 | CONFIG_HEADER = $(top_builddir)/lib/curl_config.h curlbuild.h
115 | CONFIG_CLEAN_FILES =
116 | CONFIG_CLEAN_VPATH_FILES =
117 | AM_V_P = $(am__v_P_$(V))
118 | am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
119 | am__v_P_0 = false
120 | am__v_P_1 = :
121 | AM_V_GEN = $(am__v_GEN_$(V))
122 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
123 | am__v_GEN_0 = @echo " GEN " $@;
124 | am__v_GEN_1 =
125 | AM_V_at = $(am__v_at_$(V))
126 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
127 | am__v_at_0 = @
128 | am__v_at_1 =
129 | SOURCES =
130 | DIST_SOURCES =
131 | am__can_run_installinfo = \
132 | case $$AM_UPDATE_INFO_DIR in \
133 | n|no|NO) false;; \
134 | *) (install-info --version) >/dev/null 2>&1;; \
135 | esac
136 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
137 | am__vpath_adj = case $$p in \
138 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
139 | *) f=$$p;; \
140 | esac;
141 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
142 | am__install_max = 40
143 | am__nobase_strip_setup = \
144 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
145 | am__nobase_strip = \
146 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
147 | am__nobase_list = $(am__nobase_strip_setup); \
148 | for p in $$list; do echo "$$p $$p"; done | \
149 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
150 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
151 | if (++n[$$2] == $(am__install_max)) \
152 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
153 | END { for (dir in files) print dir, files[dir] }'
154 | am__base_list = \
155 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
156 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
157 | am__uninstall_files_from_dir = { \
158 | test -z "$$files" \
159 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
160 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
161 | $(am__cd) "$$dir" && rm -f $$files; }; \
162 | }
163 | am__installdirs = "$(DESTDIR)$(pkgincludedir)"
164 | HEADERS = $(pkginclude_HEADERS)
165 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
166 | $(LISP)curlbuild.h.in
167 | # Read a list of newline-separated strings from the standard input,
168 | # and print each of them once, without duplicates. Input order is
169 | # *not* preserved.
170 | am__uniquify_input = $(AWK) '\
171 | BEGIN { nonempty = 0; } \
172 | { items[$$0] = 1; nonempty = 1; } \
173 | END { if (nonempty) { for (i in items) print i; }; } \
174 | '
175 | # Make sure the list of sources is unique. This is necessary because,
176 | # e.g., the same source file might be shared among _SOURCES variables
177 | # for different programs/libraries.
178 | am__define_uniq_tagged_files = \
179 | list='$(am__tagged_files)'; \
180 | unique=`for i in $$list; do \
181 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
182 | done | $(am__uniquify_input)`
183 | ETAGS = etags
184 | CTAGS = ctags
185 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/curlbuild.h.in
186 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
187 | pkgincludedir = $(includedir)/curl
188 | ACLOCAL = ${SHELL} /home/zhonglz/code/curl/missing aclocal-1.15
189 | AMTAR = $${TAR-tar}
190 | AM_DEFAULT_VERBOSITY = 0
191 | AR = /tmp/ndk/bin/arm-linux-androideabi-ar
192 | AS = as
193 | AUTOCONF = ${SHELL} /home/zhonglz/code/curl/missing autoconf
194 | AUTOHEADER = ${SHELL} /home/zhonglz/code/curl/missing autoheader
195 | AUTOMAKE = ${SHELL} /home/zhonglz/code/curl/missing automake-1.15
196 | AWK = mawk
197 | BLANK_AT_MAKETIME =
198 | CC = arm-linux-androideabi-gcc
199 | CCDEPMODE = depmode=gcc3
200 | CFLAGS = -O2 -Wno-system-headers
201 | CFLAG_CURL_SYMBOL_HIDING = -fvisibility=hidden
202 | CONFIGURE_OPTIONS = " '--host=arm-linux-androideabi' '--with-ssl' '--disable-ftp' '--disable-gopher' '--disable-file' '--disable-imap' '--disable-ldap' '--disable-ldaps' '--disable-pop3' '--disable-proxy' '--disable-rtsp' '--disable-smtp' '--disable-telnet' '--disable-tftp' '--without-gnutls' '--without-libidn' '--without-librtmp' '--without-nghttp2' '--disable-dict' 'host_alias=arm-linux-androideabi' 'CC=arm-linux-androideabi-gcc' 'LDFLAGS=-L/home/zhonglz/tools/android-ndk-r11c/platforms/android-21/arch-arm/usr/lib' 'CPPFLAGS=-I/home/zhonglz/tools/android-ndk-r11c/platforms/android-21/arch-arm/usr/include'"
203 | CPP = arm-linux-androideabi-gcc -E
204 | CPPFLAGS = -isystem /home/zhonglz/tools/android-ndk-r11c/platforms/android-21/arch-arm/usr/include
205 | CPPFLAG_CURL_STATICLIB =
206 | CURLVERSION = 7.50.1
207 | CURL_CA_BUNDLE =
208 | CURL_CFLAG_EXTRAS =
209 | CURL_DISABLE_DICT = 1
210 | CURL_DISABLE_FILE = 1
211 | CURL_DISABLE_FTP = 1
212 | CURL_DISABLE_GOPHER = 1
213 | CURL_DISABLE_HTTP =
214 | CURL_DISABLE_IMAP = 1
215 | CURL_DISABLE_LDAP = 1
216 | CURL_DISABLE_LDAPS = 1
217 | CURL_DISABLE_POP3 = 1
218 | CURL_DISABLE_PROXY = 1
219 | CURL_DISABLE_RTSP = 1
220 | CURL_DISABLE_SMB =
221 | CURL_DISABLE_SMTP = 1
222 | CURL_DISABLE_TELNET = 1
223 | CURL_DISABLE_TFTP = 1
224 | CURL_LT_SHLIB_VERSIONED_FLAVOUR =
225 | CURL_NETWORK_AND_TIME_LIBS =
226 | CURL_NETWORK_LIBS =
227 | CYGPATH_W = echo
228 | DEFS = -DHAVE_CONFIG_H
229 | DEPDIR = .deps
230 | DLLTOOL = false
231 | DSYMUTIL =
232 | DUMPBIN =
233 | ECHO_C =
234 | ECHO_N = -n
235 | ECHO_T =
236 | EGREP = /bin/grep -E
237 | ENABLE_SHARED = yes
238 | ENABLE_STATIC = yes
239 | EXEEXT =
240 | FGREP = /bin/grep -F
241 | GREP = /bin/grep
242 | HAVE_GNUTLS_SRP =
243 | HAVE_LDAP_SSL =
244 | HAVE_LIBZ = 1
245 | HAVE_OPENSSL_SRP = 1
246 | IDN_ENABLED =
247 | INSTALL = /usr/bin/install -c
248 | INSTALL_DATA = ${INSTALL} -m 644
249 | INSTALL_PROGRAM = ${INSTALL}
250 | INSTALL_SCRIPT = ${INSTALL}
251 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
252 | IPV6_ENABLED = 1
253 | LD = /tmp/ndk/arm-linux-androideabi/bin/ld
254 | LDFLAGS = -L/home/zhonglz/tools/android-ndk-r11c/platforms/android-21/arch-arm/usr/lib
255 | LIBCURL_LIBS = -lssl -lcrypto -lz
256 | LIBMETALINK_CPPFLAGS =
257 | LIBMETALINK_LDFLAGS =
258 | LIBMETALINK_LIBS =
259 | LIBOBJS =
260 | LIBS = -lssl -lcrypto -lz
261 | LIBTOOL = $(SHELL) $(top_builddir)/libtool
262 | LIPO =
263 | LN_S = ln -s
264 | LTLIBOBJS =
265 | LT_SYS_LIBRARY_PATH =
266 | MAINT = #
267 | MAKEINFO = ${SHELL} /home/zhonglz/code/curl/missing makeinfo
268 | MANIFEST_TOOL = :
269 | MANOPT = -man
270 | MKDIR_P = /bin/mkdir -p
271 | NM = /tmp/ndk/bin/arm-linux-androideabi-nm -B
272 | NMEDIT =
273 | NROFF = /usr/bin/nroff
274 | NSS_LIBS =
275 | OBJDUMP = arm-linux-androideabi-objdump
276 | OBJEXT = o
277 | OTOOL =
278 | OTOOL64 =
279 | PACKAGE = curl
280 | PACKAGE_BUGREPORT = a suitable curl mailing list: https://curl.haxx.se/mail/
281 | PACKAGE_NAME = curl
282 | PACKAGE_STRING = curl -
283 | PACKAGE_TARNAME = curl
284 | PACKAGE_URL =
285 | PACKAGE_VERSION = -
286 | PATH_SEPARATOR = :
287 | PERL = /usr/bin/perl
288 | PKGADD_NAME = cURL - a client that groks URLs
289 | PKGADD_PKG = HAXXcurl
290 | PKGADD_VENDOR = curl.haxx.se
291 | PKGCONFIG =
292 | RANDOM_FILE =
293 | RANLIB = arm-linux-androideabi-ranlib
294 | REQUIRE_LIB_DEPS = no
295 | SED = /bin/sed
296 | SET_MAKE =
297 | SHELL = /bin/bash
298 | SSL_ENABLED = 1
299 | SSL_LIBS =
300 | STRIP = arm-linux-androideabi-strip
301 | SUPPORT_FEATURES = SSL IPv6 UnixSockets libz NTLM NTLM_WB TLS-SRP
302 | SUPPORT_PROTOCOLS = HTTP HTTPS SMB SMBS
303 | USE_ARES =
304 | USE_AXTLS =
305 | USE_CYASSL =
306 | USE_DARWINSSL =
307 | USE_GNUTLS =
308 | USE_GNUTLS_NETTLE =
309 | USE_LIBRTMP =
310 | USE_LIBSSH2 =
311 | USE_MBEDTLS =
312 | USE_NGHTTP2 =
313 | USE_NSS =
314 | USE_OPENLDAP =
315 | USE_POLARSSL =
316 | USE_SCHANNEL =
317 | USE_UNIX_SOCKETS = 1
318 | USE_WINDOWS_SSPI =
319 | VERSION = -
320 | VERSIONNUM = 073201
321 | ZLIB_LIBS = -lz
322 | ZSH_FUNCTIONS_DIR = ${prefix}/share/zsh/site-functions
323 | abs_builddir = /home/zhonglz/code/curl/include/curl
324 | abs_srcdir = /home/zhonglz/code/curl/include/curl
325 | abs_top_builddir = /home/zhonglz/code/curl
326 | abs_top_srcdir = /home/zhonglz/code/curl
327 | ac_ct_AR =
328 | ac_ct_CC =
329 | ac_ct_DUMPBIN =
330 | am__include = include
331 | am__leading_dot = .
332 | am__quote =
333 | am__tar = $${TAR-tar} chof - "$$tardir"
334 | am__untar = $${TAR-tar} xf -
335 | bindir = ${exec_prefix}/bin
336 | build = x86_64-pc-linux-gnu
337 | build_alias =
338 | build_cpu = x86_64
339 | build_os = linux-gnu
340 | build_vendor = pc
341 | builddir = .
342 | datadir = ${datarootdir}
343 | datarootdir = ${prefix}/share
344 | docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
345 | dvidir = ${docdir}
346 | exec_prefix = ${prefix}
347 | host = arm-unknown-linux-androideabi
348 | host_alias = arm-linux-androideabi
349 | host_cpu = arm
350 | host_os = linux-androideabi
351 | host_vendor = unknown
352 | htmldir = ${docdir}
353 | includedir = ${prefix}/include
354 | infodir = ${datarootdir}/info
355 | install_sh = ${SHELL} /home/zhonglz/code/curl/install-sh
356 | libdir = ${exec_prefix}/lib
357 | libexecdir = ${exec_prefix}/libexec
358 | libext = a
359 | localedir = ${datarootdir}/locale
360 | localstatedir = ${prefix}/var
361 | mandir = ${datarootdir}/man
362 | mkdir_p = $(MKDIR_P)
363 | oldincludedir = /usr/include
364 | pdfdir = ${docdir}
365 | prefix = /usr/local
366 | program_transform_name = s,x,x,
367 | psdir = ${docdir}
368 | runstatedir = ${localstatedir}/run
369 | sbindir = ${exec_prefix}/sbin
370 | sharedstatedir = ${prefix}/com
371 | srcdir = .
372 | subdirs =
373 | sysconfdir = ${prefix}/etc
374 | target_alias =
375 | top_build_prefix = ../../
376 | top_builddir = ../..
377 | top_srcdir = ../..
378 |
379 | #***************************************************************************
380 | # _ _ ____ _
381 | # Project ___| | | | _ \| |
382 | # / __| | | | |_) | |
383 | # | (__| |_| | _ <| |___
384 | # \___|\___/|_| \_\_____|
385 | #
386 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al.
387 | #
388 | # This software is licensed as described in the file COPYING, which
389 | # you should have received as part of this distribution. The terms
390 | # are also available at https://curl.haxx.se/docs/copyright.html.
391 | #
392 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
393 | # copies of the Software, and permit persons to whom the Software is
394 | # furnished to do so, under the terms of the COPYING file.
395 | #
396 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
397 | # KIND, either express or implied.
398 | #
399 | ###########################################################################
400 | pkginclude_HEADERS = \
401 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
402 | typecheck-gcc.h curlbuild.h curlrules.h
403 |
404 |
405 | # curlbuild.h does not exist in the git tree. When the original libcurl
406 | # source code distribution archive file is created, curlbuild.h.dist is
407 | # renamed to curlbuild.h and included in the tarball so that it can be
408 | # used directly on non-configure systems.
409 | #
410 | # The distributed curlbuild.h will be overwritten on configure systems
411 | # when the configure script runs, with one that is suitable and specific
412 | # to the library being configured and built.
413 | #
414 | # curlbuild.h.in is the distributed template file from which the configure
415 | # script creates curlbuild.h at library configuration time, overwiting the
416 | # one included in the distribution archive.
417 | #
418 | # curlbuild.h.dist is not included in the source code distribution archive.
419 | EXTRA_DIST = curlbuild.h.in
420 | DISTCLEANFILES = curlbuild.h
421 | all: curlbuild.h
422 | $(MAKE) $(AM_MAKEFLAGS) all-am
423 |
424 | .SUFFIXES:
425 | $(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
426 | @for dep in $?; do \
427 | case '$(am__configure_deps)' in \
428 | *$$dep*) \
429 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
430 | && { if test -f $@; then exit 0; else break; fi; }; \
431 | exit 1;; \
432 | esac; \
433 | done; \
434 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/curl/Makefile'; \
435 | $(am__cd) $(top_srcdir) && \
436 | $(AUTOMAKE) --gnu include/curl/Makefile
437 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
438 | @case '$?' in \
439 | *config.status*) \
440 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
441 | *) \
442 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
443 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
444 | esac;
445 |
446 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
447 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
448 |
449 | $(top_srcdir)/configure: # $(am__configure_deps)
450 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
451 | $(ACLOCAL_M4): # $(am__aclocal_m4_deps)
452 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
453 | $(am__aclocal_m4_deps):
454 |
455 | curlbuild.h: stamp-h2
456 | @test -f $@ || rm -f stamp-h2
457 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
458 |
459 | stamp-h2: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
460 | @rm -f stamp-h2
461 | cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
462 |
463 | distclean-hdr:
464 | -rm -f curlbuild.h stamp-h2
465 |
466 | mostlyclean-libtool:
467 | -rm -f *.lo
468 |
469 | clean-libtool:
470 | -rm -rf .libs _libs
471 | install-pkgincludeHEADERS: $(pkginclude_HEADERS)
472 | @$(NORMAL_INSTALL)
473 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
474 | if test -n "$$list"; then \
475 | echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
476 | $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
477 | fi; \
478 | for p in $$list; do \
479 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
480 | echo "$$d$$p"; \
481 | done | $(am__base_list) | \
482 | while read files; do \
483 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
484 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
485 | done
486 |
487 | uninstall-pkgincludeHEADERS:
488 | @$(NORMAL_UNINSTALL)
489 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
490 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
491 | dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
492 |
493 | ID: $(am__tagged_files)
494 | $(am__define_uniq_tagged_files); mkid -fID $$unique
495 | tags: tags-am
496 | TAGS: tags
497 |
498 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
499 | set x; \
500 | here=`pwd`; \
501 | $(am__define_uniq_tagged_files); \
502 | shift; \
503 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
504 | test -n "$$unique" || unique=$$empty_fix; \
505 | if test $$# -gt 0; then \
506 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
507 | "$$@" $$unique; \
508 | else \
509 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
510 | $$unique; \
511 | fi; \
512 | fi
513 | ctags: ctags-am
514 |
515 | CTAGS: ctags
516 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
517 | $(am__define_uniq_tagged_files); \
518 | test -z "$(CTAGS_ARGS)$$unique" \
519 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
520 | $$unique
521 |
522 | GTAGS:
523 | here=`$(am__cd) $(top_builddir) && pwd` \
524 | && $(am__cd) $(top_srcdir) \
525 | && gtags -i $(GTAGS_ARGS) "$$here"
526 | cscopelist: cscopelist-am
527 |
528 | cscopelist-am: $(am__tagged_files)
529 | list='$(am__tagged_files)'; \
530 | case "$(srcdir)" in \
531 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
532 | *) sdir=$(subdir)/$(srcdir) ;; \
533 | esac; \
534 | for i in $$list; do \
535 | if test -f "$$i"; then \
536 | echo "$(subdir)/$$i"; \
537 | else \
538 | echo "$$sdir/$$i"; \
539 | fi; \
540 | done >> $(top_builddir)/cscope.files
541 |
542 | distclean-tags:
543 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
544 |
545 | distdir: $(DISTFILES)
546 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
547 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
548 | list='$(DISTFILES)'; \
549 | dist_files=`for file in $$list; do echo $$file; done | \
550 | sed -e "s|^$$srcdirstrip/||;t" \
551 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
552 | case $$dist_files in \
553 | */*) $(MKDIR_P) `echo "$$dist_files" | \
554 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
555 | sort -u` ;; \
556 | esac; \
557 | for file in $$dist_files; do \
558 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
559 | if test -d $$d/$$file; then \
560 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
561 | if test -d "$(distdir)/$$file"; then \
562 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
563 | fi; \
564 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
565 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
566 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
567 | fi; \
568 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
569 | else \
570 | test -f "$(distdir)/$$file" \
571 | || cp -p $$d/$$file "$(distdir)/$$file" \
572 | || exit 1; \
573 | fi; \
574 | done
575 | check-am: all-am
576 | check: check-am
577 | all-local:
578 | all-am: Makefile $(HEADERS) curlbuild.h all-local
579 | installdirs:
580 | for dir in "$(DESTDIR)$(pkgincludedir)"; do \
581 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \
582 | done
583 | install: install-am
584 | install-exec: install-exec-am
585 | install-data: install-data-am
586 | uninstall: uninstall-am
587 |
588 | install-am: all-am
589 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
590 |
591 | installcheck: installcheck-am
592 | install-strip:
593 | if test -z '$(STRIP)'; then \
594 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
595 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
596 | install; \
597 | else \
598 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
599 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
600 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
601 | fi
602 | mostlyclean-generic:
603 |
604 | clean-generic:
605 |
606 | distclean-generic:
607 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
608 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
609 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
610 |
611 | maintainer-clean-generic:
612 | @echo "This command is intended for maintainers to use"
613 | @echo "it deletes files that may require special tools to rebuild."
614 | clean: clean-am
615 |
616 | clean-am: clean-generic clean-libtool mostlyclean-am
617 |
618 | distclean: distclean-am
619 | -rm -f Makefile
620 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
621 |
622 | dvi: dvi-am
623 |
624 | dvi-am:
625 |
626 | html: html-am
627 |
628 | html-am:
629 |
630 | info: info-am
631 |
632 | info-am:
633 |
634 | install-data-am: install-pkgincludeHEADERS
635 |
636 | install-dvi: install-dvi-am
637 |
638 | install-dvi-am:
639 |
640 | install-exec-am:
641 |
642 | install-html: install-html-am
643 |
644 | install-html-am:
645 |
646 | install-info: install-info-am
647 |
648 | install-info-am:
649 |
650 | install-man:
651 |
652 | install-pdf: install-pdf-am
653 |
654 | install-pdf-am:
655 |
656 | install-ps: install-ps-am
657 |
658 | install-ps-am:
659 |
660 | installcheck-am:
661 |
662 | maintainer-clean: maintainer-clean-am
663 | -rm -f Makefile
664 | maintainer-clean-am: distclean-am maintainer-clean-generic
665 |
666 | mostlyclean: mostlyclean-am
667 |
668 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool
669 |
670 | pdf: pdf-am
671 |
672 | pdf-am:
673 |
674 | ps: ps-am
675 |
676 | ps-am:
677 |
678 | uninstall-am: uninstall-pkgincludeHEADERS
679 |
680 | .MAKE: all install-am install-strip
681 |
682 | .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
683 | clean-generic clean-libtool cscopelist-am ctags ctags-am \
684 | distclean distclean-generic distclean-hdr distclean-libtool \
685 | distclean-tags distdir dvi dvi-am html html-am info info-am \
686 | install install-am install-data install-data-am install-dvi \
687 | install-dvi-am install-exec install-exec-am install-html \
688 | install-html-am install-info install-info-am install-man \
689 | install-pdf install-pdf-am install-pkgincludeHEADERS \
690 | install-ps install-ps-am install-strip installcheck \
691 | installcheck-am installdirs maintainer-clean \
692 | maintainer-clean-generic mostlyclean mostlyclean-generic \
693 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
694 | uninstall-am uninstall-pkgincludeHEADERS
695 |
696 | .PRECIOUS: Makefile
697 |
698 |
699 | checksrc:
700 | @/usr/bin/perl $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
701 |
702 | # for debug builds, we scan the sources on all regular make invokes
703 | #all-local: checksrc
704 |
705 | # Tell versions [3.59,3.63) of GNU make to not export all variables.
706 | # Otherwise a system limit (for SysV at least) may be exceeded.
707 | .NOEXPORT:
708 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/Makefile.am:
--------------------------------------------------------------------------------
1 | #***************************************************************************
2 | # _ _ ____ _
3 | # Project ___| | | | _ \| |
4 | # / __| | | | |_) | |
5 | # | (__| |_| | _ <| |___
6 | # \___|\___/|_| \_\_____|
7 | #
8 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al.
9 | #
10 | # This software is licensed as described in the file COPYING, which
11 | # you should have received as part of this distribution. The terms
12 | # are also available at https://curl.haxx.se/docs/copyright.html.
13 | #
14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 | # copies of the Software, and permit persons to whom the Software is
16 | # furnished to do so, under the terms of the COPYING file.
17 | #
18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 | # KIND, either express or implied.
20 | #
21 | ###########################################################################
22 | pkginclude_HEADERS = \
23 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
24 | typecheck-gcc.h curlbuild.h curlrules.h
25 |
26 | pkgincludedir= $(includedir)/curl
27 |
28 | # curlbuild.h does not exist in the git tree. When the original libcurl
29 | # source code distribution archive file is created, curlbuild.h.dist is
30 | # renamed to curlbuild.h and included in the tarball so that it can be
31 | # used directly on non-configure systems.
32 | #
33 | # The distributed curlbuild.h will be overwritten on configure systems
34 | # when the configure script runs, with one that is suitable and specific
35 | # to the library being configured and built.
36 | #
37 | # curlbuild.h.in is the distributed template file from which the configure
38 | # script creates curlbuild.h at library configuration time, overwiting the
39 | # one included in the distribution archive.
40 | #
41 | # curlbuild.h.dist is not included in the source code distribution archive.
42 |
43 | EXTRA_DIST = curlbuild.h.in
44 |
45 | DISTCLEANFILES = curlbuild.h
46 |
47 | checksrc:
48 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
49 |
50 | if CURLDEBUG
51 | # for debug builds, we scan the sources on all regular make invokes
52 | all-local: checksrc
53 | endif
54 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/Makefile.in:
--------------------------------------------------------------------------------
1 | # Makefile.in generated by automake 1.15 from Makefile.am.
2 | # @configure_input@
3 |
4 | # Copyright (C) 1994-2014 Free Software Foundation, Inc.
5 |
6 | # This Makefile.in is free software; the Free Software Foundation
7 | # gives unlimited permission to copy and/or distribute it,
8 | # with or without modifications, as long as this notice is preserved.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 | # PARTICULAR PURPOSE.
14 |
15 | @SET_MAKE@
16 |
17 | VPATH = @srcdir@
18 | am__is_gnu_make = { \
19 | if test -z '$(MAKELEVEL)'; then \
20 | false; \
21 | elif test -n '$(MAKE_HOST)'; then \
22 | true; \
23 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
24 | true; \
25 | else \
26 | false; \
27 | fi; \
28 | }
29 | am__make_running_with_option = \
30 | case $${target_option-} in \
31 | ?) ;; \
32 | *) echo "am__make_running_with_option: internal error: invalid" \
33 | "target option '$${target_option-}' specified" >&2; \
34 | exit 1;; \
35 | esac; \
36 | has_opt=no; \
37 | sane_makeflags=$$MAKEFLAGS; \
38 | if $(am__is_gnu_make); then \
39 | sane_makeflags=$$MFLAGS; \
40 | else \
41 | case $$MAKEFLAGS in \
42 | *\\[\ \ ]*) \
43 | bs=\\; \
44 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
45 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
46 | esac; \
47 | fi; \
48 | skip_next=no; \
49 | strip_trailopt () \
50 | { \
51 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
52 | }; \
53 | for flg in $$sane_makeflags; do \
54 | test $$skip_next = yes && { skip_next=no; continue; }; \
55 | case $$flg in \
56 | *=*|--*) continue;; \
57 | -*I) strip_trailopt 'I'; skip_next=yes;; \
58 | -*I?*) strip_trailopt 'I';; \
59 | -*O) strip_trailopt 'O'; skip_next=yes;; \
60 | -*O?*) strip_trailopt 'O';; \
61 | -*l) strip_trailopt 'l'; skip_next=yes;; \
62 | -*l?*) strip_trailopt 'l';; \
63 | -[dEDm]) skip_next=yes;; \
64 | -[JT]) skip_next=yes;; \
65 | esac; \
66 | case $$flg in \
67 | *$$target_option*) has_opt=yes; break;; \
68 | esac; \
69 | done; \
70 | test $$has_opt = yes
71 | am__make_dryrun = (target_option=n; $(am__make_running_with_option))
72 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
73 | pkgdatadir = $(datadir)/@PACKAGE@
74 | pkglibdir = $(libdir)/@PACKAGE@
75 | pkglibexecdir = $(libexecdir)/@PACKAGE@
76 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
77 | install_sh_DATA = $(install_sh) -c -m 644
78 | install_sh_PROGRAM = $(install_sh) -c
79 | install_sh_SCRIPT = $(install_sh) -c
80 | INSTALL_HEADER = $(INSTALL_DATA)
81 | transform = $(program_transform_name)
82 | NORMAL_INSTALL = :
83 | PRE_INSTALL = :
84 | POST_INSTALL = :
85 | NORMAL_UNINSTALL = :
86 | PRE_UNINSTALL = :
87 | POST_UNINSTALL = :
88 | build_triplet = @build@
89 | host_triplet = @host@
90 | subdir = include/curl
91 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 | am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
93 | $(top_srcdir)/m4/curl-confopts.m4 \
94 | $(top_srcdir)/m4/curl-functions.m4 \
95 | $(top_srcdir)/m4/curl-openssl.m4 \
96 | $(top_srcdir)/m4/curl-override.m4 \
97 | $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
98 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
99 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
100 | $(top_srcdir)/m4/xc-am-iface.m4 \
101 | $(top_srcdir)/m4/xc-cc-check.m4 \
102 | $(top_srcdir)/m4/xc-lt-iface.m4 \
103 | $(top_srcdir)/m4/xc-translit.m4 \
104 | $(top_srcdir)/m4/xc-val-flgs.m4 \
105 | $(top_srcdir)/m4/zz40-xc-ovr.m4 \
106 | $(top_srcdir)/m4/zz50-xc-ovr.m4 \
107 | $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
108 | $(top_srcdir)/configure.ac
109 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
110 | $(ACLOCAL_M4)
111 | DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \
112 | $(am__DIST_COMMON)
113 | mkinstalldirs = $(install_sh) -d
114 | CONFIG_HEADER = $(top_builddir)/lib/curl_config.h curlbuild.h
115 | CONFIG_CLEAN_FILES =
116 | CONFIG_CLEAN_VPATH_FILES =
117 | AM_V_P = $(am__v_P_@AM_V@)
118 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
119 | am__v_P_0 = false
120 | am__v_P_1 = :
121 | AM_V_GEN = $(am__v_GEN_@AM_V@)
122 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
123 | am__v_GEN_0 = @echo " GEN " $@;
124 | am__v_GEN_1 =
125 | AM_V_at = $(am__v_at_@AM_V@)
126 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
127 | am__v_at_0 = @
128 | am__v_at_1 =
129 | SOURCES =
130 | DIST_SOURCES =
131 | am__can_run_installinfo = \
132 | case $$AM_UPDATE_INFO_DIR in \
133 | n|no|NO) false;; \
134 | *) (install-info --version) >/dev/null 2>&1;; \
135 | esac
136 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
137 | am__vpath_adj = case $$p in \
138 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
139 | *) f=$$p;; \
140 | esac;
141 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
142 | am__install_max = 40
143 | am__nobase_strip_setup = \
144 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
145 | am__nobase_strip = \
146 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
147 | am__nobase_list = $(am__nobase_strip_setup); \
148 | for p in $$list; do echo "$$p $$p"; done | \
149 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
150 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
151 | if (++n[$$2] == $(am__install_max)) \
152 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
153 | END { for (dir in files) print dir, files[dir] }'
154 | am__base_list = \
155 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
156 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
157 | am__uninstall_files_from_dir = { \
158 | test -z "$$files" \
159 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
160 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
161 | $(am__cd) "$$dir" && rm -f $$files; }; \
162 | }
163 | am__installdirs = "$(DESTDIR)$(pkgincludedir)"
164 | HEADERS = $(pkginclude_HEADERS)
165 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
166 | $(LISP)curlbuild.h.in
167 | # Read a list of newline-separated strings from the standard input,
168 | # and print each of them once, without duplicates. Input order is
169 | # *not* preserved.
170 | am__uniquify_input = $(AWK) '\
171 | BEGIN { nonempty = 0; } \
172 | { items[$$0] = 1; nonempty = 1; } \
173 | END { if (nonempty) { for (i in items) print i; }; } \
174 | '
175 | # Make sure the list of sources is unique. This is necessary because,
176 | # e.g., the same source file might be shared among _SOURCES variables
177 | # for different programs/libraries.
178 | am__define_uniq_tagged_files = \
179 | list='$(am__tagged_files)'; \
180 | unique=`for i in $$list; do \
181 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
182 | done | $(am__uniquify_input)`
183 | ETAGS = etags
184 | CTAGS = ctags
185 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/curlbuild.h.in
186 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
187 | pkgincludedir = $(includedir)/curl
188 | ACLOCAL = @ACLOCAL@
189 | AMTAR = @AMTAR@
190 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
191 | AR = @AR@
192 | AS = @AS@
193 | AUTOCONF = @AUTOCONF@
194 | AUTOHEADER = @AUTOHEADER@
195 | AUTOMAKE = @AUTOMAKE@
196 | AWK = @AWK@
197 | BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
198 | CC = @CC@
199 | CCDEPMODE = @CCDEPMODE@
200 | CFLAGS = @CFLAGS@
201 | CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
202 | CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
203 | CPP = @CPP@
204 | CPPFLAGS = @CPPFLAGS@
205 | CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
206 | CURLVERSION = @CURLVERSION@
207 | CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
208 | CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
209 | CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
210 | CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
211 | CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
212 | CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
213 | CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
214 | CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
215 | CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
216 | CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
217 | CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
218 | CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
219 | CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
220 | CURL_DISABLE_SMB = @CURL_DISABLE_SMB@
221 | CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
222 | CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
223 | CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
224 | CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
225 | CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
226 | CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
227 | CYGPATH_W = @CYGPATH_W@
228 | DEFS = @DEFS@
229 | DEPDIR = @DEPDIR@
230 | DLLTOOL = @DLLTOOL@
231 | DSYMUTIL = @DSYMUTIL@
232 | DUMPBIN = @DUMPBIN@
233 | ECHO_C = @ECHO_C@
234 | ECHO_N = @ECHO_N@
235 | ECHO_T = @ECHO_T@
236 | EGREP = @EGREP@
237 | ENABLE_SHARED = @ENABLE_SHARED@
238 | ENABLE_STATIC = @ENABLE_STATIC@
239 | EXEEXT = @EXEEXT@
240 | FGREP = @FGREP@
241 | GREP = @GREP@
242 | HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
243 | HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
244 | HAVE_LIBZ = @HAVE_LIBZ@
245 | HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@
246 | IDN_ENABLED = @IDN_ENABLED@
247 | INSTALL = @INSTALL@
248 | INSTALL_DATA = @INSTALL_DATA@
249 | INSTALL_PROGRAM = @INSTALL_PROGRAM@
250 | INSTALL_SCRIPT = @INSTALL_SCRIPT@
251 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
252 | IPV6_ENABLED = @IPV6_ENABLED@
253 | LD = @LD@
254 | LDFLAGS = @LDFLAGS@
255 | LIBCURL_LIBS = @LIBCURL_LIBS@
256 | LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
257 | LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
258 | LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
259 | LIBOBJS = @LIBOBJS@
260 | LIBS = @LIBS@
261 | LIBTOOL = @LIBTOOL@
262 | LIPO = @LIPO@
263 | LN_S = @LN_S@
264 | LTLIBOBJS = @LTLIBOBJS@
265 | LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
266 | MAINT = @MAINT@
267 | MAKEINFO = @MAKEINFO@
268 | MANIFEST_TOOL = @MANIFEST_TOOL@
269 | MANOPT = @MANOPT@
270 | MKDIR_P = @MKDIR_P@
271 | NM = @NM@
272 | NMEDIT = @NMEDIT@
273 | NROFF = @NROFF@
274 | NSS_LIBS = @NSS_LIBS@
275 | OBJDUMP = @OBJDUMP@
276 | OBJEXT = @OBJEXT@
277 | OTOOL = @OTOOL@
278 | OTOOL64 = @OTOOL64@
279 | PACKAGE = @PACKAGE@
280 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
281 | PACKAGE_NAME = @PACKAGE_NAME@
282 | PACKAGE_STRING = @PACKAGE_STRING@
283 | PACKAGE_TARNAME = @PACKAGE_TARNAME@
284 | PACKAGE_URL = @PACKAGE_URL@
285 | PACKAGE_VERSION = @PACKAGE_VERSION@
286 | PATH_SEPARATOR = @PATH_SEPARATOR@
287 | PERL = @PERL@
288 | PKGADD_NAME = @PKGADD_NAME@
289 | PKGADD_PKG = @PKGADD_PKG@
290 | PKGADD_VENDOR = @PKGADD_VENDOR@
291 | PKGCONFIG = @PKGCONFIG@
292 | RANDOM_FILE = @RANDOM_FILE@
293 | RANLIB = @RANLIB@
294 | REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
295 | SED = @SED@
296 | SET_MAKE = @SET_MAKE@
297 | SHELL = @SHELL@
298 | SSL_ENABLED = @SSL_ENABLED@
299 | SSL_LIBS = @SSL_LIBS@
300 | STRIP = @STRIP@
301 | SUPPORT_FEATURES = @SUPPORT_FEATURES@
302 | SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
303 | USE_ARES = @USE_ARES@
304 | USE_AXTLS = @USE_AXTLS@
305 | USE_CYASSL = @USE_CYASSL@
306 | USE_DARWINSSL = @USE_DARWINSSL@
307 | USE_GNUTLS = @USE_GNUTLS@
308 | USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
309 | USE_LIBRTMP = @USE_LIBRTMP@
310 | USE_LIBSSH2 = @USE_LIBSSH2@
311 | USE_MBEDTLS = @USE_MBEDTLS@
312 | USE_NGHTTP2 = @USE_NGHTTP2@
313 | USE_NSS = @USE_NSS@
314 | USE_OPENLDAP = @USE_OPENLDAP@
315 | USE_POLARSSL = @USE_POLARSSL@
316 | USE_SCHANNEL = @USE_SCHANNEL@
317 | USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@
318 | USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
319 | VERSION = @VERSION@
320 | VERSIONNUM = @VERSIONNUM@
321 | ZLIB_LIBS = @ZLIB_LIBS@
322 | ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
323 | abs_builddir = @abs_builddir@
324 | abs_srcdir = @abs_srcdir@
325 | abs_top_builddir = @abs_top_builddir@
326 | abs_top_srcdir = @abs_top_srcdir@
327 | ac_ct_AR = @ac_ct_AR@
328 | ac_ct_CC = @ac_ct_CC@
329 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
330 | am__include = @am__include@
331 | am__leading_dot = @am__leading_dot@
332 | am__quote = @am__quote@
333 | am__tar = @am__tar@
334 | am__untar = @am__untar@
335 | bindir = @bindir@
336 | build = @build@
337 | build_alias = @build_alias@
338 | build_cpu = @build_cpu@
339 | build_os = @build_os@
340 | build_vendor = @build_vendor@
341 | builddir = @builddir@
342 | datadir = @datadir@
343 | datarootdir = @datarootdir@
344 | docdir = @docdir@
345 | dvidir = @dvidir@
346 | exec_prefix = @exec_prefix@
347 | host = @host@
348 | host_alias = @host_alias@
349 | host_cpu = @host_cpu@
350 | host_os = @host_os@
351 | host_vendor = @host_vendor@
352 | htmldir = @htmldir@
353 | includedir = @includedir@
354 | infodir = @infodir@
355 | install_sh = @install_sh@
356 | libdir = @libdir@
357 | libexecdir = @libexecdir@
358 | libext = @libext@
359 | localedir = @localedir@
360 | localstatedir = @localstatedir@
361 | mandir = @mandir@
362 | mkdir_p = @mkdir_p@
363 | oldincludedir = @oldincludedir@
364 | pdfdir = @pdfdir@
365 | prefix = @prefix@
366 | program_transform_name = @program_transform_name@
367 | psdir = @psdir@
368 | runstatedir = @runstatedir@
369 | sbindir = @sbindir@
370 | sharedstatedir = @sharedstatedir@
371 | srcdir = @srcdir@
372 | subdirs = @subdirs@
373 | sysconfdir = @sysconfdir@
374 | target_alias = @target_alias@
375 | top_build_prefix = @top_build_prefix@
376 | top_builddir = @top_builddir@
377 | top_srcdir = @top_srcdir@
378 |
379 | #***************************************************************************
380 | # _ _ ____ _
381 | # Project ___| | | | _ \| |
382 | # / __| | | | |_) | |
383 | # | (__| |_| | _ <| |___
384 | # \___|\___/|_| \_\_____|
385 | #
386 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al.
387 | #
388 | # This software is licensed as described in the file COPYING, which
389 | # you should have received as part of this distribution. The terms
390 | # are also available at https://curl.haxx.se/docs/copyright.html.
391 | #
392 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
393 | # copies of the Software, and permit persons to whom the Software is
394 | # furnished to do so, under the terms of the COPYING file.
395 | #
396 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
397 | # KIND, either express or implied.
398 | #
399 | ###########################################################################
400 | pkginclude_HEADERS = \
401 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
402 | typecheck-gcc.h curlbuild.h curlrules.h
403 |
404 |
405 | # curlbuild.h does not exist in the git tree. When the original libcurl
406 | # source code distribution archive file is created, curlbuild.h.dist is
407 | # renamed to curlbuild.h and included in the tarball so that it can be
408 | # used directly on non-configure systems.
409 | #
410 | # The distributed curlbuild.h will be overwritten on configure systems
411 | # when the configure script runs, with one that is suitable and specific
412 | # to the library being configured and built.
413 | #
414 | # curlbuild.h.in is the distributed template file from which the configure
415 | # script creates curlbuild.h at library configuration time, overwiting the
416 | # one included in the distribution archive.
417 | #
418 | # curlbuild.h.dist is not included in the source code distribution archive.
419 | EXTRA_DIST = curlbuild.h.in
420 | DISTCLEANFILES = curlbuild.h
421 | all: curlbuild.h
422 | $(MAKE) $(AM_MAKEFLAGS) all-am
423 |
424 | .SUFFIXES:
425 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
426 | @for dep in $?; do \
427 | case '$(am__configure_deps)' in \
428 | *$$dep*) \
429 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
430 | && { if test -f $@; then exit 0; else break; fi; }; \
431 | exit 1;; \
432 | esac; \
433 | done; \
434 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/curl/Makefile'; \
435 | $(am__cd) $(top_srcdir) && \
436 | $(AUTOMAKE) --gnu include/curl/Makefile
437 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
438 | @case '$?' in \
439 | *config.status*) \
440 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
441 | *) \
442 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
443 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
444 | esac;
445 |
446 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
447 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
448 |
449 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
450 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
451 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
452 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
453 | $(am__aclocal_m4_deps):
454 |
455 | curlbuild.h: stamp-h2
456 | @test -f $@ || rm -f stamp-h2
457 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
458 |
459 | stamp-h2: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
460 | @rm -f stamp-h2
461 | cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
462 |
463 | distclean-hdr:
464 | -rm -f curlbuild.h stamp-h2
465 |
466 | mostlyclean-libtool:
467 | -rm -f *.lo
468 |
469 | clean-libtool:
470 | -rm -rf .libs _libs
471 | install-pkgincludeHEADERS: $(pkginclude_HEADERS)
472 | @$(NORMAL_INSTALL)
473 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
474 | if test -n "$$list"; then \
475 | echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
476 | $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
477 | fi; \
478 | for p in $$list; do \
479 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
480 | echo "$$d$$p"; \
481 | done | $(am__base_list) | \
482 | while read files; do \
483 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
484 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
485 | done
486 |
487 | uninstall-pkgincludeHEADERS:
488 | @$(NORMAL_UNINSTALL)
489 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
490 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
491 | dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
492 |
493 | ID: $(am__tagged_files)
494 | $(am__define_uniq_tagged_files); mkid -fID $$unique
495 | tags: tags-am
496 | TAGS: tags
497 |
498 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
499 | set x; \
500 | here=`pwd`; \
501 | $(am__define_uniq_tagged_files); \
502 | shift; \
503 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
504 | test -n "$$unique" || unique=$$empty_fix; \
505 | if test $$# -gt 0; then \
506 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
507 | "$$@" $$unique; \
508 | else \
509 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
510 | $$unique; \
511 | fi; \
512 | fi
513 | ctags: ctags-am
514 |
515 | CTAGS: ctags
516 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
517 | $(am__define_uniq_tagged_files); \
518 | test -z "$(CTAGS_ARGS)$$unique" \
519 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
520 | $$unique
521 |
522 | GTAGS:
523 | here=`$(am__cd) $(top_builddir) && pwd` \
524 | && $(am__cd) $(top_srcdir) \
525 | && gtags -i $(GTAGS_ARGS) "$$here"
526 | cscopelist: cscopelist-am
527 |
528 | cscopelist-am: $(am__tagged_files)
529 | list='$(am__tagged_files)'; \
530 | case "$(srcdir)" in \
531 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
532 | *) sdir=$(subdir)/$(srcdir) ;; \
533 | esac; \
534 | for i in $$list; do \
535 | if test -f "$$i"; then \
536 | echo "$(subdir)/$$i"; \
537 | else \
538 | echo "$$sdir/$$i"; \
539 | fi; \
540 | done >> $(top_builddir)/cscope.files
541 |
542 | distclean-tags:
543 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
544 |
545 | distdir: $(DISTFILES)
546 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
547 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
548 | list='$(DISTFILES)'; \
549 | dist_files=`for file in $$list; do echo $$file; done | \
550 | sed -e "s|^$$srcdirstrip/||;t" \
551 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
552 | case $$dist_files in \
553 | */*) $(MKDIR_P) `echo "$$dist_files" | \
554 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
555 | sort -u` ;; \
556 | esac; \
557 | for file in $$dist_files; do \
558 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
559 | if test -d $$d/$$file; then \
560 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
561 | if test -d "$(distdir)/$$file"; then \
562 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
563 | fi; \
564 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
565 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
566 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
567 | fi; \
568 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
569 | else \
570 | test -f "$(distdir)/$$file" \
571 | || cp -p $$d/$$file "$(distdir)/$$file" \
572 | || exit 1; \
573 | fi; \
574 | done
575 | check-am: all-am
576 | check: check-am
577 | @CURLDEBUG_FALSE@all-local:
578 | all-am: Makefile $(HEADERS) curlbuild.h all-local
579 | installdirs:
580 | for dir in "$(DESTDIR)$(pkgincludedir)"; do \
581 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \
582 | done
583 | install: install-am
584 | install-exec: install-exec-am
585 | install-data: install-data-am
586 | uninstall: uninstall-am
587 |
588 | install-am: all-am
589 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
590 |
591 | installcheck: installcheck-am
592 | install-strip:
593 | if test -z '$(STRIP)'; then \
594 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
595 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
596 | install; \
597 | else \
598 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
599 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
600 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
601 | fi
602 | mostlyclean-generic:
603 |
604 | clean-generic:
605 |
606 | distclean-generic:
607 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
608 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
609 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
610 |
611 | maintainer-clean-generic:
612 | @echo "This command is intended for maintainers to use"
613 | @echo "it deletes files that may require special tools to rebuild."
614 | clean: clean-am
615 |
616 | clean-am: clean-generic clean-libtool mostlyclean-am
617 |
618 | distclean: distclean-am
619 | -rm -f Makefile
620 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
621 |
622 | dvi: dvi-am
623 |
624 | dvi-am:
625 |
626 | html: html-am
627 |
628 | html-am:
629 |
630 | info: info-am
631 |
632 | info-am:
633 |
634 | install-data-am: install-pkgincludeHEADERS
635 |
636 | install-dvi: install-dvi-am
637 |
638 | install-dvi-am:
639 |
640 | install-exec-am:
641 |
642 | install-html: install-html-am
643 |
644 | install-html-am:
645 |
646 | install-info: install-info-am
647 |
648 | install-info-am:
649 |
650 | install-man:
651 |
652 | install-pdf: install-pdf-am
653 |
654 | install-pdf-am:
655 |
656 | install-ps: install-ps-am
657 |
658 | install-ps-am:
659 |
660 | installcheck-am:
661 |
662 | maintainer-clean: maintainer-clean-am
663 | -rm -f Makefile
664 | maintainer-clean-am: distclean-am maintainer-clean-generic
665 |
666 | mostlyclean: mostlyclean-am
667 |
668 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool
669 |
670 | pdf: pdf-am
671 |
672 | pdf-am:
673 |
674 | ps: ps-am
675 |
676 | ps-am:
677 |
678 | uninstall-am: uninstall-pkgincludeHEADERS
679 |
680 | .MAKE: all install-am install-strip
681 |
682 | .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
683 | clean-generic clean-libtool cscopelist-am ctags ctags-am \
684 | distclean distclean-generic distclean-hdr distclean-libtool \
685 | distclean-tags distdir dvi dvi-am html html-am info info-am \
686 | install install-am install-data install-data-am install-dvi \
687 | install-dvi-am install-exec install-exec-am install-html \
688 | install-html-am install-info install-info-am install-man \
689 | install-pdf install-pdf-am install-pkgincludeHEADERS \
690 | install-ps install-ps-am install-strip installcheck \
691 | installcheck-am installdirs maintainer-clean \
692 | maintainer-clean-generic mostlyclean mostlyclean-generic \
693 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
694 | uninstall-am uninstall-pkgincludeHEADERS
695 |
696 | .PRECIOUS: Makefile
697 |
698 |
699 | checksrc:
700 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
701 |
702 | # for debug builds, we scan the sources on all regular make invokes
703 | @CURLDEBUG_TRUE@all-local: checksrc
704 |
705 | # Tell versions [3.59,3.63) of GNU make to not export all variables.
706 | # Otherwise a system limit (for SysV at least) may be exceeded.
707 | .NOEXPORT:
708 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/curlbuild.h:
--------------------------------------------------------------------------------
1 | /* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */
2 | #ifndef __CURL_CURLBUILD_H
3 | #define __CURL_CURLBUILD_H
4 | /***************************************************************************
5 | * _ _ ____ _
6 | * Project ___| | | | _ \| |
7 | * / __| | | | |_) | |
8 | * | (__| |_| | _ <| |___
9 | * \___|\___/|_| \_\_____|
10 | *
11 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
12 | *
13 | * This software is licensed as described in the file COPYING, which
14 | * you should have received as part of this distribution. The terms
15 | * are also available at https://curl.haxx.se/docs/copyright.html.
16 | *
17 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
18 | * copies of the Software, and permit persons to whom the Software is
19 | * furnished to do so, under the terms of the COPYING file.
20 | *
21 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 | * KIND, either express or implied.
23 | *
24 | ***************************************************************************/
25 |
26 | /* ================================================================ */
27 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
28 | /* ================================================================ */
29 |
30 | /*
31 | * NOTE 1:
32 | * -------
33 | *
34 | * Nothing in this file is intended to be modified or adjusted by the
35 | * curl library user nor by the curl library builder.
36 | *
37 | * If you think that something actually needs to be changed, adjusted
38 | * or fixed in this file, then, report it on the libcurl development
39 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
40 | *
41 | * This header file shall only export symbols which are 'curl' or 'CURL'
42 | * prefixed, otherwise public name space would be polluted.
43 | *
44 | * NOTE 2:
45 | * -------
46 | *
47 | * Right now you might be staring at file include/curl/curlbuild.h.in or
48 | * at file include/curl/curlbuild.h, this is due to the following reason:
49 | *
50 | * On systems capable of running the configure script, the configure process
51 | * will overwrite the distributed include/curl/curlbuild.h file with one that
52 | * is suitable and specific to the library being configured and built, which
53 | * is generated from the include/curl/curlbuild.h.in template file.
54 | *
55 | */
56 |
57 | /* ================================================================ */
58 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
59 | /* ================================================================ */
60 |
61 | #ifdef CURL_SIZEOF_LONG
62 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
63 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
64 | #endif
65 |
66 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
67 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
68 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
69 | #endif
70 |
71 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
72 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
73 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
74 | #endif
75 |
76 | #ifdef CURL_TYPEOF_CURL_OFF_T
77 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
78 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
79 | #endif
80 |
81 | #ifdef CURL_FORMAT_CURL_OFF_T
82 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
83 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
84 | #endif
85 |
86 | #ifdef CURL_FORMAT_CURL_OFF_TU
87 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
88 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
89 | #endif
90 |
91 | #ifdef CURL_FORMAT_OFF_T
92 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
93 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
94 | #endif
95 |
96 | #ifdef CURL_SIZEOF_CURL_OFF_T
97 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
98 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
99 | #endif
100 |
101 | #ifdef CURL_SUFFIX_CURL_OFF_T
102 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
103 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
104 | #endif
105 |
106 | #ifdef CURL_SUFFIX_CURL_OFF_TU
107 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
108 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
109 | #endif
110 |
111 | /* ================================================================ */
112 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
113 | /* ================================================================ */
114 |
115 | /* Configure process defines this to 1 when it finds out that system */
116 | /* header file ws2tcpip.h must be included by the external interface. */
117 | /* #undef CURL_PULL_WS2TCPIP_H */
118 | #ifdef CURL_PULL_WS2TCPIP_H
119 | # ifndef WIN32_LEAN_AND_MEAN
120 | # define WIN32_LEAN_AND_MEAN
121 | # endif
122 | # include
123 | # include
124 | # include
125 | #endif
126 |
127 | /* Configure process defines this to 1 when it finds out that system */
128 | /* header file sys/types.h must be included by the external interface. */
129 | #define CURL_PULL_SYS_TYPES_H 1
130 | #ifdef CURL_PULL_SYS_TYPES_H
131 | # include
132 | #endif
133 |
134 | /* Configure process defines this to 1 when it finds out that system */
135 | /* header file stdint.h must be included by the external interface. */
136 | #define CURL_PULL_STDINT_H 1
137 | #ifdef CURL_PULL_STDINT_H
138 | # include
139 | #endif
140 |
141 | /* Configure process defines this to 1 when it finds out that system */
142 | /* header file inttypes.h must be included by the external interface. */
143 | #define CURL_PULL_INTTYPES_H 1
144 | #ifdef CURL_PULL_INTTYPES_H
145 | # include
146 | #endif
147 |
148 | /* Configure process defines this to 1 when it finds out that system */
149 | /* header file sys/socket.h must be included by the external interface. */
150 | #define CURL_PULL_SYS_SOCKET_H 1
151 | #ifdef CURL_PULL_SYS_SOCKET_H
152 | # include
153 | #endif
154 |
155 | /* Configure process defines this to 1 when it finds out that system */
156 | /* header file sys/poll.h must be included by the external interface. */
157 | /* #undef CURL_PULL_SYS_POLL_H */
158 | #ifdef CURL_PULL_SYS_POLL_H
159 | # include
160 | #endif
161 |
162 | /* The size of `long', as computed by sizeof. */
163 | #define CURL_SIZEOF_LONG 4
164 |
165 | /* Integral data type used for curl_socklen_t. */
166 | #define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
167 |
168 | /* The size of `curl_socklen_t', as computed by sizeof. */
169 | #define CURL_SIZEOF_CURL_SOCKLEN_T 4
170 |
171 | /* Data type definition of curl_socklen_t. */
172 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
173 |
174 | /* Signed integral data type used for curl_off_t. */
175 | #define CURL_TYPEOF_CURL_OFF_T int64_t
176 |
177 | /* Data type definition of curl_off_t. */
178 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
179 |
180 | /* curl_off_t formatting string directive without "%" conversion specifier. */
181 | #define CURL_FORMAT_CURL_OFF_T "lld"
182 |
183 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
184 | #define CURL_FORMAT_CURL_OFF_TU "llu"
185 |
186 | /* curl_off_t formatting string directive with "%" conversion specifier. */
187 | #define CURL_FORMAT_OFF_T "%lld"
188 |
189 | /* The size of `curl_off_t', as computed by sizeof. */
190 | #define CURL_SIZEOF_CURL_OFF_T 8
191 |
192 | /* curl_off_t constant suffix. */
193 | #define CURL_SUFFIX_CURL_OFF_T LL
194 |
195 | /* unsigned curl_off_t constant suffix. */
196 | #define CURL_SUFFIX_CURL_OFF_TU ULL
197 |
198 | #endif /* __CURL_CURLBUILD_H */
199 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/curlbuild.h.cmake:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLBUILD_H
2 | #define __CURL_CURLBUILD_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * Nothing in this file is intended to be modified or adjusted by the
34 | * curl library user nor by the curl library builder.
35 | *
36 | * If you think that something actually needs to be changed, adjusted
37 | * or fixed in this file, then, report it on the libcurl development
38 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
39 | *
40 | * This header file shall only export symbols which are 'curl' or 'CURL'
41 | * prefixed, otherwise public name space would be polluted.
42 | *
43 | * NOTE 2:
44 | * -------
45 | *
46 | * Right now you might be staring at file include/curl/curlbuild.h.in or
47 | * at file include/curl/curlbuild.h, this is due to the following reason:
48 | *
49 | * On systems capable of running the configure script, the configure process
50 | * will overwrite the distributed include/curl/curlbuild.h file with one that
51 | * is suitable and specific to the library being configured and built, which
52 | * is generated from the include/curl/curlbuild.h.in template file.
53 | *
54 | */
55 |
56 | /* ================================================================ */
57 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
58 | /* ================================================================ */
59 |
60 | #ifdef CURL_SIZEOF_LONG
61 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
62 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
63 | #endif
64 |
65 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
66 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
67 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
68 | #endif
69 |
70 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
71 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
72 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
73 | #endif
74 |
75 | #ifdef CURL_TYPEOF_CURL_OFF_T
76 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
77 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
78 | #endif
79 |
80 | #ifdef CURL_FORMAT_CURL_OFF_T
81 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
82 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
83 | #endif
84 |
85 | #ifdef CURL_FORMAT_CURL_OFF_TU
86 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
87 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
88 | #endif
89 |
90 | #ifdef CURL_FORMAT_OFF_T
91 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
92 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
93 | #endif
94 |
95 | #ifdef CURL_SIZEOF_CURL_OFF_T
96 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
97 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
98 | #endif
99 |
100 | #ifdef CURL_SUFFIX_CURL_OFF_T
101 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
102 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
103 | #endif
104 |
105 | #ifdef CURL_SUFFIX_CURL_OFF_TU
106 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
107 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
108 | #endif
109 |
110 | /* ================================================================ */
111 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
112 | /* ================================================================ */
113 |
114 | /* Configure process defines this to 1 when it finds out that system */
115 | /* header file ws2tcpip.h must be included by the external interface. */
116 | #cmakedefine CURL_PULL_WS2TCPIP_H
117 | #ifdef CURL_PULL_WS2TCPIP_H
118 | # ifndef WIN32_LEAN_AND_MEAN
119 | # define WIN32_LEAN_AND_MEAN
120 | # endif
121 | # include
122 | # include
123 | # include
124 | #endif
125 |
126 | /* Configure process defines this to 1 when it finds out that system */
127 | /* header file sys/types.h must be included by the external interface. */
128 | #cmakedefine CURL_PULL_SYS_TYPES_H
129 | #ifdef CURL_PULL_SYS_TYPES_H
130 | # include
131 | #endif
132 |
133 | /* Configure process defines this to 1 when it finds out that system */
134 | /* header file stdint.h must be included by the external interface. */
135 | #cmakedefine CURL_PULL_STDINT_H
136 | #ifdef CURL_PULL_STDINT_H
137 | # include
138 | #endif
139 |
140 | /* Configure process defines this to 1 when it finds out that system */
141 | /* header file inttypes.h must be included by the external interface. */
142 | #cmakedefine CURL_PULL_INTTYPES_H
143 | #ifdef CURL_PULL_INTTYPES_H
144 | # include
145 | #endif
146 |
147 | /* Configure process defines this to 1 when it finds out that system */
148 | /* header file sys/socket.h must be included by the external interface. */
149 | #cmakedefine CURL_PULL_SYS_SOCKET_H
150 | #ifdef CURL_PULL_SYS_SOCKET_H
151 | # include
152 | #endif
153 |
154 | /* Configure process defines this to 1 when it finds out that system */
155 | /* header file sys/poll.h must be included by the external interface. */
156 | #cmakedefine CURL_PULL_SYS_POLL_H
157 | #ifdef CURL_PULL_SYS_POLL_H
158 | # include
159 | #endif
160 |
161 | /* The size of `long', as computed by sizeof. */
162 | #define CURL_SIZEOF_LONG ${CURL_SIZEOF_LONG}
163 |
164 | /* Integral data type used for curl_socklen_t. */
165 | #define CURL_TYPEOF_CURL_SOCKLEN_T ${CURL_TYPEOF_CURL_SOCKLEN_T}
166 |
167 | /* The size of `curl_socklen_t', as computed by sizeof. */
168 | #define CURL_SIZEOF_CURL_SOCKLEN_T ${CURL_SIZEOF_CURL_SOCKLEN_T}
169 |
170 | /* Data type definition of curl_socklen_t. */
171 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
172 |
173 | /* Signed integral data type used for curl_off_t. */
174 | #define CURL_TYPEOF_CURL_OFF_T ${CURL_TYPEOF_CURL_OFF_T}
175 |
176 | /* Data type definition of curl_off_t. */
177 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
178 |
179 | /* curl_off_t formatting string directive without "%" conversion specifier. */
180 | #define CURL_FORMAT_CURL_OFF_T "${CURL_FORMAT_CURL_OFF_T}"
181 |
182 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
183 | #define CURL_FORMAT_CURL_OFF_TU "${CURL_FORMAT_CURL_OFF_TU}"
184 |
185 | /* curl_off_t formatting string directive with "%" conversion specifier. */
186 | #define CURL_FORMAT_OFF_T "${CURL_FORMAT_OFF_T}"
187 |
188 | /* The size of `curl_off_t', as computed by sizeof. */
189 | #define CURL_SIZEOF_CURL_OFF_T ${CURL_SIZEOF_CURL_OFF_T}
190 |
191 | /* curl_off_t constant suffix. */
192 | #define CURL_SUFFIX_CURL_OFF_T ${CURL_SUFFIX_CURL_OFF_T}
193 |
194 | /* unsigned curl_off_t constant suffix. */
195 | #define CURL_SUFFIX_CURL_OFF_TU ${CURL_SUFFIX_CURL_OFF_TU}
196 |
197 | #endif /* __CURL_CURLBUILD_H */
198 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/curlbuild.h.in:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLBUILD_H
2 | #define __CURL_CURLBUILD_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * Nothing in this file is intended to be modified or adjusted by the
34 | * curl library user nor by the curl library builder.
35 | *
36 | * If you think that something actually needs to be changed, adjusted
37 | * or fixed in this file, then, report it on the libcurl development
38 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
39 | *
40 | * This header file shall only export symbols which are 'curl' or 'CURL'
41 | * prefixed, otherwise public name space would be polluted.
42 | *
43 | * NOTE 2:
44 | * -------
45 | *
46 | * Right now you might be staring at file include/curl/curlbuild.h.in or
47 | * at file include/curl/curlbuild.h, this is due to the following reason:
48 | *
49 | * On systems capable of running the configure script, the configure process
50 | * will overwrite the distributed include/curl/curlbuild.h file with one that
51 | * is suitable and specific to the library being configured and built, which
52 | * is generated from the include/curl/curlbuild.h.in template file.
53 | *
54 | */
55 |
56 | /* ================================================================ */
57 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
58 | /* ================================================================ */
59 |
60 | #ifdef CURL_SIZEOF_LONG
61 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
62 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
63 | #endif
64 |
65 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
66 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
67 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
68 | #endif
69 |
70 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
71 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
72 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
73 | #endif
74 |
75 | #ifdef CURL_TYPEOF_CURL_OFF_T
76 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
77 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
78 | #endif
79 |
80 | #ifdef CURL_FORMAT_CURL_OFF_T
81 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
82 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
83 | #endif
84 |
85 | #ifdef CURL_FORMAT_CURL_OFF_TU
86 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
87 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
88 | #endif
89 |
90 | #ifdef CURL_FORMAT_OFF_T
91 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
92 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
93 | #endif
94 |
95 | #ifdef CURL_SIZEOF_CURL_OFF_T
96 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
97 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
98 | #endif
99 |
100 | #ifdef CURL_SUFFIX_CURL_OFF_T
101 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
102 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
103 | #endif
104 |
105 | #ifdef CURL_SUFFIX_CURL_OFF_TU
106 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
107 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
108 | #endif
109 |
110 | /* ================================================================ */
111 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
112 | /* ================================================================ */
113 |
114 | /* Configure process defines this to 1 when it finds out that system */
115 | /* header file ws2tcpip.h must be included by the external interface. */
116 | #undef CURL_PULL_WS2TCPIP_H
117 | #ifdef CURL_PULL_WS2TCPIP_H
118 | # ifndef WIN32_LEAN_AND_MEAN
119 | # define WIN32_LEAN_AND_MEAN
120 | # endif
121 | # include
122 | # include
123 | # include
124 | #endif
125 |
126 | /* Configure process defines this to 1 when it finds out that system */
127 | /* header file sys/types.h must be included by the external interface. */
128 | #undef CURL_PULL_SYS_TYPES_H
129 | #ifdef CURL_PULL_SYS_TYPES_H
130 | # include
131 | #endif
132 |
133 | /* Configure process defines this to 1 when it finds out that system */
134 | /* header file stdint.h must be included by the external interface. */
135 | #undef CURL_PULL_STDINT_H
136 | #ifdef CURL_PULL_STDINT_H
137 | # include
138 | #endif
139 |
140 | /* Configure process defines this to 1 when it finds out that system */
141 | /* header file inttypes.h must be included by the external interface. */
142 | #undef CURL_PULL_INTTYPES_H
143 | #ifdef CURL_PULL_INTTYPES_H
144 | # include
145 | #endif
146 |
147 | /* Configure process defines this to 1 when it finds out that system */
148 | /* header file sys/socket.h must be included by the external interface. */
149 | #undef CURL_PULL_SYS_SOCKET_H
150 | #ifdef CURL_PULL_SYS_SOCKET_H
151 | # include
152 | #endif
153 |
154 | /* Configure process defines this to 1 when it finds out that system */
155 | /* header file sys/poll.h must be included by the external interface. */
156 | #undef CURL_PULL_SYS_POLL_H
157 | #ifdef CURL_PULL_SYS_POLL_H
158 | # include
159 | #endif
160 |
161 | /* The size of `long', as computed by sizeof. */
162 | #undef CURL_SIZEOF_LONG
163 |
164 | /* Integral data type used for curl_socklen_t. */
165 | #undef CURL_TYPEOF_CURL_SOCKLEN_T
166 |
167 | /* The size of `curl_socklen_t', as computed by sizeof. */
168 | #undef CURL_SIZEOF_CURL_SOCKLEN_T
169 |
170 | /* Data type definition of curl_socklen_t. */
171 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
172 |
173 | /* Signed integral data type used for curl_off_t. */
174 | #undef CURL_TYPEOF_CURL_OFF_T
175 |
176 | /* Data type definition of curl_off_t. */
177 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
178 |
179 | /* curl_off_t formatting string directive without "%" conversion specifier. */
180 | #undef CURL_FORMAT_CURL_OFF_T
181 |
182 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
183 | #undef CURL_FORMAT_CURL_OFF_TU
184 |
185 | /* curl_off_t formatting string directive with "%" conversion specifier. */
186 | #undef CURL_FORMAT_OFF_T
187 |
188 | /* The size of `curl_off_t', as computed by sizeof. */
189 | #undef CURL_SIZEOF_CURL_OFF_T
190 |
191 | /* curl_off_t constant suffix. */
192 | #undef CURL_SUFFIX_CURL_OFF_T
193 |
194 | /* unsigned curl_off_t constant suffix. */
195 | #undef CURL_SUFFIX_CURL_OFF_TU
196 |
197 | #endif /* __CURL_CURLBUILD_H */
198 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/curlrules.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLRULES_H
2 | #define __CURL_CURLRULES_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* COMPILE TIME SANITY CHECKS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * All checks done in this file are intentionally placed in a public
34 | * header file which is pulled by curl/curl.h when an application is
35 | * being built using an already built libcurl library. Additionally
36 | * this file is also included and used when building the library.
37 | *
38 | * If compilation fails on this file it is certainly sure that the
39 | * problem is elsewhere. It could be a problem in the curlbuild.h
40 | * header file, or simply that you are using different compilation
41 | * settings than those used to build the library.
42 | *
43 | * Nothing in this file is intended to be modified or adjusted by the
44 | * curl library user nor by the curl library builder.
45 | *
46 | * Do not deactivate any check, these are done to make sure that the
47 | * library is properly built and used.
48 | *
49 | * You can find further help on the libcurl development mailing list:
50 | * https://cool.haxx.se/mailman/listinfo/curl-library/
51 | *
52 | * NOTE 2
53 | * ------
54 | *
55 | * Some of the following compile time checks are based on the fact
56 | * that the dimension of a constant array can not be a negative one.
57 | * In this way if the compile time verification fails, the compilation
58 | * will fail issuing an error. The error description wording is compiler
59 | * dependent but it will be quite similar to one of the following:
60 | *
61 | * "negative subscript or subscript is too large"
62 | * "array must have at least one element"
63 | * "-1 is an illegal array size"
64 | * "size of array is negative"
65 | *
66 | * If you are building an application which tries to use an already
67 | * built libcurl library and you are getting this kind of errors on
68 | * this file, it is a clear indication that there is a mismatch between
69 | * how the library was built and how you are trying to use it for your
70 | * application. Your already compiled or binary library provider is the
71 | * only one who can give you the details you need to properly use it.
72 | */
73 |
74 | /*
75 | * Verify that some macros are actually defined.
76 | */
77 |
78 | #ifndef CURL_SIZEOF_LONG
79 | # error "CURL_SIZEOF_LONG definition is missing!"
80 | Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
81 | #endif
82 |
83 | #ifndef CURL_TYPEOF_CURL_SOCKLEN_T
84 | # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
85 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
86 | #endif
87 |
88 | #ifndef CURL_SIZEOF_CURL_SOCKLEN_T
89 | # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
90 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
91 | #endif
92 |
93 | #ifndef CURL_TYPEOF_CURL_OFF_T
94 | # error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
95 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
96 | #endif
97 |
98 | #ifndef CURL_FORMAT_CURL_OFF_T
99 | # error "CURL_FORMAT_CURL_OFF_T definition is missing!"
100 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
101 | #endif
102 |
103 | #ifndef CURL_FORMAT_CURL_OFF_TU
104 | # error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
105 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
106 | #endif
107 |
108 | #ifndef CURL_FORMAT_OFF_T
109 | # error "CURL_FORMAT_OFF_T definition is missing!"
110 | Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
111 | #endif
112 |
113 | #ifndef CURL_SIZEOF_CURL_OFF_T
114 | # error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
115 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
116 | #endif
117 |
118 | #ifndef CURL_SUFFIX_CURL_OFF_T
119 | # error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
120 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
121 | #endif
122 |
123 | #ifndef CURL_SUFFIX_CURL_OFF_TU
124 | # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
125 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
126 | #endif
127 |
128 | /*
129 | * Macros private to this header file.
130 | */
131 |
132 | #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
133 |
134 | #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
135 |
136 | /*
137 | * Verify that the size previously defined and expected for long
138 | * is the same as the one reported by sizeof() at compile time.
139 | */
140 |
141 | typedef char
142 | __curl_rule_01__
143 | [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
144 |
145 | /*
146 | * Verify that the size previously defined and expected for
147 | * curl_off_t is actually the the same as the one reported
148 | * by sizeof() at compile time.
149 | */
150 |
151 | typedef char
152 | __curl_rule_02__
153 | [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
154 |
155 | /*
156 | * Verify at compile time that the size of curl_off_t as reported
157 | * by sizeof() is greater or equal than the one reported for long
158 | * for the current compilation.
159 | */
160 |
161 | typedef char
162 | __curl_rule_03__
163 | [CurlchkszGE(curl_off_t, long)];
164 |
165 | /*
166 | * Verify that the size previously defined and expected for
167 | * curl_socklen_t is actually the the same as the one reported
168 | * by sizeof() at compile time.
169 | */
170 |
171 | typedef char
172 | __curl_rule_04__
173 | [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
174 |
175 | /*
176 | * Verify at compile time that the size of curl_socklen_t as reported
177 | * by sizeof() is greater or equal than the one reported for int for
178 | * the current compilation.
179 | */
180 |
181 | typedef char
182 | __curl_rule_05__
183 | [CurlchkszGE(curl_socklen_t, int)];
184 |
185 | /* ================================================================ */
186 | /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
187 | /* ================================================================ */
188 |
189 | /*
190 | * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
191 | * these to be visible and exported by the external libcurl interface API,
192 | * while also making them visible to the library internals, simply including
193 | * curl_setup.h, without actually needing to include curl.h internally.
194 | * If some day this section would grow big enough, all this should be moved
195 | * to its own header file.
196 | */
197 |
198 | /*
199 | * Figure out if we can use the ## preprocessor operator, which is supported
200 | * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
201 | * or __cplusplus so we need to carefully check for them too.
202 | */
203 |
204 | #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
205 | defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
206 | defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
207 | defined(__ILEC400__)
208 | /* This compiler is believed to have an ISO compatible preprocessor */
209 | #define CURL_ISOCPP
210 | #else
211 | /* This compiler is believed NOT to have an ISO compatible preprocessor */
212 | #undef CURL_ISOCPP
213 | #endif
214 |
215 | /*
216 | * Macros for minimum-width signed and unsigned curl_off_t integer constants.
217 | */
218 |
219 | #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
220 | # define __CURL_OFF_T_C_HLPR2(x) x
221 | # define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
222 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
223 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
224 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
225 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
226 | #else
227 | # ifdef CURL_ISOCPP
228 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
229 | # else
230 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
231 | # endif
232 | # define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
233 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
234 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
235 | #endif
236 |
237 | /*
238 | * Get rid of macros private to this header file.
239 | */
240 |
241 | #undef CurlchkszEQ
242 | #undef CurlchkszGE
243 |
244 | /*
245 | * Get rid of macros not intended to exist beyond this point.
246 | */
247 |
248 | #undef CURL_PULL_WS2TCPIP_H
249 | #undef CURL_PULL_SYS_TYPES_H
250 | #undef CURL_PULL_SYS_SOCKET_H
251 | #undef CURL_PULL_SYS_POLL_H
252 | #undef CURL_PULL_STDINT_H
253 | #undef CURL_PULL_INTTYPES_H
254 |
255 | #undef CURL_TYPEOF_CURL_SOCKLEN_T
256 | #undef CURL_TYPEOF_CURL_OFF_T
257 |
258 | #ifdef CURL_NO_OLDIES
259 | #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
260 | #endif
261 |
262 | #endif /* __CURL_CURLRULES_H */
263 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/curlver.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLVER_H
2 | #define __CURL_CURLVER_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* This header file contains nothing but libcurl version info, generated by
26 | a script at release-time. This was made its own header file in 7.11.2 */
27 |
28 | /* This is the global package copyright */
29 | #define LIBCURL_COPYRIGHT "1996 - 2016 Daniel Stenberg, ."
30 |
31 | /* This is the version number of the libcurl package from which this header
32 | file origins: */
33 | #define LIBCURL_VERSION "7.50.1"
34 |
35 | /* The numeric version number is also available "in parts" by using these
36 | defines: */
37 | #define LIBCURL_VERSION_MAJOR 7
38 | #define LIBCURL_VERSION_MINOR 50
39 | #define LIBCURL_VERSION_PATCH 1
40 |
41 | /* This is the numeric version of the libcurl version number, meant for easier
42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
43 | always follow this syntax:
44 |
45 | 0xXXYYZZ
46 |
47 | Where XX, YY and ZZ are the main version, release and patch numbers in
48 | hexadecimal (using 8 bits each). All three numbers are always represented
49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7
50 | appears as "0x090b07".
51 |
52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number,
53 | and it is always a greater number in a more recent release. It makes
54 | comparisons with greater than and less than work.
55 |
56 | Note: This define is the full hex number and _does not_ use the
57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it
58 | and needs it to contain the full number.
59 | */
60 | #define LIBCURL_VERSION_NUM 0x073201
61 |
62 | /*
63 | * This is the date and time when the full source package was created. The
64 | * timestamp is not stored in git, as the timestamp is properly set in the
65 | * tarballs by the maketgz script.
66 | *
67 | * The format of the date should follow this template:
68 | *
69 | * "Mon Feb 12 11:35:33 UTC 2007"
70 | */
71 | #define LIBCURL_TIMESTAMP "Wed Aug 3 06:38:49 UTC 2016"
72 |
73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
74 | #define CURL_AT_LEAST_VERSION(x,y,z) \
75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
76 |
77 | #endif /* __CURL_CURLVER_H */
78 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/easy.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_EASY_H
2 | #define __CURL_EASY_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | CURL_EXTERN CURL *curl_easy_init(void);
29 | CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
30 | CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
31 | CURL_EXTERN void curl_easy_cleanup(CURL *curl);
32 |
33 | /*
34 | * NAME curl_easy_getinfo()
35 | *
36 | * DESCRIPTION
37 | *
38 | * Request internal information from the curl session with this function. The
39 | * third argument MUST be a pointer to a long, a pointer to a char * or a
40 | * pointer to a double (as the documentation describes elsewhere). The data
41 | * pointed to will be filled in accordingly and can be relied upon only if the
42 | * function returns CURLE_OK. This function is intended to get used *AFTER* a
43 | * performed transfer, all results from this function are undefined until the
44 | * transfer is completed.
45 | */
46 | CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
47 |
48 |
49 | /*
50 | * NAME curl_easy_duphandle()
51 | *
52 | * DESCRIPTION
53 | *
54 | * Creates a new curl session handle with the same options set for the handle
55 | * passed in. Duplicating a handle could only be a matter of cloning data and
56 | * options, internal state info and things like persistent connections cannot
57 | * be transferred. It is useful in multithreaded applications when you can run
58 | * curl_easy_duphandle() for each new thread to avoid a series of identical
59 | * curl_easy_setopt() invokes in every thread.
60 | */
61 | CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
62 |
63 | /*
64 | * NAME curl_easy_reset()
65 | *
66 | * DESCRIPTION
67 | *
68 | * Re-initializes a CURL handle to the default values. This puts back the
69 | * handle to the same state as it was in when it was just created.
70 | *
71 | * It does keep: live connections, the Session ID cache, the DNS cache and the
72 | * cookies.
73 | */
74 | CURL_EXTERN void curl_easy_reset(CURL *curl);
75 |
76 | /*
77 | * NAME curl_easy_recv()
78 | *
79 | * DESCRIPTION
80 | *
81 | * Receives data from the connected socket. Use after successful
82 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
83 | */
84 | CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
85 | size_t *n);
86 |
87 | /*
88 | * NAME curl_easy_send()
89 | *
90 | * DESCRIPTION
91 | *
92 | * Sends data over the connected socket. Use after successful
93 | * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
94 | */
95 | CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
96 | size_t buflen, size_t *n);
97 |
98 | #ifdef __cplusplus
99 | }
100 | #endif
101 |
102 | #endif
103 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/mprintf.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_MPRINTF_H
2 | #define __CURL_MPRINTF_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 | #include /* needed for FILE */
27 | #include "curl.h" /* for CURL_EXTERN */
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | CURL_EXTERN int curl_mprintf(const char *format, ...);
34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
37 | const char *format, ...);
38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
42 | const char *format, va_list args);
43 | CURL_EXTERN char *curl_maprintf(const char *format, ...);
44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif /* __CURL_MPRINTF_H */
51 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/multi.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_MULTI_H
2 | #define __CURL_MULTI_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 | /*
25 | This is an "external" header file. Don't give away any internals here!
26 |
27 | GOALS
28 |
29 | o Enable a "pull" interface. The application that uses libcurl decides where
30 | and when to ask libcurl to get/send data.
31 |
32 | o Enable multiple simultaneous transfers in the same thread without making it
33 | complicated for the application.
34 |
35 | o Enable the application to select() on its own file descriptors and curl's
36 | file descriptors simultaneous easily.
37 |
38 | */
39 |
40 | /*
41 | * This header file should not really need to include "curl.h" since curl.h
42 | * itself includes this file and we expect user applications to do #include
43 | * without the need for especially including multi.h.
44 | *
45 | * For some reason we added this include here at one point, and rather than to
46 | * break existing (wrongly written) libcurl applications, we leave it as-is
47 | * but with this warning attached.
48 | */
49 | #include "curl.h"
50 |
51 | #ifdef __cplusplus
52 | extern "C" {
53 | #endif
54 |
55 | #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
56 | typedef struct Curl_multi CURLM;
57 | #else
58 | typedef void CURLM;
59 | #endif
60 |
61 | typedef enum {
62 | CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
63 | curl_multi_socket*() soon */
64 | CURLM_OK,
65 | CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
66 | CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
67 | CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
68 | CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
69 | CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
70 | CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
71 | CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
72 | attempted to get added - again */
73 | CURLM_LAST
74 | } CURLMcode;
75 |
76 | /* just to make code nicer when using curl_multi_socket() you can now check
77 | for CURLM_CALL_MULTI_SOCKET too in the same style it works for
78 | curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
79 | #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
80 |
81 | /* bitmask bits for CURLMOPT_PIPELINING */
82 | #define CURLPIPE_NOTHING 0L
83 | #define CURLPIPE_HTTP1 1L
84 | #define CURLPIPE_MULTIPLEX 2L
85 |
86 | typedef enum {
87 | CURLMSG_NONE, /* first, not used */
88 | CURLMSG_DONE, /* This easy handle has completed. 'result' contains
89 | the CURLcode of the transfer */
90 | CURLMSG_LAST /* last, not used */
91 | } CURLMSG;
92 |
93 | struct CURLMsg {
94 | CURLMSG msg; /* what this message means */
95 | CURL *easy_handle; /* the handle it concerns */
96 | union {
97 | void *whatever; /* message-specific data */
98 | CURLcode result; /* return code for transfer */
99 | } data;
100 | };
101 | typedef struct CURLMsg CURLMsg;
102 |
103 | /* Based on poll(2) structure and values.
104 | * We don't use pollfd and POLL* constants explicitly
105 | * to cover platforms without poll(). */
106 | #define CURL_WAIT_POLLIN 0x0001
107 | #define CURL_WAIT_POLLPRI 0x0002
108 | #define CURL_WAIT_POLLOUT 0x0004
109 |
110 | struct curl_waitfd {
111 | curl_socket_t fd;
112 | short events;
113 | short revents; /* not supported yet */
114 | };
115 |
116 | /*
117 | * Name: curl_multi_init()
118 | *
119 | * Desc: inititalize multi-style curl usage
120 | *
121 | * Returns: a new CURLM handle to use in all 'curl_multi' functions.
122 | */
123 | CURL_EXTERN CURLM *curl_multi_init(void);
124 |
125 | /*
126 | * Name: curl_multi_add_handle()
127 | *
128 | * Desc: add a standard curl handle to the multi stack
129 | *
130 | * Returns: CURLMcode type, general multi error code.
131 | */
132 | CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
133 | CURL *curl_handle);
134 |
135 | /*
136 | * Name: curl_multi_remove_handle()
137 | *
138 | * Desc: removes a curl handle from the multi stack again
139 | *
140 | * Returns: CURLMcode type, general multi error code.
141 | */
142 | CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
143 | CURL *curl_handle);
144 |
145 | /*
146 | * Name: curl_multi_fdset()
147 | *
148 | * Desc: Ask curl for its fd_set sets. The app can use these to select() or
149 | * poll() on. We want curl_multi_perform() called as soon as one of
150 | * them are ready.
151 | *
152 | * Returns: CURLMcode type, general multi error code.
153 | */
154 | CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
155 | fd_set *read_fd_set,
156 | fd_set *write_fd_set,
157 | fd_set *exc_fd_set,
158 | int *max_fd);
159 |
160 | /*
161 | * Name: curl_multi_wait()
162 | *
163 | * Desc: Poll on all fds within a CURLM set as well as any
164 | * additional fds passed to the function.
165 | *
166 | * Returns: CURLMcode type, general multi error code.
167 | */
168 | CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
169 | struct curl_waitfd extra_fds[],
170 | unsigned int extra_nfds,
171 | int timeout_ms,
172 | int *ret);
173 |
174 | /*
175 | * Name: curl_multi_perform()
176 | *
177 | * Desc: When the app thinks there's data available for curl it calls this
178 | * function to read/write whatever there is right now. This returns
179 | * as soon as the reads and writes are done. This function does not
180 | * require that there actually is data available for reading or that
181 | * data can be written, it can be called just in case. It returns
182 | * the number of handles that still transfer data in the second
183 | * argument's integer-pointer.
184 | *
185 | * Returns: CURLMcode type, general multi error code. *NOTE* that this only
186 | * returns errors etc regarding the whole multi stack. There might
187 | * still have occurred problems on invidual transfers even when this
188 | * returns OK.
189 | */
190 | CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
191 | int *running_handles);
192 |
193 | /*
194 | * Name: curl_multi_cleanup()
195 | *
196 | * Desc: Cleans up and removes a whole multi stack. It does not free or
197 | * touch any individual easy handles in any way. We need to define
198 | * in what state those handles will be if this function is called
199 | * in the middle of a transfer.
200 | *
201 | * Returns: CURLMcode type, general multi error code.
202 | */
203 | CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
204 |
205 | /*
206 | * Name: curl_multi_info_read()
207 | *
208 | * Desc: Ask the multi handle if there's any messages/informationals from
209 | * the individual transfers. Messages include informationals such as
210 | * error code from the transfer or just the fact that a transfer is
211 | * completed. More details on these should be written down as well.
212 | *
213 | * Repeated calls to this function will return a new struct each
214 | * time, until a special "end of msgs" struct is returned as a signal
215 | * that there is no more to get at this point.
216 | *
217 | * The data the returned pointer points to will not survive calling
218 | * curl_multi_cleanup().
219 | *
220 | * The 'CURLMsg' struct is meant to be very simple and only contain
221 | * very basic informations. If more involved information is wanted,
222 | * we will provide the particular "transfer handle" in that struct
223 | * and that should/could/would be used in subsequent
224 | * curl_easy_getinfo() calls (or similar). The point being that we
225 | * must never expose complex structs to applications, as then we'll
226 | * undoubtably get backwards compatibility problems in the future.
227 | *
228 | * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
229 | * of structs. It also writes the number of messages left in the
230 | * queue (after this read) in the integer the second argument points
231 | * to.
232 | */
233 | CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
234 | int *msgs_in_queue);
235 |
236 | /*
237 | * Name: curl_multi_strerror()
238 | *
239 | * Desc: The curl_multi_strerror function may be used to turn a CURLMcode
240 | * value into the equivalent human readable error string. This is
241 | * useful for printing meaningful error messages.
242 | *
243 | * Returns: A pointer to a zero-terminated error message.
244 | */
245 | CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
246 |
247 | /*
248 | * Name: curl_multi_socket() and
249 | * curl_multi_socket_all()
250 | *
251 | * Desc: An alternative version of curl_multi_perform() that allows the
252 | * application to pass in one of the file descriptors that have been
253 | * detected to have "action" on them and let libcurl perform.
254 | * See man page for details.
255 | */
256 | #define CURL_POLL_NONE 0
257 | #define CURL_POLL_IN 1
258 | #define CURL_POLL_OUT 2
259 | #define CURL_POLL_INOUT 3
260 | #define CURL_POLL_REMOVE 4
261 |
262 | #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
263 |
264 | #define CURL_CSELECT_IN 0x01
265 | #define CURL_CSELECT_OUT 0x02
266 | #define CURL_CSELECT_ERR 0x04
267 |
268 | typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
269 | curl_socket_t s, /* socket */
270 | int what, /* see above */
271 | void *userp, /* private callback
272 | pointer */
273 | void *socketp); /* private socket
274 | pointer */
275 | /*
276 | * Name: curl_multi_timer_callback
277 | *
278 | * Desc: Called by libcurl whenever the library detects a change in the
279 | * maximum number of milliseconds the app is allowed to wait before
280 | * curl_multi_socket() or curl_multi_perform() must be called
281 | * (to allow libcurl's timed events to take place).
282 | *
283 | * Returns: The callback should return zero.
284 | */
285 | typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
286 | long timeout_ms, /* see above */
287 | void *userp); /* private callback
288 | pointer */
289 |
290 | CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
291 | int *running_handles);
292 |
293 | CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
294 | curl_socket_t s,
295 | int ev_bitmask,
296 | int *running_handles);
297 |
298 | CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
299 | int *running_handles);
300 |
301 | #ifndef CURL_ALLOW_OLD_MULTI_SOCKET
302 | /* This macro below was added in 7.16.3 to push users who recompile to use
303 | the new curl_multi_socket_action() instead of the old curl_multi_socket()
304 | */
305 | #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
306 | #endif
307 |
308 | /*
309 | * Name: curl_multi_timeout()
310 | *
311 | * Desc: Returns the maximum number of milliseconds the app is allowed to
312 | * wait before curl_multi_socket() or curl_multi_perform() must be
313 | * called (to allow libcurl's timed events to take place).
314 | *
315 | * Returns: CURLM error code.
316 | */
317 | CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
318 | long *milliseconds);
319 |
320 | #undef CINIT /* re-using the same name as in curl.h */
321 |
322 | #ifdef CURL_ISOCPP
323 | #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
324 | #else
325 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
326 | #define LONG CURLOPTTYPE_LONG
327 | #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
328 | #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
329 | #define OFF_T CURLOPTTYPE_OFF_T
330 | #define CINIT(name,type,number) CURLMOPT_/**/name = type + number
331 | #endif
332 |
333 | typedef enum {
334 | /* This is the socket callback function pointer */
335 | CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
336 |
337 | /* This is the argument passed to the socket callback */
338 | CINIT(SOCKETDATA, OBJECTPOINT, 2),
339 |
340 | /* set to 1 to enable pipelining for this multi handle */
341 | CINIT(PIPELINING, LONG, 3),
342 |
343 | /* This is the timer callback function pointer */
344 | CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
345 |
346 | /* This is the argument passed to the timer callback */
347 | CINIT(TIMERDATA, OBJECTPOINT, 5),
348 |
349 | /* maximum number of entries in the connection cache */
350 | CINIT(MAXCONNECTS, LONG, 6),
351 |
352 | /* maximum number of (pipelining) connections to one host */
353 | CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
354 |
355 | /* maximum number of requests in a pipeline */
356 | CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
357 |
358 | /* a connection with a content-length longer than this
359 | will not be considered for pipelining */
360 | CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
361 |
362 | /* a connection with a chunk length longer than this
363 | will not be considered for pipelining */
364 | CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
365 |
366 | /* a list of site names(+port) that are blacklisted from
367 | pipelining */
368 | CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
369 |
370 | /* a list of server types that are blacklisted from
371 | pipelining */
372 | CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
373 |
374 | /* maximum number of open connections in total */
375 | CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
376 |
377 | /* This is the server push callback function pointer */
378 | CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
379 |
380 | /* This is the argument passed to the server push callback */
381 | CINIT(PUSHDATA, OBJECTPOINT, 15),
382 |
383 | CURLMOPT_LASTENTRY /* the last unused */
384 | } CURLMoption;
385 |
386 |
387 | /*
388 | * Name: curl_multi_setopt()
389 | *
390 | * Desc: Sets options for the multi handle.
391 | *
392 | * Returns: CURLM error code.
393 | */
394 | CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
395 | CURLMoption option, ...);
396 |
397 |
398 | /*
399 | * Name: curl_multi_assign()
400 | *
401 | * Desc: This function sets an association in the multi handle between the
402 | * given socket and a private pointer of the application. This is
403 | * (only) useful for curl_multi_socket uses.
404 | *
405 | * Returns: CURLM error code.
406 | */
407 | CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
408 | curl_socket_t sockfd, void *sockp);
409 |
410 |
411 | /*
412 | * Name: curl_push_callback
413 | *
414 | * Desc: This callback gets called when a new stream is being pushed by the
415 | * server. It approves or denies the new stream.
416 | *
417 | * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
418 | */
419 | #define CURL_PUSH_OK 0
420 | #define CURL_PUSH_DENY 1
421 |
422 | struct curl_pushheaders; /* forward declaration only */
423 |
424 | CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
425 | size_t num);
426 | CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
427 | const char *name);
428 |
429 | typedef int (*curl_push_callback)(CURL *parent,
430 | CURL *easy,
431 | size_t num_headers,
432 | struct curl_pushheaders *headers,
433 | void *userp);
434 |
435 | #ifdef __cplusplus
436 | } /* end of extern "C" */
437 | #endif
438 |
439 | #endif
440 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/stamp-h2:
--------------------------------------------------------------------------------
1 | timestamp for include/curl/curlbuild.h
2 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/stdcheaders.h:
--------------------------------------------------------------------------------
1 | #ifndef __STDC_HEADERS_H
2 | #define __STDC_HEADERS_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 |
27 | size_t fread (void *, size_t, size_t, FILE *);
28 | size_t fwrite (const void *, size_t, size_t, FILE *);
29 |
30 | int strcasecmp(const char *, const char *);
31 | int strncasecmp(const char *, const char *, size_t);
32 |
33 | #endif /* __STDC_HEADERS_H */
34 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl/typecheck-gcc.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_TYPECHECK_GCC_H
2 | #define __CURL_TYPECHECK_GCC_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* wraps curl_easy_setopt() with typechecking */
26 |
27 | /* To add a new kind of warning, add an
28 | * if(_curl_is_sometype_option(_curl_opt))
29 | * if(!_curl_is_sometype(value))
30 | * _curl_easy_setopt_err_sometype();
31 | * block and define _curl_is_sometype_option, _curl_is_sometype and
32 | * _curl_easy_setopt_err_sometype below
33 | *
34 | * NOTE: We use two nested 'if' statements here instead of the && operator, in
35 | * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
36 | * when compiling with -Wlogical-op.
37 | *
38 | * To add an option that uses the same type as an existing option, you'll just
39 | * need to extend the appropriate _curl_*_option macro
40 | */
41 | #define curl_easy_setopt(handle, option, value) \
42 | __extension__ ({ \
43 | __typeof__ (option) _curl_opt = option; \
44 | if(__builtin_constant_p(_curl_opt)) { \
45 | if(_curl_is_long_option(_curl_opt)) \
46 | if(!_curl_is_long(value)) \
47 | _curl_easy_setopt_err_long(); \
48 | if(_curl_is_off_t_option(_curl_opt)) \
49 | if(!_curl_is_off_t(value)) \
50 | _curl_easy_setopt_err_curl_off_t(); \
51 | if(_curl_is_string_option(_curl_opt)) \
52 | if(!_curl_is_string(value)) \
53 | _curl_easy_setopt_err_string(); \
54 | if(_curl_is_write_cb_option(_curl_opt)) \
55 | if(!_curl_is_write_cb(value)) \
56 | _curl_easy_setopt_err_write_callback(); \
57 | if((_curl_opt) == CURLOPT_READFUNCTION) \
58 | if(!_curl_is_read_cb(value)) \
59 | _curl_easy_setopt_err_read_cb(); \
60 | if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
61 | if(!_curl_is_ioctl_cb(value)) \
62 | _curl_easy_setopt_err_ioctl_cb(); \
63 | if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
64 | if(!_curl_is_sockopt_cb(value)) \
65 | _curl_easy_setopt_err_sockopt_cb(); \
66 | if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
67 | if(!_curl_is_opensocket_cb(value)) \
68 | _curl_easy_setopt_err_opensocket_cb(); \
69 | if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
70 | if(!_curl_is_progress_cb(value)) \
71 | _curl_easy_setopt_err_progress_cb(); \
72 | if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
73 | if(!_curl_is_debug_cb(value)) \
74 | _curl_easy_setopt_err_debug_cb(); \
75 | if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
76 | if(!_curl_is_ssl_ctx_cb(value)) \
77 | _curl_easy_setopt_err_ssl_ctx_cb(); \
78 | if(_curl_is_conv_cb_option(_curl_opt)) \
79 | if(!_curl_is_conv_cb(value)) \
80 | _curl_easy_setopt_err_conv_cb(); \
81 | if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
82 | if(!_curl_is_seek_cb(value)) \
83 | _curl_easy_setopt_err_seek_cb(); \
84 | if(_curl_is_cb_data_option(_curl_opt)) \
85 | if(!_curl_is_cb_data(value)) \
86 | _curl_easy_setopt_err_cb_data(); \
87 | if((_curl_opt) == CURLOPT_ERRORBUFFER) \
88 | if(!_curl_is_error_buffer(value)) \
89 | _curl_easy_setopt_err_error_buffer(); \
90 | if((_curl_opt) == CURLOPT_STDERR) \
91 | if(!_curl_is_FILE(value)) \
92 | _curl_easy_setopt_err_FILE(); \
93 | if(_curl_is_postfields_option(_curl_opt)) \
94 | if(!_curl_is_postfields(value)) \
95 | _curl_easy_setopt_err_postfields(); \
96 | if((_curl_opt) == CURLOPT_HTTPPOST) \
97 | if(!_curl_is_arr((value), struct curl_httppost)) \
98 | _curl_easy_setopt_err_curl_httpost(); \
99 | if(_curl_is_slist_option(_curl_opt)) \
100 | if(!_curl_is_arr((value), struct curl_slist)) \
101 | _curl_easy_setopt_err_curl_slist(); \
102 | if((_curl_opt) == CURLOPT_SHARE) \
103 | if(!_curl_is_ptr((value), CURLSH)) \
104 | _curl_easy_setopt_err_CURLSH(); \
105 | } \
106 | curl_easy_setopt(handle, _curl_opt, value); \
107 | })
108 |
109 | /* wraps curl_easy_getinfo() with typechecking */
110 | /* FIXME: don't allow const pointers */
111 | #define curl_easy_getinfo(handle, info, arg) \
112 | __extension__ ({ \
113 | __typeof__ (info) _curl_info = info; \
114 | if(__builtin_constant_p(_curl_info)) { \
115 | if(_curl_is_string_info(_curl_info)) \
116 | if(!_curl_is_arr((arg), char *)) \
117 | _curl_easy_getinfo_err_string(); \
118 | if(_curl_is_long_info(_curl_info)) \
119 | if(!_curl_is_arr((arg), long)) \
120 | _curl_easy_getinfo_err_long(); \
121 | if(_curl_is_double_info(_curl_info)) \
122 | if(!_curl_is_arr((arg), double)) \
123 | _curl_easy_getinfo_err_double(); \
124 | if(_curl_is_slist_info(_curl_info)) \
125 | if(!_curl_is_arr((arg), struct curl_slist *)) \
126 | _curl_easy_getinfo_err_curl_slist(); \
127 | } \
128 | curl_easy_getinfo(handle, _curl_info, arg); \
129 | })
130 |
131 | /* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
132 | * for now just make sure that the functions are called with three
133 | * arguments
134 | */
135 | #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
136 | #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
137 |
138 |
139 | /* the actual warnings, triggered by calling the _curl_easy_setopt_err*
140 | * functions */
141 |
142 | /* To define a new warning, use _CURL_WARNING(identifier, "message") */
143 | #define _CURL_WARNING(id, message) \
144 | static void __attribute__((__warning__(message))) \
145 | __attribute__((__unused__)) __attribute__((__noinline__)) \
146 | id(void) { __asm__(""); }
147 |
148 | _CURL_WARNING(_curl_easy_setopt_err_long,
149 | "curl_easy_setopt expects a long argument for this option")
150 | _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
151 | "curl_easy_setopt expects a curl_off_t argument for this option")
152 | _CURL_WARNING(_curl_easy_setopt_err_string,
153 | "curl_easy_setopt expects a "
154 | "string (char* or char[]) argument for this option"
155 | )
156 | _CURL_WARNING(_curl_easy_setopt_err_write_callback,
157 | "curl_easy_setopt expects a curl_write_callback argument for this option")
158 | _CURL_WARNING(_curl_easy_setopt_err_read_cb,
159 | "curl_easy_setopt expects a curl_read_callback argument for this option")
160 | _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
161 | "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
162 | _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
163 | "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
164 | _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
165 | "curl_easy_setopt expects a "
166 | "curl_opensocket_callback argument for this option"
167 | )
168 | _CURL_WARNING(_curl_easy_setopt_err_progress_cb,
169 | "curl_easy_setopt expects a curl_progress_callback argument for this option")
170 | _CURL_WARNING(_curl_easy_setopt_err_debug_cb,
171 | "curl_easy_setopt expects a curl_debug_callback argument for this option")
172 | _CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
173 | "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
174 | _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
175 | "curl_easy_setopt expects a curl_conv_callback argument for this option")
176 | _CURL_WARNING(_curl_easy_setopt_err_seek_cb,
177 | "curl_easy_setopt expects a curl_seek_callback argument for this option")
178 | _CURL_WARNING(_curl_easy_setopt_err_cb_data,
179 | "curl_easy_setopt expects a "
180 | "private data pointer as argument for this option")
181 | _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
182 | "curl_easy_setopt expects a "
183 | "char buffer of CURL_ERROR_SIZE as argument for this option")
184 | _CURL_WARNING(_curl_easy_setopt_err_FILE,
185 | "curl_easy_setopt expects a FILE* argument for this option")
186 | _CURL_WARNING(_curl_easy_setopt_err_postfields,
187 | "curl_easy_setopt expects a void* or char* argument for this option")
188 | _CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
189 | "curl_easy_setopt expects a struct curl_httppost* argument for this option")
190 | _CURL_WARNING(_curl_easy_setopt_err_curl_slist,
191 | "curl_easy_setopt expects a struct curl_slist* argument for this option")
192 | _CURL_WARNING(_curl_easy_setopt_err_CURLSH,
193 | "curl_easy_setopt expects a CURLSH* argument for this option")
194 |
195 | _CURL_WARNING(_curl_easy_getinfo_err_string,
196 | "curl_easy_getinfo expects a pointer to char * for this info")
197 | _CURL_WARNING(_curl_easy_getinfo_err_long,
198 | "curl_easy_getinfo expects a pointer to long for this info")
199 | _CURL_WARNING(_curl_easy_getinfo_err_double,
200 | "curl_easy_getinfo expects a pointer to double for this info")
201 | _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
202 | "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
203 |
204 | /* groups of curl_easy_setops options that take the same type of argument */
205 |
206 | /* To add a new option to one of the groups, just add
207 | * (option) == CURLOPT_SOMETHING
208 | * to the or-expression. If the option takes a long or curl_off_t, you don't
209 | * have to do anything
210 | */
211 |
212 | /* evaluates to true if option takes a long argument */
213 | #define _curl_is_long_option(option) \
214 | (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
215 |
216 | #define _curl_is_off_t_option(option) \
217 | ((option) > CURLOPTTYPE_OFF_T)
218 |
219 | /* evaluates to true if option takes a char* argument */
220 | #define _curl_is_string_option(option) \
221 | ((option) == CURLOPT_ACCEPT_ENCODING || \
222 | (option) == CURLOPT_CAINFO || \
223 | (option) == CURLOPT_CAPATH || \
224 | (option) == CURLOPT_COOKIE || \
225 | (option) == CURLOPT_COOKIEFILE || \
226 | (option) == CURLOPT_COOKIEJAR || \
227 | (option) == CURLOPT_COOKIELIST || \
228 | (option) == CURLOPT_CRLFILE || \
229 | (option) == CURLOPT_CUSTOMREQUEST || \
230 | (option) == CURLOPT_DEFAULT_PROTOCOL || \
231 | (option) == CURLOPT_DNS_INTERFACE || \
232 | (option) == CURLOPT_DNS_LOCAL_IP4 || \
233 | (option) == CURLOPT_DNS_LOCAL_IP6 || \
234 | (option) == CURLOPT_DNS_SERVERS || \
235 | (option) == CURLOPT_EGDSOCKET || \
236 | (option) == CURLOPT_FTPPORT || \
237 | (option) == CURLOPT_FTP_ACCOUNT || \
238 | (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
239 | (option) == CURLOPT_INTERFACE || \
240 | (option) == CURLOPT_ISSUERCERT || \
241 | (option) == CURLOPT_KEYPASSWD || \
242 | (option) == CURLOPT_KRBLEVEL || \
243 | (option) == CURLOPT_LOGIN_OPTIONS || \
244 | (option) == CURLOPT_MAIL_AUTH || \
245 | (option) == CURLOPT_MAIL_FROM || \
246 | (option) == CURLOPT_NETRC_FILE || \
247 | (option) == CURLOPT_NOPROXY || \
248 | (option) == CURLOPT_PASSWORD || \
249 | (option) == CURLOPT_PINNEDPUBLICKEY || \
250 | (option) == CURLOPT_PROXY || \
251 | (option) == CURLOPT_PROXYPASSWORD || \
252 | (option) == CURLOPT_PROXYUSERNAME || \
253 | (option) == CURLOPT_PROXYUSERPWD || \
254 | (option) == CURLOPT_PROXY_SERVICE_NAME || \
255 | (option) == CURLOPT_RANDOM_FILE || \
256 | (option) == CURLOPT_RANGE || \
257 | (option) == CURLOPT_REFERER || \
258 | (option) == CURLOPT_RTSP_SESSION_ID || \
259 | (option) == CURLOPT_RTSP_STREAM_URI || \
260 | (option) == CURLOPT_RTSP_TRANSPORT || \
261 | (option) == CURLOPT_SERVICE_NAME || \
262 | (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
263 | (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
264 | (option) == CURLOPT_SSH_KNOWNHOSTS || \
265 | (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
266 | (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
267 | (option) == CURLOPT_SSLCERT || \
268 | (option) == CURLOPT_SSLCERTTYPE || \
269 | (option) == CURLOPT_SSLENGINE || \
270 | (option) == CURLOPT_SSLKEY || \
271 | (option) == CURLOPT_SSLKEYTYPE || \
272 | (option) == CURLOPT_SSL_CIPHER_LIST || \
273 | (option) == CURLOPT_TLSAUTH_PASSWORD || \
274 | (option) == CURLOPT_TLSAUTH_TYPE || \
275 | (option) == CURLOPT_TLSAUTH_USERNAME || \
276 | (option) == CURLOPT_UNIX_SOCKET_PATH || \
277 | (option) == CURLOPT_URL || \
278 | (option) == CURLOPT_USERAGENT || \
279 | (option) == CURLOPT_USERNAME || \
280 | (option) == CURLOPT_USERPWD || \
281 | (option) == CURLOPT_XOAUTH2_BEARER || \
282 | 0)
283 |
284 | /* evaluates to true if option takes a curl_write_callback argument */
285 | #define _curl_is_write_cb_option(option) \
286 | ((option) == CURLOPT_HEADERFUNCTION || \
287 | (option) == CURLOPT_WRITEFUNCTION)
288 |
289 | /* evaluates to true if option takes a curl_conv_callback argument */
290 | #define _curl_is_conv_cb_option(option) \
291 | ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
292 | (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
293 | (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
294 |
295 | /* evaluates to true if option takes a data argument to pass to a callback */
296 | #define _curl_is_cb_data_option(option) \
297 | ((option) == CURLOPT_CHUNK_DATA || \
298 | (option) == CURLOPT_CLOSESOCKETDATA || \
299 | (option) == CURLOPT_DEBUGDATA || \
300 | (option) == CURLOPT_FNMATCH_DATA || \
301 | (option) == CURLOPT_HEADERDATA || \
302 | (option) == CURLOPT_INTERLEAVEDATA || \
303 | (option) == CURLOPT_IOCTLDATA || \
304 | (option) == CURLOPT_OPENSOCKETDATA || \
305 | (option) == CURLOPT_PRIVATE || \
306 | (option) == CURLOPT_PROGRESSDATA || \
307 | (option) == CURLOPT_READDATA || \
308 | (option) == CURLOPT_SEEKDATA || \
309 | (option) == CURLOPT_SOCKOPTDATA || \
310 | (option) == CURLOPT_SSH_KEYDATA || \
311 | (option) == CURLOPT_SSL_CTX_DATA || \
312 | (option) == CURLOPT_WRITEDATA || \
313 | 0)
314 |
315 | /* evaluates to true if option takes a POST data argument (void* or char*) */
316 | #define _curl_is_postfields_option(option) \
317 | ((option) == CURLOPT_POSTFIELDS || \
318 | (option) == CURLOPT_COPYPOSTFIELDS || \
319 | 0)
320 |
321 | /* evaluates to true if option takes a struct curl_slist * argument */
322 | #define _curl_is_slist_option(option) \
323 | ((option) == CURLOPT_HTTP200ALIASES || \
324 | (option) == CURLOPT_HTTPHEADER || \
325 | (option) == CURLOPT_MAIL_RCPT || \
326 | (option) == CURLOPT_POSTQUOTE || \
327 | (option) == CURLOPT_PREQUOTE || \
328 | (option) == CURLOPT_PROXYHEADER || \
329 | (option) == CURLOPT_QUOTE || \
330 | (option) == CURLOPT_RESOLVE || \
331 | (option) == CURLOPT_TELNETOPTIONS || \
332 | 0)
333 |
334 | /* groups of curl_easy_getinfo infos that take the same type of argument */
335 |
336 | /* evaluates to true if info expects a pointer to char * argument */
337 | #define _curl_is_string_info(info) \
338 | (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
339 |
340 | /* evaluates to true if info expects a pointer to long argument */
341 | #define _curl_is_long_info(info) \
342 | (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
343 |
344 | /* evaluates to true if info expects a pointer to double argument */
345 | #define _curl_is_double_info(info) \
346 | (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
347 |
348 | /* true if info expects a pointer to struct curl_slist * argument */
349 | #define _curl_is_slist_info(info) \
350 | (CURLINFO_SLIST < (info))
351 |
352 |
353 | /* typecheck helpers -- check whether given expression has requested type*/
354 |
355 | /* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
356 | * otherwise define a new macro. Search for __builtin_types_compatible_p
357 | * in the GCC manual.
358 | * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
359 | * the actual expression passed to the curl_easy_setopt macro. This
360 | * means that you can only apply the sizeof and __typeof__ operators, no
361 | * == or whatsoever.
362 | */
363 |
364 | /* XXX: should evaluate to true iff expr is a pointer */
365 | #define _curl_is_any_ptr(expr) \
366 | (sizeof(expr) == sizeof(void*))
367 |
368 | /* evaluates to true if expr is NULL */
369 | /* XXX: must not evaluate expr, so this check is not accurate */
370 | #define _curl_is_NULL(expr) \
371 | (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
372 |
373 | /* evaluates to true if expr is type*, const type* or NULL */
374 | #define _curl_is_ptr(expr, type) \
375 | (_curl_is_NULL(expr) || \
376 | __builtin_types_compatible_p(__typeof__(expr), type *) || \
377 | __builtin_types_compatible_p(__typeof__(expr), const type *))
378 |
379 | /* evaluates to true if expr is one of type[], type*, NULL or const type* */
380 | #define _curl_is_arr(expr, type) \
381 | (_curl_is_ptr((expr), type) || \
382 | __builtin_types_compatible_p(__typeof__(expr), type []))
383 |
384 | /* evaluates to true if expr is a string */
385 | #define _curl_is_string(expr) \
386 | (_curl_is_arr((expr), char) || \
387 | _curl_is_arr((expr), signed char) || \
388 | _curl_is_arr((expr), unsigned char))
389 |
390 | /* evaluates to true if expr is a long (no matter the signedness)
391 | * XXX: for now, int is also accepted (and therefore short and char, which
392 | * are promoted to int when passed to a variadic function) */
393 | #define _curl_is_long(expr) \
394 | (__builtin_types_compatible_p(__typeof__(expr), long) || \
395 | __builtin_types_compatible_p(__typeof__(expr), signed long) || \
396 | __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
397 | __builtin_types_compatible_p(__typeof__(expr), int) || \
398 | __builtin_types_compatible_p(__typeof__(expr), signed int) || \
399 | __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
400 | __builtin_types_compatible_p(__typeof__(expr), short) || \
401 | __builtin_types_compatible_p(__typeof__(expr), signed short) || \
402 | __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
403 | __builtin_types_compatible_p(__typeof__(expr), char) || \
404 | __builtin_types_compatible_p(__typeof__(expr), signed char) || \
405 | __builtin_types_compatible_p(__typeof__(expr), unsigned char))
406 |
407 | /* evaluates to true if expr is of type curl_off_t */
408 | #define _curl_is_off_t(expr) \
409 | (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
410 |
411 | /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
412 | /* XXX: also check size of an char[] array? */
413 | #define _curl_is_error_buffer(expr) \
414 | (_curl_is_NULL(expr) || \
415 | __builtin_types_compatible_p(__typeof__(expr), char *) || \
416 | __builtin_types_compatible_p(__typeof__(expr), char[]))
417 |
418 | /* evaluates to true if expr is of type (const) void* or (const) FILE* */
419 | #if 0
420 | #define _curl_is_cb_data(expr) \
421 | (_curl_is_ptr((expr), void) || \
422 | _curl_is_ptr((expr), FILE))
423 | #else /* be less strict */
424 | #define _curl_is_cb_data(expr) \
425 | _curl_is_any_ptr(expr)
426 | #endif
427 |
428 | /* evaluates to true if expr is of type FILE* */
429 | #define _curl_is_FILE(expr) \
430 | (__builtin_types_compatible_p(__typeof__(expr), FILE *))
431 |
432 | /* evaluates to true if expr can be passed as POST data (void* or char*) */
433 | #define _curl_is_postfields(expr) \
434 | (_curl_is_ptr((expr), void) || \
435 | _curl_is_arr((expr), char))
436 |
437 | /* FIXME: the whole callback checking is messy...
438 | * The idea is to tolerate char vs. void and const vs. not const
439 | * pointers in arguments at least
440 | */
441 | /* helper: __builtin_types_compatible_p distinguishes between functions and
442 | * function pointers, hide it */
443 | #define _curl_callback_compatible(func, type) \
444 | (__builtin_types_compatible_p(__typeof__(func), type) || \
445 | __builtin_types_compatible_p(__typeof__(func), type*))
446 |
447 | /* evaluates to true if expr is of type curl_read_callback or "similar" */
448 | #define _curl_is_read_cb(expr) \
449 | (_curl_is_NULL(expr) || \
450 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
451 | __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
452 | _curl_callback_compatible((expr), _curl_read_callback1) || \
453 | _curl_callback_compatible((expr), _curl_read_callback2) || \
454 | _curl_callback_compatible((expr), _curl_read_callback3) || \
455 | _curl_callback_compatible((expr), _curl_read_callback4) || \
456 | _curl_callback_compatible((expr), _curl_read_callback5) || \
457 | _curl_callback_compatible((expr), _curl_read_callback6))
458 | typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
459 | typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
460 | typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
461 | typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
462 | typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
463 | typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
464 |
465 | /* evaluates to true if expr is of type curl_write_callback or "similar" */
466 | #define _curl_is_write_cb(expr) \
467 | (_curl_is_read_cb(expr) || \
468 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
469 | __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
470 | _curl_callback_compatible((expr), _curl_write_callback1) || \
471 | _curl_callback_compatible((expr), _curl_write_callback2) || \
472 | _curl_callback_compatible((expr), _curl_write_callback3) || \
473 | _curl_callback_compatible((expr), _curl_write_callback4) || \
474 | _curl_callback_compatible((expr), _curl_write_callback5) || \
475 | _curl_callback_compatible((expr), _curl_write_callback6))
476 | typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
477 | typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
478 | const void*);
479 | typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
480 | typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
481 | typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
482 | const void*);
483 | typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
484 |
485 | /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
486 | #define _curl_is_ioctl_cb(expr) \
487 | (_curl_is_NULL(expr) || \
488 | __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
489 | _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
490 | _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
491 | _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
492 | _curl_callback_compatible((expr), _curl_ioctl_callback4))
493 | typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
494 | typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
495 | typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
496 | typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
497 |
498 | /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
499 | #define _curl_is_sockopt_cb(expr) \
500 | (_curl_is_NULL(expr) || \
501 | __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
502 | _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
503 | _curl_callback_compatible((expr), _curl_sockopt_callback2))
504 | typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
505 | typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
506 | curlsocktype);
507 |
508 | /* evaluates to true if expr is of type curl_opensocket_callback or
509 | "similar" */
510 | #define _curl_is_opensocket_cb(expr) \
511 | (_curl_is_NULL(expr) || \
512 | __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
513 | _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
514 | _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
515 | _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
516 | _curl_callback_compatible((expr), _curl_opensocket_callback4))
517 | typedef curl_socket_t (_curl_opensocket_callback1)
518 | (void *, curlsocktype, struct curl_sockaddr *);
519 | typedef curl_socket_t (_curl_opensocket_callback2)
520 | (void *, curlsocktype, const struct curl_sockaddr *);
521 | typedef curl_socket_t (_curl_opensocket_callback3)
522 | (const void *, curlsocktype, struct curl_sockaddr *);
523 | typedef curl_socket_t (_curl_opensocket_callback4)
524 | (const void *, curlsocktype, const struct curl_sockaddr *);
525 |
526 | /* evaluates to true if expr is of type curl_progress_callback or "similar" */
527 | #define _curl_is_progress_cb(expr) \
528 | (_curl_is_NULL(expr) || \
529 | __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
530 | _curl_callback_compatible((expr), _curl_progress_callback1) || \
531 | _curl_callback_compatible((expr), _curl_progress_callback2))
532 | typedef int (_curl_progress_callback1)(void *,
533 | double, double, double, double);
534 | typedef int (_curl_progress_callback2)(const void *,
535 | double, double, double, double);
536 |
537 | /* evaluates to true if expr is of type curl_debug_callback or "similar" */
538 | #define _curl_is_debug_cb(expr) \
539 | (_curl_is_NULL(expr) || \
540 | __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
541 | _curl_callback_compatible((expr), _curl_debug_callback1) || \
542 | _curl_callback_compatible((expr), _curl_debug_callback2) || \
543 | _curl_callback_compatible((expr), _curl_debug_callback3) || \
544 | _curl_callback_compatible((expr), _curl_debug_callback4) || \
545 | _curl_callback_compatible((expr), _curl_debug_callback5) || \
546 | _curl_callback_compatible((expr), _curl_debug_callback6) || \
547 | _curl_callback_compatible((expr), _curl_debug_callback7) || \
548 | _curl_callback_compatible((expr), _curl_debug_callback8))
549 | typedef int (_curl_debug_callback1) (CURL *,
550 | curl_infotype, char *, size_t, void *);
551 | typedef int (_curl_debug_callback2) (CURL *,
552 | curl_infotype, char *, size_t, const void *);
553 | typedef int (_curl_debug_callback3) (CURL *,
554 | curl_infotype, const char *, size_t, void *);
555 | typedef int (_curl_debug_callback4) (CURL *,
556 | curl_infotype, const char *, size_t, const void *);
557 | typedef int (_curl_debug_callback5) (CURL *,
558 | curl_infotype, unsigned char *, size_t, void *);
559 | typedef int (_curl_debug_callback6) (CURL *,
560 | curl_infotype, unsigned char *, size_t, const void *);
561 | typedef int (_curl_debug_callback7) (CURL *,
562 | curl_infotype, const unsigned char *, size_t, void *);
563 | typedef int (_curl_debug_callback8) (CURL *,
564 | curl_infotype, const unsigned char *, size_t, const void *);
565 |
566 | /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
567 | /* this is getting even messier... */
568 | #define _curl_is_ssl_ctx_cb(expr) \
569 | (_curl_is_NULL(expr) || \
570 | __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
571 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
572 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
573 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
574 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
575 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
576 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
577 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
578 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
579 | typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
580 | typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
581 | typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
582 | typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
583 | #ifdef HEADER_SSL_H
584 | /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
585 | * this will of course break if we're included before OpenSSL headers...
586 | */
587 | typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
588 | typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
589 | typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
590 | typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
591 | const void *);
592 | #else
593 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
594 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
595 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
596 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
597 | #endif
598 |
599 | /* evaluates to true if expr is of type curl_conv_callback or "similar" */
600 | #define _curl_is_conv_cb(expr) \
601 | (_curl_is_NULL(expr) || \
602 | __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
603 | _curl_callback_compatible((expr), _curl_conv_callback1) || \
604 | _curl_callback_compatible((expr), _curl_conv_callback2) || \
605 | _curl_callback_compatible((expr), _curl_conv_callback3) || \
606 | _curl_callback_compatible((expr), _curl_conv_callback4))
607 | typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
608 | typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
609 | typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
610 | typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
611 |
612 | /* evaluates to true if expr is of type curl_seek_callback or "similar" */
613 | #define _curl_is_seek_cb(expr) \
614 | (_curl_is_NULL(expr) || \
615 | __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
616 | _curl_callback_compatible((expr), _curl_seek_callback1) || \
617 | _curl_callback_compatible((expr), _curl_seek_callback2))
618 | typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
619 | typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
620 |
621 |
622 | #endif /* __CURL_TYPECHECK_GCC_H */
623 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl_lib.c:
--------------------------------------------------------------------------------
1 | //
2 | // Created by zhonglz on 16/8/6.
3 | //
4 |
5 | #include
6 | #include
7 | #include "curl_ssl_CurlLib.h"
8 | #include "logger.h"
9 | #include "curl_mgr.h"
10 | #include "util.h"
11 |
12 | #define CURLLIB "curl_lib"
13 |
14 | const char* cert_path;
15 |
16 | JNIEXPORT jint JNICALL Java_curl_ssl_CurlLib_init
17 | (JNIEnv * env, jobject thiz, jstring cert)
18 | {
19 | cert_path = (*env)->GetStringUTFChars(env, cert, NULL);
20 | LOGI(CURLLIB, "cert path [%s]", cert_path);
21 |
22 | init_curl();
23 | }
24 |
25 | JNIEXPORT jbyteArray JNICALL Java_curl_ssl_CurlLib_testUrl
26 | (JNIEnv * env, jobject thiz, jstring url)
27 | {
28 | const char* p_url = (*env)->GetStringUTFChars(env, url, NULL);
29 | if (p_url == NULL)
30 | {
31 | LOGE(CURLLIB, "url is null")
32 |
33 | return NULL;
34 | }else
35 | {
36 | LOGI(CURLLIB, "test url [%s]", p_url);
37 | }
38 |
39 | CURL_DOWNLOAD_OBJECT* download_object = (CURL_DOWNLOAD_OBJECT*)malloc(sizeof(CURL_DOWNLOAD_OBJECT));
40 | download_object->data = NULL;
41 | download_object->size = 0;
42 |
43 | if (get(p_url, download_object, cert_path))
44 | {
45 | jbyteArray ret = char2jbyteArray(env, download_object->data, (unsigned int)download_object->size);
46 | free(download_object->data);
47 | free(download_object);
48 |
49 | return ret;
50 | }
51 |
52 | (*env)->ReleaseStringUTFChars(env, url, p_url);
53 |
54 | return NULL;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl_mgr.c:
--------------------------------------------------------------------------------
1 | //
2 | // Created by zhonglz on 16/8/6.
3 | // 关于curl访问 https的例子参考这里 https://curl.haxx.se/libcurl/c/https.html
4 | //
5 |
6 | #include "curl_mgr.h"
7 | #include "logger.h"
8 | #include "curl/curl.h"
9 |
10 | size_t curl_callback(char *data, size_t size, size_t count, void* userdata);
11 |
12 | int init_curl()
13 | {
14 | LOGI(CURLMGR, "init curl, NOTE that it should be just once and in main thread!!!!!!!!!!!!!");
15 | /**
16 | * 参数:flags
17 | * CURL_GLOBAL_ALL //初始化所有的可能的调用。
18 | * CURL_GLOBAL_SSL //初始化支持 安全套接字层。
19 | * CURL_GLOBAL_WIN32 //初始化win32套接字库。
20 | * CURL_GLOBAL_NOTHING //没有额外的初始化。
21 | */
22 | return curl_global_init(CURL_GLOBAL_ALL);
23 | }
24 |
25 | char * get_curl_version()
26 | {
27 | return curl_version();
28 | }
29 |
30 | int get(const char* url, LPCURL_DOWNLOAD_OBJECT obj, const char* cacert)
31 | {
32 | LOGI(CURLMGR, "begin get method[%s]", url);
33 | LOGI(CURLMGR, "cert path[%s]", cacert);
34 |
35 | CURL* curl = curl_easy_init();
36 | curl_easy_setopt(curl, CURLOPT_URL, url);
37 | curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
38 | curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
39 |
40 | #ifdef SKIP_PEER_VERIFICATION
41 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
42 | #endif
43 |
44 | #ifdef SKIP_HOSTNAME_VERIFICATION
45 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
46 | #endif
47 |
48 | curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_callback);
49 | curl_easy_setopt(curl, CURLOPT_WRITEDATA, obj);
50 | // curl_easy_setopt(curl, CURLMOPT_PIPELINING, 1L);//开启多路复用
51 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
52 | curl_easy_setopt(curl, CURLOPT_CAINFO, cacert);
53 | curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
54 | curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
55 |
56 | curl_version_info_data * cvid = curl_version_info(CURLVERSION_NOW);
57 | if (cvid->features & CURL_VERSION_SSL)
58 | {
59 | LOGI(CURLMGR, "SSL support enabled [version %s]", cvid->ssl_version);
60 | }else
61 | {
62 | LOGE(CURLMGR, "no SSL support");
63 | }
64 |
65 | CURLcode code = curl_easy_perform(curl);
66 | if (code != CURLE_OK)
67 | {
68 | LOGE(CURLMGR, "CURL failed with error code [%d]", code);
69 | } else
70 | {
71 | LOGI(CURLMGR, "CURL success, result[%d]", code);
72 | }
73 |
74 | curl_easy_cleanup(curl);
75 |
76 | LOGI(CURLMGR, "end get method[%s]", url);
77 |
78 | return code == CURLE_OK;
79 | }
80 |
81 | void post()
82 | {
83 |
84 | }
85 |
86 | void put()
87 | {
88 |
89 | }
90 |
91 | size_t curl_callback(char *data, size_t size, size_t count, void* userdata) {
92 |
93 | LOGI(CURLMGR, "Downloaded data size is [%d]", size * count);
94 |
95 | LPCURL_DOWNLOAD_OBJECT downloadObject = (LPCURL_DOWNLOAD_OBJECT) userdata;
96 |
97 | long newSize = 0;
98 | long offset = 0;
99 | char* dataPtr;
100 |
101 | if (downloadObject == NULL)
102 | {
103 | LOGE(CURLMGR, "download object is null");
104 | return 0;
105 | }
106 |
107 | if (downloadObject->data == NULL)
108 | {
109 | newSize = size * count * sizeof(char);
110 | dataPtr = (char *)malloc(newSize);
111 | }else
112 | {
113 | newSize = downloadObject->size + (size * count * sizeof(char));
114 | dataPtr = (char *)realloc(downloadObject->data, newSize);
115 | offset = downloadObject->size;
116 | }
117 |
118 | if (dataPtr==NULL)
119 | {
120 | if (downloadObject->data != NULL)
121 | {
122 | free(downloadObject->data);
123 | downloadObject->data = NULL;
124 | downloadObject->size = 0;
125 | }
126 |
127 | return 0;
128 | }
129 |
130 | downloadObject->data = dataPtr;
131 | downloadObject->size = newSize;
132 |
133 | memcpy(downloadObject->data + offset, data, size * count * sizeof(char));
134 |
135 | return size*count;
136 | }
--------------------------------------------------------------------------------
/app/src/main/jni/curl_mgr.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 钟龙州 on 16/8/6.
3 | //
4 |
5 | #ifndef USECURL_CURL_MGR_H
6 | #define USECURL_CURL_MGR_H
7 |
8 | #define SKIP_PEER_VERIFICATION
9 | #define SKIP_HOSTNAME_VERIFICATION
10 |
11 | #define CURLMGR "curl_mgr"
12 |
13 | typedef struct _CURL_DOWNLOAD_OBJECT {
14 | long size;
15 | char* data;
16 | } CURL_DOWNLOAD_OBJECT, *LPCURL_DOWNLOAD_OBJECT;
17 |
18 | int init_curl();
19 | char* get_curl_version();
20 |
21 |
22 | int get(const char* url, LPCURL_DOWNLOAD_OBJECT obj, const char* cacert);
23 | void post();
24 | void put();
25 |
26 |
27 |
28 | #endif //USECURL_CURL_MGR_H
29 |
--------------------------------------------------------------------------------
/app/src/main/jni/curl_ssl_CurlLib.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class curl_ssl_CurlLib */
4 |
5 | #ifndef _Included_curl_ssl_CurlLib
6 | #define _Included_curl_ssl_CurlLib
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: curl_ssl_CurlLib
12 | * Method: init
13 | * Signature: (Ljava/lang/String;)I
14 | */
15 | JNIEXPORT jint JNICALL Java_curl_ssl_CurlLib_init
16 | (JNIEnv *, jobject, jstring);
17 |
18 | /*
19 | * Class: curl_ssl_CurlLib
20 | * Method: testUrl
21 | * Signature: (Ljava/lang/String;)[B
22 | */
23 | JNIEXPORT jbyteArray JNICALL Java_curl_ssl_CurlLib_testUrl
24 | (JNIEnv *, jobject, jstring);
25 |
26 | #ifdef __cplusplus
27 | }
28 | #endif
29 | #endif
30 |
--------------------------------------------------------------------------------
/app/src/main/jni/logger.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by zhonglz on 16/8/6.
3 | //
4 |
5 | #ifndef USECURL_LOGGER_H
6 | #define USECURL_LOGGER_H
7 |
8 | #include
9 |
10 | #define LOGI(TAG, ...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__);
11 | #define LOGE(TAG, ...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__);
12 | #define LOGW(TAG, ...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__);
13 |
14 | #endif //USECURL_LOGGER_H
15 |
--------------------------------------------------------------------------------
/app/src/main/jni/srclib/libcryptt.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jni/srclib/libcryptt.so
--------------------------------------------------------------------------------
/app/src/main/jni/srclib/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jni/srclib/libcurl.a
--------------------------------------------------------------------------------
/app/src/main/jni/srclib/libcurl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jni/srclib/libcurl.so
--------------------------------------------------------------------------------
/app/src/main/jni/srclib/libnghttp2.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jni/srclib/libnghttp2.so
--------------------------------------------------------------------------------
/app/src/main/jni/srclib/libsss.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jni/srclib/libsss.so
--------------------------------------------------------------------------------
/app/src/main/jni/util.c:
--------------------------------------------------------------------------------
1 | //
2 | // Created by zhonglz on 16/8/6.
3 | //
4 |
5 | #include "util.h"
6 | #include
7 |
8 | jbyteArray char2jbyteArray(JNIEnv *env, char* pat, unsigned int nSize)
9 | {
10 | int i = 0;
11 | if(nSize <= 0 || pat == NULL)
12 | {
13 | return NULL;
14 | }
15 |
16 | jbyteArray tempJByteArray = (*env)->NewByteArray(env, nSize);
17 | jbyte *bytes = (*env)->GetByteArrayElements(env, tempJByteArray, 0);
18 |
19 | while(i < nSize)
20 | {
21 | bytes[i] = pat[i];
22 | i++;
23 | }
24 |
25 | (*env)->SetByteArrayRegion(env, tempJByteArray, 0, nSize, bytes );
26 |
27 | return tempJByteArray;
28 | }
--------------------------------------------------------------------------------
/app/src/main/jni/util.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 钟龙州 on 16/8/6.
3 | //
4 |
5 | #ifndef USECURL_UTIL_H
6 | #define USECURL_UTIL_H
7 |
8 | #include
9 |
10 | jbyteArray char2jbyteArray(JNIEnv *env, char* pat, unsigned int nSize);
11 |
12 | #endif //USECURL_UTIL_H
13 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libcryptt.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jniLibs/armeabi/libcryptt.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libcurl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jniLibs/armeabi/libcurl.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libcurlwithssl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jniLibs/armeabi/libcurlwithssl.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libnghttp2.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jniLibs/armeabi/libnghttp2.so
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libsss.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/jniLibs/armeabi/libsss.so
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | UseCurl
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/test/java/im/vinci/usecurl/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package im.vinci.usecurl;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/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 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/silo4/UseCurl/2cfcb3c08dd2dc438e42da777f8ee26b9f505f8c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
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-2.10-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 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------