addBetterWinLibSupp

This commit is contained in:
Your Name 2022-03-25 21:50:29 +01:00
parent febfbdcb8b
commit cd0b5a361c
25 changed files with 5378 additions and 4944 deletions

3
.gitignore vendored
View File

@ -72,9 +72,6 @@ Thumbs.db
*.exe *.exe


#Own adds: #Own adds:
g++/
build* build*
src/lib/

Makefile Makefile
S_New4 S_New4

5962
src/curl/curl.h → include/curl/curl.h Executable file → Normal file

File diff suppressed because it is too large Load Diff

154
src/curl/curlver.h → include/curl/curlver.h Executable file → Normal file
View File

@ -1,77 +1,77 @@
#ifndef __CURL_CURLVER_H #ifndef CURLINC_CURLVER_H
#define __CURL_CURLVER_H #define CURLINC_CURLVER_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/


/* This header file contains nothing but libcurl version info, generated by /* This header file contains nothing but libcurl version info, generated by
a script at release-time. This was made its own header file in 7.11.2 */ a script at release-time. This was made its own header file in 7.11.2 */


/* This is the global package copyright */ /* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2019 Daniel Stenberg, <daniel@haxx.se>." #define LIBCURL_COPYRIGHT "1996 - 2022 Daniel Stenberg, <daniel@haxx.se>."


/* This is the version number of the libcurl package from which this header /* This is the version number of the libcurl package from which this header
file origins: */ file origins: */
#define LIBCURL_VERSION "7.65.2-DEV" #define LIBCURL_VERSION "7.82.0"


/* The numeric version number is also available "in parts" by using these /* The numeric version number is also available "in parts" by using these
defines: */ defines: */
#define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 65 #define LIBCURL_VERSION_MINOR 82
#define LIBCURL_VERSION_PATCH 2 #define LIBCURL_VERSION_PATCH 0


/* This is the numeric version of the libcurl version number, meant for easier /* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
always follow this syntax: always follow this syntax:


0xXXYYZZ 0xXXYYZZ


Where XX, YY and ZZ are the main version, release and patch numbers in Where XX, YY and ZZ are the main version, release and patch numbers in
hexadecimal (using 8 bits each). All three numbers are always represented hexadecimal (using 8 bits each). All three numbers are always represented
using two digits. 1.2 would appear as "0x010200" while version 9.11.7 using two digits. 1.2 would appear as "0x010200" while version 9.11.7
appears as "0x090b07". appears as "0x090b07".


This 6-digit (24 bits) hexadecimal number does not show pre-release number, This 6-digit (24 bits) hexadecimal number does not show pre-release number,
and it is always a greater number in a more recent release. It makes and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work. comparisons with greater than and less than work.


Note: This define is the full hex number and _does not_ use the Note: This define is the full hex number and _does not_ use the
CURL_VERSION_BITS() macro since curl's own configure script greps for it CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number. and needs it to contain the full number.
*/ */
#define LIBCURL_VERSION_NUM 0x074102 #define LIBCURL_VERSION_NUM 0x075200


/* /*
* This is the date and time when the full source package was created. The * This is the date and time when the full source package was created. The
* timestamp is not stored in git, as the timestamp is properly set in the * timestamp is not stored in git, as the timestamp is properly set in the
* tarballs by the maketgz script. * tarballs by the maketgz script.
* *
* The format of the date follows this template: * The format of the date follows this template:
* *
* "2007-11-23" * "2007-11-23"
*/ */
#define LIBCURL_TIMESTAMP "[unreleased]" #define LIBCURL_TIMESTAMP "2022-03-05"


#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \ #define CURL_AT_LEAST_VERSION(x,y,z) \
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))


#endif /* __CURL_CURLVER_H */ #endif /* CURLINC_CURLVER_H */

235
src/curl/easy.h → include/curl/easy.h Executable file → Normal file
View File

@ -1,112 +1,123 @@
#ifndef __CURL_EASY_H #ifndef CURLINC_EASY_H
#define __CURL_EASY_H #define CURLINC_EASY_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif


CURL_EXTERN CURL *curl_easy_init(void); /* Flag bits in the curl_blob struct: */
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); #define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); #define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
CURL_EXTERN void curl_easy_cleanup(CURL *curl);

struct curl_blob {
/* void *data;
* NAME curl_easy_getinfo() size_t len;
* unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
* DESCRIPTION left zeroes */
* };
* Request internal information from the curl session with this function. The
* third argument MUST be a pointer to a long, a pointer to a char * or a CURL_EXTERN CURL *curl_easy_init(void);
* pointer to a double (as the documentation describes elsewhere). The data CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
* pointed to will be filled in accordingly and can be relied upon only if the CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
* function returns CURLE_OK. This function is intended to get used *AFTER* a CURL_EXTERN void curl_easy_cleanup(CURL *curl);
* performed transfer, all results from this function are undefined until the
* transfer is completed. /*
*/ * NAME curl_easy_getinfo()
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); *

* DESCRIPTION

*
/* * Request internal information from the curl session with this function. The
* NAME curl_easy_duphandle() * third argument MUST be a pointer to a long, a pointer to a char * or a
* * pointer to a double (as the documentation describes elsewhere). The data
* DESCRIPTION * pointed to will be filled in accordingly and can be relied upon only if the
* * function returns CURLE_OK. This function is intended to get used *AFTER* a
* Creates a new curl session handle with the same options set for the handle * performed transfer, all results from this function are undefined until the
* passed in. Duplicating a handle could only be a matter of cloning data and * transfer is completed.
* options, internal state info and things like persistent connections cannot */
* be transferred. It is useful in multithreaded applications when you can run CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/ /*
CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl); * NAME curl_easy_duphandle()

*
/* * DESCRIPTION
* NAME curl_easy_reset() *
* * Creates a new curl session handle with the same options set for the handle
* DESCRIPTION * passed in. Duplicating a handle could only be a matter of cloning data and
* * options, internal state info and things like persistent connections cannot
* Re-initializes a CURL handle to the default values. This puts back the * be transferred. It is useful in multithreaded applications when you can run
* handle to the same state as it was in when it was just created. * curl_easy_duphandle() for each new thread to avoid a series of identical
* * curl_easy_setopt() invokes in every thread.
* It does keep: live connections, the Session ID cache, the DNS cache and the */
* cookies. CURL_EXTERN CURL *curl_easy_duphandle(CURL *curl);
*/
CURL_EXTERN void curl_easy_reset(CURL *curl); /*

* NAME curl_easy_reset()
/* *
* NAME curl_easy_recv() * DESCRIPTION
* *
* DESCRIPTION * Re-initializes a CURL handle to the default values. This puts back the
* * handle to the same state as it was in when it was just created.
* Receives data from the connected socket. Use after successful *
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. * It does keep: live connections, the Session ID cache, the DNS cache and the
*/ * cookies.
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, */
size_t *n); CURL_EXTERN void curl_easy_reset(CURL *curl);


/* /*
* NAME curl_easy_send() * NAME curl_easy_recv()
* *
* DESCRIPTION * DESCRIPTION
* *
* Sends data over the connected socket. Use after successful * Receives data from the connected socket. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option. * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/ */
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
size_t buflen, size_t *n); size_t *n);



/*
/* * NAME curl_easy_send()
* NAME curl_easy_upkeep() *
* * DESCRIPTION
* DESCRIPTION *
* * Sends data over the connected socket. Use after successful
* Performs connection upkeep for the given session handle. * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/ */
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl); CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,

size_t buflen, size_t *n);
#ifdef __cplusplus
}
#endif /*

* NAME curl_easy_upkeep()
#endif *
* DESCRIPTION
*
* Performs connection upkeep for the given session handle.
*/
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);

#ifdef __cplusplus
}
#endif

#endif

100
src/curl/mprintf.h → include/curl/mprintf.h Executable file → Normal file
View File

@ -1,50 +1,50 @@
#ifndef __CURL_MPRINTF_H #ifndef CURLINC_MPRINTF_H
#define __CURL_MPRINTF_H #define CURLINC_MPRINTF_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/


#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> /* needed for FILE */ #include <stdio.h> /* needed for FILE */
#include "curl.h" /* for CURL_EXTERN */ #include "curl.h" /* for CURL_EXTERN */


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif


CURL_EXTERN int curl_mprintf(const char *format, ...); CURL_EXTERN int curl_mprintf(const char *format, ...);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
const char *format, ...); const char *format, ...);
CURL_EXTERN int curl_mvprintf(const char *format, va_list args); CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
const char *format, va_list args); const char *format, va_list args);
CURL_EXTERN char *curl_maprintf(const char *format, ...); CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);


#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif


#endif /* __CURL_MPRINTF_H */ #endif /* CURLINC_MPRINTF_H */

898
src/curl/multi.h → include/curl/multi.h Executable file → Normal file
View File

@ -1,441 +1,457 @@
#ifndef __CURL_MULTI_H #ifndef CURLINC_MULTI_H
#define __CURL_MULTI_H #define CURLINC_MULTI_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/
/* /*
This is an "external" header file. Don't give away any internals here! This is an "external" header file. Don't give away any internals here!


GOALS GOALS


o Enable a "pull" interface. The application that uses libcurl decides where o Enable a "pull" interface. The application that uses libcurl decides where
and when to ask libcurl to get/send data. and when to ask libcurl to get/send data.


o Enable multiple simultaneous transfers in the same thread without making it o Enable multiple simultaneous transfers in the same thread without making it
complicated for the application. complicated for the application.


o Enable the application to select() on its own file descriptors and curl's o Enable the application to select() on its own file descriptors and curl's
file descriptors simultaneous easily. file descriptors simultaneous easily.


*/ */


/* /*
* This header file should not really need to include "curl.h" since curl.h * This header file should not really need to include "curl.h" since curl.h
* itself includes this file and we expect user applications to do #include * itself includes this file and we expect user applications to do #include
* <curl/curl.h> without the need for especially including multi.h. * <curl/curl.h> without the need for especially including multi.h.
* *
* For some reason we added this include here at one point, and rather than to * For some reason we added this include here at one point, and rather than to
* break existing (wrongly written) libcurl applications, we leave it as-is * break existing (wrongly written) libcurl applications, we leave it as-is
* but with this warning attached. * but with this warning attached.
*/ */
#include "curl.h" #include "curl.h"


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif


#if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER) #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
typedef struct Curl_multi CURLM; typedef struct Curl_multi CURLM;
#else #else
typedef void CURLM; typedef void CURLM;
#endif #endif


typedef enum { typedef enum {
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
curl_multi_socket*() soon */ curl_multi_socket*() soon */
CURLM_OK, CURLM_OK,
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was
attempted to get added - again */ attempted to get added - again */
CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a
callback */ callback */
CURLM_LAST CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */
} CURLMcode; CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */

CURLM_ABORTED_BY_CALLBACK,
/* just to make code nicer when using curl_multi_socket() you can now check CURLM_LAST
for CURLM_CALL_MULTI_SOCKET too in the same style it works for } CURLMcode;
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM /* just to make code nicer when using curl_multi_socket() you can now check

for CURLM_CALL_MULTI_SOCKET too in the same style it works for
/* bitmask bits for CURLMOPT_PIPELINING */ curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
#define CURLPIPE_NOTHING 0L #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
#define CURLPIPE_HTTP1 1L
#define CURLPIPE_MULTIPLEX 2L /* bitmask bits for CURLMOPT_PIPELINING */

#define CURLPIPE_NOTHING 0L
typedef enum { #define CURLPIPE_HTTP1 1L
CURLMSG_NONE, /* first, not used */ #define CURLPIPE_MULTIPLEX 2L
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
the CURLcode of the transfer */ typedef enum {
CURLMSG_LAST /* last, not used */ CURLMSG_NONE, /* first, not used */
} CURLMSG; CURLMSG_DONE, /* This easy handle has completed. 'result' contains

the CURLcode of the transfer */
struct CURLMsg { CURLMSG_LAST /* last, not used */
CURLMSG msg; /* what this message means */ } CURLMSG;
CURL *easy_handle; /* the handle it concerns */
union { struct CURLMsg {
void *whatever; /* message-specific data */ CURLMSG msg; /* what this message means */
CURLcode result; /* return code for transfer */ CURL *easy_handle; /* the handle it concerns */
} data; union {
}; void *whatever; /* message-specific data */
typedef struct CURLMsg CURLMsg; CURLcode result; /* return code for transfer */

} data;
/* Based on poll(2) structure and values. };
* We don't use pollfd and POLL* constants explicitly typedef struct CURLMsg CURLMsg;
* to cover platforms without poll(). */
#define CURL_WAIT_POLLIN 0x0001 /* Based on poll(2) structure and values.
#define CURL_WAIT_POLLPRI 0x0002 * We don't use pollfd and POLL* constants explicitly
#define CURL_WAIT_POLLOUT 0x0004 * to cover platforms without poll(). */

#define CURL_WAIT_POLLIN 0x0001
struct curl_waitfd { #define CURL_WAIT_POLLPRI 0x0002
curl_socket_t fd; #define CURL_WAIT_POLLOUT 0x0004
short events;
short revents; /* not supported yet */ struct curl_waitfd {
}; curl_socket_t fd;

short events;
/* short revents; /* not supported yet */
* Name: curl_multi_init() };
*
* Desc: inititalize multi-style curl usage /*
* * Name: curl_multi_init()
* Returns: a new CURLM handle to use in all 'curl_multi' functions. *
*/ * Desc: inititalize multi-style curl usage
CURL_EXTERN CURLM *curl_multi_init(void); *

* Returns: a new CURLM handle to use in all 'curl_multi' functions.
/* */
* Name: curl_multi_add_handle() CURL_EXTERN CURLM *curl_multi_init(void);
*
* Desc: add a standard curl handle to the multi stack /*
* * Name: curl_multi_add_handle()
* Returns: CURLMcode type, general multi error code. *
*/ * Desc: add a standard curl handle to the multi stack
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, *
CURL *curl_handle); * Returns: CURLMcode type, general multi error code.

*/
/* CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
* Name: curl_multi_remove_handle() CURL *curl_handle);
*
* Desc: removes a curl handle from the multi stack again /*
* * Name: curl_multi_remove_handle()
* Returns: CURLMcode type, general multi error code. *
*/ * Desc: removes a curl handle from the multi stack again
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, *
CURL *curl_handle); * Returns: CURLMcode type, general multi error code.

*/
/* CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
* Name: curl_multi_fdset() CURL *curl_handle);
*
* Desc: Ask curl for its fd_set sets. The app can use these to select() or /*
* poll() on. We want curl_multi_perform() called as soon as one of * Name: curl_multi_fdset()
* them are ready. *
* * Desc: Ask curl for its fd_set sets. The app can use these to select() or
* Returns: CURLMcode type, general multi error code. * poll() on. We want curl_multi_perform() called as soon as one of
*/ * them are ready.
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, *
fd_set *read_fd_set, * Returns: CURLMcode type, general multi error code.
fd_set *write_fd_set, */
fd_set *exc_fd_set, CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
int *max_fd); fd_set *read_fd_set,

fd_set *write_fd_set,
/* fd_set *exc_fd_set,
* Name: curl_multi_wait() int *max_fd);
*
* Desc: Poll on all fds within a CURLM set as well as any /*
* additional fds passed to the function. * Name: curl_multi_wait()
* *
* Returns: CURLMcode type, general multi error code. * Desc: Poll on all fds within a CURLM set as well as any
*/ * additional fds passed to the function.
CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, *
struct curl_waitfd extra_fds[], * Returns: CURLMcode type, general multi error code.
unsigned int extra_nfds, */
int timeout_ms, CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
int *ret); struct curl_waitfd extra_fds[],

unsigned int extra_nfds,
/* int timeout_ms,
* Name: curl_multi_perform() int *ret);
*
* Desc: When the app thinks there's data available for curl it calls this /*
* function to read/write whatever there is right now. This returns * Name: curl_multi_poll()
* as soon as the reads and writes are done. This function does not *
* require that there actually is data available for reading or that * Desc: Poll on all fds within a CURLM set as well as any
* data can be written, it can be called just in case. It returns * additional fds passed to the function.
* the number of handles that still transfer data in the second *
* argument's integer-pointer. * Returns: CURLMcode type, general multi error code.
* */
* Returns: CURLMcode type, general multi error code. *NOTE* that this only CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
* returns errors etc regarding the whole multi stack. There might struct curl_waitfd extra_fds[],
* still have occurred problems on individual transfers even when unsigned int extra_nfds,
* this returns OK. int timeout_ms,
*/ int *ret);
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
int *running_handles); /*

* Name: curl_multi_wakeup()
/* *
* Name: curl_multi_cleanup() * Desc: wakes up a sleeping curl_multi_poll call.
* *
* Desc: Cleans up and removes a whole multi stack. It does not free or * Returns: CURLMcode type, general multi error code.
* touch any individual easy handles in any way. We need to define */
* in what state those handles will be if this function is called CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
* in the middle of a transfer.
* /*
* Returns: CURLMcode type, general multi error code. * Name: curl_multi_perform()
*/ *
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); * Desc: When the app thinks there's data available for curl it calls this

* function to read/write whatever there is right now. This returns
/* * as soon as the reads and writes are done. This function does not
* Name: curl_multi_info_read() * require that there actually is data available for reading or that
* * data can be written, it can be called just in case. It returns
* Desc: Ask the multi handle if there's any messages/informationals from * the number of handles that still transfer data in the second
* the individual transfers. Messages include informationals such as * argument's integer-pointer.
* error code from the transfer or just the fact that a transfer is *
* completed. More details on these should be written down as well. * Returns: CURLMcode type, general multi error code. *NOTE* that this only
* * returns errors etc regarding the whole multi stack. There might
* Repeated calls to this function will return a new struct each * still have occurred problems on individual transfers even when
* time, until a special "end of msgs" struct is returned as a signal * this returns OK.
* that there is no more to get at this point. */
* CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
* The data the returned pointer points to will not survive calling int *running_handles);
* curl_multi_cleanup().
* /*
* The 'CURLMsg' struct is meant to be very simple and only contain * Name: curl_multi_cleanup()
* very basic information. If more involved information is wanted, *
* we will provide the particular "transfer handle" in that struct * Desc: Cleans up and removes a whole multi stack. It does not free or
* and that should/could/would be used in subsequent * touch any individual easy handles in any way. We need to define
* curl_easy_getinfo() calls (or similar). The point being that we * in what state those handles will be if this function is called
* must never expose complex structs to applications, as then we'll * in the middle of a transfer.
* undoubtably get backwards compatibility problems in the future. *
* * Returns: CURLMcode type, general multi error code.
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out */
* of structs. It also writes the number of messages left in the CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
* queue (after this read) in the integer the second argument points
* to. /*
*/ * Name: curl_multi_info_read()
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, *
int *msgs_in_queue); * Desc: Ask the multi handle if there's any messages/informationals from

* the individual transfers. Messages include informationals such as
/* * error code from the transfer or just the fact that a transfer is
* Name: curl_multi_strerror() * completed. More details on these should be written down as well.
* *
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode * Repeated calls to this function will return a new struct each
* value into the equivalent human readable error string. This is * time, until a special "end of msgs" struct is returned as a signal
* useful for printing meaningful error messages. * that there is no more to get at this point.
* *
* Returns: A pointer to a zero-terminated error message. * The data the returned pointer points to will not survive calling
*/ * curl_multi_cleanup().
CURL_EXTERN const char *curl_multi_strerror(CURLMcode); *

* The 'CURLMsg' struct is meant to be very simple and only contain
/* * very basic information. If more involved information is wanted,
* Name: curl_multi_socket() and * we will provide the particular "transfer handle" in that struct
* curl_multi_socket_all() * and that should/could/would be used in subsequent
* * curl_easy_getinfo() calls (or similar). The point being that we
* Desc: An alternative version of curl_multi_perform() that allows the * must never expose complex structs to applications, as then we'll
* application to pass in one of the file descriptors that have been * undoubtably get backwards compatibility problems in the future.
* detected to have "action" on them and let libcurl perform. *
* See man page for details. * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
*/ * of structs. It also writes the number of messages left in the
#define CURL_POLL_NONE 0 * queue (after this read) in the integer the second argument points
#define CURL_POLL_IN 1 * to.
#define CURL_POLL_OUT 2 */
#define CURL_POLL_INOUT 3 CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
#define CURL_POLL_REMOVE 4 int *msgs_in_queue);


#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD /*

* Name: curl_multi_strerror()
#define CURL_CSELECT_IN 0x01 *
#define CURL_CSELECT_OUT 0x02 * Desc: The curl_multi_strerror function may be used to turn a CURLMcode
#define CURL_CSELECT_ERR 0x04 * value into the equivalent human readable error string. This is

* useful for printing meaningful error messages.
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ *
curl_socket_t s, /* socket */ * Returns: A pointer to a null-terminated error message.
int what, /* see above */ */
void *userp, /* private callback CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
pointer */
void *socketp); /* private socket /*
pointer */ * Name: curl_multi_socket() and
/* * curl_multi_socket_all()
* Name: curl_multi_timer_callback *
* * Desc: An alternative version of curl_multi_perform() that allows the
* Desc: Called by libcurl whenever the library detects a change in the * application to pass in one of the file descriptors that have been
* maximum number of milliseconds the app is allowed to wait before * detected to have "action" on them and let libcurl perform.
* curl_multi_socket() or curl_multi_perform() must be called * See man page for details.
* (to allow libcurl's timed events to take place). */
* #define CURL_POLL_NONE 0
* Returns: The callback should return zero. #define CURL_POLL_IN 1
*/ #define CURL_POLL_OUT 2
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ #define CURL_POLL_INOUT 3
long timeout_ms, /* see above */ #define CURL_POLL_REMOVE 4
void *userp); /* private callback
pointer */ #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD


CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, #define CURL_CSELECT_IN 0x01
int *running_handles); #define CURL_CSELECT_OUT 0x02

#define CURL_CSELECT_ERR 0x04
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
curl_socket_t s, typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
int ev_bitmask, curl_socket_t s, /* socket */
int *running_handles); int what, /* see above */

void *userp, /* private callback
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, pointer */
int *running_handles); void *socketp); /* private socket

pointer */
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET /*
/* This macro below was added in 7.16.3 to push users who recompile to use * Name: curl_multi_timer_callback
the new curl_multi_socket_action() instead of the old curl_multi_socket() *
*/ * Desc: Called by libcurl whenever the library detects a change in the
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) * maximum number of milliseconds the app is allowed to wait before
#endif * curl_multi_socket() or curl_multi_perform() must be called

* (to allow libcurl's timed events to take place).
/* *
* Name: curl_multi_timeout() * Returns: The callback should return zero.
* */
* Desc: Returns the maximum number of milliseconds the app is allowed to typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
* wait before curl_multi_socket() or curl_multi_perform() must be long timeout_ms, /* see above */
* called (to allow libcurl's timed events to take place). void *userp); /* private callback
* pointer */
* Returns: CURLM error code.
*/ CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, int *running_handles);
long *milliseconds);

CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
#undef CINIT /* re-using the same name as in curl.h */ curl_socket_t s,

int ev_bitmask,
#ifdef CURL_ISOCPP int *running_handles);
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
#else CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ int *running_handles);
#define LONG CURLOPTTYPE_LONG
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #ifndef CURL_ALLOW_OLD_MULTI_SOCKET
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT /* This macro below was added in 7.16.3 to push users who recompile to use
#define OFF_T CURLOPTTYPE_OFF_T the new curl_multi_socket_action() instead of the old curl_multi_socket()
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number */
#endif #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)

#endif
typedef enum {
/* This is the socket callback function pointer */ /*
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), * Name: curl_multi_timeout()

*
/* This is the argument passed to the socket callback */ * Desc: Returns the maximum number of milliseconds the app is allowed to
CINIT(SOCKETDATA, OBJECTPOINT, 2), * wait before curl_multi_socket() or curl_multi_perform() must be

* called (to allow libcurl's timed events to take place).
/* set to 1 to enable pipelining for this multi handle */ *
CINIT(PIPELINING, LONG, 3), * Returns: CURLM error code.

*/
/* This is the timer callback function pointer */ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), long *milliseconds);


/* This is the argument passed to the timer callback */ typedef enum {
CINIT(TIMERDATA, OBJECTPOINT, 5), /* This is the socket callback function pointer */

CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1),
/* maximum number of entries in the connection cache */
CINIT(MAXCONNECTS, LONG, 6), /* This is the argument passed to the socket callback */

CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
/* maximum number of (pipelining) connections to one host */
CINIT(MAX_HOST_CONNECTIONS, LONG, 7), /* set to 1 to enable pipelining for this multi handle */

CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
/* maximum number of requests in a pipeline */
CINIT(MAX_PIPELINE_LENGTH, LONG, 8), /* This is the timer callback function pointer */

CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
/* a connection with a content-length longer than this
will not be considered for pipelining */ /* This is the argument passed to the timer callback */
CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5),


/* a connection with a chunk length longer than this /* maximum number of entries in the connection cache */
will not be considered for pipelining */ CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6),
CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),

/* maximum number of (pipelining) connections to one host */
/* a list of site names(+port) that are blacklisted from CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7),
pipelining */
CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), /* maximum number of requests in a pipeline */

CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8),
/* a list of server types that are blacklisted from
pipelining */ /* a connection with a content-length longer than this
CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), will not be considered for pipelining */

CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9),
/* maximum number of open connections in total */
CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), /* a connection with a chunk length longer than this

will not be considered for pipelining */
/* This is the server push callback function pointer */ CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10),
CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),

/* a list of site names(+port) that are blocked from pipelining */
/* This is the argument passed to the server push callback */ CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11),
CINIT(PUSHDATA, OBJECTPOINT, 15),

/* a list of server types that are blocked from pipelining */
CURLMOPT_LASTENTRY /* the last unused */ CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12),
} CURLMoption;

/* maximum number of open connections in total */

CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13),
/*
* Name: curl_multi_setopt() /* This is the server push callback function pointer */
* CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14),
* Desc: Sets options for the multi handle.
* /* This is the argument passed to the server push callback */
* Returns: CURLM error code. CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15),
*/
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, /* maximum number of concurrent streams to support on a connection */
CURLMoption option, ...); CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16),



CURLMOPT_LASTENTRY /* the last unused */
/* } CURLMoption;
* Name: curl_multi_assign()
*
* Desc: This function sets an association in the multi handle between the /*
* given socket and a private pointer of the application. This is * Name: curl_multi_setopt()
* (only) useful for curl_multi_socket uses. *
* * Desc: Sets options for the multi handle.
* Returns: CURLM error code. *
*/ * Returns: CURLM error code.
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, */
curl_socket_t sockfd, void *sockp); CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,

CURLMoption option, ...);


/*
* Name: curl_push_callback /*
* * Name: curl_multi_assign()
* Desc: This callback gets called when a new stream is being pushed by the *
* server. It approves or denies the new stream. * Desc: This function sets an association in the multi handle between the
* * given socket and a private pointer of the application. This is
* Returns: CURL_PUSH_OK or CURL_PUSH_DENY. * (only) useful for curl_multi_socket uses.
*/ *
#define CURL_PUSH_OK 0 * Returns: CURLM error code.
#define CURL_PUSH_DENY 1 */

CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
struct curl_pushheaders; /* forward declaration only */ curl_socket_t sockfd, void *sockp);


CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
size_t num); /*
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h, * Name: curl_push_callback
const char *name); *

* Desc: This callback gets called when a new stream is being pushed by the
typedef int (*curl_push_callback)(CURL *parent, * server. It approves or denies the new stream. It can also decide
CURL *easy, * to completely fail the connection.
size_t num_headers, *
struct curl_pushheaders *headers, * Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT
void *userp); */

#define CURL_PUSH_OK 0
#ifdef __cplusplus #define CURL_PUSH_DENY 1
} /* end of extern "C" */ #define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */
#endif

struct curl_pushheaders; /* forward declaration only */
#endif
CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
size_t num);
CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
const char *name);

typedef int (*curl_push_callback)(CURL *parent,
CURL *easy,
size_t num_headers,
struct curl_pushheaders *headers,
void *userp);

#ifdef __cplusplus
} /* end of extern "C" */
#endif

#endif

68
include/curl/options.h Normal file
View File

@ -0,0 +1,68 @@
#ifndef CURLINC_OPTIONS_H
#define CURLINC_OPTIONS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2018 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
CURLOT_LONG, /* long (a range of values) */
CURLOT_VALUES, /* (a defined set or bitmask) */
CURLOT_OFF_T, /* curl_off_t (a range of values) */
CURLOT_OBJECT, /* pointer (void *) */
CURLOT_STRING, /* (char * to zero terminated buffer) */
CURLOT_SLIST, /* (struct curl_slist *) */
CURLOT_CBPTR, /* (void * passed as-is to a callback) */
CURLOT_BLOB, /* blob (struct curl_blob *) */
CURLOT_FUNCTION /* function pointer */
} curl_easytype;

/* Flag bits */

/* "alias" means it is provided for old programs to remain functional,
we prefer another name */
#define CURLOT_FLAG_ALIAS (1<<0)

/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
to use for curl_easy_setopt() for the given id */
struct curl_easyoption {
const char *name;
CURLoption id;
curl_easytype type;
unsigned int flags;
};

CURL_EXTERN const struct curl_easyoption *
curl_easy_option_by_name(const char *name);

CURL_EXTERN const struct curl_easyoption *
curl_easy_option_by_id (CURLoption id);

CURL_EXTERN const struct curl_easyoption *
curl_easy_option_next(const struct curl_easyoption *prev);

#ifdef __cplusplus
} /* end of extern "C" */
#endif
#endif /* CURLINC_OPTIONS_H */

66
src/curl/stdcheaders.h → include/curl/stdcheaders.h Executable file → Normal file
View File

@ -1,33 +1,33 @@
#ifndef __STDC_HEADERS_H #ifndef CURLINC_STDCHEADERS_H
#define __STDC_HEADERS_H #define CURLINC_STDCHEADERS_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/


#include <sys/types.h> #include <sys/types.h>


size_t fread(void *, size_t, size_t, FILE *); size_t fread(void *, size_t, size_t, FILE *);
size_t fwrite(const void *, size_t, size_t, FILE *); size_t fwrite(const void *, size_t, size_t, FILE *);


int strcasecmp(const char *, const char *); int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t); int strncasecmp(const char *, const char *, size_t);


#endif /* __STDC_HEADERS_H */ #endif /* CURLINC_STDCHEADERS_H */

981
src/curl/system.h → include/curl/system.h Executable file → Normal file
View File

@ -1,493 +1,488 @@
#ifndef __CURL_SYSTEM_H #ifndef CURLINC_SYSTEM_H
#define __CURL_SYSTEM_H #define CURLINC_SYSTEM_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/


/* /*
* Try to keep one section per platform, compiler and architecture, otherwise, * Try to keep one section per platform, compiler and architecture, otherwise,
* if an existing section is reused for a different one and later on the * if an existing section is reused for a different one and later on the
* original is adjusted, probably the piggybacking one can be adversely * original is adjusted, probably the piggybacking one can be adversely
* changed. * changed.
* *
* In order to differentiate between platforms/compilers/architectures use * In order to differentiate between platforms/compilers/architectures use
* only compiler built in predefined preprocessor symbols. * only compiler built in predefined preprocessor symbols.
* *
* curl_off_t * curl_off_t
* ---------- * ----------
* *
* For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit
* wide signed integral data type. The width of this data type must remain * wide signed integral data type. The width of this data type must remain
* constant and independent of any possible large file support settings. * constant and independent of any possible large file support settings.
* *
* As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit
* wide signed integral data type if there is no 64-bit type. * wide signed integral data type if there is no 64-bit type.
* *
* As a general rule, curl_off_t shall not be mapped to off_t. This rule shall * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall
* only be violated if off_t is the only 64-bit data type available and the * only be violated if off_t is the only 64-bit data type available and the
* size of off_t is independent of large file support settings. Keep your * size of off_t is independent of large file support settings. Keep your
* build on the safe side avoiding an off_t gating. If you have a 64-bit * build on the safe side avoiding an off_t gating. If you have a 64-bit
* off_t then take for sure that another 64-bit data type exists, dig deeper * off_t then take for sure that another 64-bit data type exists, dig deeper
* and you will find it. * and you will find it.
* *
*/ */


#if defined(__DJGPP__) || defined(__GO32__) #if defined(__DJGPP__) || defined(__GO32__)
# if defined(__DJGPP__) && (__DJGPP__ > 1) # if defined(__DJGPP__) && (__DJGPP__ > 1)
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_TU ULL
# else # else
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_TU UL
# endif # endif
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_TYPEOF_CURL_SOCKLEN_T int


#elif defined(__SALFORDC__) #elif defined(__SALFORDC__)
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_TYPEOF_CURL_SOCKLEN_T int


#elif defined(__BORLANDC__) #elif defined(__BORLANDC__)
# if (__BORLANDC__ < 0x520) # if (__BORLANDC__ < 0x520)
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_TU UL
# else # else
# define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_CURL_OFF_TU "I64u"
# define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_T i64
# define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_SUFFIX_CURL_OFF_TU ui64
# endif # endif
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_TYPEOF_CURL_SOCKLEN_T int


#elif defined(__TURBOC__) #elif defined(__TURBOC__)
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_TYPEOF_CURL_SOCKLEN_T int


#elif defined(__WATCOMC__) #elif defined(__POCC__)
# if defined(__386__) # if (__POCC__ < 280)
# define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_SUFFIX_CURL_OFF_TU UL
# else # elif defined(_MSC_VER)
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_TU "I64u"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_SUFFIX_CURL_OFF_T i64
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_TU ui64
# endif # else
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_TYPEOF_CURL_OFF_T long long

# define CURL_FORMAT_CURL_OFF_T "lld"
#elif defined(__POCC__) # define CURL_FORMAT_CURL_OFF_TU "llu"
# if (__POCC__ < 280) # define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_FORMAT_CURL_OFF_T "ld" # endif
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL #elif defined(__LCC__)
# elif defined(_MSC_VER) # if defined(__e2k__) /* MCST eLbrus C Compiler */
# define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_SUFFIX_CURL_OFF_TU UL
# else # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_FORMAT_CURL_OFF_TU "llu" # else /* Local (or Little) C Compiler */
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_FORMAT_CURL_OFF_T "ld"
# endif # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_SUFFIX_CURL_OFF_T L

# define CURL_SUFFIX_CURL_OFF_TU UL
#elif defined(__LCC__) # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_TYPEOF_CURL_OFF_T long # endif
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" #elif defined(__SYMBIAN32__)
# define CURL_SUFFIX_CURL_OFF_T L # if defined(__EABI__) /* Treat all ARM compilers equally */
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_FORMAT_CURL_OFF_T "lld"

# define CURL_FORMAT_CURL_OFF_TU "llu"
#elif defined(__SYMBIAN32__) # define CURL_SUFFIX_CURL_OFF_T LL
# if defined(__EABI__) /* Treat all ARM compilers equally */ # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # elif defined(__CW32__)
# define CURL_FORMAT_CURL_OFF_T "lld" # pragma longlong on
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_FORMAT_CURL_OFF_TU "llu"
# elif defined(__CW32__) # define CURL_SUFFIX_CURL_OFF_T LL
# pragma longlong on # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # elif defined(__VC32__)
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_T LL
# elif defined(__VC32__) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T __int64 # endif
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL #elif defined(__MWERKS__)
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_TYPEOF_CURL_OFF_T long long
# endif # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int # define CURL_FORMAT_CURL_OFF_TU "llu"

# define CURL_SUFFIX_CURL_OFF_T LL
#elif defined(__MWERKS__) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu" #elif defined(_WIN32_WCE)
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_FORMAT_CURL_OFF_TU "I64u"

# define CURL_SUFFIX_CURL_OFF_T i64
#elif defined(_WIN32_WCE) # define CURL_SUFFIX_CURL_OFF_TU ui64
# define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u" #elif defined(__MINGW32__)
# define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_FORMAT_CURL_OFF_TU "I64u"

# define CURL_SUFFIX_CURL_OFF_T LL
#elif defined(__MINGW32__) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_PULL_WS2TCPIP_H 1
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL #elif defined(__VMS)
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # if defined(__VAX)
# define CURL_PULL_SYS_TYPES_H 1 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_PULL_WS2TCPIP_H 1 # define CURL_FORMAT_CURL_OFF_T "ld"

# define CURL_FORMAT_CURL_OFF_TU "lu"
#elif defined(__VMS) # define CURL_SUFFIX_CURL_OFF_T L
# if defined(__VAX) # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # else
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_T LL
# else # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # endif
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL #elif defined(__OS400__)
# define CURL_SUFFIX_CURL_OFF_TU ULL # if defined(__ILEC400__)
# endif # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int # define CURL_FORMAT_CURL_OFF_T "lld"

# define CURL_FORMAT_CURL_OFF_TU "llu"
#elif defined(__OS400__) # define CURL_SUFFIX_CURL_OFF_T LL
# if defined(__ILEC400__) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_T LL # endif
# define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t #elif defined(__MVS__)
# define CURL_PULL_SYS_TYPES_H 1 # if defined(__IBMC__) || defined(__IBMCPP__)
# define CURL_PULL_SYS_SOCKET_H 1 # if defined(_ILP32)
# endif # elif defined(_LP64)

# endif
#elif defined(__MVS__) # if defined(_LONG_LONG)
# if defined(__IBMC__) || defined(__IBMCPP__) # define CURL_TYPEOF_CURL_OFF_T long long
# if defined(_ILP32) # define CURL_FORMAT_CURL_OFF_T "lld"
# elif defined(_LP64) # define CURL_FORMAT_CURL_OFF_TU "llu"
# endif # define CURL_SUFFIX_CURL_OFF_T LL
# if defined(_LONG_LONG) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # elif defined(_LP64)
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_T L
# elif defined(_LP64) # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # else
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_T L
# else # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # endif
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_TU UL # endif
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t #elif defined(__370__)
# define CURL_PULL_SYS_TYPES_H 1 # if defined(__IBMC__) || defined(__IBMCPP__)
# define CURL_PULL_SYS_SOCKET_H 1 # if defined(_ILP32)
# endif # elif defined(_LP64)

# endif
#elif defined(__370__) # if defined(_LONG_LONG)
# if defined(__IBMC__) || defined(__IBMCPP__) # define CURL_TYPEOF_CURL_OFF_T long long
# if defined(_ILP32) # define CURL_FORMAT_CURL_OFF_T "lld"
# elif defined(_LP64) # define CURL_FORMAT_CURL_OFF_TU "llu"
# endif # define CURL_SUFFIX_CURL_OFF_T LL
# if defined(_LONG_LONG) # define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_OFF_T long long # elif defined(_LP64)
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_T L
# elif defined(_LP64) # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # else
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_SUFFIX_CURL_OFF_T L
# else # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # endif
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_TU UL # endif
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t #elif defined(TPF)
# define CURL_PULL_SYS_TYPES_H 1 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_PULL_SYS_SOCKET_H 1 # define CURL_FORMAT_CURL_OFF_T "ld"
# endif # define CURL_FORMAT_CURL_OFF_TU "lu"

# define CURL_SUFFIX_CURL_OFF_T L
#elif defined(TPF) # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" #elif defined(__TINYC__) /* also known as tcc */
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_SUFFIX_CURL_OFF_TU UL # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_TYPEOF_CURL_SOCKLEN_T int # define CURL_FORMAT_CURL_OFF_TU "llu"

# define CURL_SUFFIX_CURL_OFF_T LL
#elif defined(__TINYC__) /* also known as tcc */ # define CURL_SUFFIX_CURL_OFF_TU ULL

# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */
# define CURL_SUFFIX_CURL_OFF_TU ULL # if !defined(__LP64) && (defined(__ILP32) || \
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t defined(__i386) || \
# define CURL_PULL_SYS_TYPES_H 1 defined(__sparcv8) || \
# define CURL_PULL_SYS_SOCKET_H 1 defined(__sparcv8plus))

# define CURL_TYPEOF_CURL_OFF_T long long
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */ # define CURL_FORMAT_CURL_OFF_T "lld"
# if !defined(__LP64) && (defined(__ILP32) || \ # define CURL_FORMAT_CURL_OFF_TU "llu"
defined(__i386) || \ # define CURL_SUFFIX_CURL_OFF_T LL
defined(__sparcv8) || \ # define CURL_SUFFIX_CURL_OFF_TU ULL
defined(__sparcv8plus)) # elif defined(__LP64) || \
# define CURL_TYPEOF_CURL_OFF_T long long defined(__amd64) || defined(__sparcv9)
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_T L
# elif defined(__LP64) || \ # define CURL_SUFFIX_CURL_OFF_TU UL
defined(__amd64) || defined(__sparcv9) # endif
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL #elif defined(__xlc__) /* IBM xlc compiler */
# endif # if !defined(_LP64)
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t # define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_PULL_SYS_TYPES_H 1 # define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_PULL_SYS_SOCKET_H 1 # define CURL_FORMAT_CURL_OFF_TU "llu"

# define CURL_SUFFIX_CURL_OFF_T LL
#elif defined(__xlc__) /* IBM xlc compiler */ # define CURL_SUFFIX_CURL_OFF_TU ULL
# if !defined(_LP64) # else
# define CURL_TYPEOF_CURL_OFF_T long long # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "lld" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "llu" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T LL # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_SUFFIX_CURL_OFF_TU UL
# else # endif
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL /* ===================================== */
# endif /* KEEP MSVC THE PENULTIMATE ENTRY */
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t /* ===================================== */
# define CURL_PULL_SYS_TYPES_H 1
# define CURL_PULL_SYS_SOCKET_H 1 #elif defined(_MSC_VER)

# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
/* ===================================== */ # define CURL_TYPEOF_CURL_OFF_T __int64
/* KEEP MSVC THE PENULTIMATE ENTRY */ # define CURL_FORMAT_CURL_OFF_T "I64d"
/* ===================================== */ # define CURL_FORMAT_CURL_OFF_TU "I64u"

# define CURL_SUFFIX_CURL_OFF_T i64
#elif defined(_MSC_VER) # define CURL_SUFFIX_CURL_OFF_TU ui64
# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) # else
# define CURL_TYPEOF_CURL_OFF_T __int64 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "I64d" # define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "I64u" # define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T i64 # define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU ui64 # define CURL_SUFFIX_CURL_OFF_TU UL
# else # endif
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu" /* ===================================== */
# define CURL_SUFFIX_CURL_OFF_T L /* KEEP GENERIC GCC THE LAST ENTRY */
# define CURL_SUFFIX_CURL_OFF_TU UL /* ===================================== */
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T int #elif defined(__GNUC__) && !defined(_SCO_DS)

# if !defined(__LP64__) && \
/* ===================================== */ (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
/* KEEP GENERIC GCC THE LAST ENTRY */ defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
/* ===================================== */ defined(__sparc__) || defined(__mips__) || defined(__sh__) || \

defined(__XTENSA__) || \
#elif defined(__GNUC__) && !defined(_SCO_DS) (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
# if !defined(__LP64__) && \ (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L))
(defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \ # define CURL_TYPEOF_CURL_OFF_T long long
defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \ # define CURL_FORMAT_CURL_OFF_T "lld"
defined(__sparc__) || defined(__mips__) || defined(__sh__) || \ # define CURL_FORMAT_CURL_OFF_TU "llu"
defined(__XTENSA__) || \ # define CURL_SUFFIX_CURL_OFF_T LL
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \ # define CURL_SUFFIX_CURL_OFF_TU ULL
(defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L)) # elif defined(__LP64__) || \
# define CURL_TYPEOF_CURL_OFF_T long long defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
# define CURL_FORMAT_CURL_OFF_T "lld" defined(__e2k__) || \
# define CURL_FORMAT_CURL_OFF_TU "llu" (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
# define CURL_SUFFIX_CURL_OFF_T LL (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
# define CURL_SUFFIX_CURL_OFF_TU ULL # define CURL_TYPEOF_CURL_OFF_T long
# elif defined(__LP64__) || \ # define CURL_FORMAT_CURL_OFF_T "ld"
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \ # define CURL_FORMAT_CURL_OFF_TU "lu"
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \ # define CURL_SUFFIX_CURL_OFF_T L
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L) # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # endif
# define CURL_FORMAT_CURL_OFF_T "ld" # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_FORMAT_CURL_OFF_TU "lu" # define CURL_PULL_SYS_TYPES_H 1
# define CURL_SUFFIX_CURL_OFF_T L # define CURL_PULL_SYS_SOCKET_H 1
# define CURL_SUFFIX_CURL_OFF_TU UL
# endif #else
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t /* generic "safe guess" on old 32 bit style */
# define CURL_PULL_SYS_TYPES_H 1 # define CURL_TYPEOF_CURL_OFF_T long
# define CURL_PULL_SYS_SOCKET_H 1 # define CURL_FORMAT_CURL_OFF_T "ld"

# define CURL_FORMAT_CURL_OFF_TU "lu"
#else # define CURL_SUFFIX_CURL_OFF_T L
/* generic "safe guess" on old 32 bit style */ # define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_OFF_T long # define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_FORMAT_CURL_OFF_T "ld" #endif
# define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L #ifdef _AIX
# define CURL_SUFFIX_CURL_OFF_TU UL /* AIX needs <sys/poll.h> */
# define CURL_TYPEOF_CURL_SOCKLEN_T int #define CURL_PULL_SYS_POLL_H
#endif #endif


#ifdef _AIX
/* AIX needs <sys/poll.h> */ /* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
#define CURL_PULL_SYS_POLL_H /* ws2tcpip.h is required here to properly make type definitions below. */
#endif #ifdef CURL_PULL_WS2TCPIP_H

# include <winsock2.h>

# include <windows.h>
/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */ # include <ws2tcpip.h>
/* ws2tcpip.h is required here to properly make type definitions below. */ #endif
#ifdef CURL_PULL_WS2TCPIP_H
# include <winsock2.h> /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
# include <windows.h> /* sys/types.h is required here to properly make type definitions below. */
# include <ws2tcpip.h> #ifdef CURL_PULL_SYS_TYPES_H
#endif # include <sys/types.h>

#endif
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
/* sys/types.h is required here to properly make type definitions below. */ /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
#ifdef CURL_PULL_SYS_TYPES_H /* sys/socket.h is required here to properly make type definitions below. */
# include <sys/types.h> #ifdef CURL_PULL_SYS_SOCKET_H
#endif # include <sys/socket.h>

#endif
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
/* sys/socket.h is required here to properly make type definitions below. */ /* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
#ifdef CURL_PULL_SYS_SOCKET_H /* sys/poll.h is required here to properly make type definitions below. */
# include <sys/socket.h> #ifdef CURL_PULL_SYS_POLL_H
#endif # include <sys/poll.h>

#endif
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
/* sys/poll.h is required here to properly make type definitions below. */ /* Data type definition of curl_socklen_t. */
#ifdef CURL_PULL_SYS_POLL_H #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# include <sys/poll.h> typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
#endif #endif


/* Data type definition of curl_socklen_t. */ /* Data type definition of curl_off_t. */
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; #ifdef CURL_TYPEOF_CURL_OFF_T
#endif typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;

#endif
/* Data type definition of curl_off_t. */

/*
#ifdef CURL_TYPEOF_CURL_OFF_T * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; * these to be visible and exported by the external libcurl interface API,
#endif * while also making them visible to the library internals, simply including

* curl_setup.h, without actually needing to include curl.h internally.
/* * If some day this section would grow big enough, all this should be moved
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow * to its own header file.
* these to be visible and exported by the external libcurl interface API, */
* while also making them visible to the library internals, simply including
* curl_setup.h, without actually needing to include curl.h internally. /*
* If some day this section would grow big enough, all this should be moved * Figure out if we can use the ## preprocessor operator, which is supported
* to its own header file. * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
*/ * or __cplusplus so we need to carefully check for them too.

*/
/*
* Figure out if we can use the ## preprocessor operator, which is supported #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
* or __cplusplus so we need to carefully check for them too. defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
*/ defined(__ILEC400__)

/* This compiler is believed to have an ISO compatible preprocessor */
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ #define CURL_ISOCPP
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ #else
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ /* This compiler is believed NOT to have an ISO compatible preprocessor */
defined(__ILEC400__) #undef CURL_ISOCPP
/* This compiler is believed to have an ISO compatible preprocessor */ #endif
#define CURL_ISOCPP
#else /*
/* This compiler is believed NOT to have an ISO compatible preprocessor */ * Macros for minimum-width signed and unsigned curl_off_t integer constants.
#undef CURL_ISOCPP */
#endif

#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
/* # define CURLINC_OFF_T_C_HLPR2(x) x
* Macros for minimum-width signed and unsigned curl_off_t integer constants. # define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
*/ # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \

CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
# define __CURL_OFF_T_C_HLPR2(x) x CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) #else
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ # ifdef CURL_ISOCPP
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ # else
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
#else # endif
# ifdef CURL_ISOCPP # define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
# else # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix #endif
# endif
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) #endif /* CURLINC_SYSTEM_H */
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
#endif

#endif /* __CURL_SYSTEM_H */

1405
src/curl/typecheck-gcc.h → include/curl/typecheck-gcc.h Executable file → Normal file

File diff suppressed because it is too large Load Diff

268
src/curl/urlapi.h → include/curl/urlapi.h Executable file → Normal file
View File

@ -1,123 +1,145 @@
#ifndef __CURL_URLAPI_H #ifndef CURLINC_URLAPI_H
#define __CURL_URLAPI_H #define CURLINC_URLAPI_H
/*************************************************************************** /***************************************************************************
* _ _ ____ _ * _ _ ____ _
* Project ___| | | | _ \| | * Project ___| | | | _ \| |
* / __| | | | |_) | | * / __| | | | |_) | |
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2018 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2018 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
* are also available at https://curl.haxx.se/docs/copyright.html. * are also available at https://curl.se/docs/copyright.html.
* *
* You may opt to use, copy, modify, merge, publish, distribute and/or sell * You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is * copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file. * furnished to do so, under the terms of the COPYING file.
* *
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied. * KIND, either express or implied.
* *
***************************************************************************/ ***************************************************************************/


#include "curl.h" #include "curl.h"


#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif


/* the error codes for the URL API */ /* the error codes for the URL API */
typedef enum { typedef enum {
CURLUE_OK, CURLUE_OK,
CURLUE_BAD_HANDLE, /* 1 */ CURLUE_BAD_HANDLE, /* 1 */
CURLUE_BAD_PARTPOINTER, /* 2 */ CURLUE_BAD_PARTPOINTER, /* 2 */
CURLUE_MALFORMED_INPUT, /* 3 */ CURLUE_MALFORMED_INPUT, /* 3 */
CURLUE_BAD_PORT_NUMBER, /* 4 */ CURLUE_BAD_PORT_NUMBER, /* 4 */
CURLUE_UNSUPPORTED_SCHEME, /* 5 */ CURLUE_UNSUPPORTED_SCHEME, /* 5 */
CURLUE_URLDECODE, /* 6 */ CURLUE_URLDECODE, /* 6 */
CURLUE_OUT_OF_MEMORY, /* 7 */ CURLUE_OUT_OF_MEMORY, /* 7 */
CURLUE_USER_NOT_ALLOWED, /* 8 */ CURLUE_USER_NOT_ALLOWED, /* 8 */
CURLUE_UNKNOWN_PART, /* 9 */ CURLUE_UNKNOWN_PART, /* 9 */
CURLUE_NO_SCHEME, /* 10 */ CURLUE_NO_SCHEME, /* 10 */
CURLUE_NO_USER, /* 11 */ CURLUE_NO_USER, /* 11 */
CURLUE_NO_PASSWORD, /* 12 */ CURLUE_NO_PASSWORD, /* 12 */
CURLUE_NO_OPTIONS, /* 13 */ CURLUE_NO_OPTIONS, /* 13 */
CURLUE_NO_HOST, /* 14 */ CURLUE_NO_HOST, /* 14 */
CURLUE_NO_PORT, /* 15 */ CURLUE_NO_PORT, /* 15 */
CURLUE_NO_QUERY, /* 16 */ CURLUE_NO_QUERY, /* 16 */
CURLUE_NO_FRAGMENT /* 17 */ CURLUE_NO_FRAGMENT, /* 17 */
} CURLUcode; CURLUE_NO_ZONEID, /* 18 */

CURLUE_BAD_FILE_URL, /* 19 */
typedef enum { CURLUE_BAD_FRAGMENT, /* 20 */
CURLUPART_URL, CURLUE_BAD_HOSTNAME, /* 21 */
CURLUPART_SCHEME, CURLUE_BAD_IPV6, /* 22 */
CURLUPART_USER, CURLUE_BAD_LOGIN, /* 23 */
CURLUPART_PASSWORD, CURLUE_BAD_PASSWORD, /* 24 */
CURLUPART_OPTIONS, CURLUE_BAD_PATH, /* 25 */
CURLUPART_HOST, CURLUE_BAD_QUERY, /* 26 */
CURLUPART_PORT, CURLUE_BAD_SCHEME, /* 27 */
CURLUPART_PATH, CURLUE_BAD_SLASHES, /* 28 */
CURLUPART_QUERY, CURLUE_BAD_USER, /* 29 */
CURLUPART_FRAGMENT, CURLUE_LAST
CURLUPART_ZONEID /* added in 7.65.0 */ } CURLUcode;
} CURLUPart;

typedef enum {
#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */ CURLUPART_URL,
#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set, CURLUPART_SCHEME,
if the port number matches the CURLUPART_USER,
default for the scheme */ CURLUPART_PASSWORD,
#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if CURLUPART_OPTIONS,
missing */ CURLUPART_HOST,
#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */ CURLUPART_PORT,
#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */ CURLUPART_PATH,
#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */ CURLUPART_QUERY,
#define CURLU_URLDECODE (1<<6) /* URL decode on get */ CURLUPART_FRAGMENT,
#define CURLU_URLENCODE (1<<7) /* URL encode on set */ CURLUPART_ZONEID /* added in 7.65.0 */
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */ } CURLUPart;
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */

#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */
typedef struct Curl_URL CURLU; #define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set,

if the port number matches the
/* default for the scheme */
* curl_url() creates a new CURLU handle and returns a pointer to it. #define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if
* Must be freed with curl_url_cleanup(). missing */
*/ #define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */
CURL_EXTERN CURLU *curl_url(void); #define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */

#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */
/* #define CURLU_URLDECODE (1<<6) /* URL decode on get */
* curl_url_cleanup() frees the CURLU handle and related resources used for #define CURLU_URLENCODE (1<<7) /* URL encode on set */
* the URL parsing. It will not free strings previously returned with the URL #define CURLU_APPENDQUERY (1<<8) /* append a form style part */
* API. #define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
*/ #define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the
CURL_EXTERN void curl_url_cleanup(CURLU *handle); scheme is unknown. */

#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */
/*
* curl_url_dup() duplicates a CURLU handle and returns a new copy. The new typedef struct Curl_URL CURLU;
* handle must also be freed with curl_url_cleanup().
*/ /*
CURL_EXTERN CURLU *curl_url_dup(CURLU *in); * curl_url() creates a new CURLU handle and returns a pointer to it.

* Must be freed with curl_url_cleanup().
/* */
* curl_url_get() extracts a specific part of the URL from a CURLU CURL_EXTERN CURLU *curl_url(void);
* handle. Returns error code. The returned pointer MUST be freed with
* curl_free() afterwards. /*
*/ * curl_url_cleanup() frees the CURLU handle and related resources used for
CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what, * the URL parsing. It will not free strings previously returned with the URL
char **part, unsigned int flags); * API.

*/
/* CURL_EXTERN void curl_url_cleanup(CURLU *handle);
* curl_url_set() sets a specific part of the URL in a CURLU handle. Returns
* error code. The passed in string will be copied. Passing a NULL instead of /*
* a part string, clears that part. * curl_url_dup() duplicates a CURLU handle and returns a new copy. The new
*/ * handle must also be freed with curl_url_cleanup().
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what, */
const char *part, unsigned int flags); CURL_EXTERN CURLU *curl_url_dup(CURLU *in);



/*
#ifdef __cplusplus * curl_url_get() extracts a specific part of the URL from a CURLU
} /* end of extern "C" */ * handle. Returns error code. The returned pointer MUST be freed with
#endif * curl_free() afterwards.

*/
#endif CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
char **part, unsigned int flags);

/*
* curl_url_set() sets a specific part of the URL in a CURLU handle. Returns
* error code. The passed in string will be copied. Passing a NULL instead of
* a part string, clears that part.
*/
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
const char *part, unsigned int flags);

/*
* curl_url_strerror() turns a CURLUcode value into the equivalent human
* readable error string. This is useful for printing meaningful error
* messages.
*/
CURL_EXTERN const char *curl_url_strerror(CURLUcode);

#ifdef __cplusplus
} /* end of extern "C" */
#endif

#endif /* CURLINC_URLAPI_H */

View File

@ -1,21 +1,15 @@
QT -= gui QT -= gui

CONFIG += -static -libstdc++ -static-libgcc #-static

#INCLUDEPATH += -L$${_PRO_FILE_PWD_}\openssl-android-arm64-v8a\include

#LIBS += -L$${_PRO_FILE_PWD_}\lib -lssl
#LIBS += -L$${_PRO_FILE_PWD_}\lib -lcrypto
#LIBS += -L$${_PRO_FILE_PWD_}\lib -lcurl



#Linux: #Linux:
unix: LIBS += -lcurl unix: LIBS += -lcurl


#Windows #Windows
win32: LIBS += -L$${_PRO_FILE_PWD_}\curl -lcurl win32: LIBS += -L$${_PRO_FILE_PWD_}\..\lib\ -lcurl # 7.82.0
#win32: LIBS += -L$${_PRO_FILE_PWD_}\..\alt\curl -lcurl # 7.64.1




CONFIG += c++14 console CONFIG += c++17 console
CONFIG -= app_bundle CONFIG -= app_bundle


# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use

View File

@ -10,7 +10,7 @@ AccountManager::AccountManager(std::string pathToFil, std::string pathToAccountN
exit(12); exit(12);
ifs.open(pathToAccountsFile); ifs.open(pathToAccountsFile);
if(!ifs.is_open()) { if(!ifs.is_open()) {
std::cout << " => Error: Konnte Account File nicht öffnen" << std::endl; std::cout << " => Error: Konnte Account File nicht aufmachen" << std::endl;
exit(13); exit(13);
} }
} }
@ -61,7 +61,7 @@ int AccountManager::writeDefault(std::string path)
{ {
std::ofstream ofs(path); std::ofstream ofs(path);
if(!ofs.is_open()) { if(!ofs.is_open()) {
perror((std::string(" => Error: Konnte Account Datei nicht öffnen: ") + path).c_str()); perror((std::string(" => Error: Konnte Account Datei nicht aufmachen: ") + path).c_str());
return -1; return -1;
} }
std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl; std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl;
@ -253,7 +253,7 @@ int AccountManager::setLastAccountNumber(size_t number)
std::ofstream ofs; std::ofstream ofs;
ofs.open(pathToAccountNumberFile, std::ios::trunc); ofs.open(pathToAccountNumberFile, std::ios::trunc);
if(!ofs.is_open()) { if(!ofs.is_open()) {
std::cout << " => Error: Account Number Datei ist nicht geöffnet." << std::endl; std::cout << " => Error: Account Number Datei ist nicht aufgemacht." << std::endl;
return 110; return 110;
} }
//fStream.clear(); //fStream.clear();

View File

@ -1,22 +1,21 @@
#ifndef ACCOUNTMANAGER_H #ifndef ACCOUNTMANAGER_H
#define ACCOUNTMANAGER_H #define ACCOUNTMANAGER_H




#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <fstream> #include <fstream>




#include "parameterManager.h"



struct Account { struct Account {
std::string Email, std::string Email,
Password; Password;
}; };




//wichtig vor Account declaration!!!!
#include "parameterManager.h"

class AccountManager class AccountManager
{ {
public: public:

3
src/curl/.gitignore vendored
View File

@ -1,3 +0,0 @@
curlver.h.dist
stamp-h2
stamp-h3

Binary file not shown.

View File

@ -77,7 +77,7 @@ int Logger::openFile(std::string path)
} }
file.open(path); file.open(path);
if(!file.is_open()) { if(!file.is_open()) {
perror((" => Error: Konnte LogDatei nicht öffnen: '" + path + "'").c_str()); perror((" => Error: Konnte LogDatei nicht aufmachen: '" + path + "'").c_str());
return (5657); return (5657);
} }
} }

View File

@ -1,6 +1,8 @@
#ifndef LOGGER_H #ifndef LOGGER_H
#define LOGGER_H #define LOGGER_H




#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <string> #include <string>

View File

@ -87,7 +87,7 @@ Reply PageManager::getServerRequest(std::string Url, bool useCookies, std::strin
std::string returnUrl; std::string returnUrl;




int width; int width = 0;
get_terminal_size(width); get_terminal_size(width);
if(width < 1) if(width < 1)
width = 999999; width = 999999;
@ -559,7 +559,7 @@ int PageManager::writeToFile(std::vector<std::string> paths, std::string text)
for(const auto &path : paths) { for(const auto &path : paths) {
of.open(path, std::ios::out | std::ios::app); of.open(path, std::ios::out | std::ios::app);
if(!of.is_open()) { if(!of.is_open()) {
perror((" => Error: Konnte Output: '" + path + "' Datei nicht öffnen").c_str()); perror((" => Error: Konnte Output: '" + path + "' Datei nicht aufmachen").c_str());
return -1; return -1;
} }
of << text << std::endl; of << text << std::endl;
@ -569,6 +569,13 @@ int PageManager::writeToFile(std::vector<std::string> paths, std::string text)
return 0; return 0;
} }


std::string PageManager::getCurlVersion()
{
auto data = curl_version_info(CURLVERSION_NOW);
return data->version;
}


std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg) std::string PageManager::chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg)
{ {
std::istringstream SListLang ( replace( languages_with_highst_priority_at_first, ",", "\n") + "\n" ); std::istringstream SListLang ( replace( languages_with_highst_priority_at_first, ",", "\n") + "\n" );

View File

@ -3,13 +3,13 @@




#include "accountManager.h" #include "accountManager.h"
#include "curl/curl.h"


#include "parameterManager.h" // for isNumber #include "parameterManager.h" // for isNumber


#ifdef _WIN32 #ifdef _WIN32
#include "./../include/curl/curl.h"
#include <windows.h> #include <windows.h>
#else
#include "curl/curl.h"
#endif #endif


#include <sstream> #include <sstream>
@ -67,6 +67,8 @@ public:


int writeToFile(std::vector<std::string> paths, std::string text); int writeToFile(std::vector<std::string> paths, std::string text);


static std::string getCurlVersion();

std::string sock5Proxy; std::string sock5Proxy;
private: private:
bool debugMode = false; bool debugMode = false;

View File

@ -153,23 +153,26 @@ int manageParameter(Settings &settings, int argc, char **argv)


void unterOption_printVersion(Settings &settings) void unterOption_printVersion(Settings &settings)
{ {
std::cout << "Programinfos:" << std::endl std::cout << "Programminformationen:" << std::endl
<< " > Build-Datum: " << __DATE__ << std::endl << " > Build-Datum: \t\t" << __DATE__ << std::endl
<< " > Build-Uhrzeit: " << __TIME__ << std::endl << " > Build-Uhrzeit: \t\t" << __TIME__ << std::endl
<< " > Program Version: " << settings.version << std::endl << " > Program Version: \t" << settings.version << std::endl
<< " > Defaults Datei Version: " << settings.defaultFileVersion << std::endl << " > Defaults Datei Version: \t" << settings.defaultFileVersion << std::endl

#ifdef __MINGW_GCC_VERSION #ifdef __MINGW_GCC_VERSION
<< " > MINGW GCC Version: " <<__GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << std::endl << " > MINGW GCC Version: \t" <<__GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << std::endl
#endif #endif


<< " > C++ Standart: "; << " > Curl Version: \t\t" << PageManager::getCurlVersion() << std::endl

<< " > C++ Standart: \t\t";
if(__cplusplus == 1) std::cout << "C++_Pre_C++98" << std::endl; if(__cplusplus == 1) std::cout << "C++_Pre_C++98" << std::endl;
else if (__cplusplus == 199711) std::cout << "C++98" << std::endl; else if (__cplusplus == 199711) std::cout << "C++98" << std::endl;
else if (__cplusplus == 201103) std::cout << "C++11" << std::endl; else if (__cplusplus == 201103) std::cout << "C++11" << std::endl;
else if (__cplusplus == 201402) std::cout << "C++14" << std::endl; else if (__cplusplus == 201402) std::cout << "C++14" << std::endl;
else if (__cplusplus == 201703) std::cout << "C++17" << std::endl; else if (__cplusplus == 201703) std::cout << "C++17" << std::endl;
else std::cout << "C++_Newer_C++17" << std::endl; else std::cout << "C++_Newer_C++17" << std::endl;
std::cout << " > " << sizeof (void *) * 8 << " Bit Version" << std::endl; std::cout << " > Bit Version: \t\tx" << sizeof (void *) * 8 << "" << std::endl;
} }


int loadDefaulOptions(Settings &settings) int loadDefaulOptions(Settings &settings)
@ -178,7 +181,7 @@ int loadDefaulOptions(Settings &settings)
if(!ifs.is_open()) { if(!ifs.is_open()) {
std::ofstream ofs(settings.defaultsFilePath); std::ofstream ofs(settings.defaultsFilePath);
if(!ofs.is_open()) { if(!ofs.is_open()) {
perror((" => Error: Konnte Defaults-Datei nicht öffnen: " + settings.defaultsFilePath).c_str()); perror((" => Error: Konnte Defaults-Datei nicht aufmachen: " + settings.defaultsFilePath).c_str());
return 89; return 89;
} else { } else {
std::cout << " => Erstelle Defaults-Datei: " << settings.defaultsFilePath << std::endl; std::cout << " => Erstelle Defaults-Datei: " << settings.defaultsFilePath << std::endl;
@ -257,7 +260,7 @@ int loadDefaulOptions(Settings &settings)
} }
ifs.open(settings.defaultsFilePath); ifs.open(settings.defaultsFilePath);
if(!ifs.is_open()) { if(!ifs.is_open()) {
perror((" => Error: Konnte Defaults-Datei nach dem erstellen nicht öffnen: " + settings.defaultsFilePath).c_str()); perror((" => Error: Konnte Defaults-Datei nach dem erstellen nicht aufmachen: " + settings.defaultsFilePath).c_str());
return 97; return 97;
} }
} }
@ -1593,7 +1596,7 @@ bool removeDirIsOk(std::string path, Settings *settings, bool askForDelete)


DIR* dirp = nullptr; DIR* dirp = nullptr;
if( (dirp = opendir( path.c_str() )) == nullptr ) { if( (dirp = opendir( path.c_str() )) == nullptr ) {
perror(std::string(" => Error: Konnte Verzeichnis nicht öffnen: '" + path + "'").c_str()); perror(std::string(" => Error: Konnte Verzeichnis nicht aufmachen: '" + path + "'").c_str());
return false; return false;
} }



View File

@ -1,6 +1,9 @@
#ifndef PARAMETERMANAGER_H #ifndef PARAMETERMANAGER_H
#define PARAMETERMANAGER_H #define PARAMETERMANAGER_H





#ifndef __linux__ #ifndef __linux__
#ifndef _WIN32 #ifndef _WIN32
#error "Error Invalid System: Only for Linux and Windows systems!" #error "Error Invalid System: Only for Linux and Windows systems!"
@ -60,6 +63,9 @@ struct PAGE {
}; };




//Wichtig nach MODUS UND PAGE DECLARATION
#include "pageManager.h"



struct Settings { struct Settings {



View File

@ -2,9 +2,11 @@
#define MANAGEPROGRAM_H #define MANAGEPROGRAM_H




#include "pageManager.h"

//#include "pageManager.h"
#include "parameterManager.h" #include "parameterManager.h"
#include "accountManager.h" //#include "accountManager.h"


#include <sys/types.h> #include <sys/types.h>
#include <pthread.h> #include <pthread.h>

View File

@ -1 +0,0 @@
../src/curl/

View File

@ -0,0 +1,87 @@
EXPORTS
curl_easy_cleanup @1
curl_easy_duphandle @2
curl_easy_escape @3
curl_easy_getinfo @4
curl_easy_init @5
curl_easy_option_by_id @6
curl_easy_option_by_name @7
curl_easy_option_next @8
curl_easy_pause @9
curl_easy_perform @10
curl_easy_recv @11
curl_easy_reset @12
curl_easy_send @13
curl_easy_setopt @14
curl_easy_strerror @15
curl_easy_unescape @16
curl_easy_upkeep @17
curl_escape @18
curl_formadd @19
curl_formfree @20
curl_formget @21
curl_free @22
curl_getdate @23
curl_getenv @24
curl_global_cleanup @25
curl_global_init @26
curl_global_init_mem @27
curl_global_sslset @28
curl_maprintf @29
curl_mfprintf @30
curl_mime_addpart @31
curl_mime_data @32
curl_mime_data_cb @33
curl_mime_encoder @34
curl_mime_filedata @35
curl_mime_filename @36
curl_mime_free @37
curl_mime_headers @38
curl_mime_init @39
curl_mime_name @40
curl_mime_subparts @41
curl_mime_type @42
curl_mprintf @43
curl_msnprintf @44
curl_msprintf @45
curl_multi_add_handle @46
curl_multi_assign @47
curl_multi_cleanup @48
curl_multi_fdset @49
curl_multi_info_read @50
curl_multi_init @51
curl_multi_perform @52
curl_multi_poll @53
curl_multi_remove_handle @54
curl_multi_setopt @55
curl_multi_socket @56
curl_multi_socket_action @57
curl_multi_socket_all @58
curl_multi_strerror @59
curl_multi_timeout @60
curl_multi_wait @61
curl_multi_wakeup @62
curl_mvaprintf @63
curl_mvfprintf @64
curl_mvprintf @65
curl_mvsnprintf @66
curl_mvsprintf @67
curl_pushheader_byname @68
curl_pushheader_bynum @69
curl_share_cleanup @70
curl_share_init @71
curl_share_setopt @72
curl_share_strerror @73
curl_slist_append @74
curl_slist_free_all @75
curl_strequal @76
curl_strnequal @77
curl_unescape @78
curl_url @79
curl_url_cleanup @80
curl_url_dup @81
curl_url_get @82
curl_url_set @83
curl_url_strerror @84
curl_version @85
curl_version_info @86