1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/// @file WASM shim for curl/curl.h
/// filetransfer.cc is excluded from the WASM build; this shim only needs
/// to satisfy header includes transitively pulled in by other files.
#pragma once
#include <stddef.h>
#include <stdint.h>

typedef void CURL;
typedef void CURLM;
typedef int CURLcode;
typedef int CURLMcode;
typedef int CURLoption;
typedef int CURLINFO;
typedef int curl_off_t;

#define CURLE_OK 0
#define CURLM_OK 0
#define CURLM_CALL_MULTI_PERFORM 1

struct curl_slist
{
    char * data;
    struct curl_slist * next;
};

static inline CURL * curl_easy_init(void)
{
    return nullptr;
}
static inline void curl_easy_cleanup(CURL *) {}
static inline CURLcode curl_easy_setopt(CURL *, CURLoption, ...)
{
    return CURLE_OK;
}
static inline CURLcode curl_easy_getinfo(CURL *, CURLINFO, ...)
{
    return CURLE_OK;
}
static inline const char * curl_easy_strerror(CURLcode)
{
    return "";
}
static inline CURLM * curl_multi_init(void)
{
    return nullptr;
}
static inline void curl_multi_cleanup(CURLM *) {}
static inline CURLMcode curl_multi_add_handle(CURLM *, CURL *)
{
    return CURLM_OK;
}
static inline CURLMcode curl_multi_remove_handle(CURLM *, CURL *)
{
    return CURLM_OK;
}
static inline CURLMcode curl_multi_perform(CURLM *, int *)
{
    return CURLM_OK;
}
static inline CURLMcode curl_multi_setopt(CURLM *, int, ...)
{
    return CURLM_OK;
}
static inline struct curl_slist * curl_slist_append(struct curl_slist *, const char *)
{
    return nullptr;
}
static inline void curl_slist_free_all(struct curl_slist *) {}
static inline void curl_global_init(long) {}
static inline void curl_global_cleanup(void) {}
static inline size_t curl_off_t_unused = 0;
typedef size_t (*curl_write_callback)(char *, size_t, size_t, void *);
typedef size_t (*curl_read_callback)(char *, size_t, size_t, void *);

#define CURLOPT_URL 10002
#define CURLOPT_WRITEFUNCTION 20011
#define CURLOPT_WRITEDATA 10001
#define CURLOPT_READFUNCTION 20012
#define CURLOPT_READDATA 10009
#define CURLOPT_HTTPHEADER 10023
#define CURLOPT_FOLLOWLOCATION 52
#define CURLOPT_MAXREDIRS 68
#define CURLOPT_USERAGENT 10018
#define CURLOPT_VERBOSE 41
#define CURLOPT_NOSIGNAL 99
#define CURLOPT_POST 47
#define CURLOPT_POSTFIELDSIZE 60
#define CURLOPT_UPLOAD 46
#define CURLOPT_INFILESIZE_LARGE 30115
#define CURLOPT_NOBODY 44
#define CURLINFO_RESPONSE_CODE 0x200002
#define CURLOPT_PRIVATE 10103
#define CURLINFO_PRIVATE 0x100021
#define CURLMOPT_SOCKETFUNCTION 20001
#define CURLMOPT_TIMERFUNCTION 20004
#define CURLMOPT_SOCKETDATA 10002
#define CURLMOPT_TIMERDATA 10005
#define CURL_SOCKET_TIMEOUT -1
#define CURL_POLL_REMOVE 4