Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make __wasi_args_get and __wasi_environ_get docs more explicit. #128

Merged
merged 1 commit into from
Oct 31, 2019
Merged
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
18 changes: 13 additions & 5 deletions phases/ephemeral/docs/wasi_ephemeral_preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,22 @@ modules so that embedders need not implement all of it.

Read command-line argument data.

The sizes of the buffers should match that returned by [`__wasi_args_sizes_get()`](#args_sizes_get).

Inputs:

- <a href="#args_get.argv" name="args_get.argv"></a><code>char \*\*<strong>argv</strong></code>

A pointer to a buffer to write the argument pointers.

The count of elements for the buffer should be at least the value of `argc` returned by [`__wasi_args_sizes_get()`](#args_sizes_get).

The caller of `__wasi_args_get()` is responsible for allocating an additional element for a terminating NULL pointer, if necessary.

- <a href="#args_get.argv_buf" name="args_get.argv_buf"></a><code>char \*<strong>argv\_buf</strong></code>

A pointer to a buffer to write the argument string data.

The size of this buffer should be the value of `argv_buf_size` returned by [`__wasi_args_sizes_get()`](#args_sizes_get).

### <a href="#args_sizes_get" name="args_sizes_get"></a>`__wasi_args_sizes_get()`

Return command-line argument data sizes.
Expand Down Expand Up @@ -192,21 +196,25 @@ Outputs:

Read environment variable data.

The sizes of the buffers should match that returned by [`__wasi_environ_sizes_get()`](#environ_sizes_get).

Inputs:

- <a href="#environ_get.environ" name="environ_get.environ"></a><code>char \*\*<strong>environ</strong></code>

A pointer to a buffer to write the environment variable pointers.

The count of elements for the buffer should be at least the value of `environ_count` returned by [`__wasi_environ_sizes_get()`](#environ_sizes_get).

The caller of `__wasi_environ_get()` is responsible for allocating an additional element for a terminating NULL pointer, if necessary.

- <a href="#environ_get.environ_buf" name="environ_get.environ_buf"></a><code>char \*<strong>environ\_buf</strong></code>

A pointer to a buffer to write the environment variable string data.

The size of this buffer should be the value of `environ_buf_size` returned by [`__wasi_environ_sizes_get()`](#environ_sizes_get).

### <a href="#environ_sizes_get" name="environ_sizes_get"></a>`__wasi_environ_sizes_get()`

Return command-line argument data sizes.
Return enviroment variable data sizes.

Outputs:

Expand Down