Skip to content

Commit 2a26951

Browse files
Document = and \0 use in args/environ docs. (#399)
1 parent ef8c1a5 commit 2a26951

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

phases/ephemeral/docs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,8 @@ When type is [`preopentype::dir`](#preopentype.dir):
12111211

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

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

13311333
##### Params
13321334
- <a href="#get.environ" name="get.environ"></a> `environ`: `Pointer<Pointer<u8>>`

phases/ephemeral/witx/wasi_ephemeral_args.witx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
(import "memory" (memory))
1111

1212
;;; Read command-line argument data.
13-
;;; The size of the array should match that returned by `sizes_get`
13+
;;; The size of the array should match that returned by `sizes_get`.
14+
;;; Each argument is expected to be `\0` terminated.
1415
(@interface func (export "get")
1516
(param $argv (@witx pointer (@witx pointer (@witx char8))))
1617
(param $argv_buf (@witx pointer (@witx char8)))

phases/ephemeral/witx/wasi_ephemeral_environ.witx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
;;; Read environment variable data.
1313
;;; The sizes of the buffers should match that returned by `sizes_get`.
14+
;;; Key/value pairs are expected to be joined with `=`s, and terminated with `\0`s.
1415
(@interface func (export "get")
1516
(param $environ (@witx pointer (@witx pointer (@witx char8))))
1617
(param $environ_buf (@witx pointer (@witx char8)))

phases/old/snapshot_0/docs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,8 @@ Alignment: 4
12701270

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

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

13291331
##### Params
13301332
- <a href="#environ_get.environ" name="environ_get.environ"></a> `environ`: `Pointer<Pointer<u8>>`

phases/old/snapshot_0/witx/wasi_unstable.witx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
(import "memory" (memory))
1717

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

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

phases/snapshot/docs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,8 @@ Alignment: 4
12671267

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

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

13261328
##### Params
13271329
- <a href="#environ_get.environ" name="environ_get.environ"></a> `environ`: `Pointer<Pointer<u8>>`

phases/snapshot/witx/wasi_snapshot_preview1.witx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
(import "memory" (memory))
1414

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

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

0 commit comments

Comments
 (0)