Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions docs/internals/CLIENT-WRITERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, si
The `type` argument specifies what the bytes in `buf` actually are.
The following bits are defined:
```
#define CLIENTWRITE_BODY (1<<0) /* non-meta information, BODY */
#define CLIENTWRITE_INFO (1<<1) /* meta information, not a HEADER */
#define CLIENTWRITE_HEADER (1<<2) /* meta information, HEADER */
#define CLIENTWRITE_STATUS (1<<3) /* a special status HEADER */
#define CLIENTWRITE_CONNECT (1<<4) /* a CONNECT related HEADER */
#define CLIENTWRITE_1XX (1<<5) /* a 1xx response related HEADER */
#define CLIENTWRITE_TRAILER (1<<6) /* a trailer HEADER */
#define CLIENTWRITE_BODY (1 << 0) /* non-meta information, BODY */
#define CLIENTWRITE_INFO (1 << 1) /* meta information, not a HEADER */
#define CLIENTWRITE_HEADER (1 << 2) /* meta information, HEADER */
#define CLIENTWRITE_STATUS (1 << 3) /* a special status HEADER */
#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
#define CLIENTWRITE_1XX (1 << 5) /* a 1xx response related HEADER */
#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
```

The main types here are `CLIENTWRITE_BODY` and `CLIENTWRITE_HEADER`. They are
Expand Down
1 change: 1 addition & 0 deletions docs/internals/CODE_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ This is the full list of functions generally banned.
sscanf
stat
strcat
strcpy
strdup
strerror
strncat
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/curl_formget.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ This, because first then does libcurl known which actual read callback to use.
size_t print_httppost_callback(void *arg, const char *buf, size_t len)
{
fwrite(buf, len, 1, stdout);
(*(size_t *)arg) += len;
*((size_t *)arg) += len;
return len;
}

Expand Down
8 changes: 4 additions & 4 deletions docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ CURLOPT_ALTSVC_CTRL - control alt-svc behavior
~~~c
#include <curl/curl.h>

#define CURLALTSVC_READONLYFILE (1L<<2)
#define CURLALTSVC_H1 (1L<<3)
#define CURLALTSVC_H2 (1L<<4)
#define CURLALTSVC_H3 (1L<<5)
#define CURLALTSVC_READONLYFILE (1L << 2)
#define CURLALTSVC_H1 (1L << 3)
#define CURLALTSVC_H2 (1L << 4)
#define CURLALTSVC_H3 (1L << 5)

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask);
~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/libcurl/opts/CURLOPT_HSTS_CTRL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ CURLOPT_HSTS_CTRL - control HSTS behavior
~~~c
#include <curl/curl.h>

#define CURLHSTS_ENABLE (1L<<0)
#define CURLHSTS_READONLYFILE (1L<<1)
#define CURLHSTS_ENABLE (1L << 0)
#define CURLHSTS_READONLYFILE (1L << 1)

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask);
~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/libcurl/symbols.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
sub str2num {
my ($str)=@_;
if($str && $str =~ /([0-9]*)\.([0-9]*)\.*([0-9]*)/) {
return sprintf("0x%06x", $1 <<16 | $2 << 8 | ($3 || '0'));
return sprintf("0x%06x", $1 << 16 | $2 << 8 | ($3 || '0'));
}
}

Expand Down
178 changes: 89 additions & 89 deletions include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,22 @@ struct curl_httppost {
long flags; /* as defined below */

/* specified content is a filename */
#define CURL_HTTPPOST_FILENAME (1<<0)
#define CURL_HTTPPOST_FILENAME (1 << 0)
/* specified content is a filename */
#define CURL_HTTPPOST_READFILE (1<<1)
#define CURL_HTTPPOST_READFILE (1 << 1)
/* name is only stored pointer do not free in formfree */
#define CURL_HTTPPOST_PTRNAME (1<<2)
#define CURL_HTTPPOST_PTRNAME (1 << 2)
/* contents is only stored pointer do not free in formfree */
#define CURL_HTTPPOST_PTRCONTENTS (1<<3)
#define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
/* upload file from buffer */
#define CURL_HTTPPOST_BUFFER (1<<4)
#define CURL_HTTPPOST_BUFFER (1 << 4)
/* upload file from pointer contents */
#define CURL_HTTPPOST_PTRBUFFER (1<<5)
#define CURL_HTTPPOST_PTRBUFFER (1 << 5)
/* upload file contents by using the regular read callback to get the data and
pass the given pointer as custom pointer */
#define CURL_HTTPPOST_CALLBACK (1<<6)
#define CURL_HTTPPOST_CALLBACK (1 << 6)
/* use size in 'contentlen', added in 7.46.0 */
#define CURL_HTTPPOST_LARGE (1<<7)
#define CURL_HTTPPOST_LARGE (1 << 7)

char *showfilename; /* The filename to show. If not set, the
actual filename will be used (if this
Expand Down Expand Up @@ -303,14 +303,14 @@ typedef enum {
CURLFILETYPE_UNKNOWN /* should never occur */
} curlfiletype;

#define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
#define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
#define CURLFINFOFLAG_KNOWN_TIME (1<<2)
#define CURLFINFOFLAG_KNOWN_PERM (1<<3)
#define CURLFINFOFLAG_KNOWN_UID (1<<4)
#define CURLFINFOFLAG_KNOWN_GID (1<<5)
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
#define CURLFINFOFLAG_KNOWN_FILENAME (1 << 0)
#define CURLFINFOFLAG_KNOWN_FILETYPE (1 << 1)
#define CURLFINFOFLAG_KNOWN_TIME (1 << 2)
#define CURLFINFOFLAG_KNOWN_PERM (1 << 3)
#define CURLFINFOFLAG_KNOWN_UID (1 << 4)
#define CURLFINFOFLAG_KNOWN_GID (1 << 5)
#define CURLFINFOFLAG_KNOWN_SIZE (1 << 6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1 << 7)

/* Information about a single file, used when doing FTP wildcard matching */
struct curl_fileinfo {
Expand Down Expand Up @@ -826,34 +826,34 @@ typedef enum {
*/

#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_BASIC (((unsigned long)1) << 0)
#define CURLAUTH_DIGEST (((unsigned long)1) << 1)
#define CURLAUTH_NEGOTIATE (((unsigned long)1) << 2)
/* Deprecated since the advent of CURLAUTH_NEGOTIATE */
#define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
/* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM (((unsigned long)1) << 3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1) << 4)
#ifndef CURL_NO_OLDIES
/* functionality removed since 8.8.0 */
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_NTLM_WB (((unsigned long)1) << 5)
#endif
#define CURLAUTH_BEARER (((unsigned long)1)<<6)
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_BEARER (((unsigned long)1) << 6)
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1) << 7)
#define CURLAUTH_ONLY (((unsigned long)1) << 31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE))

#define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1L<<0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1L<<1) /* password */
#define CURLSSH_AUTH_HOST (1L<<2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1L<<3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1L<<4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1L<<5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLSSH_AUTH_ANY ~0L /* all types supported by server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1L << 0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1L << 1) /* password */
#define CURLSSH_AUTH_HOST (1L << 2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1L << 3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1L << 4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1L << 5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY

#define CURLGSSAPI_DELEGATION_NONE 0L /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */
Expand Down Expand Up @@ -932,31 +932,31 @@ typedef enum {
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1L<<0)
#define CURLSSLOPT_ALLOW_BEAST (1L << 0)

/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
SSL backends where such behavior is present. */
#define CURLSSLOPT_NO_REVOKE (1L<<1)
#define CURLSSLOPT_NO_REVOKE (1L << 1)

/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
if possible. The OpenSSL backend has this ability. */
#define CURLSSLOPT_NO_PARTIALCHAIN (1L<<2)
#define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)

/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
checks and ignore missing revocation list for those SSL backends where such
behavior is present. */
#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L<<3)
#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)

/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
operating system. Currently implemented under MS-Windows. */
#define CURLSSLOPT_NATIVE_CA (1L<<4)
#define CURLSSLOPT_NATIVE_CA (1L << 4)

/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
a client certificate for authentication. (Schannel) */
#define CURLSSLOPT_AUTO_CLIENT_CERT (1L<<5)
#define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)

/* If possible, send data using TLS 1.3 early data */
#define CURLSSLOPT_EARLYDATA (1L<<6)
#define CURLSSLOPT_EARLYDATA (1L << 6)

/* The default connection attempt delay in milliseconds for happy eyeballs.
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
Expand Down Expand Up @@ -1023,20 +1023,20 @@ typedef enum {

/* bitmask defines for CURLOPT_HEADEROPT */
#define CURLHEADER_UNIFIED 0L
#define CURLHEADER_SEPARATE (1L<<0)
#define CURLHEADER_SEPARATE (1L << 0)

/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
#define CURLALTSVC_READONLYFILE (1L<<2)
#define CURLALTSVC_H1 (1L<<3)
#define CURLALTSVC_H2 (1L<<4)
#define CURLALTSVC_H3 (1L<<5)
#define CURLALTSVC_READONLYFILE (1L << 2)
#define CURLALTSVC_H1 (1L << 3)
#define CURLALTSVC_H2 (1L << 4)
#define CURLALTSVC_H3 (1L << 5)

/* bitmask values for CURLOPT_UPLOAD_FLAGS */
#define CURLULFLAG_ANSWERED (1L<<0)
#define CURLULFLAG_DELETED (1L<<1)
#define CURLULFLAG_DRAFT (1L<<2)
#define CURLULFLAG_FLAGGED (1L<<3)
#define CURLULFLAG_SEEN (1L<<4)
#define CURLULFLAG_ANSWERED (1L << 0)
#define CURLULFLAG_DELETED (1L << 1)
#define CURLULFLAG_DRAFT (1L << 2)
#define CURLULFLAG_FLAGGED (1L << 3)
#define CURLULFLAG_SEEN (1L << 4)

struct curl_hstsentry {
char *name;
Expand Down Expand Up @@ -1065,41 +1065,41 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
void *userp);

/* CURLHSTS_* are bits for the CURLOPT_HSTS option */
#define CURLHSTS_ENABLE (1L<<0)
#define CURLHSTS_READONLYFILE (1L<<1)
#define CURLHSTS_ENABLE (1L << 0)
#define CURLHSTS_READONLYFILE (1L << 1)

/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
options. Do not use. */
#define CURLPROTO_HTTP (1L<<0)
#define CURLPROTO_HTTPS (1L<<1)
#define CURLPROTO_FTP (1L<<2)
#define CURLPROTO_FTPS (1L<<3)
#define CURLPROTO_SCP (1L<<4)
#define CURLPROTO_SFTP (1L<<5)
#define CURLPROTO_TELNET (1L<<6)
#define CURLPROTO_LDAP (1L<<7)
#define CURLPROTO_LDAPS (1L<<8)
#define CURLPROTO_DICT (1L<<9)
#define CURLPROTO_FILE (1L<<10)
#define CURLPROTO_TFTP (1L<<11)
#define CURLPROTO_IMAP (1L<<12)
#define CURLPROTO_IMAPS (1L<<13)
#define CURLPROTO_POP3 (1L<<14)
#define CURLPROTO_POP3S (1L<<15)
#define CURLPROTO_SMTP (1L<<16)
#define CURLPROTO_SMTPS (1L<<17)
#define CURLPROTO_RTSP (1L<<18)
#define CURLPROTO_RTMP (1L<<19)
#define CURLPROTO_RTMPT (1L<<20)
#define CURLPROTO_RTMPE (1L<<21)
#define CURLPROTO_RTMPTE (1L<<22)
#define CURLPROTO_RTMPS (1L<<23)
#define CURLPROTO_RTMPTS (1L<<24)
#define CURLPROTO_GOPHER (1L<<25)
#define CURLPROTO_SMB (1L<<26)
#define CURLPROTO_SMBS (1L<<27)
#define CURLPROTO_MQTT (1L<<28)
#define CURLPROTO_GOPHERS (1L<<29)
#define CURLPROTO_HTTP (1L << 0)
#define CURLPROTO_HTTPS (1L << 1)
#define CURLPROTO_FTP (1L << 2)
#define CURLPROTO_FTPS (1L << 3)
#define CURLPROTO_SCP (1L << 4)
#define CURLPROTO_SFTP (1L << 5)
#define CURLPROTO_TELNET (1L << 6)
#define CURLPROTO_LDAP (1L << 7)
#define CURLPROTO_LDAPS (1L << 8)
#define CURLPROTO_DICT (1L << 9)
#define CURLPROTO_FILE (1L << 10)
#define CURLPROTO_TFTP (1L << 11)
#define CURLPROTO_IMAP (1L << 12)
#define CURLPROTO_IMAPS (1L << 13)
#define CURLPROTO_POP3 (1L << 14)
#define CURLPROTO_POP3S (1L << 15)
#define CURLPROTO_SMTP (1L << 16)
#define CURLPROTO_SMTPS (1L << 17)
#define CURLPROTO_RTSP (1L << 18)
#define CURLPROTO_RTMP (1L << 19)
#define CURLPROTO_RTMPT (1L << 20)
#define CURLPROTO_RTMPE (1L << 21)
#define CURLPROTO_RTMPTE (1L << 22)
#define CURLPROTO_RTMPS (1L << 23)
#define CURLPROTO_RTMPTS (1L << 24)
#define CURLPROTO_GOPHER (1L << 25)
#define CURLPROTO_SMB (1L << 26)
#define CURLPROTO_SMBS (1L << 27)
#define CURLPROTO_MQTT (1L << 28)
#define CURLPROTO_GOPHERS (1L << 29)
#define CURLPROTO_ALL (~0L) /* enable everything */

/* long may be 32 or 64 bits, but we should never depend on anything else
Expand Down Expand Up @@ -2424,7 +2424,7 @@ typedef struct curl_mime curl_mime; /* Mime context. */
typedef struct curl_mimepart curl_mimepart; /* Mime part context. */

/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
#define CURLMIMEOPT_FORMESCAPE (1L<<0) /* Use backslash-escaping for forms. */
#define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */

/*
* NAME curl_mime_init()
Expand Down Expand Up @@ -3006,12 +3006,12 @@ typedef enum {
CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;

#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1)
#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1 << 1)
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
#define CURL_GLOBAL_ACK_EINTR (1<<2)
#define CURL_GLOBAL_ACK_EINTR (1 << 2)

/*****************************************************************************
* Setup defines, protos etc for the sharing stuff.
Expand Down Expand Up @@ -3247,10 +3247,10 @@ CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
*/
CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);

#define CURLPAUSE_RECV (1<<0)
#define CURLPAUSE_RECV (1 << 0)
#define CURLPAUSE_RECV_CONT (0)

#define CURLPAUSE_SEND (1<<2)
#define CURLPAUSE_SEND (1 << 2)
#define CURLPAUSE_SEND_CONT (0)

#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND)
Expand Down
4 changes: 2 additions & 2 deletions include/curl/curlver.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
*/
#define LIBCURL_TIMESTAMP "[unreleased]"

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

#endif /* CURLINC_CURLVER_H */
10 changes: 5 additions & 5 deletions include/curl/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ struct curl_header {
};

/* 'origin' bits */
#define CURLH_HEADER (1<<0) /* plain server header */
#define CURLH_TRAILER (1<<1) /* trailers */
#define CURLH_CONNECT (1<<2) /* CONNECT headers */
#define CURLH_1XX (1<<3) /* 1xx headers */
#define CURLH_PSEUDO (1<<4) /* pseudo headers */
#define CURLH_HEADER (1 << 0) /* plain server header */
#define CURLH_TRAILER (1 << 1) /* trailers */
#define CURLH_CONNECT (1 << 2) /* CONNECT headers */
#define CURLH_1XX (1 << 3) /* 1xx headers */
#define CURLH_PSEUDO (1 << 4) /* pseudo headers */

typedef enum {
CURLHE_OK,
Expand Down
Loading