Skip to content

Commit

Permalink
Document = and \0 use in args/environ docs. (WebAssembly#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaulingMonkey authored Feb 24, 2021
1 parent ef8c1a5 commit 2a26951
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion phases/ephemeral/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,8 @@ When type is [`preopentype::dir`](#preopentype.dir):

#### <a href="#get" name="get"></a> `get(argv: Pointer<Pointer<u8>>, argv_buf: Pointer<u8>) -> Result<(), errno>`
Read command-line argument data.
The size of the array should match that returned by [`sizes_get`](#sizes_get)
The size of the array should match that returned by [`sizes_get`](#sizes_get).
Each argument is expected to be `\0` terminated.

##### Params
- <a href="#get.argv" name="get.argv"></a> `argv`: `Pointer<Pointer<u8>>`
Expand Down Expand Up @@ -1327,6 +1328,7 @@ The time value of the clock.
#### <a href="#get" name="get"></a> `get(environ: Pointer<Pointer<u8>>, environ_buf: Pointer<u8>) -> Result<(), errno>`
Read environment variable data.
The sizes of the buffers should match that returned by [`sizes_get`](#sizes_get).
Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.

##### Params
- <a href="#get.environ" name="get.environ"></a> `environ`: `Pointer<Pointer<u8>>`
Expand Down
3 changes: 2 additions & 1 deletion phases/ephemeral/witx/wasi_ephemeral_args.witx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
(import "memory" (memory))

;;; Read command-line argument data.
;;; The size of the array should match that returned by `sizes_get`
;;; The size of the array should match that returned by `sizes_get`.
;;; Each argument is expected to be `\0` terminated.
(@interface func (export "get")
(param $argv (@witx pointer (@witx pointer (@witx char8))))
(param $argv_buf (@witx pointer (@witx char8)))
Expand Down
1 change: 1 addition & 0 deletions phases/ephemeral/witx/wasi_ephemeral_environ.witx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

;;; Read environment variable data.
;;; The sizes of the buffers should match that returned by `sizes_get`.
;;; Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
(@interface func (export "get")
(param $environ (@witx pointer (@witx pointer (@witx char8))))
(param $environ_buf (@witx pointer (@witx char8)))
Expand Down
4 changes: 3 additions & 1 deletion phases/old/snapshot_0/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,8 @@ Alignment: 4

#### <a href="#args_get" name="args_get"></a> `args_get(argv: Pointer<Pointer<u8>>, argv_buf: Pointer<u8>) -> Result<(), errno>`
Read command-line argument data.
The size of the array should match that returned by [`args_sizes_get`](#args_sizes_get)
The size of the array should match that returned by [`args_sizes_get`](#args_sizes_get).
Each argument is expected to be `\0` terminated.

##### Params
- <a href="#args_get.argv" name="args_get.argv"></a> `argv`: `Pointer<Pointer<u8>>`
Expand Down Expand Up @@ -1325,6 +1326,7 @@ Offset: 4
#### <a href="#environ_get" name="environ_get"></a> `environ_get(environ: Pointer<Pointer<u8>>, environ_buf: Pointer<u8>) -> Result<(), errno>`
Read environment variable data.
The sizes of the buffers should match that returned by [`environ_sizes_get`](#environ_sizes_get).
Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.

##### Params
- <a href="#environ_get.environ" name="environ_get.environ"></a> `environ`: `Pointer<Pointer<u8>>`
Expand Down
4 changes: 3 additions & 1 deletion phases/old/snapshot_0/witx/wasi_unstable.witx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
(import "memory" (memory))

;;; Read command-line argument data.
;;; The size of the array should match that returned by `args_sizes_get`
;;; The size of the array should match that returned by `args_sizes_get`.
;;; Each argument is expected to be `\0` terminated.
(@interface func (export "args_get")
(param $argv (@witx pointer (@witx pointer u8)))
(param $argv_buf (@witx pointer u8))
Expand All @@ -31,6 +32,7 @@

;;; Read environment variable data.
;;; The sizes of the buffers should match that returned by `environ_sizes_get`.
;;; Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
(@interface func (export "environ_get")
(param $environ (@witx pointer (@witx pointer u8)))
(param $environ_buf (@witx pointer u8))
Expand Down
4 changes: 3 additions & 1 deletion phases/snapshot/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,8 @@ Alignment: 4

#### <a href="#args_get" name="args_get"></a> `args_get(argv: Pointer<Pointer<u8>>, argv_buf: Pointer<u8>) -> Result<(), errno>`
Read command-line argument data.
The size of the array should match that returned by [`args_sizes_get`](#args_sizes_get)
The size of the array should match that returned by [`args_sizes_get`](#args_sizes_get).
Each argument is expected to be `\0` terminated.

##### Params
- <a href="#args_get.argv" name="args_get.argv"></a> `argv`: `Pointer<Pointer<u8>>`
Expand Down Expand Up @@ -1322,6 +1323,7 @@ Offset: 4
#### <a href="#environ_get" name="environ_get"></a> `environ_get(environ: Pointer<Pointer<u8>>, environ_buf: Pointer<u8>) -> Result<(), errno>`
Read environment variable data.
The sizes of the buffers should match that returned by [`environ_sizes_get`](#environ_sizes_get).
Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.

##### Params
- <a href="#environ_get.environ" name="environ_get.environ"></a> `environ`: `Pointer<Pointer<u8>>`
Expand Down
4 changes: 3 additions & 1 deletion phases/snapshot/witx/wasi_snapshot_preview1.witx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
(import "memory" (memory))

;;; Read command-line argument data.
;;; The size of the array should match that returned by `args_sizes_get`
;;; The size of the array should match that returned by `args_sizes_get`.
;;; Each argument is expected to be `\0` terminated.
(@interface func (export "args_get")
(param $argv (@witx pointer (@witx pointer u8)))
(param $argv_buf (@witx pointer u8))
Expand All @@ -28,6 +29,7 @@

;;; Read environment variable data.
;;; The sizes of the buffers should match that returned by `environ_sizes_get`.
;;; Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
(@interface func (export "environ_get")
(param $environ (@witx pointer (@witx pointer u8)))
(param $environ_buf (@witx pointer u8))
Expand Down

0 comments on commit 2a26951

Please sign in to comment.