Skip to content

Commit

Permalink
Rename info to fd-info, and other minor fixes. (#66)
Browse files Browse the repository at this point in the history
* Rename `info` to `fd-info`, and other minor fixes.

Rename the `info` function to `fd-info`, to avoid a name collision with
the `info` type.

While here, also fix the documentation name for the `datasync` function.
And use `filesize` and for fadvise arguments.

* Swap `info` and `fd-info`.

It feels more natural to have the function be named `info` and the
record `fd-info`. `info` is a method of the `descriptor` resource,
which provides a scope, while `fd-info` is just a standalone record.
  • Loading branch information
sunfishcode authored Nov 23, 2022
1 parent 8b823a6 commit ba4706d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions wasi-filesystem.abi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Size: 8, Alignment: 8

Size: 8, Alignment: 8

## <a href="#info" name="info"></a> `info`: record
## <a href="#fd_info" name="fd_info"></a> `fd-info`: record

Information associated with a descriptor.

Expand All @@ -36,11 +36,11 @@ Size: 2, Alignment: 1

### Record Fields

- <a href="info.type" name="info.type"></a> [`type`](#info.type): [`type`](#type)
- <a href="fd_info.type" name="fd_info.type"></a> [`type`](#fd_info.type): [`type`](#type)

The type of filesystem object referenced by a descriptor.

- <a href="info.flags" name="info.flags"></a> [`flags`](#info.flags): [`flags`](#flags)
- <a href="fd_info.flags" name="fd_info.flags"></a> [`flags`](#fd_info.flags): [`flags`](#flags)

Flags associated with a descriptor.

Expand Down Expand Up @@ -657,8 +657,8 @@ Size: 16, Alignment: 8
##### Params

- <a href="#descriptor_fadvise.self" name="descriptor_fadvise.self"></a> `self`: handle<descriptor>
- <a href="#descriptor_fadvise.offset" name="descriptor_fadvise.offset"></a> `offset`: `u64`
- <a href="#descriptor_fadvise.len" name="descriptor_fadvise.len"></a> `len`: `u64`
- <a href="#descriptor_fadvise.offset" name="descriptor_fadvise.offset"></a> `offset`: [`filesize`](#filesize)
- <a href="#descriptor_fadvise.len" name="descriptor_fadvise.len"></a> `len`: [`size`](#size)
- <a href="#descriptor_fadvise.advice" name="descriptor_fadvise.advice"></a> `advice`: [`advice`](#advice)
##### Results

Expand Down Expand Up @@ -693,7 +693,7 @@ Size: 16, Alignment: 8
- <a href="#descriptor_info.self" name="descriptor_info.self"></a> `self`: handle<descriptor>
##### Results

- result<[`info`](#info), [`errno`](#errno)>
- result<[`fd-info`](#fd_info), [`errno`](#errno)>

----

Expand Down
12 changes: 6 additions & 6 deletions wasi-filesystem.wit.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ type filedelta = s64
type timestamp = u64
```

## `info`
## `fd-info`
```wit
/// Information associated with a descriptor.
///
/// Note: This was called `fdstat` in earlier versions of WASI.
record info {
record fd-info {
/// The type of filesystem object referenced by a descriptor.
%type: %type,
/// Flags associated with a descriptor.
Expand Down Expand Up @@ -413,15 +413,15 @@ resource descriptor {
/// This is similar to `posix_fadvise` in POSIX.
fadvise: func(
/// The offset within the file to which the advisory applies.
offset: u64,
offset: filesize,
/// The length of the region to which the advisory applies.
len: u64,
len: size,
/// The advice.
advice: advice
) -> result<_, errno>
```

## `fdatasync`
## `datasync`
```wit
/// Synchronize the data of a file to disk.
///
Expand All @@ -437,7 +437,7 @@ datasync: func() -> result<_, errno>
/// as additional fields.
///
/// Note: This was called `fdstat_get` in earlier versions of WASI.
info: func() -> result<info, errno>
info: func() -> result<fd-info, errno>
```

## `set-size`
Expand Down

0 comments on commit ba4706d

Please sign in to comment.