Skip to content

Commit 5d73df4

Browse files
Jake ChampionJakeChampion
authored andcommitted
generate bindings
1 parent c432ec5 commit 5d73df4

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

runtime/js-compute-runtime/host_interface/component/fastly_world.c

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,12 @@ void __wasm_import_fastly_compute_at_edge_object_store_lookup_async(int32_t, int
811811
__attribute__((__import_module__("fastly:compute-at-edge/object-store"), __import_name__("pending-lookup-wait")))
812812
void __wasm_import_fastly_compute_at_edge_object_store_pending_lookup_wait(int32_t, int32_t);
813813

814+
__attribute__((__import_module__("fastly:compute-at-edge/object-store"), __import_name__("delete-async")))
815+
void __wasm_import_fastly_compute_at_edge_object_store_delete_async(int32_t, int32_t, int32_t, int32_t);
816+
817+
__attribute__((__import_module__("fastly:compute-at-edge/object-store"), __import_name__("pending-delete-wait")))
818+
void __wasm_import_fastly_compute_at_edge_object_store_pending_delete_wait(int32_t, int32_t);
819+
814820
__attribute__((__import_module__("fastly:compute-at-edge/object-store"), __import_name__("insert")))
815821
void __wasm_import_fastly_compute_at_edge_object_store_insert(int32_t, int32_t, int32_t, int32_t, int32_t);
816822

@@ -4094,6 +4100,58 @@ bool fastly_compute_at_edge_object_store_pending_lookup_wait(fastly_compute_at_e
40944100
}
40954101
}
40964102

4103+
bool fastly_compute_at_edge_object_store_delete_async(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_compute_at_edge_object_store_pending_handle_t *ret, fastly_compute_at_edge_object_store_error_t *err) {
4104+
__attribute__((__aligned__(4)))
4105+
uint8_t ret_area[8];
4106+
int32_t ptr = (int32_t) &ret_area;
4107+
__wasm_import_fastly_compute_at_edge_object_store_delete_async((int32_t) (store), (int32_t) (*key).ptr, (int32_t) (*key).len, ptr);
4108+
fastly_world_result_fastly_compute_at_edge_object_store_pending_handle_fastly_compute_at_edge_object_store_error_t result;
4109+
switch ((int32_t) (*((uint8_t*) (ptr + 0)))) {
4110+
case 0: {
4111+
result.is_err = false;
4112+
result.val.ok = (uint32_t) (*((int32_t*) (ptr + 4)));
4113+
break;
4114+
}
4115+
case 1: {
4116+
result.is_err = true;
4117+
result.val.err = (int32_t) (*((uint8_t*) (ptr + 4)));
4118+
break;
4119+
}
4120+
}
4121+
if (!result.is_err) {
4122+
*ret = result.val.ok;
4123+
return 1;
4124+
} else {
4125+
*err = result.val.err;
4126+
return 0;
4127+
}
4128+
}
4129+
4130+
bool fastly_compute_at_edge_object_store_pending_delete_wait(fastly_compute_at_edge_object_store_pending_handle_t handle, fastly_compute_at_edge_object_store_error_t *err) {
4131+
__attribute__((__aligned__(1)))
4132+
uint8_t ret_area[2];
4133+
int32_t ptr = (int32_t) &ret_area;
4134+
__wasm_import_fastly_compute_at_edge_object_store_pending_delete_wait((int32_t) (handle), ptr);
4135+
fastly_world_result_void_fastly_compute_at_edge_object_store_error_t result;
4136+
switch ((int32_t) (*((uint8_t*) (ptr + 0)))) {
4137+
case 0: {
4138+
result.is_err = false;
4139+
break;
4140+
}
4141+
case 1: {
4142+
result.is_err = true;
4143+
result.val.err = (int32_t) (*((uint8_t*) (ptr + 1)));
4144+
break;
4145+
}
4146+
}
4147+
if (!result.is_err) {
4148+
return 1;
4149+
} else {
4150+
*err = result.val.err;
4151+
return 0;
4152+
}
4153+
}
4154+
40974155
bool fastly_compute_at_edge_object_store_insert(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_compute_at_edge_object_store_body_handle_t body_handle, fastly_compute_at_edge_object_store_error_t *err) {
40984156
__attribute__((__aligned__(1)))
40994157
uint8_t ret_area[2];

runtime/js-compute-runtime/host_interface/component/fastly_world.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ bool fastly_compute_at_edge_object_store_open(fastly_world_string_t *name, fastl
802802
bool fastly_compute_at_edge_object_store_lookup(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_world_option_fastly_compute_at_edge_object_store_body_handle_t *ret, fastly_compute_at_edge_object_store_error_t *err);
803803
bool fastly_compute_at_edge_object_store_lookup_async(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_compute_at_edge_object_store_pending_handle_t *ret, fastly_compute_at_edge_object_store_error_t *err);
804804
bool fastly_compute_at_edge_object_store_pending_lookup_wait(fastly_compute_at_edge_object_store_pending_handle_t handle, fastly_world_option_fastly_compute_at_edge_object_store_body_handle_t *ret, fastly_compute_at_edge_object_store_error_t *err);
805+
bool fastly_compute_at_edge_object_store_delete_async(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_compute_at_edge_object_store_pending_handle_t *ret, fastly_compute_at_edge_object_store_error_t *err);
806+
bool fastly_compute_at_edge_object_store_pending_delete_wait(fastly_compute_at_edge_object_store_pending_handle_t handle, fastly_compute_at_edge_object_store_error_t *err);
805807
bool fastly_compute_at_edge_object_store_insert(fastly_compute_at_edge_object_store_handle_t store, fastly_world_string_t *key, fastly_compute_at_edge_object_store_body_handle_t body_handle, fastly_compute_at_edge_object_store_error_t *err);
806808

807809
// Imported Functions from `fastly:compute-at-edge/purge`
Binary file not shown.

0 commit comments

Comments
 (0)