crossbind 2.0.0-beta.63 → 2.0.0-beta.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/package.json +2 -2
- package/src/actions/androidDevice.js +77 -0
- package/src/actions/androidGradle.js +121 -0
- package/src/actions/buildApp.js +434 -0
- package/src/actions/buildBinTools.js +0 -0
- package/src/actions/buildDependencies.js +4 -3
- package/src/actions/buildExternal.js +3 -3
- package/src/actions/buildJs.js +2 -9
- package/src/actions/buildLib.js +1 -1
- package/src/actions/buildNode.js +19 -16
- package/src/actions/buildWasiCommand.js +10 -5
- package/src/actions/buildWasm.js +24 -3
- package/src/actions/createImportedBridges.js +7 -0
- package/src/actions/createInterface.js +4 -5
- package/src/actions/createLib.js +17 -2
- package/src/actions/getCmakeParameters.js +2 -1
- package/src/actions/getData.js +2 -1
- package/src/actions/getDependLibs.js +8 -2
- package/src/actions/getEnv.js +7 -0
- package/src/actions/getLinkInputs.js +10 -7
- package/src/actions/gradleProject.js +110 -0
- package/src/actions/iosSimulator.js +63 -0
- package/src/actions/licenses.js +160 -14
- package/src/actions/nativeBridges.js +35 -0
- package/src/actions/run.js +3 -3
- package/src/actions/runnerCommands.js +16 -4
- package/src/actions/target.js +2 -1
- package/src/actions/writeRuntimeEntry.js +18 -7
- package/src/actions/xcodeProject.js +152 -0
- package/src/assets/cpp-runtime/node.cpp +18 -1
- package/src/assets/js-runtime/adapters/worker-comlink.js +58 -0
- package/src/assets/js-runtime/core.js +5 -4
- package/src/assets/toolchain-digests.json +25 -19
- package/src/assets/wasi-runtime/http/README.md +17 -0
- package/src/assets/wasi-runtime/http/bindings/crossbind_http.c +2537 -0
- package/src/assets/wasi-runtime/http/bindings/crossbind_http.h +826 -0
- package/src/assets/wasi-runtime/http/bindings/crossbind_http_component_type.o +0 -0
- package/src/assets/wasi-runtime/http/handler.cpp +298 -0
- package/src/assets/wasi-runtime/http/include/crossbind/http.h +31 -0
- package/src/assets/wasi-runtime/http/wit/deps/LICENSE.md +8 -0
- package/src/assets/wasi-runtime/http/wit/deps/cli.wit +28 -0
- package/src/assets/wasi-runtime/http/wit/deps/clocks.wit +43 -0
- package/src/assets/wasi-runtime/http/wit/deps/http.wit +509 -0
- package/src/assets/wasi-runtime/http/wit/deps/random.wit +18 -0
- package/src/assets/wasi-runtime/http/wit/world.wit +6 -0
- package/src/bin.js +102 -209
- package/src/cli.js +14 -0
- package/src/index.js +6 -0
- package/src/integration/getCrossbindScript.js +19 -4
- package/src/program.js +169 -0
- package/src/state/index.js +8 -3
- package/src/state/loadConfig.js +6 -11
- package/src/utils/appRustCrates.js +7 -1
- package/src/utils/bridgeExtras.js +74 -6
- package/src/utils/cargoLock.js +19 -0
- package/src/utils/cppDts.js +2 -0
- package/src/utils/downloadAndExtractFile.js +42 -14
- package/src/utils/embindObjectLifetime.js +35 -0
- package/src/utils/embindRsFingerprint.js +10 -3
- package/src/utils/hermes.js +40 -0
- package/src/utils/packageLicense.js +4 -2
- package/src/utils/plist.js +42 -0
- package/src/utils/pullDockerImage.js +9 -3
- package/src/utils/replaceBasePathForDocker.js +8 -0
- package/src/utils/resetCMakeCacheForSource.js +26 -0
- package/src/utils/resolveAppHost.js +21 -0
- package/src/utils/rustBridgeGen.js +13 -4
- package/src/utils/rustMt.js +5 -0
- package/src/utils/rustSysroot.js +7 -5
- package/src/utils/selectRunner.js +1 -1
- package/src/utils/swigInterface.js +5 -4
- package/src/utils/systemConfig.js +13 -0
- package/src/utils/systemKeys.js +4 -0
- package/src/utils/targets.js +30 -3
- package/src/utils/wasiHttp.js +50 -0
- package/vitest.config.js +5 -0
|
@@ -0,0 +1,2537 @@
|
|
|
1
|
+
// Generated by `wit-bindgen` 0.62.0. DO NOT EDIT!
|
|
2
|
+
#include "crossbind_http.h"
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <string.h>
|
|
5
|
+
|
|
6
|
+
// Imported Functions from `wasi:http/types@0.3.0`
|
|
7
|
+
|
|
8
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[constructor]fields")))
|
|
9
|
+
extern int32_t __wasm_import_wasi_http_types_constructor_fields(void);
|
|
10
|
+
|
|
11
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[static]fields.from-list")))
|
|
12
|
+
extern void __wasm_import_wasi_http_types_static_fields_from_list(uint8_t *, size_t, uint8_t *);
|
|
13
|
+
|
|
14
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.get")))
|
|
15
|
+
extern void __wasm_import_wasi_http_types_method_fields_get(int32_t, uint8_t *, size_t, uint8_t *);
|
|
16
|
+
|
|
17
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.has")))
|
|
18
|
+
extern int32_t __wasm_import_wasi_http_types_method_fields_has(int32_t, uint8_t *, size_t);
|
|
19
|
+
|
|
20
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.set")))
|
|
21
|
+
extern void __wasm_import_wasi_http_types_method_fields_set(int32_t, uint8_t *, size_t, uint8_t *, size_t, uint8_t *);
|
|
22
|
+
|
|
23
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.delete")))
|
|
24
|
+
extern void __wasm_import_wasi_http_types_method_fields_delete(int32_t, uint8_t *, size_t, uint8_t *);
|
|
25
|
+
|
|
26
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.get-and-delete")))
|
|
27
|
+
extern void __wasm_import_wasi_http_types_method_fields_get_and_delete(int32_t, uint8_t *, size_t, uint8_t *);
|
|
28
|
+
|
|
29
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.append")))
|
|
30
|
+
extern void __wasm_import_wasi_http_types_method_fields_append(int32_t, uint8_t *, size_t, uint8_t *, size_t, uint8_t *);
|
|
31
|
+
|
|
32
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.copy-all")))
|
|
33
|
+
extern void __wasm_import_wasi_http_types_method_fields_copy_all(int32_t, uint8_t *);
|
|
34
|
+
|
|
35
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]fields.clone")))
|
|
36
|
+
extern int32_t __wasm_import_wasi_http_types_method_fields_clone(int32_t);
|
|
37
|
+
|
|
38
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[static]request.new")))
|
|
39
|
+
extern void __wasm_import_wasi_http_types_static_request_new(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint8_t *);
|
|
40
|
+
|
|
41
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-method")))
|
|
42
|
+
extern void __wasm_import_wasi_http_types_method_request_get_method(int32_t, uint8_t *);
|
|
43
|
+
|
|
44
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.set-method")))
|
|
45
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_set_method(int32_t, int32_t, uint8_t *, size_t);
|
|
46
|
+
|
|
47
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-path-with-query")))
|
|
48
|
+
extern void __wasm_import_wasi_http_types_method_request_get_path_with_query(int32_t, uint8_t *);
|
|
49
|
+
|
|
50
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.set-path-with-query")))
|
|
51
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_set_path_with_query(int32_t, int32_t, uint8_t *, size_t);
|
|
52
|
+
|
|
53
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-scheme")))
|
|
54
|
+
extern void __wasm_import_wasi_http_types_method_request_get_scheme(int32_t, uint8_t *);
|
|
55
|
+
|
|
56
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.set-scheme")))
|
|
57
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_set_scheme(int32_t, int32_t, int32_t, uint8_t *, size_t);
|
|
58
|
+
|
|
59
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-authority")))
|
|
60
|
+
extern void __wasm_import_wasi_http_types_method_request_get_authority(int32_t, uint8_t *);
|
|
61
|
+
|
|
62
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.set-authority")))
|
|
63
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_set_authority(int32_t, int32_t, uint8_t *, size_t);
|
|
64
|
+
|
|
65
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-options")))
|
|
66
|
+
extern void __wasm_import_wasi_http_types_method_request_get_options(int32_t, uint8_t *);
|
|
67
|
+
|
|
68
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request.get-headers")))
|
|
69
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_get_headers(int32_t);
|
|
70
|
+
|
|
71
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[static]request.consume-body")))
|
|
72
|
+
extern void __wasm_import_wasi_http_types_static_request_consume_body(int32_t, int32_t, uint8_t *);
|
|
73
|
+
|
|
74
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[constructor]request-options")))
|
|
75
|
+
extern int32_t __wasm_import_wasi_http_types_constructor_request_options(void);
|
|
76
|
+
|
|
77
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.get-connect-timeout")))
|
|
78
|
+
extern void __wasm_import_wasi_http_types_method_request_options_get_connect_timeout(int32_t, uint8_t *);
|
|
79
|
+
|
|
80
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.set-connect-timeout")))
|
|
81
|
+
extern void __wasm_import_wasi_http_types_method_request_options_set_connect_timeout(int32_t, int32_t, int64_t, uint8_t *);
|
|
82
|
+
|
|
83
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.get-first-byte-timeout")))
|
|
84
|
+
extern void __wasm_import_wasi_http_types_method_request_options_get_first_byte_timeout(int32_t, uint8_t *);
|
|
85
|
+
|
|
86
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.set-first-byte-timeout")))
|
|
87
|
+
extern void __wasm_import_wasi_http_types_method_request_options_set_first_byte_timeout(int32_t, int32_t, int64_t, uint8_t *);
|
|
88
|
+
|
|
89
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.get-between-bytes-timeout")))
|
|
90
|
+
extern void __wasm_import_wasi_http_types_method_request_options_get_between_bytes_timeout(int32_t, uint8_t *);
|
|
91
|
+
|
|
92
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.set-between-bytes-timeout")))
|
|
93
|
+
extern void __wasm_import_wasi_http_types_method_request_options_set_between_bytes_timeout(int32_t, int32_t, int64_t, uint8_t *);
|
|
94
|
+
|
|
95
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]request-options.clone")))
|
|
96
|
+
extern int32_t __wasm_import_wasi_http_types_method_request_options_clone(int32_t);
|
|
97
|
+
|
|
98
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[static]response.new")))
|
|
99
|
+
extern void __wasm_import_wasi_http_types_static_response_new(int32_t, int32_t, int32_t, int32_t, uint8_t *);
|
|
100
|
+
|
|
101
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]response.get-status-code")))
|
|
102
|
+
extern int32_t __wasm_import_wasi_http_types_method_response_get_status_code(int32_t);
|
|
103
|
+
|
|
104
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]response.set-status-code")))
|
|
105
|
+
extern int32_t __wasm_import_wasi_http_types_method_response_set_status_code(int32_t, int32_t);
|
|
106
|
+
|
|
107
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[method]response.get-headers")))
|
|
108
|
+
extern int32_t __wasm_import_wasi_http_types_method_response_get_headers(int32_t);
|
|
109
|
+
|
|
110
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[static]response.consume-body")))
|
|
111
|
+
extern void __wasm_import_wasi_http_types_static_response_consume_body(int32_t, int32_t, uint8_t *);
|
|
112
|
+
|
|
113
|
+
// Exported Functions from `wasi:http/handler@0.3.0`
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
// Canonical ABI intrinsics
|
|
117
|
+
|
|
118
|
+
__attribute__((__weak__, __export_name__("cabi_realloc")))
|
|
119
|
+
void *cabi_realloc(void *ptr, size_t old_size, size_t align, size_t new_size) {
|
|
120
|
+
(void) old_size;
|
|
121
|
+
if (new_size == 0) return (void*) align;
|
|
122
|
+
void *ret = realloc(ptr, new_size);
|
|
123
|
+
if (!ret) abort();
|
|
124
|
+
return ret;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Helper Functions
|
|
128
|
+
|
|
129
|
+
void wasi_http_types_method_free(wasi_http_types_method_t *ptr) {
|
|
130
|
+
switch ((int32_t) ptr->tag) {
|
|
131
|
+
case 9: {
|
|
132
|
+
crossbind_http_string_free(&ptr->val.other);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
void wasi_http_types_scheme_free(wasi_http_types_scheme_t *ptr) {
|
|
139
|
+
switch ((int32_t) ptr->tag) {
|
|
140
|
+
case 2: {
|
|
141
|
+
crossbind_http_string_free(&ptr->val.other);
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
void crossbind_http_option_string_free(crossbind_http_option_string_t *ptr) {
|
|
148
|
+
if (ptr->is_some) {
|
|
149
|
+
crossbind_http_string_free(&ptr->val);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
void crossbind_http_option_u16_free(crossbind_http_option_u16_t *ptr) {
|
|
154
|
+
if (ptr->is_some) {
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
void wasi_http_types_dns_error_payload_free(wasi_http_types_dns_error_payload_t *ptr) {
|
|
159
|
+
crossbind_http_option_string_free(&ptr->rcode);
|
|
160
|
+
crossbind_http_option_u16_free(&ptr->info_code);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
void crossbind_http_option_u8_free(crossbind_http_option_u8_t *ptr) {
|
|
164
|
+
if (ptr->is_some) {
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
void wasi_http_types_tls_alert_received_payload_free(wasi_http_types_tls_alert_received_payload_t *ptr) {
|
|
169
|
+
crossbind_http_option_u8_free(&ptr->alert_id);
|
|
170
|
+
crossbind_http_option_string_free(&ptr->alert_message);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
void crossbind_http_option_u32_free(crossbind_http_option_u32_t *ptr) {
|
|
174
|
+
if (ptr->is_some) {
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
void wasi_http_types_field_size_payload_free(wasi_http_types_field_size_payload_t *ptr) {
|
|
179
|
+
crossbind_http_option_string_free(&ptr->field_name);
|
|
180
|
+
crossbind_http_option_u32_free(&ptr->field_size);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
void crossbind_http_option_u64_free(crossbind_http_option_u64_t *ptr) {
|
|
184
|
+
if (ptr->is_some) {
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
void wasi_http_types_option_field_size_payload_free(wasi_http_types_option_field_size_payload_t *ptr) {
|
|
189
|
+
if (ptr->is_some) {
|
|
190
|
+
wasi_http_types_field_size_payload_free(&ptr->val);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
void wasi_http_types_error_code_free(wasi_http_types_error_code_t *ptr) {
|
|
195
|
+
switch ((int32_t) ptr->tag) {
|
|
196
|
+
case 1: {
|
|
197
|
+
wasi_http_types_dns_error_payload_free(&ptr->val.dns_error);
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case 14: {
|
|
201
|
+
wasi_http_types_tls_alert_received_payload_free(&ptr->val.tls_alert_received);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
case 17: {
|
|
205
|
+
crossbind_http_option_u64_free(&ptr->val.http_request_body_size);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case 21: {
|
|
209
|
+
crossbind_http_option_u32_free(&ptr->val.http_request_header_section_size);
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
case 22: {
|
|
213
|
+
wasi_http_types_option_field_size_payload_free(&ptr->val.http_request_header_size);
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
case 23: {
|
|
217
|
+
crossbind_http_option_u32_free(&ptr->val.http_request_trailer_section_size);
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
case 24: {
|
|
221
|
+
wasi_http_types_field_size_payload_free(&ptr->val.http_request_trailer_size);
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
case 26: {
|
|
225
|
+
crossbind_http_option_u32_free(&ptr->val.http_response_header_section_size);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case 27: {
|
|
229
|
+
wasi_http_types_field_size_payload_free(&ptr->val.http_response_header_size);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
case 28: {
|
|
233
|
+
crossbind_http_option_u64_free(&ptr->val.http_response_body_size);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
case 29: {
|
|
237
|
+
crossbind_http_option_u32_free(&ptr->val.http_response_trailer_section_size);
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case 30: {
|
|
241
|
+
wasi_http_types_field_size_payload_free(&ptr->val.http_response_trailer_size);
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
case 31: {
|
|
245
|
+
crossbind_http_option_string_free(&ptr->val.http_response_transfer_coding);
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
case 32: {
|
|
249
|
+
crossbind_http_option_string_free(&ptr->val.http_response_content_coding);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
case 38: {
|
|
253
|
+
crossbind_http_option_string_free(&ptr->val.internal_error);
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
void wasi_http_types_header_error_free(wasi_http_types_header_error_t *ptr) {
|
|
260
|
+
switch ((int32_t) ptr->tag) {
|
|
261
|
+
case 4: {
|
|
262
|
+
crossbind_http_option_string_free(&ptr->val.other);
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
void wasi_http_types_request_options_error_free(wasi_http_types_request_options_error_t *ptr) {
|
|
269
|
+
switch ((int32_t) ptr->tag) {
|
|
270
|
+
case 2: {
|
|
271
|
+
crossbind_http_option_string_free(&ptr->val.other);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
void wasi_http_types_field_name_free(wasi_http_types_field_name_t *ptr) {
|
|
278
|
+
crossbind_http_string_free(ptr);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
void wasi_http_types_field_value_free(wasi_http_types_field_value_t *ptr) {
|
|
282
|
+
size_t list_len = ptr->len;
|
|
283
|
+
if (list_len > 0) {
|
|
284
|
+
uint8_t *list_ptr = ptr->ptr;
|
|
285
|
+
for (size_t i = 0; i < list_len; i++) {
|
|
286
|
+
}
|
|
287
|
+
free(list_ptr);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[resource-drop]fields")))
|
|
292
|
+
extern void __wasm_import_wasi_http_types_fields_drop(int32_t handle);
|
|
293
|
+
|
|
294
|
+
void wasi_http_types_fields_drop_own(wasi_http_types_own_fields_t handle) {
|
|
295
|
+
__wasm_import_wasi_http_types_fields_drop(handle.__handle);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
void wasi_http_types_fields_drop_borrow(wasi_http_types_borrow_fields_t handle) {
|
|
299
|
+
__wasm_import_wasi_http_types_fields_drop(handle.__handle);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
wasi_http_types_borrow_fields_t wasi_http_types_borrow_fields(wasi_http_types_own_fields_t arg) {
|
|
303
|
+
return (wasi_http_types_borrow_fields_t) { arg.__handle };
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[resource-drop]request")))
|
|
307
|
+
extern void __wasm_import_wasi_http_types_request_drop(int32_t handle);
|
|
308
|
+
|
|
309
|
+
void wasi_http_types_request_drop_own(wasi_http_types_own_request_t handle) {
|
|
310
|
+
__wasm_import_wasi_http_types_request_drop(handle.__handle);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
void wasi_http_types_request_drop_borrow(wasi_http_types_borrow_request_t handle) {
|
|
314
|
+
__wasm_import_wasi_http_types_request_drop(handle.__handle);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
wasi_http_types_borrow_request_t wasi_http_types_borrow_request(wasi_http_types_own_request_t arg) {
|
|
318
|
+
return (wasi_http_types_borrow_request_t) { arg.__handle };
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[resource-drop]request-options")))
|
|
322
|
+
extern void __wasm_import_wasi_http_types_request_options_drop(int32_t handle);
|
|
323
|
+
|
|
324
|
+
void wasi_http_types_request_options_drop_own(wasi_http_types_own_request_options_t handle) {
|
|
325
|
+
__wasm_import_wasi_http_types_request_options_drop(handle.__handle);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
void wasi_http_types_request_options_drop_borrow(wasi_http_types_borrow_request_options_t handle) {
|
|
329
|
+
__wasm_import_wasi_http_types_request_options_drop(handle.__handle);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
wasi_http_types_borrow_request_options_t wasi_http_types_borrow_request_options(wasi_http_types_own_request_options_t arg) {
|
|
333
|
+
return (wasi_http_types_borrow_request_options_t) { arg.__handle };
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[resource-drop]response")))
|
|
337
|
+
extern void __wasm_import_wasi_http_types_response_drop(int32_t handle);
|
|
338
|
+
|
|
339
|
+
void wasi_http_types_response_drop_own(wasi_http_types_own_response_t handle) {
|
|
340
|
+
__wasm_import_wasi_http_types_response_drop(handle.__handle);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
void wasi_http_types_response_drop_borrow(wasi_http_types_borrow_response_t handle) {
|
|
344
|
+
__wasm_import_wasi_http_types_response_drop(handle.__handle);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
wasi_http_types_borrow_response_t wasi_http_types_borrow_response(wasi_http_types_own_response_t arg) {
|
|
348
|
+
return (wasi_http_types_borrow_response_t) { arg.__handle };
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
void wasi_http_types_tuple2_field_name_field_value_free(wasi_http_types_tuple2_field_name_field_value_t *ptr) {
|
|
352
|
+
wasi_http_types_field_name_free(&ptr->f0);
|
|
353
|
+
wasi_http_types_field_value_free(&ptr->f1);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
void wasi_http_types_list_tuple2_field_name_field_value_free(wasi_http_types_list_tuple2_field_name_field_value_t *ptr) {
|
|
357
|
+
size_t list_len = ptr->len;
|
|
358
|
+
if (list_len > 0) {
|
|
359
|
+
wasi_http_types_tuple2_field_name_field_value_t *list_ptr = ptr->ptr;
|
|
360
|
+
for (size_t i = 0; i < list_len; i++) {
|
|
361
|
+
wasi_http_types_tuple2_field_name_field_value_free(&list_ptr[i]);
|
|
362
|
+
}
|
|
363
|
+
free(list_ptr);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
void wasi_http_types_result_own_fields_header_error_free(wasi_http_types_result_own_fields_header_error_t *ptr) {
|
|
368
|
+
if (!ptr->is_err) {
|
|
369
|
+
} else {
|
|
370
|
+
wasi_http_types_header_error_free(&ptr->val.err);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
void wasi_http_types_list_field_value_free(wasi_http_types_list_field_value_t *ptr) {
|
|
375
|
+
size_t list_len = ptr->len;
|
|
376
|
+
if (list_len > 0) {
|
|
377
|
+
wasi_http_types_field_value_t *list_ptr = ptr->ptr;
|
|
378
|
+
for (size_t i = 0; i < list_len; i++) {
|
|
379
|
+
wasi_http_types_field_value_free(&list_ptr[i]);
|
|
380
|
+
}
|
|
381
|
+
free(list_ptr);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
void wasi_http_types_result_void_header_error_free(wasi_http_types_result_void_header_error_t *ptr) {
|
|
386
|
+
if (!ptr->is_err) {
|
|
387
|
+
} else {
|
|
388
|
+
wasi_http_types_header_error_free(&ptr->val.err);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
void wasi_http_types_result_list_field_value_header_error_free(wasi_http_types_result_list_field_value_header_error_t *ptr) {
|
|
393
|
+
if (!ptr->is_err) {
|
|
394
|
+
wasi_http_types_list_field_value_free(&ptr->val.ok);
|
|
395
|
+
} else {
|
|
396
|
+
wasi_http_types_header_error_free(&ptr->val.err);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
void wasi_http_types_option_stream_u8_free(wasi_http_types_option_stream_u8_t *ptr) {
|
|
401
|
+
if (ptr->is_some) {
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
void wasi_http_types_option_own_trailers_free(wasi_http_types_option_own_trailers_t *ptr) {
|
|
406
|
+
if (ptr->is_some) {
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
void wasi_http_types_result_option_own_trailers_error_code_free(wasi_http_types_result_option_own_trailers_error_code_t *ptr) {
|
|
411
|
+
if (!ptr->is_err) {
|
|
412
|
+
wasi_http_types_option_own_trailers_free(&ptr->val.ok);
|
|
413
|
+
} else {
|
|
414
|
+
wasi_http_types_error_code_free(&ptr->val.err);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
void wasi_http_types_option_own_request_options_free(wasi_http_types_option_own_request_options_t *ptr) {
|
|
419
|
+
if (ptr->is_some) {
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
void wasi_http_types_result_void_error_code_free(wasi_http_types_result_void_error_code_t *ptr) {
|
|
424
|
+
if (!ptr->is_err) {
|
|
425
|
+
} else {
|
|
426
|
+
wasi_http_types_error_code_free(&ptr->val.err);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
void wasi_http_types_result_void_void_free(wasi_http_types_result_void_void_t *ptr) {
|
|
431
|
+
if (!ptr->is_err) {
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
void wasi_http_types_option_scheme_free(wasi_http_types_option_scheme_t *ptr) {
|
|
436
|
+
if (ptr->is_some) {
|
|
437
|
+
wasi_http_types_scheme_free(&ptr->val);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
void wasi_http_types_option_duration_free(wasi_http_types_option_duration_t *ptr) {
|
|
442
|
+
if (ptr->is_some) {
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
void wasi_http_types_result_void_request_options_error_free(wasi_http_types_result_void_request_options_error_t *ptr) {
|
|
447
|
+
if (!ptr->is_err) {
|
|
448
|
+
} else {
|
|
449
|
+
wasi_http_types_request_options_error_free(&ptr->val.err);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[stream-new-0][static]request.new")))
|
|
454
|
+
extern uint64_t wasi_http_types_stream_u8__new(void);
|
|
455
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][stream-read-0][static]request.new")))
|
|
456
|
+
extern uint32_t wasi_http_types_stream_u8__read(uint32_t, uint8_t*, size_t);
|
|
457
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][stream-write-0][static]request.new")))
|
|
458
|
+
extern uint32_t wasi_http_types_stream_u8__write(uint32_t, const uint8_t*, size_t);
|
|
459
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[stream-cancel-read-0][static]request.new")))
|
|
460
|
+
extern uint32_t wasi_http_types_stream_u8__cancel_read(uint32_t);
|
|
461
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[stream-cancel-write-0][static]request.new")))
|
|
462
|
+
extern uint32_t wasi_http_types_stream_u8__cancel_write(uint32_t);
|
|
463
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[stream-drop-readable-0][static]request.new")))
|
|
464
|
+
extern void wasi_http_types_stream_u8__drop_readable(uint32_t);
|
|
465
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[stream-drop-writable-0][static]request.new")))
|
|
466
|
+
extern void wasi_http_types_stream_u8__drop_writable(uint32_t);
|
|
467
|
+
|
|
468
|
+
wasi_http_types_stream_u8_t wasi_http_types_stream_u8_new(wasi_http_types_stream_u8_writer_t *writer) {
|
|
469
|
+
uint64_t packed = wasi_http_types_stream_u8__new();
|
|
470
|
+
*writer = (uint32_t) (packed >> 32);
|
|
471
|
+
return (uint32_t) packed;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
crossbind_http_waitable_status_t wasi_http_types_stream_u8_read(wasi_http_types_stream_u8_t reader, uint8_t *buf, size_t amt) {
|
|
475
|
+
return wasi_http_types_stream_u8__read(reader, (uint8_t*) buf, amt);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
crossbind_http_waitable_status_t wasi_http_types_stream_u8_write(wasi_http_types_stream_u8_writer_t writer, const uint8_t *buf, size_t amt) {
|
|
479
|
+
return wasi_http_types_stream_u8__write(writer, (const uint8_t*) buf, amt);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
crossbind_http_waitable_status_t wasi_http_types_stream_u8_cancel_read(wasi_http_types_stream_u8_t reader){
|
|
483
|
+
return wasi_http_types_stream_u8__cancel_read(reader);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
crossbind_http_waitable_status_t wasi_http_types_stream_u8_cancel_write(wasi_http_types_stream_u8_writer_t writer) {
|
|
487
|
+
return wasi_http_types_stream_u8__cancel_write(writer);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
void wasi_http_types_stream_u8_drop_readable(wasi_http_types_stream_u8_t reader){
|
|
491
|
+
wasi_http_types_stream_u8__drop_readable(reader);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
void wasi_http_types_stream_u8_drop_writable(wasi_http_types_stream_u8_writer_t writer) {
|
|
495
|
+
wasi_http_types_stream_u8__drop_writable(writer);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-new-1][static]request.new")))
|
|
500
|
+
extern uint64_t wasi_http_types_future_result_option_own_trailers_error_code__new(void);
|
|
501
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][future-read-1][static]request.new")))
|
|
502
|
+
extern uint32_t wasi_http_types_future_result_option_own_trailers_error_code__read(uint32_t, uint8_t*);
|
|
503
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][future-write-1][static]request.new")))
|
|
504
|
+
extern uint32_t wasi_http_types_future_result_option_own_trailers_error_code__write(uint32_t, const uint8_t*);
|
|
505
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-cancel-read-1][static]request.new")))
|
|
506
|
+
extern uint32_t wasi_http_types_future_result_option_own_trailers_error_code__cancel_read(uint32_t);
|
|
507
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-cancel-write-1][static]request.new")))
|
|
508
|
+
extern uint32_t wasi_http_types_future_result_option_own_trailers_error_code__cancel_write(uint32_t);
|
|
509
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-drop-readable-1][static]request.new")))
|
|
510
|
+
extern void wasi_http_types_future_result_option_own_trailers_error_code__drop_readable(uint32_t);
|
|
511
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-drop-writable-1][static]request.new")))
|
|
512
|
+
extern void wasi_http_types_future_result_option_own_trailers_error_code__drop_writable(uint32_t);
|
|
513
|
+
|
|
514
|
+
wasi_http_types_future_result_option_own_trailers_error_code_t wasi_http_types_future_result_option_own_trailers_error_code_new(wasi_http_types_future_result_option_own_trailers_error_code_writer_t *writer) {
|
|
515
|
+
uint64_t packed = wasi_http_types_future_result_option_own_trailers_error_code__new();
|
|
516
|
+
*writer = (uint32_t) (packed >> 32);
|
|
517
|
+
return (uint32_t) packed;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_option_own_trailers_error_code_read(wasi_http_types_future_result_option_own_trailers_error_code_t reader, wasi_http_types_result_option_own_trailers_error_code_t *buf) {
|
|
521
|
+
return wasi_http_types_future_result_option_own_trailers_error_code__read(reader, (uint8_t*) buf);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_option_own_trailers_error_code_write(wasi_http_types_future_result_option_own_trailers_error_code_writer_t writer, const wasi_http_types_result_option_own_trailers_error_code_t *buf) {
|
|
525
|
+
return wasi_http_types_future_result_option_own_trailers_error_code__write(writer, (const uint8_t*) buf);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_option_own_trailers_error_code_cancel_read(wasi_http_types_future_result_option_own_trailers_error_code_t reader){
|
|
529
|
+
return wasi_http_types_future_result_option_own_trailers_error_code__cancel_read(reader);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_option_own_trailers_error_code_cancel_write(wasi_http_types_future_result_option_own_trailers_error_code_writer_t writer) {
|
|
533
|
+
return wasi_http_types_future_result_option_own_trailers_error_code__cancel_write(writer);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
void wasi_http_types_future_result_option_own_trailers_error_code_drop_readable(wasi_http_types_future_result_option_own_trailers_error_code_t reader){
|
|
537
|
+
wasi_http_types_future_result_option_own_trailers_error_code__drop_readable(reader);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
void wasi_http_types_future_result_option_own_trailers_error_code_drop_writable(wasi_http_types_future_result_option_own_trailers_error_code_writer_t writer) {
|
|
541
|
+
wasi_http_types_future_result_option_own_trailers_error_code__drop_writable(writer);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-new-2][static]request.new")))
|
|
546
|
+
extern uint64_t wasi_http_types_future_result_void_error_code__new(void);
|
|
547
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][future-read-2][static]request.new")))
|
|
548
|
+
extern uint32_t wasi_http_types_future_result_void_error_code__read(uint32_t, uint8_t*);
|
|
549
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[async-lower][future-write-2][static]request.new")))
|
|
550
|
+
extern uint32_t wasi_http_types_future_result_void_error_code__write(uint32_t, const uint8_t*);
|
|
551
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-cancel-read-2][static]request.new")))
|
|
552
|
+
extern uint32_t wasi_http_types_future_result_void_error_code__cancel_read(uint32_t);
|
|
553
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-cancel-write-2][static]request.new")))
|
|
554
|
+
extern uint32_t wasi_http_types_future_result_void_error_code__cancel_write(uint32_t);
|
|
555
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-drop-readable-2][static]request.new")))
|
|
556
|
+
extern void wasi_http_types_future_result_void_error_code__drop_readable(uint32_t);
|
|
557
|
+
__attribute__((__import_module__("wasi:http/types@0.3.0"), __import_name__("[future-drop-writable-2][static]request.new")))
|
|
558
|
+
extern void wasi_http_types_future_result_void_error_code__drop_writable(uint32_t);
|
|
559
|
+
|
|
560
|
+
wasi_http_types_future_result_void_error_code_t wasi_http_types_future_result_void_error_code_new(wasi_http_types_future_result_void_error_code_writer_t *writer) {
|
|
561
|
+
uint64_t packed = wasi_http_types_future_result_void_error_code__new();
|
|
562
|
+
*writer = (uint32_t) (packed >> 32);
|
|
563
|
+
return (uint32_t) packed;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_void_error_code_read(wasi_http_types_future_result_void_error_code_t reader, wasi_http_types_result_void_error_code_t *buf) {
|
|
567
|
+
return wasi_http_types_future_result_void_error_code__read(reader, (uint8_t*) buf);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_void_error_code_write(wasi_http_types_future_result_void_error_code_writer_t writer, const wasi_http_types_result_void_error_code_t *buf) {
|
|
571
|
+
return wasi_http_types_future_result_void_error_code__write(writer, (const uint8_t*) buf);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_void_error_code_cancel_read(wasi_http_types_future_result_void_error_code_t reader){
|
|
575
|
+
return wasi_http_types_future_result_void_error_code__cancel_read(reader);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
crossbind_http_waitable_status_t wasi_http_types_future_result_void_error_code_cancel_write(wasi_http_types_future_result_void_error_code_writer_t writer) {
|
|
579
|
+
return wasi_http_types_future_result_void_error_code__cancel_write(writer);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
void wasi_http_types_future_result_void_error_code_drop_readable(wasi_http_types_future_result_void_error_code_t reader){
|
|
583
|
+
wasi_http_types_future_result_void_error_code__drop_readable(reader);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
void wasi_http_types_future_result_void_error_code_drop_writable(wasi_http_types_future_result_void_error_code_writer_t writer) {
|
|
587
|
+
wasi_http_types_future_result_void_error_code__drop_writable(writer);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
void exports_wasi_http_handler_error_code_free(exports_wasi_http_handler_error_code_t *ptr) {
|
|
592
|
+
wasi_http_types_error_code_free(ptr);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
void exports_wasi_http_handler_result_own_response_error_code_free(exports_wasi_http_handler_result_own_response_error_code_t *ptr) {
|
|
596
|
+
if (!ptr->is_err) {
|
|
597
|
+
} else {
|
|
598
|
+
exports_wasi_http_handler_error_code_free(&ptr->val.err);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
__attribute__((__export_name__("[callback][async-lift]wasi:http/handler@0.3.0#handle")))
|
|
603
|
+
uint32_t __wasm_export_exports_wasi_http_handler_handle_callback(uint32_t event_raw, uint32_t waitable, uint32_t code) {
|
|
604
|
+
crossbind_http_event_t event;
|
|
605
|
+
event.event = (crossbind_http_event_code_t) event_raw;
|
|
606
|
+
event.waitable = waitable;
|
|
607
|
+
event.code = code;
|
|
608
|
+
return exports_wasi_http_handler_handle_callback(&event);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
__attribute__((__import_module__("[export]wasi:http/handler@0.3.0"), __import_name__("[task-return]handle")))
|
|
612
|
+
void __wasm_export_exports_wasi_http_handler_handle__task_return(int32_t, int32_t, int32_t, int64_t, uint8_t *, uint8_t *, size_t, int32_t);
|
|
613
|
+
|
|
614
|
+
void exports_wasi_http_handler_handle_return(exports_wasi_http_handler_result_own_response_error_code_t ret) {
|
|
615
|
+
int32_t result;
|
|
616
|
+
int32_t result146;
|
|
617
|
+
int32_t result147;
|
|
618
|
+
int64_t result148;
|
|
619
|
+
uint8_t * result149;
|
|
620
|
+
uint8_t * result150;
|
|
621
|
+
size_t result151;
|
|
622
|
+
int32_t result152;
|
|
623
|
+
if ((ret).is_err) {
|
|
624
|
+
const exports_wasi_http_handler_error_code_t *payload0 = &(ret).val.err;int32_t variant;
|
|
625
|
+
int32_t variant140;
|
|
626
|
+
int64_t variant141;
|
|
627
|
+
uint8_t * variant142;
|
|
628
|
+
uint8_t * variant143;
|
|
629
|
+
size_t variant144;
|
|
630
|
+
int32_t variant145;
|
|
631
|
+
switch ((int32_t) (*payload0).tag) {
|
|
632
|
+
case 0: {
|
|
633
|
+
variant = 0;
|
|
634
|
+
variant140 = 0;
|
|
635
|
+
variant141 = 0;
|
|
636
|
+
variant142 = 0;
|
|
637
|
+
variant143 = 0;
|
|
638
|
+
variant144 = 0;
|
|
639
|
+
variant145 = 0;
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
case 1: {
|
|
643
|
+
const wasi_http_types_dns_error_payload_t *payload2 = &(*payload0).val.dns_error;
|
|
644
|
+
int32_t option;
|
|
645
|
+
uint8_t * option5;
|
|
646
|
+
size_t option6;
|
|
647
|
+
if (((*payload2).rcode).is_some) {
|
|
648
|
+
const crossbind_http_string_t *payload4 = &((*payload2).rcode).val;
|
|
649
|
+
option = 1;
|
|
650
|
+
option5 = (uint8_t *) (*payload4).ptr;
|
|
651
|
+
option6 = (*payload4).len;
|
|
652
|
+
} else {
|
|
653
|
+
option = 0;
|
|
654
|
+
option5 = 0;
|
|
655
|
+
option6 = 0;
|
|
656
|
+
}
|
|
657
|
+
int32_t option9;
|
|
658
|
+
int32_t option10;
|
|
659
|
+
if (((*payload2).info_code).is_some) {
|
|
660
|
+
const uint16_t *payload8 = &((*payload2).info_code).val;
|
|
661
|
+
option9 = 1;
|
|
662
|
+
option10 = (int32_t) (*payload8);
|
|
663
|
+
} else {
|
|
664
|
+
option9 = 0;
|
|
665
|
+
option10 = 0;
|
|
666
|
+
}
|
|
667
|
+
variant = 1;
|
|
668
|
+
variant140 = option;
|
|
669
|
+
variant141 = (int64_t) option5;
|
|
670
|
+
variant142 = (uint8_t *) option6;
|
|
671
|
+
variant143 = (uint8_t *) option9;
|
|
672
|
+
variant144 = option10;
|
|
673
|
+
variant145 = 0;
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
case 2: {
|
|
677
|
+
variant = 2;
|
|
678
|
+
variant140 = 0;
|
|
679
|
+
variant141 = 0;
|
|
680
|
+
variant142 = 0;
|
|
681
|
+
variant143 = 0;
|
|
682
|
+
variant144 = 0;
|
|
683
|
+
variant145 = 0;
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
case 3: {
|
|
687
|
+
variant = 3;
|
|
688
|
+
variant140 = 0;
|
|
689
|
+
variant141 = 0;
|
|
690
|
+
variant142 = 0;
|
|
691
|
+
variant143 = 0;
|
|
692
|
+
variant144 = 0;
|
|
693
|
+
variant145 = 0;
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
case 4: {
|
|
697
|
+
variant = 4;
|
|
698
|
+
variant140 = 0;
|
|
699
|
+
variant141 = 0;
|
|
700
|
+
variant142 = 0;
|
|
701
|
+
variant143 = 0;
|
|
702
|
+
variant144 = 0;
|
|
703
|
+
variant145 = 0;
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
case 5: {
|
|
707
|
+
variant = 5;
|
|
708
|
+
variant140 = 0;
|
|
709
|
+
variant141 = 0;
|
|
710
|
+
variant142 = 0;
|
|
711
|
+
variant143 = 0;
|
|
712
|
+
variant144 = 0;
|
|
713
|
+
variant145 = 0;
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
case 6: {
|
|
717
|
+
variant = 6;
|
|
718
|
+
variant140 = 0;
|
|
719
|
+
variant141 = 0;
|
|
720
|
+
variant142 = 0;
|
|
721
|
+
variant143 = 0;
|
|
722
|
+
variant144 = 0;
|
|
723
|
+
variant145 = 0;
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
case 7: {
|
|
727
|
+
variant = 7;
|
|
728
|
+
variant140 = 0;
|
|
729
|
+
variant141 = 0;
|
|
730
|
+
variant142 = 0;
|
|
731
|
+
variant143 = 0;
|
|
732
|
+
variant144 = 0;
|
|
733
|
+
variant145 = 0;
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
case 8: {
|
|
737
|
+
variant = 8;
|
|
738
|
+
variant140 = 0;
|
|
739
|
+
variant141 = 0;
|
|
740
|
+
variant142 = 0;
|
|
741
|
+
variant143 = 0;
|
|
742
|
+
variant144 = 0;
|
|
743
|
+
variant145 = 0;
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
case 9: {
|
|
747
|
+
variant = 9;
|
|
748
|
+
variant140 = 0;
|
|
749
|
+
variant141 = 0;
|
|
750
|
+
variant142 = 0;
|
|
751
|
+
variant143 = 0;
|
|
752
|
+
variant144 = 0;
|
|
753
|
+
variant145 = 0;
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
case 10: {
|
|
757
|
+
variant = 10;
|
|
758
|
+
variant140 = 0;
|
|
759
|
+
variant141 = 0;
|
|
760
|
+
variant142 = 0;
|
|
761
|
+
variant143 = 0;
|
|
762
|
+
variant144 = 0;
|
|
763
|
+
variant145 = 0;
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
case 11: {
|
|
767
|
+
variant = 11;
|
|
768
|
+
variant140 = 0;
|
|
769
|
+
variant141 = 0;
|
|
770
|
+
variant142 = 0;
|
|
771
|
+
variant143 = 0;
|
|
772
|
+
variant144 = 0;
|
|
773
|
+
variant145 = 0;
|
|
774
|
+
break;
|
|
775
|
+
}
|
|
776
|
+
case 12: {
|
|
777
|
+
variant = 12;
|
|
778
|
+
variant140 = 0;
|
|
779
|
+
variant141 = 0;
|
|
780
|
+
variant142 = 0;
|
|
781
|
+
variant143 = 0;
|
|
782
|
+
variant144 = 0;
|
|
783
|
+
variant145 = 0;
|
|
784
|
+
break;
|
|
785
|
+
}
|
|
786
|
+
case 13: {
|
|
787
|
+
variant = 13;
|
|
788
|
+
variant140 = 0;
|
|
789
|
+
variant141 = 0;
|
|
790
|
+
variant142 = 0;
|
|
791
|
+
variant143 = 0;
|
|
792
|
+
variant144 = 0;
|
|
793
|
+
variant145 = 0;
|
|
794
|
+
break;
|
|
795
|
+
}
|
|
796
|
+
case 14: {
|
|
797
|
+
const wasi_http_types_tls_alert_received_payload_t *payload23 = &(*payload0).val.tls_alert_received;
|
|
798
|
+
int32_t option26;
|
|
799
|
+
int32_t option27;
|
|
800
|
+
if (((*payload23).alert_id).is_some) {
|
|
801
|
+
const uint8_t *payload25 = &((*payload23).alert_id).val;
|
|
802
|
+
option26 = 1;
|
|
803
|
+
option27 = (int32_t) (*payload25);
|
|
804
|
+
} else {
|
|
805
|
+
option26 = 0;
|
|
806
|
+
option27 = 0;
|
|
807
|
+
}
|
|
808
|
+
int32_t option30;
|
|
809
|
+
uint8_t * option31;
|
|
810
|
+
size_t option32;
|
|
811
|
+
if (((*payload23).alert_message).is_some) {
|
|
812
|
+
const crossbind_http_string_t *payload29 = &((*payload23).alert_message).val;
|
|
813
|
+
option30 = 1;
|
|
814
|
+
option31 = (uint8_t *) (*payload29).ptr;
|
|
815
|
+
option32 = (*payload29).len;
|
|
816
|
+
} else {
|
|
817
|
+
option30 = 0;
|
|
818
|
+
option31 = 0;
|
|
819
|
+
option32 = 0;
|
|
820
|
+
}
|
|
821
|
+
variant = 14;
|
|
822
|
+
variant140 = option26;
|
|
823
|
+
variant141 = (int64_t) option27;
|
|
824
|
+
variant142 = (uint8_t *) option30;
|
|
825
|
+
variant143 = option31;
|
|
826
|
+
variant144 = option32;
|
|
827
|
+
variant145 = 0;
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
case 15: {
|
|
831
|
+
variant = 15;
|
|
832
|
+
variant140 = 0;
|
|
833
|
+
variant141 = 0;
|
|
834
|
+
variant142 = 0;
|
|
835
|
+
variant143 = 0;
|
|
836
|
+
variant144 = 0;
|
|
837
|
+
variant145 = 0;
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
case 16: {
|
|
841
|
+
variant = 16;
|
|
842
|
+
variant140 = 0;
|
|
843
|
+
variant141 = 0;
|
|
844
|
+
variant142 = 0;
|
|
845
|
+
variant143 = 0;
|
|
846
|
+
variant144 = 0;
|
|
847
|
+
variant145 = 0;
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
case 17: {
|
|
851
|
+
const crossbind_http_option_u64_t *payload35 = &(*payload0).val.http_request_body_size;
|
|
852
|
+
int32_t option38;
|
|
853
|
+
int64_t option39;
|
|
854
|
+
if ((*payload35).is_some) {
|
|
855
|
+
const uint64_t *payload37 = &(*payload35).val;
|
|
856
|
+
option38 = 1;
|
|
857
|
+
option39 = (int64_t) (*payload37);
|
|
858
|
+
} else {
|
|
859
|
+
option38 = 0;
|
|
860
|
+
option39 = 0;
|
|
861
|
+
}
|
|
862
|
+
variant = 17;
|
|
863
|
+
variant140 = option38;
|
|
864
|
+
variant141 = option39;
|
|
865
|
+
variant142 = 0;
|
|
866
|
+
variant143 = 0;
|
|
867
|
+
variant144 = 0;
|
|
868
|
+
variant145 = 0;
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
case 18: {
|
|
872
|
+
variant = 18;
|
|
873
|
+
variant140 = 0;
|
|
874
|
+
variant141 = 0;
|
|
875
|
+
variant142 = 0;
|
|
876
|
+
variant143 = 0;
|
|
877
|
+
variant144 = 0;
|
|
878
|
+
variant145 = 0;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
case 19: {
|
|
882
|
+
variant = 19;
|
|
883
|
+
variant140 = 0;
|
|
884
|
+
variant141 = 0;
|
|
885
|
+
variant142 = 0;
|
|
886
|
+
variant143 = 0;
|
|
887
|
+
variant144 = 0;
|
|
888
|
+
variant145 = 0;
|
|
889
|
+
break;
|
|
890
|
+
}
|
|
891
|
+
case 20: {
|
|
892
|
+
variant = 20;
|
|
893
|
+
variant140 = 0;
|
|
894
|
+
variant141 = 0;
|
|
895
|
+
variant142 = 0;
|
|
896
|
+
variant143 = 0;
|
|
897
|
+
variant144 = 0;
|
|
898
|
+
variant145 = 0;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
case 21: {
|
|
902
|
+
const crossbind_http_option_u32_t *payload43 = &(*payload0).val.http_request_header_section_size;
|
|
903
|
+
int32_t option46;
|
|
904
|
+
int32_t option47;
|
|
905
|
+
if ((*payload43).is_some) {
|
|
906
|
+
const uint32_t *payload45 = &(*payload43).val;
|
|
907
|
+
option46 = 1;
|
|
908
|
+
option47 = (int32_t) (*payload45);
|
|
909
|
+
} else {
|
|
910
|
+
option46 = 0;
|
|
911
|
+
option47 = 0;
|
|
912
|
+
}
|
|
913
|
+
variant = 21;
|
|
914
|
+
variant140 = option46;
|
|
915
|
+
variant141 = (int64_t) option47;
|
|
916
|
+
variant142 = 0;
|
|
917
|
+
variant143 = 0;
|
|
918
|
+
variant144 = 0;
|
|
919
|
+
variant145 = 0;
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
case 22: {
|
|
923
|
+
const wasi_http_types_option_field_size_payload_t *payload48 = &(*payload0).val.http_request_header_size;
|
|
924
|
+
int32_t option60;
|
|
925
|
+
int32_t option61;
|
|
926
|
+
uint8_t * option62;
|
|
927
|
+
size_t option63;
|
|
928
|
+
int32_t option64;
|
|
929
|
+
int32_t option65;
|
|
930
|
+
if ((*payload48).is_some) {
|
|
931
|
+
const wasi_http_types_field_size_payload_t *payload50 = &(*payload48).val;
|
|
932
|
+
int32_t option53;
|
|
933
|
+
uint8_t * option54;
|
|
934
|
+
size_t option55;
|
|
935
|
+
if (((*payload50).field_name).is_some) {
|
|
936
|
+
const crossbind_http_string_t *payload52 = &((*payload50).field_name).val;
|
|
937
|
+
option53 = 1;
|
|
938
|
+
option54 = (uint8_t *) (*payload52).ptr;
|
|
939
|
+
option55 = (*payload52).len;
|
|
940
|
+
} else {
|
|
941
|
+
option53 = 0;
|
|
942
|
+
option54 = 0;
|
|
943
|
+
option55 = 0;
|
|
944
|
+
}
|
|
945
|
+
int32_t option58;
|
|
946
|
+
int32_t option59;
|
|
947
|
+
if (((*payload50).field_size).is_some) {
|
|
948
|
+
const uint32_t *payload57 = &((*payload50).field_size).val;
|
|
949
|
+
option58 = 1;
|
|
950
|
+
option59 = (int32_t) (*payload57);
|
|
951
|
+
} else {
|
|
952
|
+
option58 = 0;
|
|
953
|
+
option59 = 0;
|
|
954
|
+
}
|
|
955
|
+
option60 = 1;
|
|
956
|
+
option61 = option53;
|
|
957
|
+
option62 = option54;
|
|
958
|
+
option63 = option55;
|
|
959
|
+
option64 = option58;
|
|
960
|
+
option65 = option59;
|
|
961
|
+
} else {
|
|
962
|
+
option60 = 0;
|
|
963
|
+
option61 = 0;
|
|
964
|
+
option62 = 0;
|
|
965
|
+
option63 = 0;
|
|
966
|
+
option64 = 0;
|
|
967
|
+
option65 = 0;
|
|
968
|
+
}
|
|
969
|
+
variant = 22;
|
|
970
|
+
variant140 = option60;
|
|
971
|
+
variant141 = (int64_t) option61;
|
|
972
|
+
variant142 = option62;
|
|
973
|
+
variant143 = (uint8_t *) option63;
|
|
974
|
+
variant144 = option64;
|
|
975
|
+
variant145 = option65;
|
|
976
|
+
break;
|
|
977
|
+
}
|
|
978
|
+
case 23: {
|
|
979
|
+
const crossbind_http_option_u32_t *payload66 = &(*payload0).val.http_request_trailer_section_size;
|
|
980
|
+
int32_t option69;
|
|
981
|
+
int32_t option70;
|
|
982
|
+
if ((*payload66).is_some) {
|
|
983
|
+
const uint32_t *payload68 = &(*payload66).val;
|
|
984
|
+
option69 = 1;
|
|
985
|
+
option70 = (int32_t) (*payload68);
|
|
986
|
+
} else {
|
|
987
|
+
option69 = 0;
|
|
988
|
+
option70 = 0;
|
|
989
|
+
}
|
|
990
|
+
variant = 23;
|
|
991
|
+
variant140 = option69;
|
|
992
|
+
variant141 = (int64_t) option70;
|
|
993
|
+
variant142 = 0;
|
|
994
|
+
variant143 = 0;
|
|
995
|
+
variant144 = 0;
|
|
996
|
+
variant145 = 0;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
case 24: {
|
|
1000
|
+
const wasi_http_types_field_size_payload_t *payload71 = &(*payload0).val.http_request_trailer_size;
|
|
1001
|
+
int32_t option74;
|
|
1002
|
+
uint8_t * option75;
|
|
1003
|
+
size_t option76;
|
|
1004
|
+
if (((*payload71).field_name).is_some) {
|
|
1005
|
+
const crossbind_http_string_t *payload73 = &((*payload71).field_name).val;
|
|
1006
|
+
option74 = 1;
|
|
1007
|
+
option75 = (uint8_t *) (*payload73).ptr;
|
|
1008
|
+
option76 = (*payload73).len;
|
|
1009
|
+
} else {
|
|
1010
|
+
option74 = 0;
|
|
1011
|
+
option75 = 0;
|
|
1012
|
+
option76 = 0;
|
|
1013
|
+
}
|
|
1014
|
+
int32_t option79;
|
|
1015
|
+
int32_t option80;
|
|
1016
|
+
if (((*payload71).field_size).is_some) {
|
|
1017
|
+
const uint32_t *payload78 = &((*payload71).field_size).val;
|
|
1018
|
+
option79 = 1;
|
|
1019
|
+
option80 = (int32_t) (*payload78);
|
|
1020
|
+
} else {
|
|
1021
|
+
option79 = 0;
|
|
1022
|
+
option80 = 0;
|
|
1023
|
+
}
|
|
1024
|
+
variant = 24;
|
|
1025
|
+
variant140 = option74;
|
|
1026
|
+
variant141 = (int64_t) option75;
|
|
1027
|
+
variant142 = (uint8_t *) option76;
|
|
1028
|
+
variant143 = (uint8_t *) option79;
|
|
1029
|
+
variant144 = option80;
|
|
1030
|
+
variant145 = 0;
|
|
1031
|
+
break;
|
|
1032
|
+
}
|
|
1033
|
+
case 25: {
|
|
1034
|
+
variant = 25;
|
|
1035
|
+
variant140 = 0;
|
|
1036
|
+
variant141 = 0;
|
|
1037
|
+
variant142 = 0;
|
|
1038
|
+
variant143 = 0;
|
|
1039
|
+
variant144 = 0;
|
|
1040
|
+
variant145 = 0;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
case 26: {
|
|
1044
|
+
const crossbind_http_option_u32_t *payload82 = &(*payload0).val.http_response_header_section_size;
|
|
1045
|
+
int32_t option85;
|
|
1046
|
+
int32_t option86;
|
|
1047
|
+
if ((*payload82).is_some) {
|
|
1048
|
+
const uint32_t *payload84 = &(*payload82).val;
|
|
1049
|
+
option85 = 1;
|
|
1050
|
+
option86 = (int32_t) (*payload84);
|
|
1051
|
+
} else {
|
|
1052
|
+
option85 = 0;
|
|
1053
|
+
option86 = 0;
|
|
1054
|
+
}
|
|
1055
|
+
variant = 26;
|
|
1056
|
+
variant140 = option85;
|
|
1057
|
+
variant141 = (int64_t) option86;
|
|
1058
|
+
variant142 = 0;
|
|
1059
|
+
variant143 = 0;
|
|
1060
|
+
variant144 = 0;
|
|
1061
|
+
variant145 = 0;
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
case 27: {
|
|
1065
|
+
const wasi_http_types_field_size_payload_t *payload87 = &(*payload0).val.http_response_header_size;
|
|
1066
|
+
int32_t option90;
|
|
1067
|
+
uint8_t * option91;
|
|
1068
|
+
size_t option92;
|
|
1069
|
+
if (((*payload87).field_name).is_some) {
|
|
1070
|
+
const crossbind_http_string_t *payload89 = &((*payload87).field_name).val;
|
|
1071
|
+
option90 = 1;
|
|
1072
|
+
option91 = (uint8_t *) (*payload89).ptr;
|
|
1073
|
+
option92 = (*payload89).len;
|
|
1074
|
+
} else {
|
|
1075
|
+
option90 = 0;
|
|
1076
|
+
option91 = 0;
|
|
1077
|
+
option92 = 0;
|
|
1078
|
+
}
|
|
1079
|
+
int32_t option95;
|
|
1080
|
+
int32_t option96;
|
|
1081
|
+
if (((*payload87).field_size).is_some) {
|
|
1082
|
+
const uint32_t *payload94 = &((*payload87).field_size).val;
|
|
1083
|
+
option95 = 1;
|
|
1084
|
+
option96 = (int32_t) (*payload94);
|
|
1085
|
+
} else {
|
|
1086
|
+
option95 = 0;
|
|
1087
|
+
option96 = 0;
|
|
1088
|
+
}
|
|
1089
|
+
variant = 27;
|
|
1090
|
+
variant140 = option90;
|
|
1091
|
+
variant141 = (int64_t) option91;
|
|
1092
|
+
variant142 = (uint8_t *) option92;
|
|
1093
|
+
variant143 = (uint8_t *) option95;
|
|
1094
|
+
variant144 = option96;
|
|
1095
|
+
variant145 = 0;
|
|
1096
|
+
break;
|
|
1097
|
+
}
|
|
1098
|
+
case 28: {
|
|
1099
|
+
const crossbind_http_option_u64_t *payload97 = &(*payload0).val.http_response_body_size;
|
|
1100
|
+
int32_t option100;
|
|
1101
|
+
int64_t option101;
|
|
1102
|
+
if ((*payload97).is_some) {
|
|
1103
|
+
const uint64_t *payload99 = &(*payload97).val;
|
|
1104
|
+
option100 = 1;
|
|
1105
|
+
option101 = (int64_t) (*payload99);
|
|
1106
|
+
} else {
|
|
1107
|
+
option100 = 0;
|
|
1108
|
+
option101 = 0;
|
|
1109
|
+
}
|
|
1110
|
+
variant = 28;
|
|
1111
|
+
variant140 = option100;
|
|
1112
|
+
variant141 = option101;
|
|
1113
|
+
variant142 = 0;
|
|
1114
|
+
variant143 = 0;
|
|
1115
|
+
variant144 = 0;
|
|
1116
|
+
variant145 = 0;
|
|
1117
|
+
break;
|
|
1118
|
+
}
|
|
1119
|
+
case 29: {
|
|
1120
|
+
const crossbind_http_option_u32_t *payload102 = &(*payload0).val.http_response_trailer_section_size;
|
|
1121
|
+
int32_t option105;
|
|
1122
|
+
int32_t option106;
|
|
1123
|
+
if ((*payload102).is_some) {
|
|
1124
|
+
const uint32_t *payload104 = &(*payload102).val;
|
|
1125
|
+
option105 = 1;
|
|
1126
|
+
option106 = (int32_t) (*payload104);
|
|
1127
|
+
} else {
|
|
1128
|
+
option105 = 0;
|
|
1129
|
+
option106 = 0;
|
|
1130
|
+
}
|
|
1131
|
+
variant = 29;
|
|
1132
|
+
variant140 = option105;
|
|
1133
|
+
variant141 = (int64_t) option106;
|
|
1134
|
+
variant142 = 0;
|
|
1135
|
+
variant143 = 0;
|
|
1136
|
+
variant144 = 0;
|
|
1137
|
+
variant145 = 0;
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
case 30: {
|
|
1141
|
+
const wasi_http_types_field_size_payload_t *payload107 = &(*payload0).val.http_response_trailer_size;
|
|
1142
|
+
int32_t option110;
|
|
1143
|
+
uint8_t * option111;
|
|
1144
|
+
size_t option112;
|
|
1145
|
+
if (((*payload107).field_name).is_some) {
|
|
1146
|
+
const crossbind_http_string_t *payload109 = &((*payload107).field_name).val;
|
|
1147
|
+
option110 = 1;
|
|
1148
|
+
option111 = (uint8_t *) (*payload109).ptr;
|
|
1149
|
+
option112 = (*payload109).len;
|
|
1150
|
+
} else {
|
|
1151
|
+
option110 = 0;
|
|
1152
|
+
option111 = 0;
|
|
1153
|
+
option112 = 0;
|
|
1154
|
+
}
|
|
1155
|
+
int32_t option115;
|
|
1156
|
+
int32_t option116;
|
|
1157
|
+
if (((*payload107).field_size).is_some) {
|
|
1158
|
+
const uint32_t *payload114 = &((*payload107).field_size).val;
|
|
1159
|
+
option115 = 1;
|
|
1160
|
+
option116 = (int32_t) (*payload114);
|
|
1161
|
+
} else {
|
|
1162
|
+
option115 = 0;
|
|
1163
|
+
option116 = 0;
|
|
1164
|
+
}
|
|
1165
|
+
variant = 30;
|
|
1166
|
+
variant140 = option110;
|
|
1167
|
+
variant141 = (int64_t) option111;
|
|
1168
|
+
variant142 = (uint8_t *) option112;
|
|
1169
|
+
variant143 = (uint8_t *) option115;
|
|
1170
|
+
variant144 = option116;
|
|
1171
|
+
variant145 = 0;
|
|
1172
|
+
break;
|
|
1173
|
+
}
|
|
1174
|
+
case 31: {
|
|
1175
|
+
const crossbind_http_option_string_t *payload117 = &(*payload0).val.http_response_transfer_coding;
|
|
1176
|
+
int32_t option120;
|
|
1177
|
+
uint8_t * option121;
|
|
1178
|
+
size_t option122;
|
|
1179
|
+
if ((*payload117).is_some) {
|
|
1180
|
+
const crossbind_http_string_t *payload119 = &(*payload117).val;
|
|
1181
|
+
option120 = 1;
|
|
1182
|
+
option121 = (uint8_t *) (*payload119).ptr;
|
|
1183
|
+
option122 = (*payload119).len;
|
|
1184
|
+
} else {
|
|
1185
|
+
option120 = 0;
|
|
1186
|
+
option121 = 0;
|
|
1187
|
+
option122 = 0;
|
|
1188
|
+
}
|
|
1189
|
+
variant = 31;
|
|
1190
|
+
variant140 = option120;
|
|
1191
|
+
variant141 = (int64_t) option121;
|
|
1192
|
+
variant142 = (uint8_t *) option122;
|
|
1193
|
+
variant143 = 0;
|
|
1194
|
+
variant144 = 0;
|
|
1195
|
+
variant145 = 0;
|
|
1196
|
+
break;
|
|
1197
|
+
}
|
|
1198
|
+
case 32: {
|
|
1199
|
+
const crossbind_http_option_string_t *payload123 = &(*payload0).val.http_response_content_coding;
|
|
1200
|
+
int32_t option126;
|
|
1201
|
+
uint8_t * option127;
|
|
1202
|
+
size_t option128;
|
|
1203
|
+
if ((*payload123).is_some) {
|
|
1204
|
+
const crossbind_http_string_t *payload125 = &(*payload123).val;
|
|
1205
|
+
option126 = 1;
|
|
1206
|
+
option127 = (uint8_t *) (*payload125).ptr;
|
|
1207
|
+
option128 = (*payload125).len;
|
|
1208
|
+
} else {
|
|
1209
|
+
option126 = 0;
|
|
1210
|
+
option127 = 0;
|
|
1211
|
+
option128 = 0;
|
|
1212
|
+
}
|
|
1213
|
+
variant = 32;
|
|
1214
|
+
variant140 = option126;
|
|
1215
|
+
variant141 = (int64_t) option127;
|
|
1216
|
+
variant142 = (uint8_t *) option128;
|
|
1217
|
+
variant143 = 0;
|
|
1218
|
+
variant144 = 0;
|
|
1219
|
+
variant145 = 0;
|
|
1220
|
+
break;
|
|
1221
|
+
}
|
|
1222
|
+
case 33: {
|
|
1223
|
+
variant = 33;
|
|
1224
|
+
variant140 = 0;
|
|
1225
|
+
variant141 = 0;
|
|
1226
|
+
variant142 = 0;
|
|
1227
|
+
variant143 = 0;
|
|
1228
|
+
variant144 = 0;
|
|
1229
|
+
variant145 = 0;
|
|
1230
|
+
break;
|
|
1231
|
+
}
|
|
1232
|
+
case 34: {
|
|
1233
|
+
variant = 34;
|
|
1234
|
+
variant140 = 0;
|
|
1235
|
+
variant141 = 0;
|
|
1236
|
+
variant142 = 0;
|
|
1237
|
+
variant143 = 0;
|
|
1238
|
+
variant144 = 0;
|
|
1239
|
+
variant145 = 0;
|
|
1240
|
+
break;
|
|
1241
|
+
}
|
|
1242
|
+
case 35: {
|
|
1243
|
+
variant = 35;
|
|
1244
|
+
variant140 = 0;
|
|
1245
|
+
variant141 = 0;
|
|
1246
|
+
variant142 = 0;
|
|
1247
|
+
variant143 = 0;
|
|
1248
|
+
variant144 = 0;
|
|
1249
|
+
variant145 = 0;
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
case 36: {
|
|
1253
|
+
variant = 36;
|
|
1254
|
+
variant140 = 0;
|
|
1255
|
+
variant141 = 0;
|
|
1256
|
+
variant142 = 0;
|
|
1257
|
+
variant143 = 0;
|
|
1258
|
+
variant144 = 0;
|
|
1259
|
+
variant145 = 0;
|
|
1260
|
+
break;
|
|
1261
|
+
}
|
|
1262
|
+
case 37: {
|
|
1263
|
+
variant = 37;
|
|
1264
|
+
variant140 = 0;
|
|
1265
|
+
variant141 = 0;
|
|
1266
|
+
variant142 = 0;
|
|
1267
|
+
variant143 = 0;
|
|
1268
|
+
variant144 = 0;
|
|
1269
|
+
variant145 = 0;
|
|
1270
|
+
break;
|
|
1271
|
+
}
|
|
1272
|
+
case 38: {
|
|
1273
|
+
const crossbind_http_option_string_t *payload134 = &(*payload0).val.internal_error;
|
|
1274
|
+
int32_t option137;
|
|
1275
|
+
uint8_t * option138;
|
|
1276
|
+
size_t option139;
|
|
1277
|
+
if ((*payload134).is_some) {
|
|
1278
|
+
const crossbind_http_string_t *payload136 = &(*payload134).val;
|
|
1279
|
+
option137 = 1;
|
|
1280
|
+
option138 = (uint8_t *) (*payload136).ptr;
|
|
1281
|
+
option139 = (*payload136).len;
|
|
1282
|
+
} else {
|
|
1283
|
+
option137 = 0;
|
|
1284
|
+
option138 = 0;
|
|
1285
|
+
option139 = 0;
|
|
1286
|
+
}
|
|
1287
|
+
variant = 38;
|
|
1288
|
+
variant140 = option137;
|
|
1289
|
+
variant141 = (int64_t) option138;
|
|
1290
|
+
variant142 = (uint8_t *) option139;
|
|
1291
|
+
variant143 = 0;
|
|
1292
|
+
variant144 = 0;
|
|
1293
|
+
variant145 = 0;
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
result = 1;
|
|
1298
|
+
result146 = variant;
|
|
1299
|
+
result147 = variant140;
|
|
1300
|
+
result148 = variant141;
|
|
1301
|
+
result149 = variant142;
|
|
1302
|
+
result150 = variant143;
|
|
1303
|
+
result151 = variant144;
|
|
1304
|
+
result152 = variant145;
|
|
1305
|
+
} else {
|
|
1306
|
+
const exports_wasi_http_handler_own_response_t *payload = &(ret).val.ok;result = 0;
|
|
1307
|
+
result146 = (*payload).__handle;
|
|
1308
|
+
result147 = 0;
|
|
1309
|
+
result148 = 0;
|
|
1310
|
+
result149 = 0;
|
|
1311
|
+
result150 = 0;
|
|
1312
|
+
result151 = 0;
|
|
1313
|
+
result152 = 0;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
__wasm_export_exports_wasi_http_handler_handle__task_return(result, result146, result147, result148, result149, result150, result151, result152);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
void crossbind_http_string_set(crossbind_http_string_t *ret, const char*s) {
|
|
1321
|
+
ret->ptr = (uint8_t*) s;
|
|
1322
|
+
ret->len = strlen(s);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
void crossbind_http_string_dup(crossbind_http_string_t *ret, const char*s) {
|
|
1326
|
+
ret->len = strlen(s);
|
|
1327
|
+
ret->ptr = (uint8_t*) cabi_realloc(NULL, 0, 1, ret->len * 1);
|
|
1328
|
+
memcpy(ret->ptr, s, ret->len * 1);
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
void crossbind_http_string_dup_n(crossbind_http_string_t *ret, const char*s, size_t len) {
|
|
1332
|
+
ret->len = len;
|
|
1333
|
+
ret->ptr = (uint8_t*) cabi_realloc(NULL, 0, 1, ret->len * 1);
|
|
1334
|
+
memcpy(ret->ptr, s, ret->len * 1);
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
void crossbind_http_string_free(crossbind_http_string_t *ret) {
|
|
1338
|
+
if (ret->len > 0) {
|
|
1339
|
+
free(ret->ptr);
|
|
1340
|
+
}
|
|
1341
|
+
ret->ptr = NULL;
|
|
1342
|
+
ret->len = 0;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// Async Helper Functions
|
|
1346
|
+
|
|
1347
|
+
__attribute__((__import_module__("$root"), __import_name__("[subtask-cancel]")))
|
|
1348
|
+
extern uint32_t __subtask_cancel(uint32_t handle);
|
|
1349
|
+
|
|
1350
|
+
crossbind_http_subtask_status_t crossbind_http_subtask_cancel(crossbind_http_subtask_t subtask) {
|
|
1351
|
+
return __subtask_cancel(subtask);
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
__attribute__((__import_module__("$root"), __import_name__("[subtask-drop]")))
|
|
1355
|
+
extern void __subtask_drop(uint32_t handle);
|
|
1356
|
+
|
|
1357
|
+
void crossbind_http_subtask_drop(crossbind_http_subtask_t subtask) {
|
|
1358
|
+
__subtask_drop(subtask);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
__attribute__((__import_module__("$root"), __import_name__("[waitable-set-new]")))
|
|
1362
|
+
extern uint32_t __waitable_set_new(void);
|
|
1363
|
+
|
|
1364
|
+
crossbind_http_waitable_set_t crossbind_http_waitable_set_new(void) {
|
|
1365
|
+
return __waitable_set_new();
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
__attribute__((__import_module__("$root"), __import_name__("[waitable-join]")))
|
|
1369
|
+
extern void __waitable_join(uint32_t, uint32_t);
|
|
1370
|
+
|
|
1371
|
+
void crossbind_http_waitable_join(uint32_t waitable, crossbind_http_waitable_set_t set) {
|
|
1372
|
+
__waitable_join(waitable, set);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
__attribute__((__import_module__("$root"), __import_name__("[waitable-set-drop]")))
|
|
1376
|
+
extern void __waitable_set_drop(uint32_t);
|
|
1377
|
+
|
|
1378
|
+
void crossbind_http_waitable_set_drop(crossbind_http_waitable_set_t set) {
|
|
1379
|
+
__waitable_set_drop(set);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
__attribute__((__import_module__("$root"), __import_name__("[waitable-set-wait]")))
|
|
1383
|
+
extern uint32_t __waitable_set_wait(uint32_t, uint32_t*);
|
|
1384
|
+
__attribute__((__import_module__("$root"), __import_name__("[waitable-set-poll]")))
|
|
1385
|
+
extern uint32_t __waitable_set_poll(uint32_t, uint32_t*);
|
|
1386
|
+
|
|
1387
|
+
void crossbind_http_waitable_set_wait(crossbind_http_waitable_set_t set, crossbind_http_event_t *event) {
|
|
1388
|
+
event->event = (crossbind_http_event_code_t) __waitable_set_wait(set, &event->waitable);
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
void crossbind_http_waitable_set_poll(crossbind_http_waitable_set_t set, crossbind_http_event_t *event) {
|
|
1392
|
+
event->event = (crossbind_http_event_code_t) __waitable_set_poll(set, &event->waitable);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
__attribute__((__import_module__("[export]$root"), __import_name__("[task-cancel]")))
|
|
1396
|
+
extern void __task_cancel(void);
|
|
1397
|
+
|
|
1398
|
+
void crossbind_http_task_cancel() {
|
|
1399
|
+
__task_cancel();
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
__attribute__((__import_module__("$root"), __import_name__("[backpressure-inc]")))
|
|
1403
|
+
extern void __backpressure_inc(void);
|
|
1404
|
+
|
|
1405
|
+
void crossbind_http_backpressure_inc(void) {
|
|
1406
|
+
__backpressure_inc();
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
__attribute__((__import_module__("$root"), __import_name__("[backpressure-dec]")))
|
|
1410
|
+
extern void __backpressure_dec(void);
|
|
1411
|
+
|
|
1412
|
+
void crossbind_http_backpressure_dec(void) {
|
|
1413
|
+
__backpressure_dec();
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
__attribute__((__import_module__("$root"), __import_name__("[context-get-0]")))
|
|
1417
|
+
extern void* __context_get_0(void);
|
|
1418
|
+
|
|
1419
|
+
void* crossbind_http_context_get_0(void) {
|
|
1420
|
+
return __context_get_0();
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
__attribute__((__import_module__("$root"), __import_name__("[context-set-0]")))
|
|
1424
|
+
extern void __context_set_0(void*);
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
void crossbind_http_context_set_0(void *value) {
|
|
1428
|
+
__context_set_0(value);
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
__attribute__((__import_module__("$root"), __import_name__("[thread-yield]")))
|
|
1432
|
+
extern uint32_t __thread_yield(void);
|
|
1433
|
+
|
|
1434
|
+
void crossbind_http_thread_yield(void) {
|
|
1435
|
+
__thread_yield();
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
// Component Adapters
|
|
1441
|
+
|
|
1442
|
+
wasi_http_types_own_fields_t wasi_http_types_constructor_fields(void) {
|
|
1443
|
+
int32_t ret = __wasm_import_wasi_http_types_constructor_fields();
|
|
1444
|
+
return (wasi_http_types_own_fields_t) { ret };
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
bool wasi_http_types_static_fields_from_list(wasi_http_types_list_tuple2_field_name_field_value_t *entries, wasi_http_types_own_fields_t *ret, wasi_http_types_header_error_t *err) {
|
|
1448
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1449
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
1450
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1451
|
+
__wasm_import_wasi_http_types_static_fields_from_list((uint8_t *) (*entries).ptr, (*entries).len, ptr);
|
|
1452
|
+
wasi_http_types_result_own_fields_header_error_t result;
|
|
1453
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1454
|
+
case 0: {
|
|
1455
|
+
result.is_err = false;
|
|
1456
|
+
result.val.ok = (wasi_http_types_own_fields_t) { *((int32_t*) (ptr + sizeof(void*))) };
|
|
1457
|
+
break;
|
|
1458
|
+
}
|
|
1459
|
+
case 1: {
|
|
1460
|
+
result.is_err = true;
|
|
1461
|
+
wasi_http_types_header_error_t variant;
|
|
1462
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
1463
|
+
switch ((int32_t) variant.tag) {
|
|
1464
|
+
case 0: {
|
|
1465
|
+
break;
|
|
1466
|
+
}
|
|
1467
|
+
case 1: {
|
|
1468
|
+
break;
|
|
1469
|
+
}
|
|
1470
|
+
case 2: {
|
|
1471
|
+
break;
|
|
1472
|
+
}
|
|
1473
|
+
case 3: {
|
|
1474
|
+
break;
|
|
1475
|
+
}
|
|
1476
|
+
case 4: {
|
|
1477
|
+
crossbind_http_option_string_t option;
|
|
1478
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
1479
|
+
case 0: {
|
|
1480
|
+
option.is_some = false;
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
case 1: {
|
|
1484
|
+
option.is_some = true;
|
|
1485
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
1486
|
+
break;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
variant.val.other = option;
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
result.val.err = variant;
|
|
1495
|
+
break;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
if (!result.is_err) {
|
|
1499
|
+
*ret = result.val.ok;
|
|
1500
|
+
return 1;
|
|
1501
|
+
} else {
|
|
1502
|
+
*err = result.val.err;
|
|
1503
|
+
return 0;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
void wasi_http_types_method_fields_get(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name, wasi_http_types_list_field_value_t *ret) {
|
|
1508
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1509
|
+
uint8_t ret_area[(2*sizeof(void*))];
|
|
1510
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1511
|
+
__wasm_import_wasi_http_types_method_fields_get((self).__handle, (uint8_t *) (*name).ptr, (*name).len, ptr);
|
|
1512
|
+
*ret = (wasi_http_types_list_field_value_t) { (wasi_http_types_field_value_t*)(*((uint8_t **) (ptr + 0))), (*((size_t*) (ptr + sizeof(void*)))) };
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
bool wasi_http_types_method_fields_has(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name) {
|
|
1516
|
+
int32_t ret = __wasm_import_wasi_http_types_method_fields_has((self).__handle, (uint8_t *) (*name).ptr, (*name).len);
|
|
1517
|
+
return ret;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
bool wasi_http_types_method_fields_set(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name, wasi_http_types_list_field_value_t *value, wasi_http_types_header_error_t *err) {
|
|
1521
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1522
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
1523
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1524
|
+
__wasm_import_wasi_http_types_method_fields_set((self).__handle, (uint8_t *) (*name).ptr, (*name).len, (uint8_t *) (*value).ptr, (*value).len, ptr);
|
|
1525
|
+
wasi_http_types_result_void_header_error_t result;
|
|
1526
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1527
|
+
case 0: {
|
|
1528
|
+
result.is_err = false;
|
|
1529
|
+
break;
|
|
1530
|
+
}
|
|
1531
|
+
case 1: {
|
|
1532
|
+
result.is_err = true;
|
|
1533
|
+
wasi_http_types_header_error_t variant;
|
|
1534
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
1535
|
+
switch ((int32_t) variant.tag) {
|
|
1536
|
+
case 0: {
|
|
1537
|
+
break;
|
|
1538
|
+
}
|
|
1539
|
+
case 1: {
|
|
1540
|
+
break;
|
|
1541
|
+
}
|
|
1542
|
+
case 2: {
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
case 3: {
|
|
1546
|
+
break;
|
|
1547
|
+
}
|
|
1548
|
+
case 4: {
|
|
1549
|
+
crossbind_http_option_string_t option;
|
|
1550
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
1551
|
+
case 0: {
|
|
1552
|
+
option.is_some = false;
|
|
1553
|
+
break;
|
|
1554
|
+
}
|
|
1555
|
+
case 1: {
|
|
1556
|
+
option.is_some = true;
|
|
1557
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
1558
|
+
break;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
variant.val.other = option;
|
|
1562
|
+
break;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
result.val.err = variant;
|
|
1567
|
+
break;
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
if (!result.is_err) {
|
|
1571
|
+
return 1;
|
|
1572
|
+
} else {
|
|
1573
|
+
*err = result.val.err;
|
|
1574
|
+
return 0;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
bool wasi_http_types_method_fields_delete(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name, wasi_http_types_header_error_t *err) {
|
|
1579
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1580
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
1581
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1582
|
+
__wasm_import_wasi_http_types_method_fields_delete((self).__handle, (uint8_t *) (*name).ptr, (*name).len, ptr);
|
|
1583
|
+
wasi_http_types_result_void_header_error_t result;
|
|
1584
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1585
|
+
case 0: {
|
|
1586
|
+
result.is_err = false;
|
|
1587
|
+
break;
|
|
1588
|
+
}
|
|
1589
|
+
case 1: {
|
|
1590
|
+
result.is_err = true;
|
|
1591
|
+
wasi_http_types_header_error_t variant;
|
|
1592
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
1593
|
+
switch ((int32_t) variant.tag) {
|
|
1594
|
+
case 0: {
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
case 1: {
|
|
1598
|
+
break;
|
|
1599
|
+
}
|
|
1600
|
+
case 2: {
|
|
1601
|
+
break;
|
|
1602
|
+
}
|
|
1603
|
+
case 3: {
|
|
1604
|
+
break;
|
|
1605
|
+
}
|
|
1606
|
+
case 4: {
|
|
1607
|
+
crossbind_http_option_string_t option;
|
|
1608
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
1609
|
+
case 0: {
|
|
1610
|
+
option.is_some = false;
|
|
1611
|
+
break;
|
|
1612
|
+
}
|
|
1613
|
+
case 1: {
|
|
1614
|
+
option.is_some = true;
|
|
1615
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
variant.val.other = option;
|
|
1620
|
+
break;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
result.val.err = variant;
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
if (!result.is_err) {
|
|
1629
|
+
return 1;
|
|
1630
|
+
} else {
|
|
1631
|
+
*err = result.val.err;
|
|
1632
|
+
return 0;
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
bool wasi_http_types_method_fields_get_and_delete(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name, wasi_http_types_list_field_value_t *ret, wasi_http_types_header_error_t *err) {
|
|
1637
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1638
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
1639
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1640
|
+
__wasm_import_wasi_http_types_method_fields_get_and_delete((self).__handle, (uint8_t *) (*name).ptr, (*name).len, ptr);
|
|
1641
|
+
wasi_http_types_result_list_field_value_header_error_t result;
|
|
1642
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1643
|
+
case 0: {
|
|
1644
|
+
result.is_err = false;
|
|
1645
|
+
result.val.ok = (wasi_http_types_list_field_value_t) { (wasi_http_types_field_value_t*)(*((uint8_t **) (ptr + sizeof(void*)))), (*((size_t*) (ptr + (2*sizeof(void*))))) };
|
|
1646
|
+
break;
|
|
1647
|
+
}
|
|
1648
|
+
case 1: {
|
|
1649
|
+
result.is_err = true;
|
|
1650
|
+
wasi_http_types_header_error_t variant;
|
|
1651
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
1652
|
+
switch ((int32_t) variant.tag) {
|
|
1653
|
+
case 0: {
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
case 1: {
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
case 2: {
|
|
1660
|
+
break;
|
|
1661
|
+
}
|
|
1662
|
+
case 3: {
|
|
1663
|
+
break;
|
|
1664
|
+
}
|
|
1665
|
+
case 4: {
|
|
1666
|
+
crossbind_http_option_string_t option;
|
|
1667
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
1668
|
+
case 0: {
|
|
1669
|
+
option.is_some = false;
|
|
1670
|
+
break;
|
|
1671
|
+
}
|
|
1672
|
+
case 1: {
|
|
1673
|
+
option.is_some = true;
|
|
1674
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
variant.val.other = option;
|
|
1679
|
+
break;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
result.val.err = variant;
|
|
1684
|
+
break;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
if (!result.is_err) {
|
|
1688
|
+
*ret = result.val.ok;
|
|
1689
|
+
return 1;
|
|
1690
|
+
} else {
|
|
1691
|
+
*err = result.val.err;
|
|
1692
|
+
return 0;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
bool wasi_http_types_method_fields_append(wasi_http_types_borrow_fields_t self, wasi_http_types_field_name_t *name, wasi_http_types_field_value_t *value, wasi_http_types_header_error_t *err) {
|
|
1697
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1698
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
1699
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1700
|
+
__wasm_import_wasi_http_types_method_fields_append((self).__handle, (uint8_t *) (*name).ptr, (*name).len, (uint8_t *) (*value).ptr, (*value).len, ptr);
|
|
1701
|
+
wasi_http_types_result_void_header_error_t result;
|
|
1702
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1703
|
+
case 0: {
|
|
1704
|
+
result.is_err = false;
|
|
1705
|
+
break;
|
|
1706
|
+
}
|
|
1707
|
+
case 1: {
|
|
1708
|
+
result.is_err = true;
|
|
1709
|
+
wasi_http_types_header_error_t variant;
|
|
1710
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
1711
|
+
switch ((int32_t) variant.tag) {
|
|
1712
|
+
case 0: {
|
|
1713
|
+
break;
|
|
1714
|
+
}
|
|
1715
|
+
case 1: {
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
case 2: {
|
|
1719
|
+
break;
|
|
1720
|
+
}
|
|
1721
|
+
case 3: {
|
|
1722
|
+
break;
|
|
1723
|
+
}
|
|
1724
|
+
case 4: {
|
|
1725
|
+
crossbind_http_option_string_t option;
|
|
1726
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
1727
|
+
case 0: {
|
|
1728
|
+
option.is_some = false;
|
|
1729
|
+
break;
|
|
1730
|
+
}
|
|
1731
|
+
case 1: {
|
|
1732
|
+
option.is_some = true;
|
|
1733
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
variant.val.other = option;
|
|
1738
|
+
break;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
result.val.err = variant;
|
|
1743
|
+
break;
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
if (!result.is_err) {
|
|
1747
|
+
return 1;
|
|
1748
|
+
} else {
|
|
1749
|
+
*err = result.val.err;
|
|
1750
|
+
return 0;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
void wasi_http_types_method_fields_copy_all(wasi_http_types_borrow_fields_t self, wasi_http_types_list_tuple2_field_name_field_value_t *ret) {
|
|
1755
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1756
|
+
uint8_t ret_area[(2*sizeof(void*))];
|
|
1757
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1758
|
+
__wasm_import_wasi_http_types_method_fields_copy_all((self).__handle, ptr);
|
|
1759
|
+
*ret = (wasi_http_types_list_tuple2_field_name_field_value_t) { (wasi_http_types_tuple2_field_name_field_value_t*)(*((uint8_t **) (ptr + 0))), (*((size_t*) (ptr + sizeof(void*)))) };
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
wasi_http_types_own_fields_t wasi_http_types_method_fields_clone(wasi_http_types_borrow_fields_t self) {
|
|
1763
|
+
int32_t ret = __wasm_import_wasi_http_types_method_fields_clone((self).__handle);
|
|
1764
|
+
return (wasi_http_types_own_fields_t) { ret };
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
void wasi_http_types_static_request_new(wasi_http_types_own_headers_t headers, wasi_http_types_stream_u8_t *maybe_contents, wasi_http_types_future_result_option_own_trailers_error_code_t trailers, wasi_http_types_own_request_options_t *maybe_options, wasi_http_types_tuple2_own_request_future_result_void_error_code_t *ret) {
|
|
1768
|
+
__attribute__((__aligned__(4)))
|
|
1769
|
+
uint8_t ret_area[8];
|
|
1770
|
+
wasi_http_types_option_stream_u8_t contents;
|
|
1771
|
+
contents.is_some = maybe_contents != NULL;if (maybe_contents) {
|
|
1772
|
+
contents.val = *maybe_contents;
|
|
1773
|
+
}
|
|
1774
|
+
wasi_http_types_option_own_request_options_t options;
|
|
1775
|
+
options.is_some = maybe_options != NULL;if (maybe_options) {
|
|
1776
|
+
options.val = *maybe_options;
|
|
1777
|
+
}
|
|
1778
|
+
int32_t option;
|
|
1779
|
+
int32_t option1;
|
|
1780
|
+
if ((contents).is_some) {
|
|
1781
|
+
const wasi_http_types_stream_u8_t *payload0 = &(contents).val;
|
|
1782
|
+
option = 1;
|
|
1783
|
+
option1 = ((int32_t) *payload0);
|
|
1784
|
+
} else {
|
|
1785
|
+
option = 0;
|
|
1786
|
+
option1 = 0;
|
|
1787
|
+
}
|
|
1788
|
+
int32_t option4;
|
|
1789
|
+
int32_t option5;
|
|
1790
|
+
if ((options).is_some) {
|
|
1791
|
+
const wasi_http_types_own_request_options_t *payload3 = &(options).val;
|
|
1792
|
+
option4 = 1;
|
|
1793
|
+
option5 = (*payload3).__handle;
|
|
1794
|
+
} else {
|
|
1795
|
+
option4 = 0;
|
|
1796
|
+
option5 = 0;
|
|
1797
|
+
}
|
|
1798
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1799
|
+
__wasm_import_wasi_http_types_static_request_new((headers).__handle, option, option1, ((int32_t) trailers), option4, option5, ptr);
|
|
1800
|
+
*ret = (wasi_http_types_tuple2_own_request_future_result_void_error_code_t) {
|
|
1801
|
+
(wasi_http_types_own_request_t) (wasi_http_types_own_request_t) { *((int32_t*) (ptr + 0)) },
|
|
1802
|
+
(wasi_http_types_future_result_void_error_code_t) ((uint32_t) *((int32_t*) (ptr + 4))),
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
void wasi_http_types_method_request_get_method(wasi_http_types_borrow_request_t self, wasi_http_types_method_t *ret) {
|
|
1807
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1808
|
+
uint8_t ret_area[(3*sizeof(void*))];
|
|
1809
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1810
|
+
__wasm_import_wasi_http_types_method_request_get_method((self).__handle, ptr);
|
|
1811
|
+
wasi_http_types_method_t variant;
|
|
1812
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + 0));
|
|
1813
|
+
switch ((int32_t) variant.tag) {
|
|
1814
|
+
case 0: {
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
case 1: {
|
|
1818
|
+
break;
|
|
1819
|
+
}
|
|
1820
|
+
case 2: {
|
|
1821
|
+
break;
|
|
1822
|
+
}
|
|
1823
|
+
case 3: {
|
|
1824
|
+
break;
|
|
1825
|
+
}
|
|
1826
|
+
case 4: {
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
case 5: {
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
case 6: {
|
|
1833
|
+
break;
|
|
1834
|
+
}
|
|
1835
|
+
case 7: {
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
case 8: {
|
|
1839
|
+
break;
|
|
1840
|
+
}
|
|
1841
|
+
case 9: {
|
|
1842
|
+
variant.val.other = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + sizeof(void*)))), (*((size_t*) (ptr + (2*sizeof(void*))))) };
|
|
1843
|
+
break;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
*ret = variant;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
bool wasi_http_types_method_request_set_method(wasi_http_types_borrow_request_t self, wasi_http_types_method_t *method) {
|
|
1850
|
+
int32_t variant;
|
|
1851
|
+
uint8_t * variant9;
|
|
1852
|
+
size_t variant10;
|
|
1853
|
+
switch ((int32_t) (*method).tag) {
|
|
1854
|
+
case 0: {
|
|
1855
|
+
variant = 0;
|
|
1856
|
+
variant9 = 0;
|
|
1857
|
+
variant10 = 0;
|
|
1858
|
+
break;
|
|
1859
|
+
}
|
|
1860
|
+
case 1: {
|
|
1861
|
+
variant = 1;
|
|
1862
|
+
variant9 = 0;
|
|
1863
|
+
variant10 = 0;
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
case 2: {
|
|
1867
|
+
variant = 2;
|
|
1868
|
+
variant9 = 0;
|
|
1869
|
+
variant10 = 0;
|
|
1870
|
+
break;
|
|
1871
|
+
}
|
|
1872
|
+
case 3: {
|
|
1873
|
+
variant = 3;
|
|
1874
|
+
variant9 = 0;
|
|
1875
|
+
variant10 = 0;
|
|
1876
|
+
break;
|
|
1877
|
+
}
|
|
1878
|
+
case 4: {
|
|
1879
|
+
variant = 4;
|
|
1880
|
+
variant9 = 0;
|
|
1881
|
+
variant10 = 0;
|
|
1882
|
+
break;
|
|
1883
|
+
}
|
|
1884
|
+
case 5: {
|
|
1885
|
+
variant = 5;
|
|
1886
|
+
variant9 = 0;
|
|
1887
|
+
variant10 = 0;
|
|
1888
|
+
break;
|
|
1889
|
+
}
|
|
1890
|
+
case 6: {
|
|
1891
|
+
variant = 6;
|
|
1892
|
+
variant9 = 0;
|
|
1893
|
+
variant10 = 0;
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
case 7: {
|
|
1897
|
+
variant = 7;
|
|
1898
|
+
variant9 = 0;
|
|
1899
|
+
variant10 = 0;
|
|
1900
|
+
break;
|
|
1901
|
+
}
|
|
1902
|
+
case 8: {
|
|
1903
|
+
variant = 8;
|
|
1904
|
+
variant9 = 0;
|
|
1905
|
+
variant10 = 0;
|
|
1906
|
+
break;
|
|
1907
|
+
}
|
|
1908
|
+
case 9: {
|
|
1909
|
+
const crossbind_http_string_t *payload8 = &(*method).val.other;
|
|
1910
|
+
variant = 9;
|
|
1911
|
+
variant9 = (uint8_t *) (*payload8).ptr;
|
|
1912
|
+
variant10 = (*payload8).len;
|
|
1913
|
+
break;
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_set_method((self).__handle, variant, variant9, variant10);
|
|
1917
|
+
wasi_http_types_result_void_void_t result;
|
|
1918
|
+
switch (ret) {
|
|
1919
|
+
case 0: {
|
|
1920
|
+
result.is_err = false;
|
|
1921
|
+
break;
|
|
1922
|
+
}
|
|
1923
|
+
case 1: {
|
|
1924
|
+
result.is_err = true;
|
|
1925
|
+
break;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
if (!result.is_err) {
|
|
1929
|
+
return 1;
|
|
1930
|
+
} else {
|
|
1931
|
+
return 0;
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
bool wasi_http_types_method_request_get_path_with_query(wasi_http_types_borrow_request_t self, crossbind_http_string_t *ret) {
|
|
1936
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1937
|
+
uint8_t ret_area[(3*sizeof(void*))];
|
|
1938
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1939
|
+
__wasm_import_wasi_http_types_method_request_get_path_with_query((self).__handle, ptr);
|
|
1940
|
+
crossbind_http_option_string_t option;
|
|
1941
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
1942
|
+
case 0: {
|
|
1943
|
+
option.is_some = false;
|
|
1944
|
+
break;
|
|
1945
|
+
}
|
|
1946
|
+
case 1: {
|
|
1947
|
+
option.is_some = true;
|
|
1948
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + sizeof(void*)))), (*((size_t*) (ptr + (2*sizeof(void*))))) };
|
|
1949
|
+
break;
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
*ret = option.val;
|
|
1953
|
+
return option.is_some;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
bool wasi_http_types_method_request_set_path_with_query(wasi_http_types_borrow_request_t self, crossbind_http_string_t *maybe_path_with_query) {
|
|
1957
|
+
crossbind_http_option_string_t path_with_query;
|
|
1958
|
+
path_with_query.is_some = maybe_path_with_query != NULL;if (maybe_path_with_query) {
|
|
1959
|
+
path_with_query.val = *maybe_path_with_query;
|
|
1960
|
+
}
|
|
1961
|
+
int32_t option;
|
|
1962
|
+
uint8_t * option1;
|
|
1963
|
+
size_t option2;
|
|
1964
|
+
if ((path_with_query).is_some) {
|
|
1965
|
+
const crossbind_http_string_t *payload0 = &(path_with_query).val;
|
|
1966
|
+
option = 1;
|
|
1967
|
+
option1 = (uint8_t *) (*payload0).ptr;
|
|
1968
|
+
option2 = (*payload0).len;
|
|
1969
|
+
} else {
|
|
1970
|
+
option = 0;
|
|
1971
|
+
option1 = 0;
|
|
1972
|
+
option2 = 0;
|
|
1973
|
+
}
|
|
1974
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_set_path_with_query((self).__handle, option, option1, option2);
|
|
1975
|
+
wasi_http_types_result_void_void_t result;
|
|
1976
|
+
switch (ret) {
|
|
1977
|
+
case 0: {
|
|
1978
|
+
result.is_err = false;
|
|
1979
|
+
break;
|
|
1980
|
+
}
|
|
1981
|
+
case 1: {
|
|
1982
|
+
result.is_err = true;
|
|
1983
|
+
break;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
if (!result.is_err) {
|
|
1987
|
+
return 1;
|
|
1988
|
+
} else {
|
|
1989
|
+
return 0;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
bool wasi_http_types_method_request_get_scheme(wasi_http_types_borrow_request_t self, wasi_http_types_scheme_t *ret) {
|
|
1994
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
1995
|
+
uint8_t ret_area[(4*sizeof(void*))];
|
|
1996
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
1997
|
+
__wasm_import_wasi_http_types_method_request_get_scheme((self).__handle, ptr);
|
|
1998
|
+
wasi_http_types_option_scheme_t option;
|
|
1999
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2000
|
+
case 0: {
|
|
2001
|
+
option.is_some = false;
|
|
2002
|
+
break;
|
|
2003
|
+
}
|
|
2004
|
+
case 1: {
|
|
2005
|
+
option.is_some = true;
|
|
2006
|
+
wasi_http_types_scheme_t variant;
|
|
2007
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
2008
|
+
switch ((int32_t) variant.tag) {
|
|
2009
|
+
case 0: {
|
|
2010
|
+
break;
|
|
2011
|
+
}
|
|
2012
|
+
case 1: {
|
|
2013
|
+
break;
|
|
2014
|
+
}
|
|
2015
|
+
case 2: {
|
|
2016
|
+
variant.val.other = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (2*sizeof(void*))))), (*((size_t*) (ptr + (3*sizeof(void*))))) };
|
|
2017
|
+
break;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
option.val = variant;
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
*ret = option.val;
|
|
2026
|
+
return option.is_some;
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
bool wasi_http_types_method_request_set_scheme(wasi_http_types_borrow_request_t self, wasi_http_types_scheme_t *maybe_scheme) {
|
|
2030
|
+
wasi_http_types_option_scheme_t scheme;
|
|
2031
|
+
scheme.is_some = maybe_scheme != NULL;if (maybe_scheme) {
|
|
2032
|
+
scheme.val = *maybe_scheme;
|
|
2033
|
+
}
|
|
2034
|
+
int32_t option;
|
|
2035
|
+
int32_t option6;
|
|
2036
|
+
uint8_t * option7;
|
|
2037
|
+
size_t option8;
|
|
2038
|
+
if ((scheme).is_some) {
|
|
2039
|
+
const wasi_http_types_scheme_t *payload0 = &(scheme).val;
|
|
2040
|
+
int32_t variant;
|
|
2041
|
+
uint8_t * variant4;
|
|
2042
|
+
size_t variant5;
|
|
2043
|
+
switch ((int32_t) (*payload0).tag) {
|
|
2044
|
+
case 0: {
|
|
2045
|
+
variant = 0;
|
|
2046
|
+
variant4 = 0;
|
|
2047
|
+
variant5 = 0;
|
|
2048
|
+
break;
|
|
2049
|
+
}
|
|
2050
|
+
case 1: {
|
|
2051
|
+
variant = 1;
|
|
2052
|
+
variant4 = 0;
|
|
2053
|
+
variant5 = 0;
|
|
2054
|
+
break;
|
|
2055
|
+
}
|
|
2056
|
+
case 2: {
|
|
2057
|
+
const crossbind_http_string_t *payload3 = &(*payload0).val.other;
|
|
2058
|
+
variant = 2;
|
|
2059
|
+
variant4 = (uint8_t *) (*payload3).ptr;
|
|
2060
|
+
variant5 = (*payload3).len;
|
|
2061
|
+
break;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
option = 1;
|
|
2065
|
+
option6 = variant;
|
|
2066
|
+
option7 = variant4;
|
|
2067
|
+
option8 = variant5;
|
|
2068
|
+
} else {
|
|
2069
|
+
option = 0;
|
|
2070
|
+
option6 = 0;
|
|
2071
|
+
option7 = 0;
|
|
2072
|
+
option8 = 0;
|
|
2073
|
+
}
|
|
2074
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_set_scheme((self).__handle, option, option6, option7, option8);
|
|
2075
|
+
wasi_http_types_result_void_void_t result;
|
|
2076
|
+
switch (ret) {
|
|
2077
|
+
case 0: {
|
|
2078
|
+
result.is_err = false;
|
|
2079
|
+
break;
|
|
2080
|
+
}
|
|
2081
|
+
case 1: {
|
|
2082
|
+
result.is_err = true;
|
|
2083
|
+
break;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
if (!result.is_err) {
|
|
2087
|
+
return 1;
|
|
2088
|
+
} else {
|
|
2089
|
+
return 0;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
bool wasi_http_types_method_request_get_authority(wasi_http_types_borrow_request_t self, crossbind_http_string_t *ret) {
|
|
2094
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
2095
|
+
uint8_t ret_area[(3*sizeof(void*))];
|
|
2096
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2097
|
+
__wasm_import_wasi_http_types_method_request_get_authority((self).__handle, ptr);
|
|
2098
|
+
crossbind_http_option_string_t option;
|
|
2099
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2100
|
+
case 0: {
|
|
2101
|
+
option.is_some = false;
|
|
2102
|
+
break;
|
|
2103
|
+
}
|
|
2104
|
+
case 1: {
|
|
2105
|
+
option.is_some = true;
|
|
2106
|
+
option.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + sizeof(void*)))), (*((size_t*) (ptr + (2*sizeof(void*))))) };
|
|
2107
|
+
break;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
*ret = option.val;
|
|
2111
|
+
return option.is_some;
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
bool wasi_http_types_method_request_set_authority(wasi_http_types_borrow_request_t self, crossbind_http_string_t *maybe_authority) {
|
|
2115
|
+
crossbind_http_option_string_t authority;
|
|
2116
|
+
authority.is_some = maybe_authority != NULL;if (maybe_authority) {
|
|
2117
|
+
authority.val = *maybe_authority;
|
|
2118
|
+
}
|
|
2119
|
+
int32_t option;
|
|
2120
|
+
uint8_t * option1;
|
|
2121
|
+
size_t option2;
|
|
2122
|
+
if ((authority).is_some) {
|
|
2123
|
+
const crossbind_http_string_t *payload0 = &(authority).val;
|
|
2124
|
+
option = 1;
|
|
2125
|
+
option1 = (uint8_t *) (*payload0).ptr;
|
|
2126
|
+
option2 = (*payload0).len;
|
|
2127
|
+
} else {
|
|
2128
|
+
option = 0;
|
|
2129
|
+
option1 = 0;
|
|
2130
|
+
option2 = 0;
|
|
2131
|
+
}
|
|
2132
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_set_authority((self).__handle, option, option1, option2);
|
|
2133
|
+
wasi_http_types_result_void_void_t result;
|
|
2134
|
+
switch (ret) {
|
|
2135
|
+
case 0: {
|
|
2136
|
+
result.is_err = false;
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
case 1: {
|
|
2140
|
+
result.is_err = true;
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
if (!result.is_err) {
|
|
2145
|
+
return 1;
|
|
2146
|
+
} else {
|
|
2147
|
+
return 0;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
bool wasi_http_types_method_request_get_options(wasi_http_types_borrow_request_t self, wasi_http_types_own_request_options_t *ret) {
|
|
2152
|
+
__attribute__((__aligned__(4)))
|
|
2153
|
+
uint8_t ret_area[8];
|
|
2154
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2155
|
+
__wasm_import_wasi_http_types_method_request_get_options((self).__handle, ptr);
|
|
2156
|
+
wasi_http_types_option_own_request_options_t option;
|
|
2157
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2158
|
+
case 0: {
|
|
2159
|
+
option.is_some = false;
|
|
2160
|
+
break;
|
|
2161
|
+
}
|
|
2162
|
+
case 1: {
|
|
2163
|
+
option.is_some = true;
|
|
2164
|
+
option.val = (wasi_http_types_own_request_options_t) { *((int32_t*) (ptr + 4)) };
|
|
2165
|
+
break;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
*ret = option.val;
|
|
2169
|
+
return option.is_some;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
wasi_http_types_own_headers_t wasi_http_types_method_request_get_headers(wasi_http_types_borrow_request_t self) {
|
|
2173
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_get_headers((self).__handle);
|
|
2174
|
+
return (wasi_http_types_own_headers_t) { ret };
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
void wasi_http_types_static_request_consume_body(wasi_http_types_own_request_t this_, wasi_http_types_future_result_void_error_code_t res, wasi_http_types_tuple2_stream_u8_future_result_option_own_trailers_error_code_t *ret) {
|
|
2178
|
+
__attribute__((__aligned__(4)))
|
|
2179
|
+
uint8_t ret_area[8];
|
|
2180
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2181
|
+
__wasm_import_wasi_http_types_static_request_consume_body((this_).__handle, ((int32_t) res), ptr);
|
|
2182
|
+
*ret = (wasi_http_types_tuple2_stream_u8_future_result_option_own_trailers_error_code_t) {
|
|
2183
|
+
(wasi_http_types_stream_u8_t) ((uint32_t) *((int32_t*) (ptr + 0))),
|
|
2184
|
+
(wasi_http_types_future_result_option_own_trailers_error_code_t) ((uint32_t) *((int32_t*) (ptr + 4))),
|
|
2185
|
+
};
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
wasi_http_types_own_request_options_t wasi_http_types_constructor_request_options(void) {
|
|
2189
|
+
int32_t ret = __wasm_import_wasi_http_types_constructor_request_options();
|
|
2190
|
+
return (wasi_http_types_own_request_options_t) { ret };
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
bool wasi_http_types_method_request_options_get_connect_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *ret) {
|
|
2194
|
+
__attribute__((__aligned__(8)))
|
|
2195
|
+
uint8_t ret_area[16];
|
|
2196
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2197
|
+
__wasm_import_wasi_http_types_method_request_options_get_connect_timeout((self).__handle, ptr);
|
|
2198
|
+
wasi_http_types_option_duration_t option;
|
|
2199
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2200
|
+
case 0: {
|
|
2201
|
+
option.is_some = false;
|
|
2202
|
+
break;
|
|
2203
|
+
}
|
|
2204
|
+
case 1: {
|
|
2205
|
+
option.is_some = true;
|
|
2206
|
+
option.val = (uint64_t) (*((int64_t*) (ptr + 8)));
|
|
2207
|
+
break;
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
*ret = option.val;
|
|
2211
|
+
return option.is_some;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
bool wasi_http_types_method_request_options_set_connect_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *maybe_duration, wasi_http_types_request_options_error_t *err) {
|
|
2215
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
2216
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
2217
|
+
wasi_http_types_option_duration_t duration;
|
|
2218
|
+
duration.is_some = maybe_duration != NULL;if (maybe_duration) {
|
|
2219
|
+
duration.val = *maybe_duration;
|
|
2220
|
+
}
|
|
2221
|
+
int32_t option;
|
|
2222
|
+
int64_t option1;
|
|
2223
|
+
if ((duration).is_some) {
|
|
2224
|
+
const wasi_http_types_duration_t *payload0 = &(duration).val;
|
|
2225
|
+
option = 1;
|
|
2226
|
+
option1 = (int64_t) (*payload0);
|
|
2227
|
+
} else {
|
|
2228
|
+
option = 0;
|
|
2229
|
+
option1 = 0;
|
|
2230
|
+
}
|
|
2231
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2232
|
+
__wasm_import_wasi_http_types_method_request_options_set_connect_timeout((self).__handle, option, option1, ptr);
|
|
2233
|
+
wasi_http_types_result_void_request_options_error_t result;
|
|
2234
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2235
|
+
case 0: {
|
|
2236
|
+
result.is_err = false;
|
|
2237
|
+
break;
|
|
2238
|
+
}
|
|
2239
|
+
case 1: {
|
|
2240
|
+
result.is_err = true;
|
|
2241
|
+
wasi_http_types_request_options_error_t variant;
|
|
2242
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
2243
|
+
switch ((int32_t) variant.tag) {
|
|
2244
|
+
case 0: {
|
|
2245
|
+
break;
|
|
2246
|
+
}
|
|
2247
|
+
case 1: {
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
case 2: {
|
|
2251
|
+
crossbind_http_option_string_t option2;
|
|
2252
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
2253
|
+
case 0: {
|
|
2254
|
+
option2.is_some = false;
|
|
2255
|
+
break;
|
|
2256
|
+
}
|
|
2257
|
+
case 1: {
|
|
2258
|
+
option2.is_some = true;
|
|
2259
|
+
option2.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
2260
|
+
break;
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2263
|
+
variant.val.other = option2;
|
|
2264
|
+
break;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
result.val.err = variant;
|
|
2269
|
+
break;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
if (!result.is_err) {
|
|
2273
|
+
return 1;
|
|
2274
|
+
} else {
|
|
2275
|
+
*err = result.val.err;
|
|
2276
|
+
return 0;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
bool wasi_http_types_method_request_options_get_first_byte_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *ret) {
|
|
2281
|
+
__attribute__((__aligned__(8)))
|
|
2282
|
+
uint8_t ret_area[16];
|
|
2283
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2284
|
+
__wasm_import_wasi_http_types_method_request_options_get_first_byte_timeout((self).__handle, ptr);
|
|
2285
|
+
wasi_http_types_option_duration_t option;
|
|
2286
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2287
|
+
case 0: {
|
|
2288
|
+
option.is_some = false;
|
|
2289
|
+
break;
|
|
2290
|
+
}
|
|
2291
|
+
case 1: {
|
|
2292
|
+
option.is_some = true;
|
|
2293
|
+
option.val = (uint64_t) (*((int64_t*) (ptr + 8)));
|
|
2294
|
+
break;
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
*ret = option.val;
|
|
2298
|
+
return option.is_some;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
bool wasi_http_types_method_request_options_set_first_byte_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *maybe_duration, wasi_http_types_request_options_error_t *err) {
|
|
2302
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
2303
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
2304
|
+
wasi_http_types_option_duration_t duration;
|
|
2305
|
+
duration.is_some = maybe_duration != NULL;if (maybe_duration) {
|
|
2306
|
+
duration.val = *maybe_duration;
|
|
2307
|
+
}
|
|
2308
|
+
int32_t option;
|
|
2309
|
+
int64_t option1;
|
|
2310
|
+
if ((duration).is_some) {
|
|
2311
|
+
const wasi_http_types_duration_t *payload0 = &(duration).val;
|
|
2312
|
+
option = 1;
|
|
2313
|
+
option1 = (int64_t) (*payload0);
|
|
2314
|
+
} else {
|
|
2315
|
+
option = 0;
|
|
2316
|
+
option1 = 0;
|
|
2317
|
+
}
|
|
2318
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2319
|
+
__wasm_import_wasi_http_types_method_request_options_set_first_byte_timeout((self).__handle, option, option1, ptr);
|
|
2320
|
+
wasi_http_types_result_void_request_options_error_t result;
|
|
2321
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2322
|
+
case 0: {
|
|
2323
|
+
result.is_err = false;
|
|
2324
|
+
break;
|
|
2325
|
+
}
|
|
2326
|
+
case 1: {
|
|
2327
|
+
result.is_err = true;
|
|
2328
|
+
wasi_http_types_request_options_error_t variant;
|
|
2329
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
2330
|
+
switch ((int32_t) variant.tag) {
|
|
2331
|
+
case 0: {
|
|
2332
|
+
break;
|
|
2333
|
+
}
|
|
2334
|
+
case 1: {
|
|
2335
|
+
break;
|
|
2336
|
+
}
|
|
2337
|
+
case 2: {
|
|
2338
|
+
crossbind_http_option_string_t option2;
|
|
2339
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
2340
|
+
case 0: {
|
|
2341
|
+
option2.is_some = false;
|
|
2342
|
+
break;
|
|
2343
|
+
}
|
|
2344
|
+
case 1: {
|
|
2345
|
+
option2.is_some = true;
|
|
2346
|
+
option2.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
2347
|
+
break;
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
variant.val.other = option2;
|
|
2351
|
+
break;
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
result.val.err = variant;
|
|
2356
|
+
break;
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
if (!result.is_err) {
|
|
2360
|
+
return 1;
|
|
2361
|
+
} else {
|
|
2362
|
+
*err = result.val.err;
|
|
2363
|
+
return 0;
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
bool wasi_http_types_method_request_options_get_between_bytes_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *ret) {
|
|
2368
|
+
__attribute__((__aligned__(8)))
|
|
2369
|
+
uint8_t ret_area[16];
|
|
2370
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2371
|
+
__wasm_import_wasi_http_types_method_request_options_get_between_bytes_timeout((self).__handle, ptr);
|
|
2372
|
+
wasi_http_types_option_duration_t option;
|
|
2373
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2374
|
+
case 0: {
|
|
2375
|
+
option.is_some = false;
|
|
2376
|
+
break;
|
|
2377
|
+
}
|
|
2378
|
+
case 1: {
|
|
2379
|
+
option.is_some = true;
|
|
2380
|
+
option.val = (uint64_t) (*((int64_t*) (ptr + 8)));
|
|
2381
|
+
break;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
*ret = option.val;
|
|
2385
|
+
return option.is_some;
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
bool wasi_http_types_method_request_options_set_between_bytes_timeout(wasi_http_types_borrow_request_options_t self, wasi_http_types_duration_t *maybe_duration, wasi_http_types_request_options_error_t *err) {
|
|
2389
|
+
__attribute__((__aligned__(sizeof(void*))))
|
|
2390
|
+
uint8_t ret_area[(5*sizeof(void*))];
|
|
2391
|
+
wasi_http_types_option_duration_t duration;
|
|
2392
|
+
duration.is_some = maybe_duration != NULL;if (maybe_duration) {
|
|
2393
|
+
duration.val = *maybe_duration;
|
|
2394
|
+
}
|
|
2395
|
+
int32_t option;
|
|
2396
|
+
int64_t option1;
|
|
2397
|
+
if ((duration).is_some) {
|
|
2398
|
+
const wasi_http_types_duration_t *payload0 = &(duration).val;
|
|
2399
|
+
option = 1;
|
|
2400
|
+
option1 = (int64_t) (*payload0);
|
|
2401
|
+
} else {
|
|
2402
|
+
option = 0;
|
|
2403
|
+
option1 = 0;
|
|
2404
|
+
}
|
|
2405
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2406
|
+
__wasm_import_wasi_http_types_method_request_options_set_between_bytes_timeout((self).__handle, option, option1, ptr);
|
|
2407
|
+
wasi_http_types_result_void_request_options_error_t result;
|
|
2408
|
+
switch ((int32_t) *((uint8_t*) (ptr + 0))) {
|
|
2409
|
+
case 0: {
|
|
2410
|
+
result.is_err = false;
|
|
2411
|
+
break;
|
|
2412
|
+
}
|
|
2413
|
+
case 1: {
|
|
2414
|
+
result.is_err = true;
|
|
2415
|
+
wasi_http_types_request_options_error_t variant;
|
|
2416
|
+
variant.tag = (int32_t) *((uint8_t*) (ptr + sizeof(void*)));
|
|
2417
|
+
switch ((int32_t) variant.tag) {
|
|
2418
|
+
case 0: {
|
|
2419
|
+
break;
|
|
2420
|
+
}
|
|
2421
|
+
case 1: {
|
|
2422
|
+
break;
|
|
2423
|
+
}
|
|
2424
|
+
case 2: {
|
|
2425
|
+
crossbind_http_option_string_t option2;
|
|
2426
|
+
switch ((int32_t) *((uint8_t*) (ptr + (2*sizeof(void*))))) {
|
|
2427
|
+
case 0: {
|
|
2428
|
+
option2.is_some = false;
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
case 1: {
|
|
2432
|
+
option2.is_some = true;
|
|
2433
|
+
option2.val = (crossbind_http_string_t) { (uint8_t*)(*((uint8_t **) (ptr + (3*sizeof(void*))))), (*((size_t*) (ptr + (4*sizeof(void*))))) };
|
|
2434
|
+
break;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
variant.val.other = option2;
|
|
2438
|
+
break;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
result.val.err = variant;
|
|
2443
|
+
break;
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
if (!result.is_err) {
|
|
2447
|
+
return 1;
|
|
2448
|
+
} else {
|
|
2449
|
+
*err = result.val.err;
|
|
2450
|
+
return 0;
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
wasi_http_types_own_request_options_t wasi_http_types_method_request_options_clone(wasi_http_types_borrow_request_options_t self) {
|
|
2455
|
+
int32_t ret = __wasm_import_wasi_http_types_method_request_options_clone((self).__handle);
|
|
2456
|
+
return (wasi_http_types_own_request_options_t) { ret };
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
void wasi_http_types_static_response_new(wasi_http_types_own_headers_t headers, wasi_http_types_stream_u8_t *maybe_contents, wasi_http_types_future_result_option_own_trailers_error_code_t trailers, wasi_http_types_tuple2_own_response_future_result_void_error_code_t *ret) {
|
|
2460
|
+
__attribute__((__aligned__(4)))
|
|
2461
|
+
uint8_t ret_area[8];
|
|
2462
|
+
wasi_http_types_option_stream_u8_t contents;
|
|
2463
|
+
contents.is_some = maybe_contents != NULL;if (maybe_contents) {
|
|
2464
|
+
contents.val = *maybe_contents;
|
|
2465
|
+
}
|
|
2466
|
+
int32_t option;
|
|
2467
|
+
int32_t option1;
|
|
2468
|
+
if ((contents).is_some) {
|
|
2469
|
+
const wasi_http_types_stream_u8_t *payload0 = &(contents).val;
|
|
2470
|
+
option = 1;
|
|
2471
|
+
option1 = ((int32_t) *payload0);
|
|
2472
|
+
} else {
|
|
2473
|
+
option = 0;
|
|
2474
|
+
option1 = 0;
|
|
2475
|
+
}
|
|
2476
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2477
|
+
__wasm_import_wasi_http_types_static_response_new((headers).__handle, option, option1, ((int32_t) trailers), ptr);
|
|
2478
|
+
*ret = (wasi_http_types_tuple2_own_response_future_result_void_error_code_t) {
|
|
2479
|
+
(wasi_http_types_own_response_t) (wasi_http_types_own_response_t) { *((int32_t*) (ptr + 0)) },
|
|
2480
|
+
(wasi_http_types_future_result_void_error_code_t) ((uint32_t) *((int32_t*) (ptr + 4))),
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
wasi_http_types_status_code_t wasi_http_types_method_response_get_status_code(wasi_http_types_borrow_response_t self) {
|
|
2485
|
+
int32_t ret = __wasm_import_wasi_http_types_method_response_get_status_code((self).__handle);
|
|
2486
|
+
return (uint16_t) (ret);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
bool wasi_http_types_method_response_set_status_code(wasi_http_types_borrow_response_t self, wasi_http_types_status_code_t status_code) {
|
|
2490
|
+
int32_t ret = __wasm_import_wasi_http_types_method_response_set_status_code((self).__handle, (int32_t) (status_code));
|
|
2491
|
+
wasi_http_types_result_void_void_t result;
|
|
2492
|
+
switch (ret) {
|
|
2493
|
+
case 0: {
|
|
2494
|
+
result.is_err = false;
|
|
2495
|
+
break;
|
|
2496
|
+
}
|
|
2497
|
+
case 1: {
|
|
2498
|
+
result.is_err = true;
|
|
2499
|
+
break;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
if (!result.is_err) {
|
|
2503
|
+
return 1;
|
|
2504
|
+
} else {
|
|
2505
|
+
return 0;
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
wasi_http_types_own_headers_t wasi_http_types_method_response_get_headers(wasi_http_types_borrow_response_t self) {
|
|
2510
|
+
int32_t ret = __wasm_import_wasi_http_types_method_response_get_headers((self).__handle);
|
|
2511
|
+
return (wasi_http_types_own_headers_t) { ret };
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
void wasi_http_types_static_response_consume_body(wasi_http_types_own_response_t this_, wasi_http_types_future_result_void_error_code_t res, wasi_http_types_tuple2_stream_u8_future_result_option_own_trailers_error_code_t *ret) {
|
|
2515
|
+
__attribute__((__aligned__(4)))
|
|
2516
|
+
uint8_t ret_area[8];
|
|
2517
|
+
uint8_t *ptr = (uint8_t *) &ret_area;
|
|
2518
|
+
__wasm_import_wasi_http_types_static_response_consume_body((this_).__handle, ((int32_t) res), ptr);
|
|
2519
|
+
*ret = (wasi_http_types_tuple2_stream_u8_future_result_option_own_trailers_error_code_t) {
|
|
2520
|
+
(wasi_http_types_stream_u8_t) ((uint32_t) *((int32_t*) (ptr + 0))),
|
|
2521
|
+
(wasi_http_types_future_result_option_own_trailers_error_code_t) ((uint32_t) *((int32_t*) (ptr + 4))),
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
__attribute__((__export_name__("[async-lift]wasi:http/handler@0.3.0#handle")))
|
|
2526
|
+
int32_t __wasm_export_exports_wasi_http_handler_handle(int32_t arg) {
|
|
2527
|
+
crossbind_http_callback_code_t ret = exports_wasi_http_handler_handle((exports_wasi_http_handler_own_request_t) { arg });
|
|
2528
|
+
return ret;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
// Ensure that the *_component_type.o object is linked in
|
|
2532
|
+
|
|
2533
|
+
extern void __component_type_object_force_link_crossbind_http(void);
|
|
2534
|
+
__attribute__((used))
|
|
2535
|
+
void __component_type_object_force_link_crossbind_http_public_use_in_this_compilation_unit(void) {
|
|
2536
|
+
__component_type_object_force_link_crossbind_http();
|
|
2537
|
+
}
|