source cleanup: remove all custom typedef structs

- Stick to a single unified way to use structs
 - Make checksrc complain on 'typedef struct {'
 - Allow them in tests, public headers and examples

 - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually
   typedef different types/structs depending on build conditions.

Closes #5338
This commit is contained in:
Daniel Stenberg 2020-05-14 00:05:04 +02:00
parent 5d54b5e697
commit 8df455479f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
71 changed files with 718 additions and 672 deletions

View file

@ -2115,8 +2115,8 @@ CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
/* Mime/form handling support. */
typedef struct curl_mime_s curl_mime; /* Mime context. */
typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
typedef struct curl_mime curl_mime; /* Mime context. */
typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
/*
* NAME curl_mime_init()
@ -2490,10 +2490,11 @@ struct curl_slist {
* subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
*/
typedef struct {
struct curl_ssl_backend {
curl_sslbackend id;
const char *name;
} curl_ssl_backend;
};
typedef struct curl_ssl_backend curl_ssl_backend;
typedef enum {
CURLSSLSET_OK = 0,
@ -2745,7 +2746,7 @@ typedef enum {
from above. */
#define CURLVERSION_NOW CURLVERSION_SEVENTH
typedef struct {
struct curl_version_info_data {
CURLversion age; /* age of the returned struct */
const char *version; /* LIBCURL_VERSION */
unsigned int version_num; /* LIBCURL_VERSION_NUM */
@ -2789,7 +2790,8 @@ typedef struct {
const char *capath; /* the built-in default CURLOPT_CAPATH, might
be NULL */
} curl_version_info_data;
};
typedef struct curl_version_info_data curl_version_info_data;
#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported