├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── Makefile.am ├── autogen.sh ├── configure.ac ├── deps ├── curl-static │ ├── curl │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ └── libcurl.a ├── libfragmentzip.a └── libgrabkernel.a ├── include ├── Makefile.am └── libgrabkernel │ └── libgrabkernel.h ├── libgrabkernel.pc.in ├── libgrabkernel.xcodeproj └── project.pbxproj └── libgrabkernel ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Makefile.am ├── ViewController.h ├── ViewController.m ├── libgrabkernel.m └── main.m /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [tihmstar] 4 | patreon: tihmstar 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.la 2 | *.lo 3 | *.o 4 | .libs 5 | .deps 6 | Makefile 7 | *.in 8 | aclocal.m4 9 | autom4te.cache/ 10 | compile 11 | config.guess 12 | config.h 13 | config.h.in 14 | config.log 15 | config.status 16 | config.sub 17 | configure 18 | depcomp 19 | install-sh 20 | libgrabkernel.pc 21 | libgrabkernel/.deps/ 22 | libtool 23 | ltmain.sh 24 | m4/ 25 | missing 26 | stamp-h1 27 | configure~ 28 | config.h.in~ 29 | Makefile 30 | Makefile.in 31 | project.xcworkspace 32 | xcshareddata 33 | xcuserdata -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 tihmstar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | ACLOCAL_AMFLAGS = -I m4 3 | SUBDIRS=libgrabkernel include 4 | 5 | pkgconfigdir = $(libdir)/pkgconfig 6 | pkgconfig_DATA = libgrabkernel.pc 7 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #cleanup cache for correct versioning when run multiple times 4 | rm -rf autom4te.cache 5 | 6 | 7 | aclocal -I m4 8 | autoconf 9 | autoheader 10 | automake --add-missing 11 | autoreconf -i 12 | ./configure "$@" 13 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ([2.69]) 2 | AC_INIT([libgrabkernel], m4_esyscmd([git rev-list --count HEAD | tr -d '\n']), [tihmstar@gmail.com]) 3 | 4 | AC_CANONICAL_SYSTEM 5 | AC_CANONICAL_HOST 6 | AM_PROG_LIBTOOL 7 | 8 | AM_INIT_AUTOMAKE([subdir-objects]) 9 | AC_CONFIG_HEADERS([config.h]) 10 | AC_CONFIG_MACRO_DIRS([m4]) 11 | AC_CANONICAL_SYSTEM 12 | 13 | AC_DEFINE([VERSION_COMMIT_COUNT], "m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])", [Git commit count]) 14 | AC_DEFINE([VERSION_COMMIT_SHA], "m4_esyscmd([git rev-parse HEAD | tr -d '\n'])", [Git commit sha]) 15 | AC_SUBST([VERSION_COMMIT_COUNT], ["m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])"]) 16 | AC_SUBST([VERSION_COMMIT_SHA], ["m4_esyscmd([git rev-parse HEAD | tr -d '\n'])"]) 17 | 18 | # Checks for programs. 19 | AC_PROG_CC 20 | AC_PROG_CXX 21 | AC_PROG_OBJC 22 | 23 | CXXFLAGS+=" -std=c++11" 24 | CFLAGS+=" -std=c11" 25 | 26 | # Checks for libraries. 27 | LIBFRAGMENTZIP_REQUIRES_STR="libfragmentzip >= 68" 28 | LIBGENERAL_REQUIRES_STR="libgeneral >= 75" 29 | PKG_CHECK_MODULES(libfragmentzip, $LIBFRAGMENTZIP_REQUIRES_STR) 30 | PKG_CHECK_MODULES(libgeneral, $LIBGENERAL_REQUIRES_STR) 31 | 32 | AC_SUBST([libfragmentzip_requires], [$LIBFRAGMENTZIP_REQUIRES_STR]) 33 | 34 | AC_ARG_ENABLE([debug], 35 | [AS_HELP_STRING([--enable-debug], 36 | [enable debug build(default is no)])], 37 | [debug_build=true], 38 | [debug_build=false]) 39 | 40 | 41 | AC_CONFIG_FILES([Makefile 42 | include/Makefile 43 | libgrabkernel/Makefile 44 | libgrabkernel.pc]) 45 | AC_OUTPUT 46 | -------------------------------------------------------------------------------- /deps/curl-static/curl/curl.h: -------------------------------------------------------------------------------- 1 | #ifndef __CURL_CURL_H 2 | #define __CURL_CURL_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2014, 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 http://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 | * If you have libcurl problems, all docs and details are found here: 27 | * http://curl.haxx.se/libcurl/ 28 | * 29 | * curl-library mailing list subscription and unsubscription web interface: 30 | * http://cool.haxx.se/mailman/listinfo/curl-library/ 31 | */ 32 | 33 | #include "curlver.h" /* libcurl version defines */ 34 | #include "curlbuild.h" /* libcurl build definitions */ 35 | #include "curlrules.h" /* libcurl rules enforcement */ 36 | 37 | /* 38 | * Define WIN32 when build target is Win32 API 39 | */ 40 | 41 | #if (defined(_WIN32) || defined(__WIN32__)) && \ 42 | !defined(WIN32) && !defined(__SYMBIAN32__) 43 | #define WIN32 44 | #endif 45 | 46 | #include 47 | #include 48 | 49 | #if defined(__FreeBSD__) && (__FreeBSD__ >= 2) 50 | /* Needed for __FreeBSD_version symbol definition */ 51 | #include 52 | #endif 53 | 54 | /* The include stuff here below is mainly for time_t! */ 55 | #include 56 | #include 57 | 58 | #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) 59 | #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__)) 60 | /* The check above prevents the winsock2 inclusion if winsock.h already was 61 | included, since they can't co-exist without problems */ 62 | #include 63 | #include 64 | #endif 65 | #endif 66 | 67 | /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish 68 | libc5-based Linux systems. Only include it on systems that are known to 69 | require it! */ 70 | #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ 71 | defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ 72 | defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ 73 | (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) 74 | #include 75 | #endif 76 | 77 | #if !defined(WIN32) && !defined(_WIN32_WCE) 78 | #include 79 | #endif 80 | 81 | #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) 82 | #include 83 | #endif 84 | 85 | #ifdef __BEOS__ 86 | #include 87 | #endif 88 | 89 | #ifdef __cplusplus 90 | extern "C" { 91 | #endif 92 | 93 | typedef void CURL; 94 | 95 | /* 96 | * libcurl external API function linkage decorations. 97 | */ 98 | 99 | #ifdef CURL_STATICLIB 100 | # define CURL_EXTERN 101 | #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) 102 | # if defined(BUILDING_LIBCURL) 103 | # define CURL_EXTERN __declspec(dllexport) 104 | # else 105 | # define CURL_EXTERN __declspec(dllimport) 106 | # endif 107 | #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) 108 | # define CURL_EXTERN CURL_EXTERN_SYMBOL 109 | #else 110 | # define CURL_EXTERN 111 | #endif 112 | 113 | #ifndef curl_socket_typedef 114 | /* socket typedef */ 115 | #if defined(WIN32) && !defined(__LWIP_OPT_H__) 116 | typedef SOCKET curl_socket_t; 117 | #define CURL_SOCKET_BAD INVALID_SOCKET 118 | #else 119 | typedef int curl_socket_t; 120 | #define CURL_SOCKET_BAD -1 121 | #endif 122 | #define curl_socket_typedef 123 | #endif /* curl_socket_typedef */ 124 | 125 | struct curl_httppost { 126 | struct curl_httppost *next; /* next entry in the list */ 127 | char *name; /* pointer to allocated name */ 128 | long namelength; /* length of name length */ 129 | char *contents; /* pointer to allocated data contents */ 130 | long contentslength; /* length of contents field */ 131 | char *buffer; /* pointer to allocated buffer contents */ 132 | long bufferlength; /* length of buffer field */ 133 | char *contenttype; /* Content-Type */ 134 | struct curl_slist* contentheader; /* list of extra headers for this form */ 135 | struct curl_httppost *more; /* if one field name has more than one 136 | file, this link should link to following 137 | files */ 138 | long flags; /* as defined below */ 139 | #define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ 140 | #define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ 141 | #define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer 142 | do not free in formfree */ 143 | #define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer 144 | do not free in formfree */ 145 | #define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ 146 | #define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ 147 | #define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the 148 | regular read callback to get the data 149 | and pass the given pointer as custom 150 | pointer */ 151 | 152 | char *showfilename; /* The file name to show. If not set, the 153 | actual file name will be used (if this 154 | is a file part) */ 155 | void *userp; /* custom pointer used for 156 | HTTPPOST_CALLBACK posts */ 157 | }; 158 | 159 | /* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered 160 | deprecated but was the only choice up until 7.31.0 */ 161 | typedef int (*curl_progress_callback)(void *clientp, 162 | double dltotal, 163 | double dlnow, 164 | double ultotal, 165 | double ulnow); 166 | 167 | /* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in 168 | 7.32.0, it avoids floating point and provides more detailed information. */ 169 | typedef int (*curl_xferinfo_callback)(void *clientp, 170 | curl_off_t dltotal, 171 | curl_off_t dlnow, 172 | curl_off_t ultotal, 173 | curl_off_t ulnow); 174 | 175 | #ifndef CURL_MAX_WRITE_SIZE 176 | /* Tests have proven that 20K is a very bad buffer size for uploads on 177 | Windows, while 16K for some odd reason performed a lot better. 178 | We do the ifndef check to allow this value to easier be changed at build 179 | time for those who feel adventurous. The practical minimum is about 180 | 400 bytes since libcurl uses a buffer of this size as a scratch area 181 | (unrelated to network send operations). */ 182 | #define CURL_MAX_WRITE_SIZE 16384 183 | #endif 184 | 185 | #ifndef CURL_MAX_HTTP_HEADER 186 | /* The only reason to have a max limit for this is to avoid the risk of a bad 187 | server feeding libcurl with a never-ending header that will cause reallocs 188 | infinitely */ 189 | #define CURL_MAX_HTTP_HEADER (100*1024) 190 | #endif 191 | 192 | /* This is a magic return code for the write callback that, when returned, 193 | will signal libcurl to pause receiving on the current transfer. */ 194 | #define CURL_WRITEFUNC_PAUSE 0x10000001 195 | 196 | typedef size_t (*curl_write_callback)(char *buffer, 197 | size_t size, 198 | size_t nitems, 199 | void *outstream); 200 | 201 | 202 | 203 | /* enumeration of file types */ 204 | typedef enum { 205 | CURLFILETYPE_FILE = 0, 206 | CURLFILETYPE_DIRECTORY, 207 | CURLFILETYPE_SYMLINK, 208 | CURLFILETYPE_DEVICE_BLOCK, 209 | CURLFILETYPE_DEVICE_CHAR, 210 | CURLFILETYPE_NAMEDPIPE, 211 | CURLFILETYPE_SOCKET, 212 | CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ 213 | 214 | CURLFILETYPE_UNKNOWN /* should never occur */ 215 | } curlfiletype; 216 | 217 | #define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) 218 | #define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) 219 | #define CURLFINFOFLAG_KNOWN_TIME (1<<2) 220 | #define CURLFINFOFLAG_KNOWN_PERM (1<<3) 221 | #define CURLFINFOFLAG_KNOWN_UID (1<<4) 222 | #define CURLFINFOFLAG_KNOWN_GID (1<<5) 223 | #define CURLFINFOFLAG_KNOWN_SIZE (1<<6) 224 | #define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) 225 | 226 | /* Content of this structure depends on information which is known and is 227 | achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man 228 | page for callbacks returning this structure -- some fields are mandatory, 229 | some others are optional. The FLAG field has special meaning. */ 230 | struct curl_fileinfo { 231 | char *filename; 232 | curlfiletype filetype; 233 | time_t time; 234 | unsigned int perm; 235 | int uid; 236 | int gid; 237 | curl_off_t size; 238 | long int hardlinks; 239 | 240 | struct { 241 | /* If some of these fields is not NULL, it is a pointer to b_data. */ 242 | char *time; 243 | char *perm; 244 | char *user; 245 | char *group; 246 | char *target; /* pointer to the target filename of a symlink */ 247 | } strings; 248 | 249 | unsigned int flags; 250 | 251 | /* used internally */ 252 | char * b_data; 253 | size_t b_size; 254 | size_t b_used; 255 | }; 256 | 257 | /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ 258 | #define CURL_CHUNK_BGN_FUNC_OK 0 259 | #define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ 260 | #define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ 261 | 262 | /* if splitting of data transfer is enabled, this callback is called before 263 | download of an individual chunk started. Note that parameter "remains" works 264 | only for FTP wildcard downloading (for now), otherwise is not used */ 265 | typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, 266 | void *ptr, 267 | int remains); 268 | 269 | /* return codes for CURLOPT_CHUNK_END_FUNCTION */ 270 | #define CURL_CHUNK_END_FUNC_OK 0 271 | #define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ 272 | 273 | /* If splitting of data transfer is enabled this callback is called after 274 | download of an individual chunk finished. 275 | Note! After this callback was set then it have to be called FOR ALL chunks. 276 | Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. 277 | This is the reason why we don't need "transfer_info" parameter in this 278 | callback and we are not interested in "remains" parameter too. */ 279 | typedef long (*curl_chunk_end_callback)(void *ptr); 280 | 281 | /* return codes for FNMATCHFUNCTION */ 282 | #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ 283 | #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ 284 | #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ 285 | 286 | /* callback type for wildcard downloading pattern matching. If the 287 | string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ 288 | typedef int (*curl_fnmatch_callback)(void *ptr, 289 | const char *pattern, 290 | const char *string); 291 | 292 | /* These are the return codes for the seek callbacks */ 293 | #define CURL_SEEKFUNC_OK 0 294 | #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ 295 | #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so 296 | libcurl might try other means instead */ 297 | typedef int (*curl_seek_callback)(void *instream, 298 | curl_off_t offset, 299 | int origin); /* 'whence' */ 300 | 301 | /* This is a return code for the read callback that, when returned, will 302 | signal libcurl to immediately abort the current transfer. */ 303 | #define CURL_READFUNC_ABORT 0x10000000 304 | /* This is a return code for the read callback that, when returned, will 305 | signal libcurl to pause sending data on the current transfer. */ 306 | #define CURL_READFUNC_PAUSE 0x10000001 307 | 308 | typedef size_t (*curl_read_callback)(char *buffer, 309 | size_t size, 310 | size_t nitems, 311 | void *instream); 312 | 313 | typedef enum { 314 | CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ 315 | CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ 316 | CURLSOCKTYPE_LAST /* never use */ 317 | } curlsocktype; 318 | 319 | /* The return code from the sockopt_callback can signal information back 320 | to libcurl: */ 321 | #define CURL_SOCKOPT_OK 0 322 | #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return 323 | CURLE_ABORTED_BY_CALLBACK */ 324 | #define CURL_SOCKOPT_ALREADY_CONNECTED 2 325 | 326 | typedef int (*curl_sockopt_callback)(void *clientp, 327 | curl_socket_t curlfd, 328 | curlsocktype purpose); 329 | 330 | struct curl_sockaddr { 331 | int family; 332 | int socktype; 333 | int protocol; 334 | unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it 335 | turned really ugly and painful on the systems that 336 | lack this type */ 337 | struct sockaddr addr; 338 | }; 339 | 340 | typedef curl_socket_t 341 | (*curl_opensocket_callback)(void *clientp, 342 | curlsocktype purpose, 343 | struct curl_sockaddr *address); 344 | 345 | typedef int 346 | (*curl_closesocket_callback)(void *clientp, curl_socket_t item); 347 | 348 | typedef enum { 349 | CURLIOE_OK, /* I/O operation successful */ 350 | CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ 351 | CURLIOE_FAILRESTART, /* failed to restart the read */ 352 | CURLIOE_LAST /* never use */ 353 | } curlioerr; 354 | 355 | typedef enum { 356 | CURLIOCMD_NOP, /* no operation */ 357 | CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ 358 | CURLIOCMD_LAST /* never use */ 359 | } curliocmd; 360 | 361 | typedef curlioerr (*curl_ioctl_callback)(CURL *handle, 362 | int cmd, 363 | void *clientp); 364 | 365 | /* 366 | * The following typedef's are signatures of malloc, free, realloc, strdup and 367 | * calloc respectively. Function pointers of these types can be passed to the 368 | * curl_global_init_mem() function to set user defined memory management 369 | * callback routines. 370 | */ 371 | typedef void *(*curl_malloc_callback)(size_t size); 372 | typedef void (*curl_free_callback)(void *ptr); 373 | typedef void *(*curl_realloc_callback)(void *ptr, size_t size); 374 | typedef char *(*curl_strdup_callback)(const char *str); 375 | typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); 376 | 377 | /* the kind of data that is passed to information_callback*/ 378 | typedef enum { 379 | CURLINFO_TEXT = 0, 380 | CURLINFO_HEADER_IN, /* 1 */ 381 | CURLINFO_HEADER_OUT, /* 2 */ 382 | CURLINFO_DATA_IN, /* 3 */ 383 | CURLINFO_DATA_OUT, /* 4 */ 384 | CURLINFO_SSL_DATA_IN, /* 5 */ 385 | CURLINFO_SSL_DATA_OUT, /* 6 */ 386 | CURLINFO_END 387 | } curl_infotype; 388 | 389 | typedef int (*curl_debug_callback) 390 | (CURL *handle, /* the handle/transfer this concerns */ 391 | curl_infotype type, /* what kind of data */ 392 | char *data, /* points to the data */ 393 | size_t size, /* size of the data pointed to */ 394 | void *userptr); /* whatever the user please */ 395 | 396 | /* All possible error codes from all sorts of curl functions. Future versions 397 | may return other values, stay prepared. 398 | 399 | Always add new return codes last. Never *EVER* remove any. The return 400 | codes must remain the same! 401 | */ 402 | 403 | typedef enum { 404 | CURLE_OK = 0, 405 | CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ 406 | CURLE_FAILED_INIT, /* 2 */ 407 | CURLE_URL_MALFORMAT, /* 3 */ 408 | CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for 409 | 7.17.0, reused in April 2011 for 7.21.5] */ 410 | CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ 411 | CURLE_COULDNT_RESOLVE_HOST, /* 6 */ 412 | CURLE_COULDNT_CONNECT, /* 7 */ 413 | CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ 414 | CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server 415 | due to lack of access - when login fails 416 | this is not returned. */ 417 | CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for 418 | 7.15.4, reused in Dec 2011 for 7.24.0]*/ 419 | CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ 420 | CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server 421 | [was obsoleted in August 2007 for 7.17.0, 422 | reused in Dec 2011 for 7.24.0]*/ 423 | CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ 424 | CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ 425 | CURLE_FTP_CANT_GET_HOST, /* 15 */ 426 | CURLE_HTTP2, /* 16 - A problem in the http2 framing layer. 427 | [was obsoleted in August 2007 for 7.17.0, 428 | reused in July 2014 for 7.38.0] */ 429 | CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ 430 | CURLE_PARTIAL_FILE, /* 18 */ 431 | CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ 432 | CURLE_OBSOLETE20, /* 20 - NOT USED */ 433 | CURLE_QUOTE_ERROR, /* 21 - quote command failure */ 434 | CURLE_HTTP_RETURNED_ERROR, /* 22 */ 435 | CURLE_WRITE_ERROR, /* 23 */ 436 | CURLE_OBSOLETE24, /* 24 - NOT USED */ 437 | CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ 438 | CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ 439 | CURLE_OUT_OF_MEMORY, /* 27 */ 440 | /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error 441 | instead of a memory allocation error if CURL_DOES_CONVERSIONS 442 | is defined 443 | */ 444 | CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ 445 | CURLE_OBSOLETE29, /* 29 - NOT USED */ 446 | CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ 447 | CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ 448 | CURLE_OBSOLETE32, /* 32 - NOT USED */ 449 | CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ 450 | CURLE_HTTP_POST_ERROR, /* 34 */ 451 | CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ 452 | CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ 453 | CURLE_FILE_COULDNT_READ_FILE, /* 37 */ 454 | CURLE_LDAP_CANNOT_BIND, /* 38 */ 455 | CURLE_LDAP_SEARCH_FAILED, /* 39 */ 456 | CURLE_OBSOLETE40, /* 40 - NOT USED */ 457 | CURLE_FUNCTION_NOT_FOUND, /* 41 */ 458 | CURLE_ABORTED_BY_CALLBACK, /* 42 */ 459 | CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ 460 | CURLE_OBSOLETE44, /* 44 - NOT USED */ 461 | CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ 462 | CURLE_OBSOLETE46, /* 46 - NOT USED */ 463 | CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ 464 | CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ 465 | CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ 466 | CURLE_OBSOLETE50, /* 50 - NOT USED */ 467 | CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint 468 | wasn't verified fine */ 469 | CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ 470 | CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ 471 | CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as 472 | default */ 473 | CURLE_SEND_ERROR, /* 55 - failed sending network data */ 474 | CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ 475 | CURLE_OBSOLETE57, /* 57 - NOT IN USE */ 476 | CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ 477 | CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ 478 | CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ 479 | CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ 480 | CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ 481 | CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ 482 | CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ 483 | CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind 484 | that failed */ 485 | CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ 486 | CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not 487 | accepted and we failed to login */ 488 | CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ 489 | CURLE_TFTP_PERM, /* 69 - permission problem on server */ 490 | CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ 491 | CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ 492 | CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ 493 | CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ 494 | CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ 495 | CURLE_CONV_FAILED, /* 75 - conversion failed */ 496 | CURLE_CONV_REQD, /* 76 - caller must register conversion 497 | callbacks using curl_easy_setopt options 498 | CURLOPT_CONV_FROM_NETWORK_FUNCTION, 499 | CURLOPT_CONV_TO_NETWORK_FUNCTION, and 500 | CURLOPT_CONV_FROM_UTF8_FUNCTION */ 501 | CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing 502 | or wrong format */ 503 | CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ 504 | CURLE_SSH, /* 79 - error from the SSH layer, somewhat 505 | generic so the error message will be of 506 | interest when this has happened */ 507 | 508 | CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL 509 | connection */ 510 | CURLE_AGAIN, /* 81 - socket is not ready for send/recv, 511 | wait till it's ready and try again (Added 512 | in 7.18.2) */ 513 | CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or 514 | wrong format (Added in 7.19.0) */ 515 | CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in 516 | 7.19.0) */ 517 | CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ 518 | CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ 519 | CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ 520 | CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ 521 | CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ 522 | CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the 523 | session will be queued */ 524 | CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not 525 | match */ 526 | CURL_LAST /* never use! */ 527 | } CURLcode; 528 | 529 | #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all 530 | the obsolete stuff removed! */ 531 | 532 | /* Previously obsolete error code re-used in 7.38.0 */ 533 | #define CURLE_OBSOLETE16 CURLE_HTTP2 534 | 535 | /* Previously obsolete error codes re-used in 7.24.0 */ 536 | #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED 537 | #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT 538 | 539 | /* compatibility with older names */ 540 | #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING 541 | 542 | /* The following were added in 7.21.5, April 2011 */ 543 | #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION 544 | 545 | /* The following were added in 7.17.1 */ 546 | /* These are scheduled to disappear by 2009 */ 547 | #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION 548 | 549 | /* The following were added in 7.17.0 */ 550 | /* These are scheduled to disappear by 2009 */ 551 | #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ 552 | #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 553 | #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 554 | #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 555 | #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 556 | #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 557 | #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 558 | #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 559 | #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 560 | #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 561 | #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 562 | #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 563 | #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN 564 | 565 | #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED 566 | #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE 567 | #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR 568 | #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL 569 | #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS 570 | #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR 571 | #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED 572 | 573 | /* The following were added earlier */ 574 | 575 | #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT 576 | 577 | #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR 578 | #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED 579 | #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED 580 | 581 | #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE 582 | #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME 583 | 584 | /* This was the error code 50 in 7.7.3 and a few earlier versions, this 585 | is no longer used by libcurl but is instead #defined here only to not 586 | make programs break */ 587 | #define CURLE_ALREADY_COMPLETE 99999 588 | 589 | /* Provide defines for really old option names */ 590 | #define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */ 591 | #define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */ 592 | #define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA 593 | 594 | /* Since long deprecated options with no code in the lib that does anything 595 | with them. */ 596 | #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40 597 | #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72 598 | 599 | #endif /*!CURL_NO_OLDIES*/ 600 | 601 | /* This prototype applies to all conversion callbacks */ 602 | typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); 603 | 604 | typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ 605 | void *ssl_ctx, /* actually an 606 | OpenSSL SSL_CTX */ 607 | void *userptr); 608 | 609 | typedef enum { 610 | CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use 611 | CONNECT HTTP/1.1 */ 612 | CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT 613 | HTTP/1.0 */ 614 | CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already 615 | in 7.10 */ 616 | CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ 617 | CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ 618 | CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the 619 | host name rather than the IP address. added 620 | in 7.18.0 */ 621 | } curl_proxytype; /* this enum was added in 7.10 */ 622 | 623 | /* 624 | * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: 625 | * 626 | * CURLAUTH_NONE - No HTTP authentication 627 | * CURLAUTH_BASIC - HTTP Basic authentication (default) 628 | * CURLAUTH_DIGEST - HTTP Digest authentication 629 | * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication 630 | * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated) 631 | * CURLAUTH_NTLM - HTTP NTLM authentication 632 | * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour 633 | * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper 634 | * CURLAUTH_ONLY - Use together with a single other type to force no 635 | * authentication or just that single type 636 | * CURLAUTH_ANY - All fine types set 637 | * CURLAUTH_ANYSAFE - All fine types except Basic 638 | */ 639 | 640 | #define CURLAUTH_NONE ((unsigned long)0) 641 | #define CURLAUTH_BASIC (((unsigned long)1)<<0) 642 | #define CURLAUTH_DIGEST (((unsigned long)1)<<1) 643 | #define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2) 644 | /* Deprecated since the advent of CURLAUTH_NEGOTIATE */ 645 | #define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE 646 | #define CURLAUTH_NTLM (((unsigned long)1)<<3) 647 | #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) 648 | #define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) 649 | #define CURLAUTH_ONLY (((unsigned long)1)<<31) 650 | #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) 651 | #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) 652 | 653 | #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ 654 | #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ 655 | #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ 656 | #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ 657 | #define CURLSSH_AUTH_HOST (1<<2) /* host key files */ 658 | #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ 659 | #define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ 660 | #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY 661 | 662 | #define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ 663 | #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ 664 | #define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ 665 | 666 | #define CURL_ERROR_SIZE 256 667 | 668 | enum curl_khtype { 669 | CURLKHTYPE_UNKNOWN, 670 | CURLKHTYPE_RSA1, 671 | CURLKHTYPE_RSA, 672 | CURLKHTYPE_DSS 673 | }; 674 | 675 | struct curl_khkey { 676 | const char *key; /* points to a zero-terminated string encoded with base64 677 | if len is zero, otherwise to the "raw" data */ 678 | size_t len; 679 | enum curl_khtype keytype; 680 | }; 681 | 682 | /* this is the set of return values expected from the curl_sshkeycallback 683 | callback */ 684 | enum curl_khstat { 685 | CURLKHSTAT_FINE_ADD_TO_FILE, 686 | CURLKHSTAT_FINE, 687 | CURLKHSTAT_REJECT, /* reject the connection, return an error */ 688 | CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so 689 | this causes a CURLE_DEFER error but otherwise the 690 | connection will be left intact etc */ 691 | CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ 692 | }; 693 | 694 | /* this is the set of status codes pass in to the callback */ 695 | enum curl_khmatch { 696 | CURLKHMATCH_OK, /* match */ 697 | CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ 698 | CURLKHMATCH_MISSING, /* no matching host/key found */ 699 | CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ 700 | }; 701 | 702 | typedef int 703 | (*curl_sshkeycallback) (CURL *easy, /* easy handle */ 704 | const struct curl_khkey *knownkey, /* known */ 705 | const struct curl_khkey *foundkey, /* found */ 706 | enum curl_khmatch, /* libcurl's view on the keys */ 707 | void *clientp); /* custom pointer passed from app */ 708 | 709 | /* parameter for the CURLOPT_USE_SSL option */ 710 | typedef enum { 711 | CURLUSESSL_NONE, /* do not attempt to use SSL */ 712 | CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ 713 | CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ 714 | CURLUSESSL_ALL, /* SSL for all communication or fail */ 715 | CURLUSESSL_LAST /* not an option, never use */ 716 | } curl_usessl; 717 | 718 | /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ 719 | 720 | /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the 721 | name of improving interoperability with older servers. Some SSL libraries 722 | have introduced work-arounds for this flaw but those work-arounds sometimes 723 | make the SSL communication fail. To regain functionality with those broken 724 | servers, a user can this way allow the vulnerability back. */ 725 | #define CURLSSLOPT_ALLOW_BEAST (1<<0) 726 | 727 | #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all 728 | the obsolete stuff removed! */ 729 | 730 | /* Backwards compatibility with older names */ 731 | /* These are scheduled to disappear by 2009 */ 732 | 733 | #define CURLFTPSSL_NONE CURLUSESSL_NONE 734 | #define CURLFTPSSL_TRY CURLUSESSL_TRY 735 | #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL 736 | #define CURLFTPSSL_ALL CURLUSESSL_ALL 737 | #define CURLFTPSSL_LAST CURLUSESSL_LAST 738 | #define curl_ftpssl curl_usessl 739 | #endif /*!CURL_NO_OLDIES*/ 740 | 741 | /* parameter for the CURLOPT_FTP_SSL_CCC option */ 742 | typedef enum { 743 | CURLFTPSSL_CCC_NONE, /* do not send CCC */ 744 | CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ 745 | CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ 746 | CURLFTPSSL_CCC_LAST /* not an option, never use */ 747 | } curl_ftpccc; 748 | 749 | /* parameter for the CURLOPT_FTPSSLAUTH option */ 750 | typedef enum { 751 | CURLFTPAUTH_DEFAULT, /* let libcurl decide */ 752 | CURLFTPAUTH_SSL, /* use "AUTH SSL" */ 753 | CURLFTPAUTH_TLS, /* use "AUTH TLS" */ 754 | CURLFTPAUTH_LAST /* not an option, never use */ 755 | } curl_ftpauth; 756 | 757 | /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ 758 | typedef enum { 759 | CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ 760 | CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD 761 | again if MKD succeeded, for SFTP this does 762 | similar magic */ 763 | CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD 764 | again even if MKD failed! */ 765 | CURLFTP_CREATE_DIR_LAST /* not an option, never use */ 766 | } curl_ftpcreatedir; 767 | 768 | /* parameter for the CURLOPT_FTP_FILEMETHOD option */ 769 | typedef enum { 770 | CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ 771 | CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ 772 | CURLFTPMETHOD_NOCWD, /* no CWD at all */ 773 | CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ 774 | CURLFTPMETHOD_LAST /* not an option, never use */ 775 | } curl_ftpmethod; 776 | 777 | /* bitmask defines for CURLOPT_HEADEROPT */ 778 | #define CURLHEADER_UNIFIED 0 779 | #define CURLHEADER_SEPARATE (1<<0) 780 | 781 | /* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ 782 | #define CURLPROTO_HTTP (1<<0) 783 | #define CURLPROTO_HTTPS (1<<1) 784 | #define CURLPROTO_FTP (1<<2) 785 | #define CURLPROTO_FTPS (1<<3) 786 | #define CURLPROTO_SCP (1<<4) 787 | #define CURLPROTO_SFTP (1<<5) 788 | #define CURLPROTO_TELNET (1<<6) 789 | #define CURLPROTO_LDAP (1<<7) 790 | #define CURLPROTO_LDAPS (1<<8) 791 | #define CURLPROTO_DICT (1<<9) 792 | #define CURLPROTO_FILE (1<<10) 793 | #define CURLPROTO_TFTP (1<<11) 794 | #define CURLPROTO_IMAP (1<<12) 795 | #define CURLPROTO_IMAPS (1<<13) 796 | #define CURLPROTO_POP3 (1<<14) 797 | #define CURLPROTO_POP3S (1<<15) 798 | #define CURLPROTO_SMTP (1<<16) 799 | #define CURLPROTO_SMTPS (1<<17) 800 | #define CURLPROTO_RTSP (1<<18) 801 | #define CURLPROTO_RTMP (1<<19) 802 | #define CURLPROTO_RTMPT (1<<20) 803 | #define CURLPROTO_RTMPE (1<<21) 804 | #define CURLPROTO_RTMPTE (1<<22) 805 | #define CURLPROTO_RTMPS (1<<23) 806 | #define CURLPROTO_RTMPTS (1<<24) 807 | #define CURLPROTO_GOPHER (1<<25) 808 | #define CURLPROTO_SMB (1<<26) 809 | #define CURLPROTO_SMBS (1<<27) 810 | #define CURLPROTO_ALL (~0) /* enable everything */ 811 | 812 | /* long may be 32 or 64 bits, but we should never depend on anything else 813 | but 32 */ 814 | #define CURLOPTTYPE_LONG 0 815 | #define CURLOPTTYPE_OBJECTPOINT 10000 816 | #define CURLOPTTYPE_FUNCTIONPOINT 20000 817 | #define CURLOPTTYPE_OFF_T 30000 818 | 819 | /* name is uppercase CURLOPT_, 820 | type is one of the defined CURLOPTTYPE_ 821 | number is unique identifier */ 822 | #ifdef CINIT 823 | #undef CINIT 824 | #endif 825 | 826 | #ifdef CURL_ISOCPP 827 | #define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu 828 | #else 829 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ 830 | #define LONG CURLOPTTYPE_LONG 831 | #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT 832 | #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT 833 | #define OFF_T CURLOPTTYPE_OFF_T 834 | #define CINIT(name,type,number) CURLOPT_/**/name = type + number 835 | #endif 836 | 837 | /* 838 | * This macro-mania below setups the CURLOPT_[what] enum, to be used with 839 | * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] 840 | * word. 841 | */ 842 | 843 | typedef enum { 844 | /* This is the FILE * or void * the regular output should be written to. */ 845 | CINIT(WRITEDATA, OBJECTPOINT, 1), 846 | 847 | /* The full URL to get/put */ 848 | CINIT(URL, OBJECTPOINT, 2), 849 | 850 | /* Port number to connect to, if other than default. */ 851 | CINIT(PORT, LONG, 3), 852 | 853 | /* Name of proxy to use. */ 854 | CINIT(PROXY, OBJECTPOINT, 4), 855 | 856 | /* "user:password;options" to use when fetching. */ 857 | CINIT(USERPWD, OBJECTPOINT, 5), 858 | 859 | /* "user:password" to use with proxy. */ 860 | CINIT(PROXYUSERPWD, OBJECTPOINT, 6), 861 | 862 | /* Range to get, specified as an ASCII string. */ 863 | CINIT(RANGE, OBJECTPOINT, 7), 864 | 865 | /* not used */ 866 | 867 | /* Specified file stream to upload from (use as input): */ 868 | CINIT(READDATA, OBJECTPOINT, 9), 869 | 870 | /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE 871 | * bytes big. If this is not used, error messages go to stderr instead: */ 872 | CINIT(ERRORBUFFER, OBJECTPOINT, 10), 873 | 874 | /* Function that will be called to store the output (instead of fwrite). The 875 | * parameters will use fwrite() syntax, make sure to follow them. */ 876 | CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), 877 | 878 | /* Function that will be called to read the input (instead of fread). The 879 | * parameters will use fread() syntax, make sure to follow them. */ 880 | CINIT(READFUNCTION, FUNCTIONPOINT, 12), 881 | 882 | /* Time-out the read operation after this amount of seconds */ 883 | CINIT(TIMEOUT, LONG, 13), 884 | 885 | /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about 886 | * how large the file being sent really is. That allows better error 887 | * checking and better verifies that the upload was successful. -1 means 888 | * unknown size. 889 | * 890 | * For large file support, there is also a _LARGE version of the key 891 | * which takes an off_t type, allowing platforms with larger off_t 892 | * sizes to handle larger files. See below for INFILESIZE_LARGE. 893 | */ 894 | CINIT(INFILESIZE, LONG, 14), 895 | 896 | /* POST static input fields. */ 897 | CINIT(POSTFIELDS, OBJECTPOINT, 15), 898 | 899 | /* Set the referrer page (needed by some CGIs) */ 900 | CINIT(REFERER, OBJECTPOINT, 16), 901 | 902 | /* Set the FTP PORT string (interface name, named or numerical IP address) 903 | Use i.e '-' to use default address. */ 904 | CINIT(FTPPORT, OBJECTPOINT, 17), 905 | 906 | /* Set the User-Agent string (examined by some CGIs) */ 907 | CINIT(USERAGENT, OBJECTPOINT, 18), 908 | 909 | /* If the download receives less than "low speed limit" bytes/second 910 | * during "low speed time" seconds, the operations is aborted. 911 | * You could i.e if you have a pretty high speed connection, abort if 912 | * it is less than 2000 bytes/sec during 20 seconds. 913 | */ 914 | 915 | /* Set the "low speed limit" */ 916 | CINIT(LOW_SPEED_LIMIT, LONG, 19), 917 | 918 | /* Set the "low speed time" */ 919 | CINIT(LOW_SPEED_TIME, LONG, 20), 920 | 921 | /* Set the continuation offset. 922 | * 923 | * Note there is also a _LARGE version of this key which uses 924 | * off_t types, allowing for large file offsets on platforms which 925 | * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. 926 | */ 927 | CINIT(RESUME_FROM, LONG, 21), 928 | 929 | /* Set cookie in request: */ 930 | CINIT(COOKIE, OBJECTPOINT, 22), 931 | 932 | /* This points to a linked list of headers, struct curl_slist kind. This 933 | list is also used for RTSP (in spite of its name) */ 934 | CINIT(HTTPHEADER, OBJECTPOINT, 23), 935 | 936 | /* This points to a linked list of post entries, struct curl_httppost */ 937 | CINIT(HTTPPOST, OBJECTPOINT, 24), 938 | 939 | /* name of the file keeping your private SSL-certificate */ 940 | CINIT(SSLCERT, OBJECTPOINT, 25), 941 | 942 | /* password for the SSL or SSH private key */ 943 | CINIT(KEYPASSWD, OBJECTPOINT, 26), 944 | 945 | /* send TYPE parameter? */ 946 | CINIT(CRLF, LONG, 27), 947 | 948 | /* send linked-list of QUOTE commands */ 949 | CINIT(QUOTE, OBJECTPOINT, 28), 950 | 951 | /* send FILE * or void * to store headers to, if you use a callback it 952 | is simply passed to the callback unmodified */ 953 | CINIT(HEADERDATA, OBJECTPOINT, 29), 954 | 955 | /* point to a file to read the initial cookies from, also enables 956 | "cookie awareness" */ 957 | CINIT(COOKIEFILE, OBJECTPOINT, 31), 958 | 959 | /* What version to specifically try to use. 960 | See CURL_SSLVERSION defines below. */ 961 | CINIT(SSLVERSION, LONG, 32), 962 | 963 | /* What kind of HTTP time condition to use, see defines */ 964 | CINIT(TIMECONDITION, LONG, 33), 965 | 966 | /* Time to use with the above condition. Specified in number of seconds 967 | since 1 Jan 1970 */ 968 | CINIT(TIMEVALUE, LONG, 34), 969 | 970 | /* 35 = OBSOLETE */ 971 | 972 | /* Custom request, for customizing the get command like 973 | HTTP: DELETE, TRACE and others 974 | FTP: to use a different list command 975 | */ 976 | CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), 977 | 978 | /* HTTP request, for odd commands like DELETE, TRACE and others */ 979 | CINIT(STDERR, OBJECTPOINT, 37), 980 | 981 | /* 38 is not used */ 982 | 983 | /* send linked-list of post-transfer QUOTE commands */ 984 | CINIT(POSTQUOTE, OBJECTPOINT, 39), 985 | 986 | CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */ 987 | 988 | CINIT(VERBOSE, LONG, 41), /* talk a lot */ 989 | CINIT(HEADER, LONG, 42), /* throw the header out too */ 990 | CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ 991 | CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ 992 | CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */ 993 | CINIT(UPLOAD, LONG, 46), /* this is an upload */ 994 | CINIT(POST, LONG, 47), /* HTTP POST method */ 995 | CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */ 996 | 997 | CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ 998 | 999 | /* Specify whether to read the user+password from the .netrc or the URL. 1000 | * This must be one of the CURL_NETRC_* enums below. */ 1001 | CINIT(NETRC, LONG, 51), 1002 | 1003 | CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ 1004 | 1005 | CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ 1006 | CINIT(PUT, LONG, 54), /* HTTP PUT */ 1007 | 1008 | /* 55 = OBSOLETE */ 1009 | 1010 | /* DEPRECATED 1011 | * Function that will be called instead of the internal progress display 1012 | * function. This function should be defined as the curl_progress_callback 1013 | * prototype defines. */ 1014 | CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), 1015 | 1016 | /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION 1017 | callbacks */ 1018 | CINIT(PROGRESSDATA, OBJECTPOINT, 57), 1019 | #define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA 1020 | 1021 | /* We want the referrer field set automatically when following locations */ 1022 | CINIT(AUTOREFERER, LONG, 58), 1023 | 1024 | /* Port of the proxy, can be set in the proxy string as well with: 1025 | "[host]:[port]" */ 1026 | CINIT(PROXYPORT, LONG, 59), 1027 | 1028 | /* size of the POST input data, if strlen() is not good to use */ 1029 | CINIT(POSTFIELDSIZE, LONG, 60), 1030 | 1031 | /* tunnel non-http operations through a HTTP proxy */ 1032 | CINIT(HTTPPROXYTUNNEL, LONG, 61), 1033 | 1034 | /* Set the interface string to use as outgoing network interface */ 1035 | CINIT(INTERFACE, OBJECTPOINT, 62), 1036 | 1037 | /* Set the krb4/5 security level, this also enables krb4/5 awareness. This 1038 | * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string 1039 | * is set but doesn't match one of these, 'private' will be used. */ 1040 | CINIT(KRBLEVEL, OBJECTPOINT, 63), 1041 | 1042 | /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ 1043 | CINIT(SSL_VERIFYPEER, LONG, 64), 1044 | 1045 | /* The CApath or CAfile used to validate the peer certificate 1046 | this option is used only if SSL_VERIFYPEER is true */ 1047 | CINIT(CAINFO, OBJECTPOINT, 65), 1048 | 1049 | /* 66 = OBSOLETE */ 1050 | /* 67 = OBSOLETE */ 1051 | 1052 | /* Maximum number of http redirects to follow */ 1053 | CINIT(MAXREDIRS, LONG, 68), 1054 | 1055 | /* Pass a long set to 1 to get the date of the requested document (if 1056 | possible)! Pass a zero to shut it off. */ 1057 | CINIT(FILETIME, LONG, 69), 1058 | 1059 | /* This points to a linked list of telnet options */ 1060 | CINIT(TELNETOPTIONS, OBJECTPOINT, 70), 1061 | 1062 | /* Max amount of cached alive connections */ 1063 | CINIT(MAXCONNECTS, LONG, 71), 1064 | 1065 | CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */ 1066 | 1067 | /* 73 = OBSOLETE */ 1068 | 1069 | /* Set to explicitly use a new connection for the upcoming transfer. 1070 | Do not use this unless you're absolutely sure of this, as it makes the 1071 | operation slower and is less friendly for the network. */ 1072 | CINIT(FRESH_CONNECT, LONG, 74), 1073 | 1074 | /* Set to explicitly forbid the upcoming transfer's connection to be re-used 1075 | when done. Do not use this unless you're absolutely sure of this, as it 1076 | makes the operation slower and is less friendly for the network. */ 1077 | CINIT(FORBID_REUSE, LONG, 75), 1078 | 1079 | /* Set to a file name that contains random data for libcurl to use to 1080 | seed the random engine when doing SSL connects. */ 1081 | CINIT(RANDOM_FILE, OBJECTPOINT, 76), 1082 | 1083 | /* Set to the Entropy Gathering Daemon socket pathname */ 1084 | CINIT(EGDSOCKET, OBJECTPOINT, 77), 1085 | 1086 | /* Time-out connect operations after this amount of seconds, if connects are 1087 | OK within this time, then fine... This only aborts the connect phase. */ 1088 | CINIT(CONNECTTIMEOUT, LONG, 78), 1089 | 1090 | /* Function that will be called to store headers (instead of fwrite). The 1091 | * parameters will use fwrite() syntax, make sure to follow them. */ 1092 | CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), 1093 | 1094 | /* Set this to force the HTTP request to get back to GET. Only really usable 1095 | if POST, PUT or a custom request have been used first. 1096 | */ 1097 | CINIT(HTTPGET, LONG, 80), 1098 | 1099 | /* Set if we should verify the Common name from the peer certificate in ssl 1100 | * handshake, set 1 to check existence, 2 to ensure that it matches the 1101 | * provided hostname. */ 1102 | CINIT(SSL_VERIFYHOST, LONG, 81), 1103 | 1104 | /* Specify which file name to write all known cookies in after completed 1105 | operation. Set file name to "-" (dash) to make it go to stdout. */ 1106 | CINIT(COOKIEJAR, OBJECTPOINT, 82), 1107 | 1108 | /* Specify which SSL ciphers to use */ 1109 | CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), 1110 | 1111 | /* Specify which HTTP version to use! This must be set to one of the 1112 | CURL_HTTP_VERSION* enums set below. */ 1113 | CINIT(HTTP_VERSION, LONG, 84), 1114 | 1115 | /* Specifically switch on or off the FTP engine's use of the EPSV command. By 1116 | default, that one will always be attempted before the more traditional 1117 | PASV command. */ 1118 | CINIT(FTP_USE_EPSV, LONG, 85), 1119 | 1120 | /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ 1121 | CINIT(SSLCERTTYPE, OBJECTPOINT, 86), 1122 | 1123 | /* name of the file keeping your private SSL-key */ 1124 | CINIT(SSLKEY, OBJECTPOINT, 87), 1125 | 1126 | /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ 1127 | CINIT(SSLKEYTYPE, OBJECTPOINT, 88), 1128 | 1129 | /* crypto engine for the SSL-sub system */ 1130 | CINIT(SSLENGINE, OBJECTPOINT, 89), 1131 | 1132 | /* set the crypto engine for the SSL-sub system as default 1133 | the param has no meaning... 1134 | */ 1135 | CINIT(SSLENGINE_DEFAULT, LONG, 90), 1136 | 1137 | /* Non-zero value means to use the global dns cache */ 1138 | CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */ 1139 | 1140 | /* DNS cache timeout */ 1141 | CINIT(DNS_CACHE_TIMEOUT, LONG, 92), 1142 | 1143 | /* send linked-list of pre-transfer QUOTE commands */ 1144 | CINIT(PREQUOTE, OBJECTPOINT, 93), 1145 | 1146 | /* set the debug function */ 1147 | CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), 1148 | 1149 | /* set the data for the debug function */ 1150 | CINIT(DEBUGDATA, OBJECTPOINT, 95), 1151 | 1152 | /* mark this as start of a cookie session */ 1153 | CINIT(COOKIESESSION, LONG, 96), 1154 | 1155 | /* The CApath directory used to validate the peer certificate 1156 | this option is used only if SSL_VERIFYPEER is true */ 1157 | CINIT(CAPATH, OBJECTPOINT, 97), 1158 | 1159 | /* Instruct libcurl to use a smaller receive buffer */ 1160 | CINIT(BUFFERSIZE, LONG, 98), 1161 | 1162 | /* Instruct libcurl to not use any signal/alarm handlers, even when using 1163 | timeouts. This option is useful for multi-threaded applications. 1164 | See libcurl-the-guide for more background information. */ 1165 | CINIT(NOSIGNAL, LONG, 99), 1166 | 1167 | /* Provide a CURLShare for mutexing non-ts data */ 1168 | CINIT(SHARE, OBJECTPOINT, 100), 1169 | 1170 | /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), 1171 | CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ 1172 | CINIT(PROXYTYPE, LONG, 101), 1173 | 1174 | /* Set the Accept-Encoding string. Use this to tell a server you would like 1175 | the response to be compressed. Before 7.21.6, this was known as 1176 | CURLOPT_ENCODING */ 1177 | CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), 1178 | 1179 | /* Set pointer to private data */ 1180 | CINIT(PRIVATE, OBJECTPOINT, 103), 1181 | 1182 | /* Set aliases for HTTP 200 in the HTTP Response header */ 1183 | CINIT(HTTP200ALIASES, OBJECTPOINT, 104), 1184 | 1185 | /* Continue to send authentication (user+password) when following locations, 1186 | even when hostname changed. This can potentially send off the name 1187 | and password to whatever host the server decides. */ 1188 | CINIT(UNRESTRICTED_AUTH, LONG, 105), 1189 | 1190 | /* Specifically switch on or off the FTP engine's use of the EPRT command ( 1191 | it also disables the LPRT attempt). By default, those ones will always be 1192 | attempted before the good old traditional PORT command. */ 1193 | CINIT(FTP_USE_EPRT, LONG, 106), 1194 | 1195 | /* Set this to a bitmask value to enable the particular authentications 1196 | methods you like. Use this in combination with CURLOPT_USERPWD. 1197 | Note that setting multiple bits may cause extra network round-trips. */ 1198 | CINIT(HTTPAUTH, LONG, 107), 1199 | 1200 | /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx 1201 | in second argument. The function must be matching the 1202 | curl_ssl_ctx_callback proto. */ 1203 | CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), 1204 | 1205 | /* Set the userdata for the ssl context callback function's third 1206 | argument */ 1207 | CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), 1208 | 1209 | /* FTP Option that causes missing dirs to be created on the remote server. 1210 | In 7.19.4 we introduced the convenience enums for this option using the 1211 | CURLFTP_CREATE_DIR prefix. 1212 | */ 1213 | CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), 1214 | 1215 | /* Set this to a bitmask value to enable the particular authentications 1216 | methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. 1217 | Note that setting multiple bits may cause extra network round-trips. */ 1218 | CINIT(PROXYAUTH, LONG, 111), 1219 | 1220 | /* FTP option that changes the timeout, in seconds, associated with 1221 | getting a response. This is different from transfer timeout time and 1222 | essentially places a demand on the FTP server to acknowledge commands 1223 | in a timely manner. */ 1224 | CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), 1225 | #define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT 1226 | 1227 | /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to 1228 | tell libcurl to resolve names to those IP versions only. This only has 1229 | affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ 1230 | CINIT(IPRESOLVE, LONG, 113), 1231 | 1232 | /* Set this option to limit the size of a file that will be downloaded from 1233 | an HTTP or FTP server. 1234 | 1235 | Note there is also _LARGE version which adds large file support for 1236 | platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ 1237 | CINIT(MAXFILESIZE, LONG, 114), 1238 | 1239 | /* See the comment for INFILESIZE above, but in short, specifies 1240 | * the size of the file being uploaded. -1 means unknown. 1241 | */ 1242 | CINIT(INFILESIZE_LARGE, OFF_T, 115), 1243 | 1244 | /* Sets the continuation offset. There is also a LONG version of this; 1245 | * look above for RESUME_FROM. 1246 | */ 1247 | CINIT(RESUME_FROM_LARGE, OFF_T, 116), 1248 | 1249 | /* Sets the maximum size of data that will be downloaded from 1250 | * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. 1251 | */ 1252 | CINIT(MAXFILESIZE_LARGE, OFF_T, 117), 1253 | 1254 | /* Set this option to the file name of your .netrc file you want libcurl 1255 | to parse (using the CURLOPT_NETRC option). If not set, libcurl will do 1256 | a poor attempt to find the user's home directory and check for a .netrc 1257 | file in there. */ 1258 | CINIT(NETRC_FILE, OBJECTPOINT, 118), 1259 | 1260 | /* Enable SSL/TLS for FTP, pick one of: 1261 | CURLUSESSL_TRY - try using SSL, proceed anyway otherwise 1262 | CURLUSESSL_CONTROL - SSL for the control connection or fail 1263 | CURLUSESSL_ALL - SSL for all communication or fail 1264 | */ 1265 | CINIT(USE_SSL, LONG, 119), 1266 | 1267 | /* The _LARGE version of the standard POSTFIELDSIZE option */ 1268 | CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), 1269 | 1270 | /* Enable/disable the TCP Nagle algorithm */ 1271 | CINIT(TCP_NODELAY, LONG, 121), 1272 | 1273 | /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ 1274 | /* 123 OBSOLETE. Gone in 7.16.0 */ 1275 | /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ 1276 | /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ 1277 | /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ 1278 | /* 127 OBSOLETE. Gone in 7.16.0 */ 1279 | /* 128 OBSOLETE. Gone in 7.16.0 */ 1280 | 1281 | /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option 1282 | can be used to change libcurl's default action which is to first try 1283 | "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK 1284 | response has been received. 1285 | 1286 | Available parameters are: 1287 | CURLFTPAUTH_DEFAULT - let libcurl decide 1288 | CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS 1289 | CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL 1290 | */ 1291 | CINIT(FTPSSLAUTH, LONG, 129), 1292 | 1293 | CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), 1294 | CINIT(IOCTLDATA, OBJECTPOINT, 131), 1295 | 1296 | /* 132 OBSOLETE. Gone in 7.16.0 */ 1297 | /* 133 OBSOLETE. Gone in 7.16.0 */ 1298 | 1299 | /* zero terminated string for pass on to the FTP server when asked for 1300 | "account" info */ 1301 | CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), 1302 | 1303 | /* feed cookies into cookie engine */ 1304 | CINIT(COOKIELIST, OBJECTPOINT, 135), 1305 | 1306 | /* ignore Content-Length */ 1307 | CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), 1308 | 1309 | /* Set to non-zero to skip the IP address received in a 227 PASV FTP server 1310 | response. Typically used for FTP-SSL purposes but is not restricted to 1311 | that. libcurl will then instead use the same IP address it used for the 1312 | control connection. */ 1313 | CINIT(FTP_SKIP_PASV_IP, LONG, 137), 1314 | 1315 | /* Select "file method" to use when doing FTP, see the curl_ftpmethod 1316 | above. */ 1317 | CINIT(FTP_FILEMETHOD, LONG, 138), 1318 | 1319 | /* Local port number to bind the socket to */ 1320 | CINIT(LOCALPORT, LONG, 139), 1321 | 1322 | /* Number of ports to try, including the first one set with LOCALPORT. 1323 | Thus, setting it to 1 will make no additional attempts but the first. 1324 | */ 1325 | CINIT(LOCALPORTRANGE, LONG, 140), 1326 | 1327 | /* no transfer, set up connection and let application use the socket by 1328 | extracting it with CURLINFO_LASTSOCKET */ 1329 | CINIT(CONNECT_ONLY, LONG, 141), 1330 | 1331 | /* Function that will be called to convert from the 1332 | network encoding (instead of using the iconv calls in libcurl) */ 1333 | CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), 1334 | 1335 | /* Function that will be called to convert to the 1336 | network encoding (instead of using the iconv calls in libcurl) */ 1337 | CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), 1338 | 1339 | /* Function that will be called to convert from UTF8 1340 | (instead of using the iconv calls in libcurl) 1341 | Note that this is used only for SSL certificate processing */ 1342 | CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), 1343 | 1344 | /* if the connection proceeds too quickly then need to slow it down */ 1345 | /* limit-rate: maximum number of bytes per second to send or receive */ 1346 | CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), 1347 | CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), 1348 | 1349 | /* Pointer to command string to send if USER/PASS fails. */ 1350 | CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), 1351 | 1352 | /* callback function for setting socket options */ 1353 | CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), 1354 | CINIT(SOCKOPTDATA, OBJECTPOINT, 149), 1355 | 1356 | /* set to 0 to disable session ID re-use for this transfer, default is 1357 | enabled (== 1) */ 1358 | CINIT(SSL_SESSIONID_CACHE, LONG, 150), 1359 | 1360 | /* allowed SSH authentication methods */ 1361 | CINIT(SSH_AUTH_TYPES, LONG, 151), 1362 | 1363 | /* Used by scp/sftp to do public/private key authentication */ 1364 | CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), 1365 | CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), 1366 | 1367 | /* Send CCC (Clear Command Channel) after authentication */ 1368 | CINIT(FTP_SSL_CCC, LONG, 154), 1369 | 1370 | /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ 1371 | CINIT(TIMEOUT_MS, LONG, 155), 1372 | CINIT(CONNECTTIMEOUT_MS, LONG, 156), 1373 | 1374 | /* set to zero to disable the libcurl's decoding and thus pass the raw body 1375 | data to the application even when it is encoded/compressed */ 1376 | CINIT(HTTP_TRANSFER_DECODING, LONG, 157), 1377 | CINIT(HTTP_CONTENT_DECODING, LONG, 158), 1378 | 1379 | /* Permission used when creating new files and directories on the remote 1380 | server for protocols that support it, SFTP/SCP/FILE */ 1381 | CINIT(NEW_FILE_PERMS, LONG, 159), 1382 | CINIT(NEW_DIRECTORY_PERMS, LONG, 160), 1383 | 1384 | /* Set the behaviour of POST when redirecting. Values must be set to one 1385 | of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ 1386 | CINIT(POSTREDIR, LONG, 161), 1387 | 1388 | /* used by scp/sftp to verify the host's public key */ 1389 | CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), 1390 | 1391 | /* Callback function for opening socket (instead of socket(2)). Optionally, 1392 | callback is able change the address or refuse to connect returning 1393 | CURL_SOCKET_BAD. The callback should have type 1394 | curl_opensocket_callback */ 1395 | CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), 1396 | CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), 1397 | 1398 | /* POST volatile input fields. */ 1399 | CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), 1400 | 1401 | /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ 1402 | CINIT(PROXY_TRANSFER_MODE, LONG, 166), 1403 | 1404 | /* Callback function for seeking in the input stream */ 1405 | CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), 1406 | CINIT(SEEKDATA, OBJECTPOINT, 168), 1407 | 1408 | /* CRL file */ 1409 | CINIT(CRLFILE, OBJECTPOINT, 169), 1410 | 1411 | /* Issuer certificate */ 1412 | CINIT(ISSUERCERT, OBJECTPOINT, 170), 1413 | 1414 | /* (IPv6) Address scope */ 1415 | CINIT(ADDRESS_SCOPE, LONG, 171), 1416 | 1417 | /* Collect certificate chain info and allow it to get retrievable with 1418 | CURLINFO_CERTINFO after the transfer is complete. */ 1419 | CINIT(CERTINFO, LONG, 172), 1420 | 1421 | /* "name" and "pwd" to use when fetching. */ 1422 | CINIT(USERNAME, OBJECTPOINT, 173), 1423 | CINIT(PASSWORD, OBJECTPOINT, 174), 1424 | 1425 | /* "name" and "pwd" to use with Proxy when fetching. */ 1426 | CINIT(PROXYUSERNAME, OBJECTPOINT, 175), 1427 | CINIT(PROXYPASSWORD, OBJECTPOINT, 176), 1428 | 1429 | /* Comma separated list of hostnames defining no-proxy zones. These should 1430 | match both hostnames directly, and hostnames within a domain. For 1431 | example, local.com will match local.com and www.local.com, but NOT 1432 | notlocal.com or www.notlocal.com. For compatibility with other 1433 | implementations of this, .local.com will be considered to be the same as 1434 | local.com. A single * is the only valid wildcard, and effectively 1435 | disables the use of proxy. */ 1436 | CINIT(NOPROXY, OBJECTPOINT, 177), 1437 | 1438 | /* block size for TFTP transfers */ 1439 | CINIT(TFTP_BLKSIZE, LONG, 178), 1440 | 1441 | /* Socks Service */ 1442 | CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), 1443 | 1444 | /* Socks Service */ 1445 | CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), 1446 | 1447 | /* set the bitmask for the protocols that are allowed to be used for the 1448 | transfer, which thus helps the app which takes URLs from users or other 1449 | external inputs and want to restrict what protocol(s) to deal 1450 | with. Defaults to CURLPROTO_ALL. */ 1451 | CINIT(PROTOCOLS, LONG, 181), 1452 | 1453 | /* set the bitmask for the protocols that libcurl is allowed to follow to, 1454 | as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs 1455 | to be set in both bitmasks to be allowed to get redirected to. Defaults 1456 | to all protocols except FILE and SCP. */ 1457 | CINIT(REDIR_PROTOCOLS, LONG, 182), 1458 | 1459 | /* set the SSH knownhost file name to use */ 1460 | CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), 1461 | 1462 | /* set the SSH host key callback, must point to a curl_sshkeycallback 1463 | function */ 1464 | CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), 1465 | 1466 | /* set the SSH host key callback custom pointer */ 1467 | CINIT(SSH_KEYDATA, OBJECTPOINT, 185), 1468 | 1469 | /* set the SMTP mail originator */ 1470 | CINIT(MAIL_FROM, OBJECTPOINT, 186), 1471 | 1472 | /* set the SMTP mail receiver(s) */ 1473 | CINIT(MAIL_RCPT, OBJECTPOINT, 187), 1474 | 1475 | /* FTP: send PRET before PASV */ 1476 | CINIT(FTP_USE_PRET, LONG, 188), 1477 | 1478 | /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ 1479 | CINIT(RTSP_REQUEST, LONG, 189), 1480 | 1481 | /* The RTSP session identifier */ 1482 | CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190), 1483 | 1484 | /* The RTSP stream URI */ 1485 | CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191), 1486 | 1487 | /* The Transport: header to use in RTSP requests */ 1488 | CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192), 1489 | 1490 | /* Manually initialize the client RTSP CSeq for this handle */ 1491 | CINIT(RTSP_CLIENT_CSEQ, LONG, 193), 1492 | 1493 | /* Manually initialize the server RTSP CSeq for this handle */ 1494 | CINIT(RTSP_SERVER_CSEQ, LONG, 194), 1495 | 1496 | /* The stream to pass to INTERLEAVEFUNCTION. */ 1497 | CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), 1498 | 1499 | /* Let the application define a custom write method for RTP data */ 1500 | CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), 1501 | 1502 | /* Turn on wildcard matching */ 1503 | CINIT(WILDCARDMATCH, LONG, 197), 1504 | 1505 | /* Directory matching callback called before downloading of an 1506 | individual file (chunk) started */ 1507 | CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), 1508 | 1509 | /* Directory matching callback called after the file (chunk) 1510 | was downloaded, or skipped */ 1511 | CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), 1512 | 1513 | /* Change match (fnmatch-like) callback for wildcard matching */ 1514 | CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), 1515 | 1516 | /* Let the application define custom chunk data pointer */ 1517 | CINIT(CHUNK_DATA, OBJECTPOINT, 201), 1518 | 1519 | /* FNMATCH_FUNCTION user pointer */ 1520 | CINIT(FNMATCH_DATA, OBJECTPOINT, 202), 1521 | 1522 | /* send linked-list of name:port:address sets */ 1523 | CINIT(RESOLVE, OBJECTPOINT, 203), 1524 | 1525 | /* Set a username for authenticated TLS */ 1526 | CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204), 1527 | 1528 | /* Set a password for authenticated TLS */ 1529 | CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205), 1530 | 1531 | /* Set authentication type for authenticated TLS */ 1532 | CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), 1533 | 1534 | /* Set to 1 to enable the "TE:" header in HTTP requests to ask for 1535 | compressed transfer-encoded responses. Set to 0 to disable the use of TE: 1536 | in outgoing requests. The current default is 0, but it might change in a 1537 | future libcurl release. 1538 | 1539 | libcurl will ask for the compressed methods it knows of, and if that 1540 | isn't any, it will not ask for transfer-encoding at all even if this 1541 | option is set to 1. 1542 | 1543 | */ 1544 | CINIT(TRANSFER_ENCODING, LONG, 207), 1545 | 1546 | /* Callback function for closing socket (instead of close(2)). The callback 1547 | should have type curl_closesocket_callback */ 1548 | CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), 1549 | CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), 1550 | 1551 | /* allow GSSAPI credential delegation */ 1552 | CINIT(GSSAPI_DELEGATION, LONG, 210), 1553 | 1554 | /* Set the name servers to use for DNS resolution */ 1555 | CINIT(DNS_SERVERS, OBJECTPOINT, 211), 1556 | 1557 | /* Time-out accept operations (currently for FTP only) after this amount 1558 | of miliseconds. */ 1559 | CINIT(ACCEPTTIMEOUT_MS, LONG, 212), 1560 | 1561 | /* Set TCP keepalive */ 1562 | CINIT(TCP_KEEPALIVE, LONG, 213), 1563 | 1564 | /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ 1565 | CINIT(TCP_KEEPIDLE, LONG, 214), 1566 | CINIT(TCP_KEEPINTVL, LONG, 215), 1567 | 1568 | /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ 1569 | CINIT(SSL_OPTIONS, LONG, 216), 1570 | 1571 | /* Set the SMTP auth originator */ 1572 | CINIT(MAIL_AUTH, OBJECTPOINT, 217), 1573 | 1574 | /* Enable/disable SASL initial response */ 1575 | CINIT(SASL_IR, LONG, 218), 1576 | 1577 | /* Function that will be called instead of the internal progress display 1578 | * function. This function should be defined as the curl_xferinfo_callback 1579 | * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ 1580 | CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219), 1581 | 1582 | /* The XOAUTH2 bearer token */ 1583 | CINIT(XOAUTH2_BEARER, OBJECTPOINT, 220), 1584 | 1585 | /* Set the interface string to use as outgoing network 1586 | * interface for DNS requests. 1587 | * Only supported by the c-ares DNS backend */ 1588 | CINIT(DNS_INTERFACE, OBJECTPOINT, 221), 1589 | 1590 | /* Set the local IPv4 address to use for outgoing DNS requests. 1591 | * Only supported by the c-ares DNS backend */ 1592 | CINIT(DNS_LOCAL_IP4, OBJECTPOINT, 222), 1593 | 1594 | /* Set the local IPv4 address to use for outgoing DNS requests. 1595 | * Only supported by the c-ares DNS backend */ 1596 | CINIT(DNS_LOCAL_IP6, OBJECTPOINT, 223), 1597 | 1598 | /* Set authentication options directly */ 1599 | CINIT(LOGIN_OPTIONS, OBJECTPOINT, 224), 1600 | 1601 | /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ 1602 | CINIT(SSL_ENABLE_NPN, LONG, 225), 1603 | 1604 | /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ 1605 | CINIT(SSL_ENABLE_ALPN, LONG, 226), 1606 | 1607 | /* Time to wait for a response to a HTTP request containing an 1608 | * Expect: 100-continue header before sending the data anyway. */ 1609 | CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227), 1610 | 1611 | /* This points to a linked list of headers used for proxy requests only, 1612 | struct curl_slist kind */ 1613 | CINIT(PROXYHEADER, OBJECTPOINT, 228), 1614 | 1615 | /* Pass in a bitmask of "header options" */ 1616 | CINIT(HEADEROPT, LONG, 229), 1617 | 1618 | /* The public key in DER form used to validate the peer public key 1619 | this option is used only if SSL_VERIFYPEER is true */ 1620 | CINIT(PINNEDPUBLICKEY, OBJECTPOINT, 230), 1621 | 1622 | /* Path to Unix domain socket */ 1623 | CINIT(UNIX_SOCKET_PATH, OBJECTPOINT, 231), 1624 | 1625 | CURLOPT_LASTENTRY /* the last unused */ 1626 | } CURLoption; 1627 | 1628 | #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all 1629 | the obsolete stuff removed! */ 1630 | 1631 | /* Backwards compatibility with older names */ 1632 | /* These are scheduled to disappear by 2011 */ 1633 | 1634 | /* This was added in version 7.19.1 */ 1635 | #define CURLOPT_POST301 CURLOPT_POSTREDIR 1636 | 1637 | /* These are scheduled to disappear by 2009 */ 1638 | 1639 | /* The following were added in 7.17.0 */ 1640 | #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD 1641 | #define CURLOPT_FTPAPPEND CURLOPT_APPEND 1642 | #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY 1643 | #define CURLOPT_FTP_SSL CURLOPT_USE_SSL 1644 | 1645 | /* The following were added earlier */ 1646 | 1647 | #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD 1648 | #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL 1649 | 1650 | #else 1651 | /* This is set if CURL_NO_OLDIES is defined at compile-time */ 1652 | #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ 1653 | #endif 1654 | 1655 | 1656 | /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host 1657 | name resolves addresses using more than one IP protocol version, this 1658 | option might be handy to force libcurl to use a specific IP version. */ 1659 | #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP 1660 | versions that your system allows */ 1661 | #define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */ 1662 | #define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */ 1663 | 1664 | /* three convenient "aliases" that follow the name scheme better */ 1665 | #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER 1666 | 1667 | /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ 1668 | enum { 1669 | CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd 1670 | like the library to choose the best possible 1671 | for us! */ 1672 | CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ 1673 | CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ 1674 | CURL_HTTP_VERSION_2_0, /* please use HTTP 2.0 in the request */ 1675 | 1676 | CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ 1677 | }; 1678 | 1679 | /* 1680 | * Public API enums for RTSP requests 1681 | */ 1682 | enum { 1683 | CURL_RTSPREQ_NONE, /* first in list */ 1684 | CURL_RTSPREQ_OPTIONS, 1685 | CURL_RTSPREQ_DESCRIBE, 1686 | CURL_RTSPREQ_ANNOUNCE, 1687 | CURL_RTSPREQ_SETUP, 1688 | CURL_RTSPREQ_PLAY, 1689 | CURL_RTSPREQ_PAUSE, 1690 | CURL_RTSPREQ_TEARDOWN, 1691 | CURL_RTSPREQ_GET_PARAMETER, 1692 | CURL_RTSPREQ_SET_PARAMETER, 1693 | CURL_RTSPREQ_RECORD, 1694 | CURL_RTSPREQ_RECEIVE, 1695 | CURL_RTSPREQ_LAST /* last in list */ 1696 | }; 1697 | 1698 | /* These enums are for use with the CURLOPT_NETRC option. */ 1699 | enum CURL_NETRC_OPTION { 1700 | CURL_NETRC_IGNORED, /* The .netrc will never be read. 1701 | * This is the default. */ 1702 | CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred 1703 | * to one in the .netrc. */ 1704 | CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. 1705 | * Unless one is set programmatically, the .netrc 1706 | * will be queried. */ 1707 | CURL_NETRC_LAST 1708 | }; 1709 | 1710 | enum { 1711 | CURL_SSLVERSION_DEFAULT, 1712 | CURL_SSLVERSION_TLSv1, /* TLS 1.x */ 1713 | CURL_SSLVERSION_SSLv2, 1714 | CURL_SSLVERSION_SSLv3, 1715 | CURL_SSLVERSION_TLSv1_0, 1716 | CURL_SSLVERSION_TLSv1_1, 1717 | CURL_SSLVERSION_TLSv1_2, 1718 | 1719 | CURL_SSLVERSION_LAST /* never use, keep last */ 1720 | }; 1721 | 1722 | enum CURL_TLSAUTH { 1723 | CURL_TLSAUTH_NONE, 1724 | CURL_TLSAUTH_SRP, 1725 | CURL_TLSAUTH_LAST /* never use, keep last */ 1726 | }; 1727 | 1728 | /* symbols to use with CURLOPT_POSTREDIR. 1729 | CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 1730 | can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 1731 | | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ 1732 | 1733 | #define CURL_REDIR_GET_ALL 0 1734 | #define CURL_REDIR_POST_301 1 1735 | #define CURL_REDIR_POST_302 2 1736 | #define CURL_REDIR_POST_303 4 1737 | #define CURL_REDIR_POST_ALL \ 1738 | (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) 1739 | 1740 | typedef enum { 1741 | CURL_TIMECOND_NONE, 1742 | 1743 | CURL_TIMECOND_IFMODSINCE, 1744 | CURL_TIMECOND_IFUNMODSINCE, 1745 | CURL_TIMECOND_LASTMOD, 1746 | 1747 | CURL_TIMECOND_LAST 1748 | } curl_TimeCond; 1749 | 1750 | 1751 | /* curl_strequal() and curl_strnequal() are subject for removal in a future 1752 | libcurl, see lib/README.curlx for details */ 1753 | CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); 1754 | CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); 1755 | 1756 | /* name is uppercase CURLFORM_ */ 1757 | #ifdef CFINIT 1758 | #undef CFINIT 1759 | #endif 1760 | 1761 | #ifdef CURL_ISOCPP 1762 | #define CFINIT(name) CURLFORM_ ## name 1763 | #else 1764 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ 1765 | #define CFINIT(name) CURLFORM_/**/name 1766 | #endif 1767 | 1768 | typedef enum { 1769 | CFINIT(NOTHING), /********* the first one is unused ************/ 1770 | 1771 | /* */ 1772 | CFINIT(COPYNAME), 1773 | CFINIT(PTRNAME), 1774 | CFINIT(NAMELENGTH), 1775 | CFINIT(COPYCONTENTS), 1776 | CFINIT(PTRCONTENTS), 1777 | CFINIT(CONTENTSLENGTH), 1778 | CFINIT(FILECONTENT), 1779 | CFINIT(ARRAY), 1780 | CFINIT(OBSOLETE), 1781 | CFINIT(FILE), 1782 | 1783 | CFINIT(BUFFER), 1784 | CFINIT(BUFFERPTR), 1785 | CFINIT(BUFFERLENGTH), 1786 | 1787 | CFINIT(CONTENTTYPE), 1788 | CFINIT(CONTENTHEADER), 1789 | CFINIT(FILENAME), 1790 | CFINIT(END), 1791 | CFINIT(OBSOLETE2), 1792 | 1793 | CFINIT(STREAM), 1794 | 1795 | CURLFORM_LASTENTRY /* the last unused */ 1796 | } CURLformoption; 1797 | 1798 | #undef CFINIT /* done */ 1799 | 1800 | /* structure to be used as parameter for CURLFORM_ARRAY */ 1801 | struct curl_forms { 1802 | CURLformoption option; 1803 | const char *value; 1804 | }; 1805 | 1806 | /* use this for multipart formpost building */ 1807 | /* Returns code for curl_formadd() 1808 | * 1809 | * Returns: 1810 | * CURL_FORMADD_OK on success 1811 | * CURL_FORMADD_MEMORY if the FormInfo allocation fails 1812 | * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form 1813 | * CURL_FORMADD_NULL if a null pointer was given for a char 1814 | * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed 1815 | * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used 1816 | * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) 1817 | * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated 1818 | * CURL_FORMADD_MEMORY if some allocation for string copying failed. 1819 | * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array 1820 | * 1821 | ***************************************************************************/ 1822 | typedef enum { 1823 | CURL_FORMADD_OK, /* first, no error */ 1824 | 1825 | CURL_FORMADD_MEMORY, 1826 | CURL_FORMADD_OPTION_TWICE, 1827 | CURL_FORMADD_NULL, 1828 | CURL_FORMADD_UNKNOWN_OPTION, 1829 | CURL_FORMADD_INCOMPLETE, 1830 | CURL_FORMADD_ILLEGAL_ARRAY, 1831 | CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ 1832 | 1833 | CURL_FORMADD_LAST /* last */ 1834 | } CURLFORMcode; 1835 | 1836 | /* 1837 | * NAME curl_formadd() 1838 | * 1839 | * DESCRIPTION 1840 | * 1841 | * Pretty advanced function for building multi-part formposts. Each invoke 1842 | * adds one part that together construct a full post. Then use 1843 | * CURLOPT_HTTPPOST to send it off to libcurl. 1844 | */ 1845 | CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, 1846 | struct curl_httppost **last_post, 1847 | ...); 1848 | 1849 | /* 1850 | * callback function for curl_formget() 1851 | * The void *arg pointer will be the one passed as second argument to 1852 | * curl_formget(). 1853 | * The character buffer passed to it must not be freed. 1854 | * Should return the buffer length passed to it as the argument "len" on 1855 | * success. 1856 | */ 1857 | typedef size_t (*curl_formget_callback)(void *arg, const char *buf, 1858 | size_t len); 1859 | 1860 | /* 1861 | * NAME curl_formget() 1862 | * 1863 | * DESCRIPTION 1864 | * 1865 | * Serialize a curl_httppost struct built with curl_formadd(). 1866 | * Accepts a void pointer as second argument which will be passed to 1867 | * the curl_formget_callback function. 1868 | * Returns 0 on success. 1869 | */ 1870 | CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, 1871 | curl_formget_callback append); 1872 | /* 1873 | * NAME curl_formfree() 1874 | * 1875 | * DESCRIPTION 1876 | * 1877 | * Free a multipart formpost previously built with curl_formadd(). 1878 | */ 1879 | CURL_EXTERN void curl_formfree(struct curl_httppost *form); 1880 | 1881 | /* 1882 | * NAME curl_getenv() 1883 | * 1884 | * DESCRIPTION 1885 | * 1886 | * Returns a malloc()'ed string that MUST be curl_free()ed after usage is 1887 | * complete. DEPRECATED - see lib/README.curlx 1888 | */ 1889 | CURL_EXTERN char *curl_getenv(const char *variable); 1890 | 1891 | /* 1892 | * NAME curl_version() 1893 | * 1894 | * DESCRIPTION 1895 | * 1896 | * Returns a static ascii string of the libcurl version. 1897 | */ 1898 | CURL_EXTERN char *curl_version(void); 1899 | 1900 | /* 1901 | * NAME curl_easy_escape() 1902 | * 1903 | * DESCRIPTION 1904 | * 1905 | * Escapes URL strings (converts all letters consider illegal in URLs to their 1906 | * %XX versions). This function returns a new allocated string or NULL if an 1907 | * error occurred. 1908 | */ 1909 | CURL_EXTERN char *curl_easy_escape(CURL *handle, 1910 | const char *string, 1911 | int length); 1912 | 1913 | /* the previous version: */ 1914 | CURL_EXTERN char *curl_escape(const char *string, 1915 | int length); 1916 | 1917 | 1918 | /* 1919 | * NAME curl_easy_unescape() 1920 | * 1921 | * DESCRIPTION 1922 | * 1923 | * Unescapes URL encoding in strings (converts all %XX codes to their 8bit 1924 | * versions). This function returns a new allocated string or NULL if an error 1925 | * occurred. 1926 | * Conversion Note: On non-ASCII platforms the ASCII %XX codes are 1927 | * converted into the host encoding. 1928 | */ 1929 | CURL_EXTERN char *curl_easy_unescape(CURL *handle, 1930 | const char *string, 1931 | int length, 1932 | int *outlength); 1933 | 1934 | /* the previous version */ 1935 | CURL_EXTERN char *curl_unescape(const char *string, 1936 | int length); 1937 | 1938 | /* 1939 | * NAME curl_free() 1940 | * 1941 | * DESCRIPTION 1942 | * 1943 | * Provided for de-allocation in the same translation unit that did the 1944 | * allocation. Added in libcurl 7.10 1945 | */ 1946 | CURL_EXTERN void curl_free(void *p); 1947 | 1948 | /* 1949 | * NAME curl_global_init() 1950 | * 1951 | * DESCRIPTION 1952 | * 1953 | * curl_global_init() should be invoked exactly once for each application that 1954 | * uses libcurl and before any call of other libcurl functions. 1955 | * 1956 | * This function is not thread-safe! 1957 | */ 1958 | CURL_EXTERN CURLcode curl_global_init(long flags); 1959 | 1960 | /* 1961 | * NAME curl_global_init_mem() 1962 | * 1963 | * DESCRIPTION 1964 | * 1965 | * curl_global_init() or curl_global_init_mem() should be invoked exactly once 1966 | * for each application that uses libcurl. This function can be used to 1967 | * initialize libcurl and set user defined memory management callback 1968 | * functions. Users can implement memory management routines to check for 1969 | * memory leaks, check for mis-use of the curl library etc. User registered 1970 | * callback routines with be invoked by this library instead of the system 1971 | * memory management routines like malloc, free etc. 1972 | */ 1973 | CURL_EXTERN CURLcode curl_global_init_mem(long flags, 1974 | curl_malloc_callback m, 1975 | curl_free_callback f, 1976 | curl_realloc_callback r, 1977 | curl_strdup_callback s, 1978 | curl_calloc_callback c); 1979 | 1980 | /* 1981 | * NAME curl_global_cleanup() 1982 | * 1983 | * DESCRIPTION 1984 | * 1985 | * curl_global_cleanup() should be invoked exactly once for each application 1986 | * that uses libcurl 1987 | */ 1988 | CURL_EXTERN void curl_global_cleanup(void); 1989 | 1990 | /* linked-list structure for the CURLOPT_QUOTE option (and other) */ 1991 | struct curl_slist { 1992 | char *data; 1993 | struct curl_slist *next; 1994 | }; 1995 | 1996 | /* 1997 | * NAME curl_slist_append() 1998 | * 1999 | * DESCRIPTION 2000 | * 2001 | * Appends a string to a linked list. If no list exists, it will be created 2002 | * first. Returns the new list, after appending. 2003 | */ 2004 | CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, 2005 | const char *); 2006 | 2007 | /* 2008 | * NAME curl_slist_free_all() 2009 | * 2010 | * DESCRIPTION 2011 | * 2012 | * free a previously built curl_slist. 2013 | */ 2014 | CURL_EXTERN void curl_slist_free_all(struct curl_slist *); 2015 | 2016 | /* 2017 | * NAME curl_getdate() 2018 | * 2019 | * DESCRIPTION 2020 | * 2021 | * Returns the time, in seconds since 1 Jan 1970 of the time string given in 2022 | * the first argument. The time argument in the second parameter is unused 2023 | * and should be set to NULL. 2024 | */ 2025 | CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); 2026 | 2027 | /* info about the certificate chain, only for OpenSSL builds. Asked 2028 | for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ 2029 | struct curl_certinfo { 2030 | int num_of_certs; /* number of certificates with information */ 2031 | struct curl_slist **certinfo; /* for each index in this array, there's a 2032 | linked list with textual information in the 2033 | format "name: value" */ 2034 | }; 2035 | 2036 | /* enum for the different supported SSL backends */ 2037 | typedef enum { 2038 | CURLSSLBACKEND_NONE = 0, 2039 | CURLSSLBACKEND_OPENSSL = 1, 2040 | CURLSSLBACKEND_GNUTLS = 2, 2041 | CURLSSLBACKEND_NSS = 3, 2042 | CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */ 2043 | CURLSSLBACKEND_GSKIT = 5, 2044 | CURLSSLBACKEND_POLARSSL = 6, 2045 | CURLSSLBACKEND_CYASSL = 7, 2046 | CURLSSLBACKEND_SCHANNEL = 8, 2047 | CURLSSLBACKEND_DARWINSSL = 9, 2048 | CURLSSLBACKEND_AXTLS = 10 2049 | } curl_sslbackend; 2050 | 2051 | /* Information about the SSL library used and the respective internal SSL 2052 | handle, which can be used to obtain further information regarding the 2053 | connection. Asked for with CURLINFO_TLS_SESSION. */ 2054 | struct curl_tlssessioninfo { 2055 | curl_sslbackend backend; 2056 | void *internals; 2057 | }; 2058 | 2059 | #define CURLINFO_STRING 0x100000 2060 | #define CURLINFO_LONG 0x200000 2061 | #define CURLINFO_DOUBLE 0x300000 2062 | #define CURLINFO_SLIST 0x400000 2063 | #define CURLINFO_MASK 0x0fffff 2064 | #define CURLINFO_TYPEMASK 0xf00000 2065 | 2066 | typedef enum { 2067 | CURLINFO_NONE, /* first, never use this */ 2068 | CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, 2069 | CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, 2070 | CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, 2071 | CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, 2072 | CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, 2073 | CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, 2074 | CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, 2075 | CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, 2076 | CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, 2077 | CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, 2078 | CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, 2079 | CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, 2080 | CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, 2081 | CURLINFO_FILETIME = CURLINFO_LONG + 14, 2082 | CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, 2083 | CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, 2084 | CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, 2085 | CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, 2086 | CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, 2087 | CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, 2088 | CURLINFO_PRIVATE = CURLINFO_STRING + 21, 2089 | CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, 2090 | CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, 2091 | CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, 2092 | CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, 2093 | CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, 2094 | CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, 2095 | CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, 2096 | CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, 2097 | CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, 2098 | CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, 2099 | CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, 2100 | CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, 2101 | CURLINFO_CERTINFO = CURLINFO_SLIST + 34, 2102 | CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, 2103 | CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, 2104 | CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, 2105 | CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, 2106 | CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, 2107 | CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, 2108 | CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, 2109 | CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, 2110 | CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43, 2111 | /* Fill in new entries below here! */ 2112 | 2113 | CURLINFO_LASTONE = 43 2114 | } CURLINFO; 2115 | 2116 | /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as 2117 | CURLINFO_HTTP_CODE */ 2118 | #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE 2119 | 2120 | typedef enum { 2121 | CURLCLOSEPOLICY_NONE, /* first, never use this */ 2122 | 2123 | CURLCLOSEPOLICY_OLDEST, 2124 | CURLCLOSEPOLICY_LEAST_RECENTLY_USED, 2125 | CURLCLOSEPOLICY_LEAST_TRAFFIC, 2126 | CURLCLOSEPOLICY_SLOWEST, 2127 | CURLCLOSEPOLICY_CALLBACK, 2128 | 2129 | CURLCLOSEPOLICY_LAST /* last, never use this */ 2130 | } curl_closepolicy; 2131 | 2132 | #define CURL_GLOBAL_SSL (1<<0) 2133 | #define CURL_GLOBAL_WIN32 (1<<1) 2134 | #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) 2135 | #define CURL_GLOBAL_NOTHING 0 2136 | #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL 2137 | #define CURL_GLOBAL_ACK_EINTR (1<<2) 2138 | 2139 | 2140 | /***************************************************************************** 2141 | * Setup defines, protos etc for the sharing stuff. 2142 | */ 2143 | 2144 | /* Different data locks for a single share */ 2145 | typedef enum { 2146 | CURL_LOCK_DATA_NONE = 0, 2147 | /* CURL_LOCK_DATA_SHARE is used internally to say that 2148 | * the locking is just made to change the internal state of the share 2149 | * itself. 2150 | */ 2151 | CURL_LOCK_DATA_SHARE, 2152 | CURL_LOCK_DATA_COOKIE, 2153 | CURL_LOCK_DATA_DNS, 2154 | CURL_LOCK_DATA_SSL_SESSION, 2155 | CURL_LOCK_DATA_CONNECT, 2156 | CURL_LOCK_DATA_LAST 2157 | } curl_lock_data; 2158 | 2159 | /* Different lock access types */ 2160 | typedef enum { 2161 | CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ 2162 | CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ 2163 | CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ 2164 | CURL_LOCK_ACCESS_LAST /* never use */ 2165 | } curl_lock_access; 2166 | 2167 | typedef void (*curl_lock_function)(CURL *handle, 2168 | curl_lock_data data, 2169 | curl_lock_access locktype, 2170 | void *userptr); 2171 | typedef void (*curl_unlock_function)(CURL *handle, 2172 | curl_lock_data data, 2173 | void *userptr); 2174 | 2175 | typedef void CURLSH; 2176 | 2177 | typedef enum { 2178 | CURLSHE_OK, /* all is fine */ 2179 | CURLSHE_BAD_OPTION, /* 1 */ 2180 | CURLSHE_IN_USE, /* 2 */ 2181 | CURLSHE_INVALID, /* 3 */ 2182 | CURLSHE_NOMEM, /* 4 out of memory */ 2183 | CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ 2184 | CURLSHE_LAST /* never use */ 2185 | } CURLSHcode; 2186 | 2187 | typedef enum { 2188 | CURLSHOPT_NONE, /* don't use */ 2189 | CURLSHOPT_SHARE, /* specify a data type to share */ 2190 | CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ 2191 | CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ 2192 | CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ 2193 | CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock 2194 | callback functions */ 2195 | CURLSHOPT_LAST /* never use */ 2196 | } CURLSHoption; 2197 | 2198 | CURL_EXTERN CURLSH *curl_share_init(void); 2199 | CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); 2200 | CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); 2201 | 2202 | /**************************************************************************** 2203 | * Structures for querying information about the curl library at runtime. 2204 | */ 2205 | 2206 | typedef enum { 2207 | CURLVERSION_FIRST, 2208 | CURLVERSION_SECOND, 2209 | CURLVERSION_THIRD, 2210 | CURLVERSION_FOURTH, 2211 | CURLVERSION_LAST /* never actually use this */ 2212 | } CURLversion; 2213 | 2214 | /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by 2215 | basically all programs ever that want to get version information. It is 2216 | meant to be a built-in version number for what kind of struct the caller 2217 | expects. If the struct ever changes, we redefine the NOW to another enum 2218 | from above. */ 2219 | #define CURLVERSION_NOW CURLVERSION_FOURTH 2220 | 2221 | typedef struct { 2222 | CURLversion age; /* age of the returned struct */ 2223 | const char *version; /* LIBCURL_VERSION */ 2224 | unsigned int version_num; /* LIBCURL_VERSION_NUM */ 2225 | const char *host; /* OS/host/cpu/machine when configured */ 2226 | int features; /* bitmask, see defines below */ 2227 | const char *ssl_version; /* human readable string */ 2228 | long ssl_version_num; /* not used anymore, always 0 */ 2229 | const char *libz_version; /* human readable string */ 2230 | /* protocols is terminated by an entry with a NULL protoname */ 2231 | const char * const *protocols; 2232 | 2233 | /* The fields below this were added in CURLVERSION_SECOND */ 2234 | const char *ares; 2235 | int ares_num; 2236 | 2237 | /* This field was added in CURLVERSION_THIRD */ 2238 | const char *libidn; 2239 | 2240 | /* These field were added in CURLVERSION_FOURTH */ 2241 | 2242 | /* Same as '_libiconv_version' if built with HAVE_ICONV */ 2243 | int iconv_ver_num; 2244 | 2245 | const char *libssh_version; /* human readable string */ 2246 | 2247 | } curl_version_info_data; 2248 | 2249 | #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ 2250 | #define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported 2251 | (deprecated) */ 2252 | #define CURL_VERSION_SSL (1<<2) /* SSL options are present */ 2253 | #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ 2254 | #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ 2255 | #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported 2256 | (deprecated) */ 2257 | #define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */ 2258 | #define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */ 2259 | #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */ 2260 | #define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */ 2261 | #define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are 2262 | supported */ 2263 | #define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */ 2264 | #define CURL_VERSION_CONV (1<<12) /* Character conversions supported */ 2265 | #define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */ 2266 | #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ 2267 | #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper 2268 | is suported */ 2269 | #define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ 2270 | #define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */ 2271 | #define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */ 2272 | #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */ 2273 | 2274 | /* 2275 | * NAME curl_version_info() 2276 | * 2277 | * DESCRIPTION 2278 | * 2279 | * This function returns a pointer to a static copy of the version info 2280 | * struct. See above. 2281 | */ 2282 | CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); 2283 | 2284 | /* 2285 | * NAME curl_easy_strerror() 2286 | * 2287 | * DESCRIPTION 2288 | * 2289 | * The curl_easy_strerror function may be used to turn a CURLcode value 2290 | * into the equivalent human readable error string. This is useful 2291 | * for printing meaningful error messages. 2292 | */ 2293 | CURL_EXTERN const char *curl_easy_strerror(CURLcode); 2294 | 2295 | /* 2296 | * NAME curl_share_strerror() 2297 | * 2298 | * DESCRIPTION 2299 | * 2300 | * The curl_share_strerror function may be used to turn a CURLSHcode value 2301 | * into the equivalent human readable error string. This is useful 2302 | * for printing meaningful error messages. 2303 | */ 2304 | CURL_EXTERN const char *curl_share_strerror(CURLSHcode); 2305 | 2306 | /* 2307 | * NAME curl_easy_pause() 2308 | * 2309 | * DESCRIPTION 2310 | * 2311 | * The curl_easy_pause function pauses or unpauses transfers. Select the new 2312 | * state by setting the bitmask, use the convenience defines below. 2313 | * 2314 | */ 2315 | CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); 2316 | 2317 | #define CURLPAUSE_RECV (1<<0) 2318 | #define CURLPAUSE_RECV_CONT (0) 2319 | 2320 | #define CURLPAUSE_SEND (1<<2) 2321 | #define CURLPAUSE_SEND_CONT (0) 2322 | 2323 | #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) 2324 | #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) 2325 | 2326 | #ifdef __cplusplus 2327 | } 2328 | #endif 2329 | 2330 | /* unfortunately, the easy.h and multi.h include files need options and info 2331 | stuff before they can be included! */ 2332 | #include "easy.h" /* nothing in curl is fun without the easy stuff */ 2333 | #include "multi.h" 2334 | 2335 | /* the typechecker doesn't work in C++ (yet) */ 2336 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ 2337 | ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ 2338 | !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) 2339 | #include "typecheck-gcc.h" 2340 | #else 2341 | #if defined(__STDC__) && (__STDC__ >= 1) 2342 | /* This preprocessor magic that replaces a call with the exact same call is 2343 | only done to make sure application authors pass exactly three arguments 2344 | to these functions. */ 2345 | #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) 2346 | #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) 2347 | #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) 2348 | #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) 2349 | #endif /* __STDC__ >= 1 */ 2350 | #endif /* gcc >= 4.3 && !__cplusplus */ 2351 | 2352 | #endif /* __CURL_CURL_H */ 2353 | -------------------------------------------------------------------------------- /deps/curl-static/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 http://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: http://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 | #ifdef __LP64__ 116 | 117 | /* Configure process defines this to 1 when it finds out that system */ 118 | /* header file ws2tcpip.h must be included by the external interface. */ 119 | /* #undef CURL_PULL_WS2TCPIP_H */ 120 | #ifdef CURL_PULL_WS2TCPIP_H 121 | # ifndef WIN32_LEAN_AND_MEAN 122 | # define WIN32_LEAN_AND_MEAN 123 | # endif 124 | # include 125 | # include 126 | # include 127 | #endif 128 | 129 | /* Configure process defines this to 1 when it finds out that system */ 130 | /* header file sys/types.h must be included by the external interface. */ 131 | #define CURL_PULL_SYS_TYPES_H 1 132 | #ifdef CURL_PULL_SYS_TYPES_H 133 | # include 134 | #endif 135 | 136 | /* Configure process defines this to 1 when it finds out that system */ 137 | /* header file stdint.h must be included by the external interface. */ 138 | /* #undef CURL_PULL_STDINT_H */ 139 | #ifdef CURL_PULL_STDINT_H 140 | # include 141 | #endif 142 | 143 | /* Configure process defines this to 1 when it finds out that system */ 144 | /* header file inttypes.h must be included by the external interface. */ 145 | /* #undef CURL_PULL_INTTYPES_H */ 146 | #ifdef CURL_PULL_INTTYPES_H 147 | # include 148 | #endif 149 | 150 | /* Configure process defines this to 1 when it finds out that system */ 151 | /* header file sys/socket.h must be included by the external interface. */ 152 | #define CURL_PULL_SYS_SOCKET_H 1 153 | #ifdef CURL_PULL_SYS_SOCKET_H 154 | # include 155 | #endif 156 | 157 | /* Configure process defines this to 1 when it finds out that system */ 158 | /* header file sys/poll.h must be included by the external interface. */ 159 | /* #undef CURL_PULL_SYS_POLL_H */ 160 | #ifdef CURL_PULL_SYS_POLL_H 161 | # include 162 | #endif 163 | 164 | /* The size of `long', as computed by sizeof. */ 165 | #define CURL_SIZEOF_LONG 8 166 | 167 | /* Integral data type used for curl_socklen_t. */ 168 | #define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t 169 | 170 | /* The size of `curl_socklen_t', as computed by sizeof. */ 171 | #define CURL_SIZEOF_CURL_SOCKLEN_T 4 172 | 173 | /* Data type definition of curl_socklen_t. */ 174 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; 175 | 176 | /* Signed integral data type used for curl_off_t. */ 177 | #define CURL_TYPEOF_CURL_OFF_T long 178 | 179 | /* Data type definition of curl_off_t. */ 180 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; 181 | 182 | /* curl_off_t formatting string directive without "%" conversion specifier. */ 183 | #define CURL_FORMAT_CURL_OFF_T "ld" 184 | 185 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */ 186 | #define CURL_FORMAT_CURL_OFF_TU "lu" 187 | 188 | /* curl_off_t formatting string directive with "%" conversion specifier. */ 189 | #define CURL_FORMAT_OFF_T "%ld" 190 | 191 | /* The size of `curl_off_t', as computed by sizeof. */ 192 | #define CURL_SIZEOF_CURL_OFF_T 8 193 | 194 | /* curl_off_t constant suffix. */ 195 | #define CURL_SUFFIX_CURL_OFF_T L 196 | 197 | /* unsigned curl_off_t constant suffix. */ 198 | #define CURL_SUFFIX_CURL_OFF_TU UL 199 | 200 | #else /* __LP64__ */ 201 | 202 | /* Configure process defines this to 1 when it finds out that system */ 203 | /* header file ws2tcpip.h must be included by the external interface. */ 204 | /* #undef CURL_PULL_WS2TCPIP_H */ 205 | #ifdef CURL_PULL_WS2TCPIP_H 206 | # ifndef WIN32_LEAN_AND_MEAN 207 | # define WIN32_LEAN_AND_MEAN 208 | # endif 209 | # include 210 | # include 211 | # include 212 | #endif 213 | 214 | /* Configure process defines this to 1 when it finds out that system */ 215 | /* header file sys/types.h must be included by the external interface. */ 216 | #define CURL_PULL_SYS_TYPES_H 1 217 | #ifdef CURL_PULL_SYS_TYPES_H 218 | # include 219 | #endif 220 | 221 | /* Configure process defines this to 1 when it finds out that system */ 222 | /* header file stdint.h must be included by the external interface. */ 223 | #define CURL_PULL_STDINT_H 1 224 | #ifdef CURL_PULL_STDINT_H 225 | # include 226 | #endif 227 | 228 | /* Configure process defines this to 1 when it finds out that system */ 229 | /* header file inttypes.h must be included by the external interface. */ 230 | #define CURL_PULL_INTTYPES_H 1 231 | #ifdef CURL_PULL_INTTYPES_H 232 | # include 233 | #endif 234 | 235 | /* Configure process defines this to 1 when it finds out that system */ 236 | /* header file sys/socket.h must be included by the external interface. */ 237 | #define CURL_PULL_SYS_SOCKET_H 1 238 | #ifdef CURL_PULL_SYS_SOCKET_H 239 | # include 240 | #endif 241 | 242 | /* Configure process defines this to 1 when it finds out that system */ 243 | /* header file sys/poll.h must be included by the external interface. */ 244 | /* #undef CURL_PULL_SYS_POLL_H */ 245 | #ifdef CURL_PULL_SYS_POLL_H 246 | # include 247 | #endif 248 | 249 | /* The size of `long', as computed by sizeof. */ 250 | #define CURL_SIZEOF_LONG 4 251 | 252 | /* Integral data type used for curl_socklen_t. */ 253 | #define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t 254 | 255 | /* The size of `curl_socklen_t', as computed by sizeof. */ 256 | #define CURL_SIZEOF_CURL_SOCKLEN_T 4 257 | 258 | /* Data type definition of curl_socklen_t. */ 259 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; 260 | 261 | /* Signed integral data type used for curl_off_t. */ 262 | #define CURL_TYPEOF_CURL_OFF_T int64_t 263 | 264 | /* Data type definition of curl_off_t. */ 265 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; 266 | 267 | /* curl_off_t formatting string directive without "%" conversion specifier. */ 268 | #define CURL_FORMAT_CURL_OFF_T "lld" 269 | 270 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */ 271 | #define CURL_FORMAT_CURL_OFF_TU "llu" 272 | 273 | /* curl_off_t formatting string directive with "%" conversion specifier. */ 274 | #define CURL_FORMAT_OFF_T "%lld" 275 | 276 | /* The size of `curl_off_t', as computed by sizeof. */ 277 | #define CURL_SIZEOF_CURL_OFF_T 8 278 | 279 | /* curl_off_t constant suffix. */ 280 | #define CURL_SUFFIX_CURL_OFF_T LL 281 | 282 | /* unsigned curl_off_t constant suffix. */ 283 | #define CURL_SUFFIX_CURL_OFF_TU ULL 284 | 285 | #endif /* __LP64__ */ 286 | 287 | #endif /* __CURL_CURLBUILD_H */ 288 | -------------------------------------------------------------------------------- /deps/curl-static/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 http://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 | * http://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 | -------------------------------------------------------------------------------- /deps/curl-static/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 - 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 http://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 - 2015 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.40.0" 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 40 39 | #define LIBCURL_VERSION_PATCH 0 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 | #define LIBCURL_VERSION_NUM 0x072800 57 | 58 | /* 59 | * This is the date and time when the full source package was created. The 60 | * timestamp is not stored in git, as the timestamp is properly set in the 61 | * tarballs by the maketgz script. 62 | * 63 | * The format of the date should follow this template: 64 | * 65 | * "Mon Feb 12 11:35:33 UTC 2007" 66 | */ 67 | #define LIBCURL_TIMESTAMP "Thu Jan 8 08:17:17 UTC 2015" 68 | 69 | #endif /* __CURL_CURLVER_H */ 70 | -------------------------------------------------------------------------------- /deps/curl-static/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 http://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 | -------------------------------------------------------------------------------- /deps/curl-static/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 - 2013, 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 http://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 | 28 | #include "curl.h" 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | CURL_EXTERN int curl_mprintf(const char *format, ...); 35 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 36 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 37 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 38 | const char *format, ...); 39 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 40 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 42 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 43 | const char *format, va_list args); 44 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 45 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 46 | 47 | #ifdef _MPRINTF_REPLACE 48 | # undef printf 49 | # undef fprintf 50 | # undef sprintf 51 | # undef vsprintf 52 | # undef snprintf 53 | # undef vprintf 54 | # undef vfprintf 55 | # undef vsnprintf 56 | # undef aprintf 57 | # undef vaprintf 58 | # define printf curl_mprintf 59 | # define fprintf curl_mfprintf 60 | #ifdef CURLDEBUG 61 | /* When built with CURLDEBUG we define away the sprintf functions since we 62 | don't want internal code to be using them */ 63 | # define sprintf sprintf_was_used 64 | # define vsprintf vsprintf_was_used 65 | #else 66 | # define sprintf curl_msprintf 67 | # define vsprintf curl_mvsprintf 68 | #endif 69 | # define snprintf curl_msnprintf 70 | # define vprintf curl_mvprintf 71 | # define vfprintf curl_mvfprintf 72 | # define vsnprintf curl_mvsnprintf 73 | # define aprintf curl_maprintf 74 | # define vaprintf curl_mvaprintf 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __CURL_MPRINTF_H */ 82 | -------------------------------------------------------------------------------- /deps/curl-static/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 - 2013, 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 http://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 | typedef void CURLM; 56 | 57 | typedef enum { 58 | CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or 59 | curl_multi_socket*() soon */ 60 | CURLM_OK, 61 | CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ 62 | CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ 63 | CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ 64 | CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ 65 | CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ 66 | CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ 67 | CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was 68 | attempted to get added - again */ 69 | CURLM_LAST 70 | } CURLMcode; 71 | 72 | /* just to make code nicer when using curl_multi_socket() you can now check 73 | for CURLM_CALL_MULTI_SOCKET too in the same style it works for 74 | curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ 75 | #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM 76 | 77 | typedef enum { 78 | CURLMSG_NONE, /* first, not used */ 79 | CURLMSG_DONE, /* This easy handle has completed. 'result' contains 80 | the CURLcode of the transfer */ 81 | CURLMSG_LAST /* last, not used */ 82 | } CURLMSG; 83 | 84 | struct CURLMsg { 85 | CURLMSG msg; /* what this message means */ 86 | CURL *easy_handle; /* the handle it concerns */ 87 | union { 88 | void *whatever; /* message-specific data */ 89 | CURLcode result; /* return code for transfer */ 90 | } data; 91 | }; 92 | typedef struct CURLMsg CURLMsg; 93 | 94 | /* Based on poll(2) structure and values. 95 | * We don't use pollfd and POLL* constants explicitly 96 | * to cover platforms without poll(). */ 97 | #define CURL_WAIT_POLLIN 0x0001 98 | #define CURL_WAIT_POLLPRI 0x0002 99 | #define CURL_WAIT_POLLOUT 0x0004 100 | 101 | struct curl_waitfd { 102 | curl_socket_t fd; 103 | short events; 104 | short revents; /* not supported yet */ 105 | }; 106 | 107 | /* 108 | * Name: curl_multi_init() 109 | * 110 | * Desc: inititalize multi-style curl usage 111 | * 112 | * Returns: a new CURLM handle to use in all 'curl_multi' functions. 113 | */ 114 | CURL_EXTERN CURLM *curl_multi_init(void); 115 | 116 | /* 117 | * Name: curl_multi_add_handle() 118 | * 119 | * Desc: add a standard curl handle to the multi stack 120 | * 121 | * Returns: CURLMcode type, general multi error code. 122 | */ 123 | CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, 124 | CURL *curl_handle); 125 | 126 | /* 127 | * Name: curl_multi_remove_handle() 128 | * 129 | * Desc: removes a curl handle from the multi stack again 130 | * 131 | * Returns: CURLMcode type, general multi error code. 132 | */ 133 | CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, 134 | CURL *curl_handle); 135 | 136 | /* 137 | * Name: curl_multi_fdset() 138 | * 139 | * Desc: Ask curl for its fd_set sets. The app can use these to select() or 140 | * poll() on. We want curl_multi_perform() called as soon as one of 141 | * them are ready. 142 | * 143 | * Returns: CURLMcode type, general multi error code. 144 | */ 145 | CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, 146 | fd_set *read_fd_set, 147 | fd_set *write_fd_set, 148 | fd_set *exc_fd_set, 149 | int *max_fd); 150 | 151 | /* 152 | * Name: curl_multi_wait() 153 | * 154 | * Desc: Poll on all fds within a CURLM set as well as any 155 | * additional fds passed to the function. 156 | * 157 | * Returns: CURLMcode type, general multi error code. 158 | */ 159 | CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, 160 | struct curl_waitfd extra_fds[], 161 | unsigned int extra_nfds, 162 | int timeout_ms, 163 | int *ret); 164 | 165 | /* 166 | * Name: curl_multi_perform() 167 | * 168 | * Desc: When the app thinks there's data available for curl it calls this 169 | * function to read/write whatever there is right now. This returns 170 | * as soon as the reads and writes are done. This function does not 171 | * require that there actually is data available for reading or that 172 | * data can be written, it can be called just in case. It returns 173 | * the number of handles that still transfer data in the second 174 | * argument's integer-pointer. 175 | * 176 | * Returns: CURLMcode type, general multi error code. *NOTE* that this only 177 | * returns errors etc regarding the whole multi stack. There might 178 | * still have occurred problems on invidual transfers even when this 179 | * returns OK. 180 | */ 181 | CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, 182 | int *running_handles); 183 | 184 | /* 185 | * Name: curl_multi_cleanup() 186 | * 187 | * Desc: Cleans up and removes a whole multi stack. It does not free or 188 | * touch any individual easy handles in any way. We need to define 189 | * in what state those handles will be if this function is called 190 | * in the middle of a transfer. 191 | * 192 | * Returns: CURLMcode type, general multi error code. 193 | */ 194 | CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); 195 | 196 | /* 197 | * Name: curl_multi_info_read() 198 | * 199 | * Desc: Ask the multi handle if there's any messages/informationals from 200 | * the individual transfers. Messages include informationals such as 201 | * error code from the transfer or just the fact that a transfer is 202 | * completed. More details on these should be written down as well. 203 | * 204 | * Repeated calls to this function will return a new struct each 205 | * time, until a special "end of msgs" struct is returned as a signal 206 | * that there is no more to get at this point. 207 | * 208 | * The data the returned pointer points to will not survive calling 209 | * curl_multi_cleanup(). 210 | * 211 | * The 'CURLMsg' struct is meant to be very simple and only contain 212 | * very basic informations. If more involved information is wanted, 213 | * we will provide the particular "transfer handle" in that struct 214 | * and that should/could/would be used in subsequent 215 | * curl_easy_getinfo() calls (or similar). The point being that we 216 | * must never expose complex structs to applications, as then we'll 217 | * undoubtably get backwards compatibility problems in the future. 218 | * 219 | * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out 220 | * of structs. It also writes the number of messages left in the 221 | * queue (after this read) in the integer the second argument points 222 | * to. 223 | */ 224 | CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, 225 | int *msgs_in_queue); 226 | 227 | /* 228 | * Name: curl_multi_strerror() 229 | * 230 | * Desc: The curl_multi_strerror function may be used to turn a CURLMcode 231 | * value into the equivalent human readable error string. This is 232 | * useful for printing meaningful error messages. 233 | * 234 | * Returns: A pointer to a zero-terminated error message. 235 | */ 236 | CURL_EXTERN const char *curl_multi_strerror(CURLMcode); 237 | 238 | /* 239 | * Name: curl_multi_socket() and 240 | * curl_multi_socket_all() 241 | * 242 | * Desc: An alternative version of curl_multi_perform() that allows the 243 | * application to pass in one of the file descriptors that have been 244 | * detected to have "action" on them and let libcurl perform. 245 | * See man page for details. 246 | */ 247 | #define CURL_POLL_NONE 0 248 | #define CURL_POLL_IN 1 249 | #define CURL_POLL_OUT 2 250 | #define CURL_POLL_INOUT 3 251 | #define CURL_POLL_REMOVE 4 252 | 253 | #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD 254 | 255 | #define CURL_CSELECT_IN 0x01 256 | #define CURL_CSELECT_OUT 0x02 257 | #define CURL_CSELECT_ERR 0x04 258 | 259 | typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ 260 | curl_socket_t s, /* socket */ 261 | int what, /* see above */ 262 | void *userp, /* private callback 263 | pointer */ 264 | void *socketp); /* private socket 265 | pointer */ 266 | /* 267 | * Name: curl_multi_timer_callback 268 | * 269 | * Desc: Called by libcurl whenever the library detects a change in the 270 | * maximum number of milliseconds the app is allowed to wait before 271 | * curl_multi_socket() or curl_multi_perform() must be called 272 | * (to allow libcurl's timed events to take place). 273 | * 274 | * Returns: The callback should return zero. 275 | */ 276 | typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ 277 | long timeout_ms, /* see above */ 278 | void *userp); /* private callback 279 | pointer */ 280 | 281 | CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, 282 | int *running_handles); 283 | 284 | CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, 285 | curl_socket_t s, 286 | int ev_bitmask, 287 | int *running_handles); 288 | 289 | CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, 290 | int *running_handles); 291 | 292 | #ifndef CURL_ALLOW_OLD_MULTI_SOCKET 293 | /* This macro below was added in 7.16.3 to push users who recompile to use 294 | the new curl_multi_socket_action() instead of the old curl_multi_socket() 295 | */ 296 | #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) 297 | #endif 298 | 299 | /* 300 | * Name: curl_multi_timeout() 301 | * 302 | * Desc: Returns the maximum number of milliseconds the app is allowed to 303 | * wait before curl_multi_socket() or curl_multi_perform() must be 304 | * called (to allow libcurl's timed events to take place). 305 | * 306 | * Returns: CURLM error code. 307 | */ 308 | CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, 309 | long *milliseconds); 310 | 311 | #undef CINIT /* re-using the same name as in curl.h */ 312 | 313 | #ifdef CURL_ISOCPP 314 | #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num 315 | #else 316 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ 317 | #define LONG CURLOPTTYPE_LONG 318 | #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT 319 | #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT 320 | #define OFF_T CURLOPTTYPE_OFF_T 321 | #define CINIT(name,type,number) CURLMOPT_/**/name = type + number 322 | #endif 323 | 324 | typedef enum { 325 | /* This is the socket callback function pointer */ 326 | CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), 327 | 328 | /* This is the argument passed to the socket callback */ 329 | CINIT(SOCKETDATA, OBJECTPOINT, 2), 330 | 331 | /* set to 1 to enable pipelining for this multi handle */ 332 | CINIT(PIPELINING, LONG, 3), 333 | 334 | /* This is the timer callback function pointer */ 335 | CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), 336 | 337 | /* This is the argument passed to the timer callback */ 338 | CINIT(TIMERDATA, OBJECTPOINT, 5), 339 | 340 | /* maximum number of entries in the connection cache */ 341 | CINIT(MAXCONNECTS, LONG, 6), 342 | 343 | /* maximum number of (pipelining) connections to one host */ 344 | CINIT(MAX_HOST_CONNECTIONS, LONG, 7), 345 | 346 | /* maximum number of requests in a pipeline */ 347 | CINIT(MAX_PIPELINE_LENGTH, LONG, 8), 348 | 349 | /* a connection with a content-length longer than this 350 | will not be considered for pipelining */ 351 | CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), 352 | 353 | /* a connection with a chunk length longer than this 354 | will not be considered for pipelining */ 355 | CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), 356 | 357 | /* a list of site names(+port) that are blacklisted from 358 | pipelining */ 359 | CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), 360 | 361 | /* a list of server types that are blacklisted from 362 | pipelining */ 363 | CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), 364 | 365 | /* maximum number of open connections in total */ 366 | CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), 367 | 368 | CURLMOPT_LASTENTRY /* the last unused */ 369 | } CURLMoption; 370 | 371 | 372 | /* 373 | * Name: curl_multi_setopt() 374 | * 375 | * Desc: Sets options for the multi handle. 376 | * 377 | * Returns: CURLM error code. 378 | */ 379 | CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, 380 | CURLMoption option, ...); 381 | 382 | 383 | /* 384 | * Name: curl_multi_assign() 385 | * 386 | * Desc: This function sets an association in the multi handle between the 387 | * given socket and a private pointer of the application. This is 388 | * (only) useful for curl_multi_socket uses. 389 | * 390 | * Returns: CURLM error code. 391 | */ 392 | CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, 393 | curl_socket_t sockfd, void *sockp); 394 | 395 | #ifdef __cplusplus 396 | } /* end of extern "C" */ 397 | #endif 398 | 399 | #endif 400 | -------------------------------------------------------------------------------- /deps/curl-static/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 http://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 | -------------------------------------------------------------------------------- /deps/curl-static/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 - 2014, 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 http://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_URL || \ 222 | (option) == CURLOPT_PROXY || \ 223 | (option) == CURLOPT_INTERFACE || \ 224 | (option) == CURLOPT_NETRC_FILE || \ 225 | (option) == CURLOPT_USERPWD || \ 226 | (option) == CURLOPT_USERNAME || \ 227 | (option) == CURLOPT_PASSWORD || \ 228 | (option) == CURLOPT_PROXYUSERPWD || \ 229 | (option) == CURLOPT_PROXYUSERNAME || \ 230 | (option) == CURLOPT_PROXYPASSWORD || \ 231 | (option) == CURLOPT_NOPROXY || \ 232 | (option) == CURLOPT_ACCEPT_ENCODING || \ 233 | (option) == CURLOPT_REFERER || \ 234 | (option) == CURLOPT_USERAGENT || \ 235 | (option) == CURLOPT_COOKIE || \ 236 | (option) == CURLOPT_COOKIEFILE || \ 237 | (option) == CURLOPT_COOKIEJAR || \ 238 | (option) == CURLOPT_COOKIELIST || \ 239 | (option) == CURLOPT_FTPPORT || \ 240 | (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ 241 | (option) == CURLOPT_FTP_ACCOUNT || \ 242 | (option) == CURLOPT_RANGE || \ 243 | (option) == CURLOPT_CUSTOMREQUEST || \ 244 | (option) == CURLOPT_SSLCERT || \ 245 | (option) == CURLOPT_SSLCERTTYPE || \ 246 | (option) == CURLOPT_SSLKEY || \ 247 | (option) == CURLOPT_SSLKEYTYPE || \ 248 | (option) == CURLOPT_KEYPASSWD || \ 249 | (option) == CURLOPT_SSLENGINE || \ 250 | (option) == CURLOPT_CAINFO || \ 251 | (option) == CURLOPT_CAPATH || \ 252 | (option) == CURLOPT_RANDOM_FILE || \ 253 | (option) == CURLOPT_EGDSOCKET || \ 254 | (option) == CURLOPT_SSL_CIPHER_LIST || \ 255 | (option) == CURLOPT_KRBLEVEL || \ 256 | (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ 257 | (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ 258 | (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ 259 | (option) == CURLOPT_CRLFILE || \ 260 | (option) == CURLOPT_ISSUERCERT || \ 261 | (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ 262 | (option) == CURLOPT_SSH_KNOWNHOSTS || \ 263 | (option) == CURLOPT_MAIL_FROM || \ 264 | (option) == CURLOPT_RTSP_SESSION_ID || \ 265 | (option) == CURLOPT_RTSP_STREAM_URI || \ 266 | (option) == CURLOPT_RTSP_TRANSPORT || \ 267 | (option) == CURLOPT_XOAUTH2_BEARER || \ 268 | (option) == CURLOPT_DNS_SERVERS || \ 269 | (option) == CURLOPT_DNS_INTERFACE || \ 270 | (option) == CURLOPT_DNS_LOCAL_IP4 || \ 271 | (option) == CURLOPT_DNS_LOCAL_IP6 || \ 272 | (option) == CURLOPT_LOGIN_OPTIONS || \ 273 | 0) 274 | 275 | /* evaluates to true if option takes a curl_write_callback argument */ 276 | #define _curl_is_write_cb_option(option) \ 277 | ((option) == CURLOPT_HEADERFUNCTION || \ 278 | (option) == CURLOPT_WRITEFUNCTION) 279 | 280 | /* evaluates to true if option takes a curl_conv_callback argument */ 281 | #define _curl_is_conv_cb_option(option) \ 282 | ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ 283 | (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ 284 | (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) 285 | 286 | /* evaluates to true if option takes a data argument to pass to a callback */ 287 | #define _curl_is_cb_data_option(option) \ 288 | ((option) == CURLOPT_WRITEDATA || \ 289 | (option) == CURLOPT_READDATA || \ 290 | (option) == CURLOPT_IOCTLDATA || \ 291 | (option) == CURLOPT_SOCKOPTDATA || \ 292 | (option) == CURLOPT_OPENSOCKETDATA || \ 293 | (option) == CURLOPT_PROGRESSDATA || \ 294 | (option) == CURLOPT_HEADERDATA || \ 295 | (option) == CURLOPT_DEBUGDATA || \ 296 | (option) == CURLOPT_SSL_CTX_DATA || \ 297 | (option) == CURLOPT_SEEKDATA || \ 298 | (option) == CURLOPT_PRIVATE || \ 299 | (option) == CURLOPT_SSH_KEYDATA || \ 300 | (option) == CURLOPT_INTERLEAVEDATA || \ 301 | (option) == CURLOPT_CHUNK_DATA || \ 302 | (option) == CURLOPT_FNMATCH_DATA || \ 303 | 0) 304 | 305 | /* evaluates to true if option takes a POST data argument (void* or char*) */ 306 | #define _curl_is_postfields_option(option) \ 307 | ((option) == CURLOPT_POSTFIELDS || \ 308 | (option) == CURLOPT_COPYPOSTFIELDS || \ 309 | 0) 310 | 311 | /* evaluates to true if option takes a struct curl_slist * argument */ 312 | #define _curl_is_slist_option(option) \ 313 | ((option) == CURLOPT_HTTPHEADER || \ 314 | (option) == CURLOPT_HTTP200ALIASES || \ 315 | (option) == CURLOPT_QUOTE || \ 316 | (option) == CURLOPT_POSTQUOTE || \ 317 | (option) == CURLOPT_PREQUOTE || \ 318 | (option) == CURLOPT_TELNETOPTIONS || \ 319 | (option) == CURLOPT_MAIL_RCPT || \ 320 | 0) 321 | 322 | /* groups of curl_easy_getinfo infos that take the same type of argument */ 323 | 324 | /* evaluates to true if info expects a pointer to char * argument */ 325 | #define _curl_is_string_info(info) \ 326 | (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) 327 | 328 | /* evaluates to true if info expects a pointer to long argument */ 329 | #define _curl_is_long_info(info) \ 330 | (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) 331 | 332 | /* evaluates to true if info expects a pointer to double argument */ 333 | #define _curl_is_double_info(info) \ 334 | (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) 335 | 336 | /* true if info expects a pointer to struct curl_slist * argument */ 337 | #define _curl_is_slist_info(info) \ 338 | (CURLINFO_SLIST < (info)) 339 | 340 | 341 | /* typecheck helpers -- check whether given expression has requested type*/ 342 | 343 | /* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros, 344 | * otherwise define a new macro. Search for __builtin_types_compatible_p 345 | * in the GCC manual. 346 | * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is 347 | * the actual expression passed to the curl_easy_setopt macro. This 348 | * means that you can only apply the sizeof and __typeof__ operators, no 349 | * == or whatsoever. 350 | */ 351 | 352 | /* XXX: should evaluate to true iff expr is a pointer */ 353 | #define _curl_is_any_ptr(expr) \ 354 | (sizeof(expr) == sizeof(void*)) 355 | 356 | /* evaluates to true if expr is NULL */ 357 | /* XXX: must not evaluate expr, so this check is not accurate */ 358 | #define _curl_is_NULL(expr) \ 359 | (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) 360 | 361 | /* evaluates to true if expr is type*, const type* or NULL */ 362 | #define _curl_is_ptr(expr, type) \ 363 | (_curl_is_NULL(expr) || \ 364 | __builtin_types_compatible_p(__typeof__(expr), type *) || \ 365 | __builtin_types_compatible_p(__typeof__(expr), const type *)) 366 | 367 | /* evaluates to true if expr is one of type[], type*, NULL or const type* */ 368 | #define _curl_is_arr(expr, type) \ 369 | (_curl_is_ptr((expr), type) || \ 370 | __builtin_types_compatible_p(__typeof__(expr), type [])) 371 | 372 | /* evaluates to true if expr is a string */ 373 | #define _curl_is_string(expr) \ 374 | (_curl_is_arr((expr), char) || \ 375 | _curl_is_arr((expr), signed char) || \ 376 | _curl_is_arr((expr), unsigned char)) 377 | 378 | /* evaluates to true if expr is a long (no matter the signedness) 379 | * XXX: for now, int is also accepted (and therefore short and char, which 380 | * are promoted to int when passed to a variadic function) */ 381 | #define _curl_is_long(expr) \ 382 | (__builtin_types_compatible_p(__typeof__(expr), long) || \ 383 | __builtin_types_compatible_p(__typeof__(expr), signed long) || \ 384 | __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ 385 | __builtin_types_compatible_p(__typeof__(expr), int) || \ 386 | __builtin_types_compatible_p(__typeof__(expr), signed int) || \ 387 | __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ 388 | __builtin_types_compatible_p(__typeof__(expr), short) || \ 389 | __builtin_types_compatible_p(__typeof__(expr), signed short) || \ 390 | __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ 391 | __builtin_types_compatible_p(__typeof__(expr), char) || \ 392 | __builtin_types_compatible_p(__typeof__(expr), signed char) || \ 393 | __builtin_types_compatible_p(__typeof__(expr), unsigned char)) 394 | 395 | /* evaluates to true if expr is of type curl_off_t */ 396 | #define _curl_is_off_t(expr) \ 397 | (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) 398 | 399 | /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ 400 | /* XXX: also check size of an char[] array? */ 401 | #define _curl_is_error_buffer(expr) \ 402 | (_curl_is_NULL(expr) || \ 403 | __builtin_types_compatible_p(__typeof__(expr), char *) || \ 404 | __builtin_types_compatible_p(__typeof__(expr), char[])) 405 | 406 | /* evaluates to true if expr is of type (const) void* or (const) FILE* */ 407 | #if 0 408 | #define _curl_is_cb_data(expr) \ 409 | (_curl_is_ptr((expr), void) || \ 410 | _curl_is_ptr((expr), FILE)) 411 | #else /* be less strict */ 412 | #define _curl_is_cb_data(expr) \ 413 | _curl_is_any_ptr(expr) 414 | #endif 415 | 416 | /* evaluates to true if expr is of type FILE* */ 417 | #define _curl_is_FILE(expr) \ 418 | (__builtin_types_compatible_p(__typeof__(expr), FILE *)) 419 | 420 | /* evaluates to true if expr can be passed as POST data (void* or char*) */ 421 | #define _curl_is_postfields(expr) \ 422 | (_curl_is_ptr((expr), void) || \ 423 | _curl_is_arr((expr), char)) 424 | 425 | /* FIXME: the whole callback checking is messy... 426 | * The idea is to tolerate char vs. void and const vs. not const 427 | * pointers in arguments at least 428 | */ 429 | /* helper: __builtin_types_compatible_p distinguishes between functions and 430 | * function pointers, hide it */ 431 | #define _curl_callback_compatible(func, type) \ 432 | (__builtin_types_compatible_p(__typeof__(func), type) || \ 433 | __builtin_types_compatible_p(__typeof__(func), type*)) 434 | 435 | /* evaluates to true if expr is of type curl_read_callback or "similar" */ 436 | #define _curl_is_read_cb(expr) \ 437 | (_curl_is_NULL(expr) || \ 438 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \ 439 | __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \ 440 | _curl_callback_compatible((expr), _curl_read_callback1) || \ 441 | _curl_callback_compatible((expr), _curl_read_callback2) || \ 442 | _curl_callback_compatible((expr), _curl_read_callback3) || \ 443 | _curl_callback_compatible((expr), _curl_read_callback4) || \ 444 | _curl_callback_compatible((expr), _curl_read_callback5) || \ 445 | _curl_callback_compatible((expr), _curl_read_callback6)) 446 | typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*); 447 | typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*); 448 | typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*); 449 | typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*); 450 | typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*); 451 | typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*); 452 | 453 | /* evaluates to true if expr is of type curl_write_callback or "similar" */ 454 | #define _curl_is_write_cb(expr) \ 455 | (_curl_is_read_cb(expr) || \ 456 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \ 457 | __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \ 458 | _curl_callback_compatible((expr), _curl_write_callback1) || \ 459 | _curl_callback_compatible((expr), _curl_write_callback2) || \ 460 | _curl_callback_compatible((expr), _curl_write_callback3) || \ 461 | _curl_callback_compatible((expr), _curl_write_callback4) || \ 462 | _curl_callback_compatible((expr), _curl_write_callback5) || \ 463 | _curl_callback_compatible((expr), _curl_write_callback6)) 464 | typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*); 465 | typedef size_t (_curl_write_callback2)(const char *, size_t, size_t, 466 | const void*); 467 | typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*); 468 | typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*); 469 | typedef size_t (_curl_write_callback5)(const void *, size_t, size_t, 470 | const void*); 471 | typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*); 472 | 473 | /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ 474 | #define _curl_is_ioctl_cb(expr) \ 475 | (_curl_is_NULL(expr) || \ 476 | __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \ 477 | _curl_callback_compatible((expr), _curl_ioctl_callback1) || \ 478 | _curl_callback_compatible((expr), _curl_ioctl_callback2) || \ 479 | _curl_callback_compatible((expr), _curl_ioctl_callback3) || \ 480 | _curl_callback_compatible((expr), _curl_ioctl_callback4)) 481 | typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*); 482 | typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*); 483 | typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*); 484 | typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*); 485 | 486 | /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ 487 | #define _curl_is_sockopt_cb(expr) \ 488 | (_curl_is_NULL(expr) || \ 489 | __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \ 490 | _curl_callback_compatible((expr), _curl_sockopt_callback1) || \ 491 | _curl_callback_compatible((expr), _curl_sockopt_callback2)) 492 | typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); 493 | typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, 494 | curlsocktype); 495 | 496 | /* evaluates to true if expr is of type curl_opensocket_callback or 497 | "similar" */ 498 | #define _curl_is_opensocket_cb(expr) \ 499 | (_curl_is_NULL(expr) || \ 500 | __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ 501 | _curl_callback_compatible((expr), _curl_opensocket_callback1) || \ 502 | _curl_callback_compatible((expr), _curl_opensocket_callback2) || \ 503 | _curl_callback_compatible((expr), _curl_opensocket_callback3) || \ 504 | _curl_callback_compatible((expr), _curl_opensocket_callback4)) 505 | typedef curl_socket_t (_curl_opensocket_callback1) 506 | (void *, curlsocktype, struct curl_sockaddr *); 507 | typedef curl_socket_t (_curl_opensocket_callback2) 508 | (void *, curlsocktype, const struct curl_sockaddr *); 509 | typedef curl_socket_t (_curl_opensocket_callback3) 510 | (const void *, curlsocktype, struct curl_sockaddr *); 511 | typedef curl_socket_t (_curl_opensocket_callback4) 512 | (const void *, curlsocktype, const struct curl_sockaddr *); 513 | 514 | /* evaluates to true if expr is of type curl_progress_callback or "similar" */ 515 | #define _curl_is_progress_cb(expr) \ 516 | (_curl_is_NULL(expr) || \ 517 | __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \ 518 | _curl_callback_compatible((expr), _curl_progress_callback1) || \ 519 | _curl_callback_compatible((expr), _curl_progress_callback2)) 520 | typedef int (_curl_progress_callback1)(void *, 521 | double, double, double, double); 522 | typedef int (_curl_progress_callback2)(const void *, 523 | double, double, double, double); 524 | 525 | /* evaluates to true if expr is of type curl_debug_callback or "similar" */ 526 | #define _curl_is_debug_cb(expr) \ 527 | (_curl_is_NULL(expr) || \ 528 | __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \ 529 | _curl_callback_compatible((expr), _curl_debug_callback1) || \ 530 | _curl_callback_compatible((expr), _curl_debug_callback2) || \ 531 | _curl_callback_compatible((expr), _curl_debug_callback3) || \ 532 | _curl_callback_compatible((expr), _curl_debug_callback4) || \ 533 | _curl_callback_compatible((expr), _curl_debug_callback5) || \ 534 | _curl_callback_compatible((expr), _curl_debug_callback6) || \ 535 | _curl_callback_compatible((expr), _curl_debug_callback7) || \ 536 | _curl_callback_compatible((expr), _curl_debug_callback8)) 537 | typedef int (_curl_debug_callback1) (CURL *, 538 | curl_infotype, char *, size_t, void *); 539 | typedef int (_curl_debug_callback2) (CURL *, 540 | curl_infotype, char *, size_t, const void *); 541 | typedef int (_curl_debug_callback3) (CURL *, 542 | curl_infotype, const char *, size_t, void *); 543 | typedef int (_curl_debug_callback4) (CURL *, 544 | curl_infotype, const char *, size_t, const void *); 545 | typedef int (_curl_debug_callback5) (CURL *, 546 | curl_infotype, unsigned char *, size_t, void *); 547 | typedef int (_curl_debug_callback6) (CURL *, 548 | curl_infotype, unsigned char *, size_t, const void *); 549 | typedef int (_curl_debug_callback7) (CURL *, 550 | curl_infotype, const unsigned char *, size_t, void *); 551 | typedef int (_curl_debug_callback8) (CURL *, 552 | curl_infotype, const unsigned char *, size_t, const void *); 553 | 554 | /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ 555 | /* this is getting even messier... */ 556 | #define _curl_is_ssl_ctx_cb(expr) \ 557 | (_curl_is_NULL(expr) || \ 558 | __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \ 559 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \ 560 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \ 561 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \ 562 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \ 563 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \ 564 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \ 565 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \ 566 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) 567 | typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *); 568 | typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *); 569 | typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *); 570 | typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); 571 | #ifdef HEADER_SSL_H 572 | /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX 573 | * this will of course break if we're included before OpenSSL headers... 574 | */ 575 | typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); 576 | typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); 577 | typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); 578 | typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, 579 | const void *); 580 | #else 581 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; 582 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; 583 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; 584 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; 585 | #endif 586 | 587 | /* evaluates to true if expr is of type curl_conv_callback or "similar" */ 588 | #define _curl_is_conv_cb(expr) \ 589 | (_curl_is_NULL(expr) || \ 590 | __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \ 591 | _curl_callback_compatible((expr), _curl_conv_callback1) || \ 592 | _curl_callback_compatible((expr), _curl_conv_callback2) || \ 593 | _curl_callback_compatible((expr), _curl_conv_callback3) || \ 594 | _curl_callback_compatible((expr), _curl_conv_callback4)) 595 | typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); 596 | typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); 597 | typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); 598 | typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); 599 | 600 | /* evaluates to true if expr is of type curl_seek_callback or "similar" */ 601 | #define _curl_is_seek_cb(expr) \ 602 | (_curl_is_NULL(expr) || \ 603 | __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \ 604 | _curl_callback_compatible((expr), _curl_seek_callback1) || \ 605 | _curl_callback_compatible((expr), _curl_seek_callback2)) 606 | typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); 607 | typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); 608 | 609 | 610 | #endif /* __CURL_TYPECHECK_GCC_H */ 611 | -------------------------------------------------------------------------------- /deps/curl-static/libcurl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tihmstar/libgrabkernel/c0401b9627fcb1bcb0e9df52d0141ed67e73ad43/deps/curl-static/libcurl.a -------------------------------------------------------------------------------- /deps/libfragmentzip.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tihmstar/libgrabkernel/c0401b9627fcb1bcb0e9df52d0141ed67e73ad43/deps/libfragmentzip.a -------------------------------------------------------------------------------- /deps/libgrabkernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tihmstar/libgrabkernel/c0401b9627fcb1bcb0e9df52d0141ed67e73ad43/deps/libgrabkernel.a -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | nobase_dist_include_HEADERS = libgrabkernel/libgrabkernel.h 2 | 3 | -------------------------------------------------------------------------------- /include/libgrabkernel/libgrabkernel.h: -------------------------------------------------------------------------------- 1 | // 2 | // libgrabkernel.h 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #ifndef libgrabkernel_h 10 | #define libgrabkernel_h 11 | 12 | #include 13 | 14 | const char* libgrabkernel_version(void); 15 | int grabkernel(const char *downloadPath, int isResearchKernel); 16 | 17 | 18 | #endif /* libgrabkernel_h */ 19 | -------------------------------------------------------------------------------- /libgrabkernel.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libgrabkernel 7 | Description: an iOS kernel downloader lib 8 | 9 | Requires: @libfragmentzip_requires@ 10 | Version: @VERSION_COMMIT_COUNT@ 11 | Libs: -L${libdir} -lgrabkernel 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /libgrabkernel.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8715950E220392B6008A0E66 /* libMobileGestalt.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8715950D220392B6008A0E66 /* libMobileGestalt.tbd */; }; 11 | 87A38A3D2970E97D006B9903 /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87A38A3B2970E90F006B9903 /* libfragmentzip.a */; }; 12 | 87D2D15C22037EFE00DA88A5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 87D2D15B22037EFE00DA88A5 /* AppDelegate.m */; }; 13 | 87D2D15F22037EFE00DA88A5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 87D2D15E22037EFE00DA88A5 /* ViewController.m */; }; 14 | 87D2D16222037EFE00DA88A5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 87D2D16022037EFE00DA88A5 /* Main.storyboard */; }; 15 | 87D2D16422037F0000DA88A5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87D2D16322037F0000DA88A5 /* Assets.xcassets */; }; 16 | 87D2D16722037F0000DA88A5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 87D2D16522037F0000DA88A5 /* LaunchScreen.storyboard */; }; 17 | 87D2D16A22037F0000DA88A5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 87D2D16922037F0000DA88A5 /* main.m */; }; 18 | 87D2D17222037F3200DA88A5 /* libgrabkernel.m in Sources */ = {isa = PBXBuildFile; fileRef = 87D2D17122037F3200DA88A5 /* libgrabkernel.m */; }; 19 | 87D2D17822038EF300DA88A5 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87D2D17722038EF300DA88A5 /* libcurl.a */; }; 20 | 87D2D17A22038EFC00DA88A5 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 87D2D17922038EFC00DA88A5 /* libz.tbd */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 8715950D220392B6008A0E66 /* libMobileGestalt.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libMobileGestalt.tbd; path = usr/lib/libMobileGestalt.tbd; sourceTree = SDKROOT; }; 25 | 87A38A362970E5A9006B9903 /* libfragmentzip_la-libfragmentzip.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = "libfragmentzip_la-libfragmentzip.o"; path = "external/libfragmentzip/libfragmentzip/libfragmentzip_la-libfragmentzip.o"; sourceTree = ""; }; 26 | 87A38A372970E5BB006B9903 /* libgrabkernel.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = libgrabkernel.xcodeproj; sourceTree = ""; }; 27 | 87A38A3B2970E90F006B9903 /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = deps/libfragmentzip.a; sourceTree = ""; }; 28 | 87D2D15722037EFE00DA88A5 /* libgrabkernel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = libgrabkernel.app; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | 87D2D15A22037EFE00DA88A5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 30 | 87D2D15B22037EFE00DA88A5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 31 | 87D2D15D22037EFE00DA88A5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 32 | 87D2D15E22037EFE00DA88A5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 33 | 87D2D16122037EFE00DA88A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34 | 87D2D16322037F0000DA88A5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 35 | 87D2D16622037F0000DA88A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 36 | 87D2D16822037F0000DA88A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 87D2D16922037F0000DA88A5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 38 | 87D2D17022037F3200DA88A5 /* libgrabkernel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = libgrabkernel.h; path = ../include/libgrabkernel/libgrabkernel.h; sourceTree = ""; }; 39 | 87D2D17122037F3200DA88A5 /* libgrabkernel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libgrabkernel.m; sourceTree = ""; }; 40 | 87D2D17522038D8200DA88A5 /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = external/libfragmentzip/libfragmentzip/.libs/libfragmentzip.a; sourceTree = ""; }; 41 | 87D2D17722038EF300DA88A5 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcurl.a; path = "deps/curl-static/libcurl.a"; sourceTree = ""; }; 42 | 87D2D17922038EFC00DA88A5 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 87D2D15422037EFE00DA88A5 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 8715950E220392B6008A0E66 /* libMobileGestalt.tbd in Frameworks */, 51 | 87A38A3D2970E97D006B9903 /* libfragmentzip.a in Frameworks */, 52 | 87D2D17A22038EFC00DA88A5 /* libz.tbd in Frameworks */, 53 | 87D2D17822038EF300DA88A5 /* libcurl.a in Frameworks */, 54 | ); 55 | runOnlyForDeploymentPostprocessing = 0; 56 | }; 57 | /* End PBXFrameworksBuildPhase section */ 58 | 59 | /* Begin PBXGroup section */ 60 | 87A38A382970E5BB006B9903 /* Products */ = { 61 | isa = PBXGroup; 62 | name = Products; 63 | sourceTree = ""; 64 | }; 65 | 87D2D14E22037EFE00DA88A5 = { 66 | isa = PBXGroup; 67 | children = ( 68 | 87D2D15922037EFE00DA88A5 /* libgrabkernel */, 69 | 87D2D15822037EFE00DA88A5 /* Products */, 70 | 87D2D17422038D8200DA88A5 /* Frameworks */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 87D2D15822037EFE00DA88A5 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 87D2D15722037EFE00DA88A5 /* libgrabkernel.app */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 87D2D15922037EFE00DA88A5 /* libgrabkernel */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 87D2D15A22037EFE00DA88A5 /* AppDelegate.h */, 86 | 87D2D15B22037EFE00DA88A5 /* AppDelegate.m */, 87 | 87D2D17022037F3200DA88A5 /* libgrabkernel.h */, 88 | 87D2D17122037F3200DA88A5 /* libgrabkernel.m */, 89 | 87D2D15D22037EFE00DA88A5 /* ViewController.h */, 90 | 87D2D15E22037EFE00DA88A5 /* ViewController.m */, 91 | 87D2D16022037EFE00DA88A5 /* Main.storyboard */, 92 | 87D2D16322037F0000DA88A5 /* Assets.xcassets */, 93 | 87D2D16522037F0000DA88A5 /* LaunchScreen.storyboard */, 94 | 87D2D16822037F0000DA88A5 /* Info.plist */, 95 | 87D2D16922037F0000DA88A5 /* main.m */, 96 | ); 97 | path = libgrabkernel; 98 | sourceTree = ""; 99 | }; 100 | 87D2D17422038D8200DA88A5 /* Frameworks */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 87A38A3B2970E90F006B9903 /* libfragmentzip.a */, 104 | 87A38A372970E5BB006B9903 /* libgrabkernel.xcodeproj */, 105 | 87A38A362970E5A9006B9903 /* libfragmentzip_la-libfragmentzip.o */, 106 | 8715950D220392B6008A0E66 /* libMobileGestalt.tbd */, 107 | 87D2D17922038EFC00DA88A5 /* libz.tbd */, 108 | 87D2D17722038EF300DA88A5 /* libcurl.a */, 109 | 87D2D17522038D8200DA88A5 /* libfragmentzip.a */, 110 | ); 111 | name = Frameworks; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXNativeTarget section */ 117 | 87D2D15622037EFE00DA88A5 /* libgrabkernel */ = { 118 | isa = PBXNativeTarget; 119 | buildConfigurationList = 87D2D16D22037F0000DA88A5 /* Build configuration list for PBXNativeTarget "libgrabkernel" */; 120 | buildPhases = ( 121 | 87D2D15322037EFE00DA88A5 /* Sources */, 122 | 87D2D15422037EFE00DA88A5 /* Frameworks */, 123 | 87D2D15522037EFE00DA88A5 /* Resources */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = libgrabkernel; 130 | productName = libgrabkernel; 131 | productReference = 87D2D15722037EFE00DA88A5 /* libgrabkernel.app */; 132 | productType = "com.apple.product-type.application"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | 87D2D14F22037EFE00DA88A5 /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | LastUpgradeCheck = 1000; 141 | ORGANIZATIONNAME = tihmstar; 142 | TargetAttributes = { 143 | 87D2D15622037EFE00DA88A5 = { 144 | CreatedOnToolsVersion = 10.0; 145 | }; 146 | }; 147 | }; 148 | buildConfigurationList = 87D2D15222037EFE00DA88A5 /* Build configuration list for PBXProject "libgrabkernel" */; 149 | compatibilityVersion = "Xcode 9.3"; 150 | developmentRegion = en; 151 | hasScannedForEncodings = 0; 152 | knownRegions = ( 153 | en, 154 | Base, 155 | ); 156 | mainGroup = 87D2D14E22037EFE00DA88A5; 157 | productRefGroup = 87D2D15822037EFE00DA88A5 /* Products */; 158 | projectDirPath = ""; 159 | projectReferences = ( 160 | { 161 | ProductGroup = 87A38A382970E5BB006B9903 /* Products */; 162 | ProjectRef = 87A38A372970E5BB006B9903 /* libgrabkernel.xcodeproj */; 163 | }, 164 | ); 165 | projectRoot = ""; 166 | targets = ( 167 | 87D2D15622037EFE00DA88A5 /* libgrabkernel */, 168 | ); 169 | }; 170 | /* End PBXProject section */ 171 | 172 | /* Begin PBXResourcesBuildPhase section */ 173 | 87D2D15522037EFE00DA88A5 /* Resources */ = { 174 | isa = PBXResourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 87D2D16722037F0000DA88A5 /* LaunchScreen.storyboard in Resources */, 178 | 87D2D16422037F0000DA88A5 /* Assets.xcassets in Resources */, 179 | 87D2D16222037EFE00DA88A5 /* Main.storyboard in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 87D2D15322037EFE00DA88A5 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 87D2D17222037F3200DA88A5 /* libgrabkernel.m in Sources */, 191 | 87D2D15F22037EFE00DA88A5 /* ViewController.m in Sources */, 192 | 87D2D16A22037F0000DA88A5 /* main.m in Sources */, 193 | 87D2D15C22037EFE00DA88A5 /* AppDelegate.m in Sources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXSourcesBuildPhase section */ 198 | 199 | /* Begin PBXVariantGroup section */ 200 | 87D2D16022037EFE00DA88A5 /* Main.storyboard */ = { 201 | isa = PBXVariantGroup; 202 | children = ( 203 | 87D2D16122037EFE00DA88A5 /* Base */, 204 | ); 205 | name = Main.storyboard; 206 | sourceTree = ""; 207 | }; 208 | 87D2D16522037F0000DA88A5 /* LaunchScreen.storyboard */ = { 209 | isa = PBXVariantGroup; 210 | children = ( 211 | 87D2D16622037F0000DA88A5 /* Base */, 212 | ); 213 | name = LaunchScreen.storyboard; 214 | sourceTree = ""; 215 | }; 216 | /* End PBXVariantGroup section */ 217 | 218 | /* Begin XCBuildConfiguration section */ 219 | 87D2D16B22037F0000DA88A5 /* Debug */ = { 220 | isa = XCBuildConfiguration; 221 | buildSettings = { 222 | ALWAYS_SEARCH_USER_PATHS = NO; 223 | CLANG_ANALYZER_NONNULL = YES; 224 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_ENABLE_OBJC_WEAK = YES; 230 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 231 | CLANG_WARN_BOOL_CONVERSION = YES; 232 | CLANG_WARN_COMMA = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 237 | CLANG_WARN_EMPTY_BODY = YES; 238 | CLANG_WARN_ENUM_CONVERSION = YES; 239 | CLANG_WARN_INFINITE_RECURSION = YES; 240 | CLANG_WARN_INT_CONVERSION = YES; 241 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 242 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 243 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 245 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 246 | CLANG_WARN_STRICT_PROTOTYPES = YES; 247 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 248 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 249 | CLANG_WARN_UNREACHABLE_CODE = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | CODE_SIGN_IDENTITY = "iPhone Developer"; 252 | COPY_PHASE_STRIP = NO; 253 | DEBUG_INFORMATION_FORMAT = dwarf; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | ENABLE_TESTABILITY = YES; 256 | GCC_C_LANGUAGE_STANDARD = gnu11; 257 | GCC_DYNAMIC_NO_PIC = NO; 258 | GCC_NO_COMMON_BLOCKS = YES; 259 | GCC_OPTIMIZATION_LEVEL = 0; 260 | GCC_PREPROCESSOR_DEFINITIONS = ( 261 | "DEBUG=1", 262 | "$(inherited)", 263 | ); 264 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 266 | GCC_WARN_UNDECLARED_SELECTOR = YES; 267 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 268 | GCC_WARN_UNUSED_FUNCTION = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 271 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 272 | ONLY_ACTIVE_ARCH = YES; 273 | SDKROOT = iphoneos; 274 | }; 275 | name = Debug; 276 | }; 277 | 87D2D16C22037F0000DA88A5 /* Release */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ALWAYS_SEARCH_USER_PATHS = NO; 281 | CLANG_ANALYZER_NONNULL = YES; 282 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_ENABLE_OBJC_WEAK = YES; 288 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 289 | CLANG_WARN_BOOL_CONVERSION = YES; 290 | CLANG_WARN_COMMA = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 293 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 294 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 295 | CLANG_WARN_EMPTY_BODY = YES; 296 | CLANG_WARN_ENUM_CONVERSION = YES; 297 | CLANG_WARN_INFINITE_RECURSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 300 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 301 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 303 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 304 | CLANG_WARN_STRICT_PROTOTYPES = YES; 305 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 306 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 307 | CLANG_WARN_UNREACHABLE_CODE = YES; 308 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 309 | CODE_SIGN_IDENTITY = "iPhone Developer"; 310 | COPY_PHASE_STRIP = NO; 311 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 312 | ENABLE_NS_ASSERTIONS = NO; 313 | ENABLE_STRICT_OBJC_MSGSEND = YES; 314 | GCC_C_LANGUAGE_STANDARD = gnu11; 315 | GCC_NO_COMMON_BLOCKS = YES; 316 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 317 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 318 | GCC_WARN_UNDECLARED_SELECTOR = YES; 319 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 320 | GCC_WARN_UNUSED_FUNCTION = YES; 321 | GCC_WARN_UNUSED_VARIABLE = YES; 322 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 323 | MTL_ENABLE_DEBUG_INFO = NO; 324 | SDKROOT = iphoneos; 325 | VALIDATE_PRODUCT = YES; 326 | }; 327 | name = Release; 328 | }; 329 | 87D2D16E22037F0000DA88A5 /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | ARCHS = ( 334 | "$(ARCHS_STANDARD)", 335 | arm64e, 336 | ); 337 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 338 | CODE_SIGN_IDENTITY = "Apple Development"; 339 | CODE_SIGN_STYLE = Automatic; 340 | DEVELOPMENT_TEAM = 59B3JQHY8D; 341 | ENABLE_BITCODE = NO; 342 | HEADER_SEARCH_PATHS = ( 343 | "$(SRCROOT)/external/libfragmentzip/include", 344 | "$(SRCROOT)/deps/curl-static", 345 | ); 346 | INFOPLIST_FILE = libgrabkernel/Info.plist; 347 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 348 | LD_RUNPATH_SEARCH_PATHS = ( 349 | "$(inherited)", 350 | "@executable_path/Frameworks", 351 | ); 352 | LIBRARY_SEARCH_PATHS = ( 353 | "$(inherited)", 354 | "$(PROJECT_DIR)/deps/curl-static", 355 | "$(PROJECT_DIR)/deps", 356 | ); 357 | PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.test; 358 | PRODUCT_NAME = "$(TARGET_NAME)"; 359 | PROVISIONING_PROFILE = ""; 360 | PROVISIONING_PROFILE_SPECIFIER = ""; 361 | SYSTEM_HEADER_SEARCH_PATHS = ""; 362 | TARGETED_DEVICE_FAMILY = "1,2"; 363 | USER_HEADER_SEARCH_PATHS = ""; 364 | }; 365 | name = Debug; 366 | }; 367 | 87D2D16F22037F0000DA88A5 /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | ARCHS = ( 372 | "$(ARCHS_STANDARD)", 373 | arm64e, 374 | ); 375 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 376 | CODE_SIGN_IDENTITY = "Apple Development"; 377 | CODE_SIGN_STYLE = Automatic; 378 | DEVELOPMENT_TEAM = 59B3JQHY8D; 379 | ENABLE_BITCODE = NO; 380 | HEADER_SEARCH_PATHS = ( 381 | "$(SRCROOT)/external/libfragmentzip/include", 382 | "$(SRCROOT)/deps/curl-static", 383 | ); 384 | INFOPLIST_FILE = libgrabkernel/Info.plist; 385 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 386 | LD_RUNPATH_SEARCH_PATHS = ( 387 | "$(inherited)", 388 | "@executable_path/Frameworks", 389 | ); 390 | LIBRARY_SEARCH_PATHS = ( 391 | "$(inherited)", 392 | "$(PROJECT_DIR)/deps/curl-static", 393 | "$(PROJECT_DIR)/deps", 394 | ); 395 | PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.test; 396 | PRODUCT_NAME = "$(TARGET_NAME)"; 397 | PROVISIONING_PROFILE_SPECIFIER = ""; 398 | SYSTEM_HEADER_SEARCH_PATHS = ""; 399 | TARGETED_DEVICE_FAMILY = "1,2"; 400 | USER_HEADER_SEARCH_PATHS = ""; 401 | }; 402 | name = Release; 403 | }; 404 | /* End XCBuildConfiguration section */ 405 | 406 | /* Begin XCConfigurationList section */ 407 | 87D2D15222037EFE00DA88A5 /* Build configuration list for PBXProject "libgrabkernel" */ = { 408 | isa = XCConfigurationList; 409 | buildConfigurations = ( 410 | 87D2D16B22037F0000DA88A5 /* Debug */, 411 | 87D2D16C22037F0000DA88A5 /* Release */, 412 | ); 413 | defaultConfigurationIsVisible = 0; 414 | defaultConfigurationName = Release; 415 | }; 416 | 87D2D16D22037F0000DA88A5 /* Build configuration list for PBXNativeTarget "libgrabkernel" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | 87D2D16E22037F0000DA88A5 /* Debug */, 420 | 87D2D16F22037F0000DA88A5 /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | /* End XCConfigurationList section */ 426 | }; 427 | rootObject = 87D2D14F22037EFE00DA88A5 /* Project object */; 428 | } 429 | -------------------------------------------------------------------------------- /libgrabkernel/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /libgrabkernel/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /libgrabkernel/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /libgrabkernel/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /libgrabkernel/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /libgrabkernel/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /libgrabkernel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /libgrabkernel/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -I$(top_srcdir)/include $(GLOBAL_CFLAGS) $(libfragmentzip_CFLAGS) $(libgeneral_CFLAGS) 2 | AM_CXXFLAGS = $(AM_CFLAGS) $(GLOBAL_CXXFLAGS) 3 | AM_OBJCFLAGS = $(AM_CFLAGS) $(GLOBAL_OBJCFLAGS) 4 | AM_LDFLAGS = $(libfragmentzip_LIBS) 5 | 6 | lib_LTLIBRARIES = libgrabkernel.la 7 | 8 | libgrabkernel_la_CFLAGS = $(AM_CFLAGS) 9 | libgrabkernel_la_CXXFLAGS = $(AM_CXXFLAGS) 10 | libgrabkernel_la_OBJCFLAGS = $(AM_OBJCFLAGS) 11 | libgrabkernel_la_LIBADD = $(AM_LDFLAGS) 12 | libgrabkernel_la_SOURCES = libgrabkernel.m 13 | -------------------------------------------------------------------------------- /libgrabkernel/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /libgrabkernel/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #include "libgrabkernel.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | 22 | 23 | char path[1024] = {0}; 24 | snprintf(path, sizeof(path), "%skernel", getenv("TMPDIR")); 25 | 26 | int asd = grabkernel(path, 0); 27 | 28 | 29 | printf(""); 30 | } 31 | 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /libgrabkernel/libgrabkernel.m: -------------------------------------------------------------------------------- 1 | // 2 | // libgrabkernel.c 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #include "../include/libgrabkernel/libgrabkernel.h" 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | 20 | #define IPSW_URL_TEMPLATE "https://api.ipsw.me/v2.1/%s/%s/url/dl" 21 | 22 | CFPropertyListRef MGCopyAnswer(CFStringRef property); 23 | char * MYCFStringCopyUTF8String(CFStringRef aString) { 24 | if (aString == NULL) { 25 | return NULL; 26 | } 27 | 28 | CFIndex length = CFStringGetLength(aString); 29 | CFIndex maxSize = 30 | CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; 31 | char *buffer = (char *)malloc(maxSize); 32 | if (CFStringGetCString(aString, buffer, maxSize, 33 | kCFStringEncodingUTF8)) { 34 | return buffer; 35 | } 36 | free(buffer); // If we failed 37 | return NULL; 38 | } 39 | 40 | int getBuildNum(char *outStr, size_t *inOutSize){ 41 | int err = 0; 42 | cassure(outStr); 43 | cassure(inOutSize); 44 | 45 | CFStringRef buildVersion = MGCopyAnswer(CFSTR("BuildVersion")); 46 | CFIndex length = CFStringGetLength(buildVersion); 47 | CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; 48 | cassure(*inOutSize>=maxSize); 49 | 50 | cassure(CFStringGetCString(buildVersion, outStr, maxSize, kCFStringEncodingUTF8)); 51 | *inOutSize = strlen(outStr)+1; 52 | 53 | error: 54 | return err; 55 | } 56 | 57 | int getHWModel(char *outStr, size_t *inOutSize){ 58 | int err = 0; 59 | cassure(outStr); 60 | cassure(inOutSize); 61 | 62 | CFStringRef s = MGCopyAnswer(CFSTR("HWModelStr")); 63 | CFIndex length = CFStringGetLength(s); 64 | CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingASCII) + 1; 65 | cassure(*inOutSize>=maxSize); 66 | 67 | cassure(CFStringGetCString(s, outStr, maxSize, kCFStringEncodingUTF8)); 68 | *inOutSize = strlen(outStr)+1; 69 | 70 | error: 71 | return err; 72 | } 73 | 74 | int getMachineName(char *outStr, size_t *inOutSize){ 75 | int err = 0; 76 | size_t realSize = 0; 77 | struct utsname name; 78 | 79 | cassure(outStr); 80 | cassure(inOutSize); 81 | 82 | cassure(!uname(&name)); 83 | 84 | realSize = strlen(name.machine)+1; 85 | cassure(*inOutSize>=realSize); 86 | 87 | *inOutSize = realSize; 88 | strncpy(outStr,name.machine,realSize); 89 | 90 | error: 91 | return err; 92 | } 93 | 94 | static void fragmentzip_callback(unsigned int progress){ 95 | static int prevProgress = 0; 96 | if (prevProgress != progress) { 97 | prevProgress = progress; 98 | if (progress % 5 == 0) { 99 | printf("."); 100 | } 101 | } 102 | } 103 | 104 | char *getKernelpath(const char *buildmanifestPath, const char *model, int isResearchKernel){ 105 | int err = 0; 106 | char *rt = NULL; 107 | cassure(buildmanifestPath); 108 | cassure(model); 109 | 110 | @autoreleasepool { 111 | NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[NSString stringWithCString:buildmanifestPath encoding:NSUTF8StringEncoding]]; 112 | NSArray *identities = [dict valueForKey:@"BuildIdentities"]; 113 | for (NSDictionary *item in identities) { 114 | NSDictionary *info = [item valueForKey:@"Info"]; 115 | NSString *hwmodel = [info valueForKey:@"DeviceClass"]; 116 | 117 | if (strcasecmp(hwmodel.UTF8String, model) == 0) { 118 | NSDictionary *manifest = [item valueForKey:@"Manifest"]; 119 | NSDictionary *kcache = [manifest valueForKey:@"KernelCache"]; 120 | NSDictionary *kinfo = [kcache valueForKey:@"Info"]; 121 | NSString *kpath = [kinfo valueForKey:@"Path"]; 122 | rt = strdup(kpath.UTF8String); 123 | break; 124 | } 125 | } 126 | } 127 | cassure(rt); 128 | error: 129 | if (err) { 130 | printf("[GK] Error: %d\n",err); 131 | return NULL; 132 | } 133 | return rt; 134 | } 135 | 136 | int grabkernel(const char *downloadPath, int isResearchKernel){ 137 | int err = 0; 138 | char build[0x100] = {}; 139 | char machine[0x100] = {}; 140 | char hwmodel[0x100] = {}; 141 | char firmwareUrl[0x200] = {}; 142 | size_t sBuild = 0; 143 | size_t sMachine = 0; 144 | size_t sModel = 0; 145 | fragmentzip_t * fz= NULL; 146 | char *kernelpath = NULL; 147 | printf("[GK] %s\n",libgrabkernel_version()); 148 | cassure(downloadPath); 149 | 150 | sBuild = sizeof(build); 151 | cassure(!getBuildNum(build, &sBuild)); 152 | printf("[GK] Got build number: %s\n",build); 153 | sMachine = sizeof(machine); 154 | cassure(!getMachineName(machine, &sMachine)); 155 | printf("[GK] Got machine number: %s\n",machine); 156 | sModel = sizeof(hwmodel); 157 | cassure(!getHWModel(hwmodel, &sModel)); 158 | printf("[GK] Got model: %s\n",hwmodel); 159 | 160 | cassure(sizeof(firmwareUrl)>sBuild+sMachine+strlen(IPSW_URL_TEMPLATE)+1); 161 | snprintf(firmwareUrl, sizeof(firmwareUrl), IPSW_URL_TEMPLATE, machine,build); 162 | 163 | char path[1024] = {0}; 164 | snprintf(path, sizeof(path), "%sBuildmanifest.plist", getenv("TMPDIR")); 165 | 166 | printf("[GK] Opening remote url %s\n",firmwareUrl); 167 | cassure(fz = fragmentzip_open(firmwareUrl)); 168 | 169 | printf("[GK] Downloading Buildmanifest"); 170 | cassure(!fragmentzip_download_file(fz, "BuildManifest.plist", path, fragmentzip_callback)); 171 | printf(" ok!\n"); 172 | 173 | cassure(kernelpath = getKernelpath(path, hwmodel, isResearchKernel)); 174 | printf("[GK] Downloading kernel: %s",kernelpath); 175 | cassure(!fragmentzip_download_file(fz, kernelpath, downloadPath, fragmentzip_callback)); 176 | printf(" ok!\n"); 177 | 178 | printf("[GK] Done!\n"); 179 | 180 | 181 | error: 182 | safeFree(kernelpath); 183 | return err; 184 | } 185 | 186 | 187 | const char* libgrabkernel_version(){ 188 | return VERSION_STRING; 189 | } 190 | -------------------------------------------------------------------------------- /libgrabkernel/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // libgrabkernel 4 | // 5 | // Created by tihmstar on 31.01.19. 6 | // Copyright © 2019 tihmstar. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | --------------------------------------------------------------------------------