-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename `preview2/` to `wasip2/` * Update to v0.2.1
- Loading branch information
1 parent
3561990
commit 74a1d20
Showing
41 changed files
with
564 additions
and
147 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package wasi:cli@0.2.1; | ||
|
||
@since(version = 0.2.0) | ||
world command { | ||
@since(version = 0.2.0) | ||
include imports; | ||
|
||
@since(version = 0.2.0) | ||
export run; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@since(version = 0.2.0) | ||
interface exit { | ||
/// Exit the current instance and any linked instances. | ||
@since(version = 0.2.0) | ||
exit: func(status: result); | ||
|
||
/// Exit the current instance and any linked instances, reporting the | ||
/// specified status code to the host. | ||
/// | ||
/// The meaning of the code depends on the context, with 0 usually meaning | ||
/// "success", and other values indicating various types of failure. | ||
/// | ||
/// This function does not return; the effect is analogous to a trap, but | ||
/// without the connotation that something bad has happened. | ||
@unstable(feature = cli-exit-with-code) | ||
exit-with-code: func(status-code: u8); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package wasi:cli@0.2.1; | ||
|
||
@since(version = 0.2.0) | ||
world imports { | ||
@since(version = 0.2.0) | ||
include wasi:clocks/imports@0.2.1; | ||
@since(version = 0.2.0) | ||
include wasi:filesystem/imports@0.2.1; | ||
@since(version = 0.2.0) | ||
include wasi:sockets/imports@0.2.1; | ||
@since(version = 0.2.0) | ||
include wasi:random/imports@0.2.1; | ||
@since(version = 0.2.0) | ||
include wasi:io/imports@0.2.1; | ||
|
||
@since(version = 0.2.0) | ||
import environment; | ||
@since(version = 0.2.0) | ||
import exit; | ||
@since(version = 0.2.0) | ||
import stdin; | ||
@since(version = 0.2.0) | ||
import stdout; | ||
@since(version = 0.2.0) | ||
import stderr; | ||
@since(version = 0.2.0) | ||
import terminal-input; | ||
@since(version = 0.2.0) | ||
import terminal-output; | ||
@since(version = 0.2.0) | ||
import terminal-stdin; | ||
@since(version = 0.2.0) | ||
import terminal-stdout; | ||
@since(version = 0.2.0) | ||
import terminal-stderr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@since(version = 0.2.0) | ||
interface run { | ||
/// Run the program. | ||
@since(version = 0.2.0) | ||
run: func() -> result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@since(version = 0.2.0) | ||
interface stdin { | ||
@since(version = 0.2.0) | ||
use wasi:io/streams@0.2.1.{input-stream}; | ||
|
||
@since(version = 0.2.0) | ||
get-stdin: func() -> input-stream; | ||
} | ||
|
||
@since(version = 0.2.0) | ||
interface stdout { | ||
@since(version = 0.2.0) | ||
use wasi:io/streams@0.2.1.{output-stream}; | ||
|
||
@since(version = 0.2.0) | ||
get-stdout: func() -> output-stream; | ||
} | ||
|
||
@since(version = 0.2.0) | ||
interface stderr { | ||
@since(version = 0.2.0) | ||
use wasi:io/streams@0.2.1.{output-stream}; | ||
|
||
@since(version = 0.2.0) | ||
get-stderr: func() -> output-stream; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,38 +7,43 @@ package wasi:[email protected]; | |
/// | ||
/// A monotonic clock is a clock which has an unspecified initial value, and | ||
/// successive reads of the clock will produce non-decreasing values. | ||
/// | ||
/// It is intended for measuring elapsed time. | ||
@since(version = 0.2.0) | ||
interface monotonic-clock { | ||
@since(version = 0.2.0) | ||
use wasi:io/poll@0.2.0.{pollable}; | ||
|
||
/// An instant in time, in nanoseconds. An instant is relative to an | ||
/// unspecified initial value, and can only be compared to instances from | ||
/// the same monotonic-clock. | ||
@since(version = 0.2.0) | ||
type instant = u64; | ||
|
||
/// A duration of time, in nanoseconds. | ||
@since(version = 0.2.0) | ||
type duration = u64; | ||
|
||
/// Read the current value of the clock. | ||
/// | ||
/// The clock is monotonic, therefore calling this function repeatedly will | ||
/// produce a sequence of non-decreasing values. | ||
@since(version = 0.2.0) | ||
now: func() -> instant; | ||
|
||
/// Query the resolution of the clock. Returns the duration of time | ||
/// corresponding to a clock tick. | ||
@since(version = 0.2.0) | ||
resolution: func() -> duration; | ||
|
||
/// Create a `pollable` which will resolve once the specified instant | ||
/// occured. | ||
/// has occured. | ||
@since(version = 0.2.0) | ||
subscribe-instant: func( | ||
when: instant, | ||
) -> pollable; | ||
|
||
/// Create a `pollable` which will resolve once the given duration has | ||
/// elapsed, starting at the time at which this function was called. | ||
/// occured. | ||
/// Create a `pollable` that will resolve after the specified duration has | ||
/// elapsed from the time this function is invoked. | ||
@since(version = 0.2.0) | ||
subscribe-duration: func( | ||
when: duration, | ||
) -> pollable; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package wasi:clocks@0.2.0; | ||
|
||
@unstable(feature = clocks-timezone) | ||
interface timezone { | ||
@unstable(feature = clocks-timezone) | ||
use wall-clock.{datetime}; | ||
|
||
/// Return information needed to display the given `datetime`. This includes | ||
/// the UTC offset, the time zone name, and a flag indicating whether | ||
/// daylight saving time is active. | ||
/// | ||
/// If the timezone cannot be determined for the given `datetime`, return a | ||
/// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight | ||
/// saving time. | ||
@unstable(feature = clocks-timezone) | ||
display: func(when: datetime) -> timezone-display; | ||
|
||
/// The same as `display`, but only return the UTC offset. | ||
@unstable(feature = clocks-timezone) | ||
utc-offset: func(when: datetime) -> s32; | ||
|
||
/// Information useful for displaying the timezone of a specific `datetime`. | ||
/// | ||
/// This information may vary within a single `timezone` to reflect daylight | ||
/// saving time adjustments. | ||
@unstable(feature = clocks-timezone) | ||
record timezone-display { | ||
/// The number of seconds difference between UTC time and the local | ||
/// time of the timezone. | ||
/// | ||
/// The returned value will always be less than 86400 which is the | ||
/// number of seconds in a day (24*60*60). | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should return 0. | ||
utc-offset: s32, | ||
|
||
/// The abbreviated name of the timezone to display to a user. The name | ||
/// `UTC` indicates Coordinated Universal Time. Otherwise, this should | ||
/// reference local standards for the name of the time zone. | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should be the string `UTC`. | ||
/// | ||
/// In time zones that do not have an applicable name, a formatted | ||
/// representation of the UTC offset may be returned, such as `-04:00`. | ||
name: string, | ||
|
||
/// Whether daylight saving time is active. | ||
/// | ||
/// In implementations that do not expose an actual time zone, this | ||
/// should return false. | ||
in-daylight-saving-time: bool, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,10 @@ package wasi:[email protected]; | |
/// monotonic, making it unsuitable for measuring elapsed time. | ||
/// | ||
/// It is intended for reporting the current date and time for humans. | ||
@since(version = 0.2.0) | ||
interface wall-clock { | ||
/// A time and date in seconds plus nanoseconds. | ||
@since(version = 0.2.0) | ||
record datetime { | ||
seconds: u64, | ||
nanoseconds: u32, | ||
|
@@ -33,10 +35,12 @@ interface wall-clock { | |
/// | ||
/// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 | ||
/// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time | ||
@since(version = 0.2.0) | ||
now: func() -> datetime; | ||
|
||
/// Query the resolution of the clock. | ||
/// | ||
/// The nanoseconds field of the output is always less than 1000000000. | ||
@since(version = 0.2.0) | ||
resolution: func() -> datetime; | ||
} |
Oops, something went wrong.