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

@ -35,12 +35,11 @@ typedef enum {
TOOLMIME_STDINDATA
} toolmimekind;
typedef struct tool_mime tool_mime;
struct tool_mime {
/* Structural fields. */
toolmimekind kind; /* Part kind. */
tool_mime *parent; /* Parent item. */
tool_mime *prev; /* Previous sibling (reverse order link). */
struct tool_mime *parent; /* Parent item. */
struct tool_mime *prev; /* Previous sibling (reverse order link). */
/* Common fields. */
const char *data; /* Actual data or data filename. */
const char *name; /* Part name. */
@ -49,7 +48,7 @@ struct tool_mime {
const char *encoder; /* Part's requested encoding. */
struct curl_slist *headers; /* User-defined headers. */
/* TOOLMIME_PARTS fields. */
tool_mime *subparts; /* Part's subparts. */
struct tool_mime *subparts; /* Part's subparts. */
/* TOOLMIME_STDIN/TOOLMIME_STDINDATA fields. */
curl_off_t origin; /* Stdin read origin offset. */
curl_off_t size; /* Stdin data size. */
@ -63,10 +62,10 @@ int tool_mime_stdin_seek(void *instream, curl_off_t offset, int whence);
int formparse(struct OperationConfig *config,
const char *input,
tool_mime **mimeroot,
tool_mime **mimecurrent,
struct tool_mime **mimeroot,
struct tool_mime **mimecurrent,
bool literal_value);
CURLcode tool2curlmime(CURL *curl, tool_mime *m, curl_mime **mime);
void tool_mime_free(tool_mime *mime);
CURLcode tool2curlmime(CURL *curl, struct tool_mime *m, curl_mime **mime);
void tool_mime_free(struct tool_mime *mime);
#endif /* HEADER_CURL_TOOL_FORMPARSE_H */