Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions abi-versions/vNEXT/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2095,17 +2095,16 @@ This function is gated on [`HAS_PROPERTIES`] host feature.
#### `proxy_call_foreign_function`

* params:
- `i32 (const char *) name_data`
- `i32 (size_t) name_size`
- `i32 (uint32_t) custom_function_id`
- `i32 (const uint8_t *) arguments_data`
- `i32 (size_t) arguments_size`
- `i32 (uint8_t **) return_results_data`
- `i32 (size_t *) return_results_size`
* returns:
- `i32 (`[`proxy_status_t`]`) status`

Calls registered foreign function (`name_data`, `name_size`)
with arguments (`arguments_data`, `arguments_size`).
Calls [custom function] `custom_function_id` with arguments
(`arguments_data`, `arguments_size`).

Return value(s) (`return_results_data`, `return_results_size`)
are optional.
Expand All @@ -2126,12 +2125,12 @@ This function is gated on [`HAS_CUSTOM_FUNCTIONS`] host feature.

* params:
- `i32 (uint32_t) plugin_context_id`
- `i32 (uint32_t) function_id`
- `i32 (uint32_t) custom_callback_id`
- `i32 (size_t) arguments_size`
* returns:
- none

Called when a registered foreign callback `function_id` is called.
Called when a [custom callback] `custom_callback_id` is called.

Its arguments (of `arguments_size`) can be retrieved using
[`proxy_get_buffer_bytes`] with `buffer_id` set to
Expand Down Expand Up @@ -2414,6 +2413,9 @@ changes to unrelated connections/requests.
[`HAS_CUSTOM_FUNCTIONS`]: ./registries/HOST_FEATURES.md
[`HAS_WASI_PREVIEW1_CORE`]: ./registries/HOST_FEATURES.md

[custom function]: ./registries/CUSTOM_FUNCTIONS.md
[custom callbacks]: ./registries/CUSTOM_FUNCTIONS.md

[`proxy_abi_version_0_x_x`]: #proxy_abi_version_0_x_x
[`_initialize`]: #_initialize
[`main`]: #main
Expand Down
22 changes: 22 additions & 0 deletions abi-versions/vNEXT/registries/CUSTOM_FUNCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Custom functions and callbacks

#### Custom functions

| Identifier | Name | Arguments | Return value | Description |
|:----------:|:-----------------|:---------:|:------------:|:--------------------------------------------------------------|


#### Custom callbacks

| Identifier | Name | Arguments | Return value | Description |
|:----------:|:-----------------|:---------:|:------------:|:--------------------------------------------------------------|


Identifiers below 0x2000 are reserved for standardized functions and callbacks.

Numbers above that range are considered private and can be used without assignment in the registry.

Random number in the private range should be used for private extensions and functions and callbacks under active development.

Once the custom function or callback is finalized and implemented in a subset of hosts and SDKs, it will be assigned identifier
in the standardized range.
Loading