Skip to content

Commit

Permalink
Remove __wasi_ and __WASI_ prefixes from names in comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Sep 12, 2019
1 parent c760e95 commit 5e5a29c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 74 deletions.
141 changes: 69 additions & 72 deletions design/wasi_unstable/typenames.witx
Original file line number Diff line number Diff line change
Expand Up @@ -197,79 +197,78 @@
;; File descriptor rights, determining which actions may be performed.
(typename $rights_t
(flags u64
;; The right to invoke `__wasi_fd_datasync()`.
;; The right to invoke `fd_datasync`.
;;
;; If `__WASI_RIGHT_PATH_OPEN` is set, includes the right to invoke
;; `__wasi_path_open()` with `__WASI_FDFLAG_DSYNC`.
;; If `RIGHT_PATH_OPEN` is set, includes the right to invoke
;; `path_open` with `FDFLAG_DSYNC`.
(flag $RIGHT_FD_DATASYNC)
;; The right to invoke `__wasi_fd_read()` and `__wasi_sock_recv()`.
;; The right to invoke `fd_read` and `sock_recv`.
;;
;; If `__WASI_RIGHT_FD_SEEK` is set, includes the right to invoke
;; `__wasi_fd_pread()`.
;; If `RIGHT_FD_SEEK` is set, includes the right to invoke `fd_pread`.
(flag $RIGHT_FD_READ)
;; The right to invoke `__wasi_fd_seek()`. This flag implies `__WASI_RIGHT_FD_TELL`.
;; The right to invoke `fd_seek`. This flag implies `RIGHT_FD_TELL`.
(flag $RIGHT_FD_SEEK)
;; The right to invoke `__wasi_fd_fdstat_set_flags()`.
;; The right to invoke `fd_fdstat_set_flags`.
(flag $RIGHT_FD_FDSTAT_SET_FLAGS)
;; The right to invoke `__wasi_fd_sync()`.
;; The right to invoke `fd_sync`.
;;
;; If `__WASI_RIGHT_PATH_OPEN` is set, includes the right to invoke
;; `__wasi_path_open()` with `__WASI_FDFLAG_RSYNC` and `__WASI_FDFLAG_DSYNC`.
;; If `RIGHT_PATH_OPEN` is set, includes the right to invoke
;; `path_open` with `FDFLAG_RSYNC` and `FDFLAG_DSYNC`.
(flag $RIGHT_FD_SYNC)
;; The right to invoke `__wasi_fd_seek()` in such a way that the file offset
;; remains unaltered (i.e., `__WASI_WHENCE_CUR` with offset zero), or to
;; invoke `__wasi_fd_tell()`.
;; The right to invoke `fd_seek` in such a way that the file offset
;; remains unaltered (i.e., `WHENCE_CUR` with offset zero), or to
;; invoke `fd_tell`.
(flag $RIGHT_FD_TELL)
;; The right to invoke `__wasi_fd_write()` and `__wasi_sock_send()`.
;; If `__WASI_RIGHT_FD_SEEK` is set, includes the right to invoke `__wasi_fd_pwrite()`.
;; The right to invoke `fd_write` and `sock_send`.
;; If `RIGHT_FD_SEEK` is set, includes the right to invoke `fd_pwrite`.
(flag $RIGHT_FD_WRITE)
;; The right to invoke `__wasi_fd_advise()`.
;; The right to invoke `fd_advise`.
(flag $RIGHT_FD_ADVISE)
;; The right to invoke `__wasi_fd_allocate()`.
;; The right to invoke `fd_allocate`.
(flag $RIGHT_FD_ALLOCATE)
;; The right to invoke `__wasi_path_create_directory()`.
;; The right to invoke `path_create_directory`.
(flag $RIGHT_PATH_CREATE_DIRECTORY)
;; If `__WASI_RIGHT_PATH_OPEN` is set, the right to invoke `__wasi_path_open()` with `__WASI_O_CREAT`.
;; If `RIGHT_PATH_OPEN` is set, the right to invoke `path_open` with `O_CREAT`.
(flag $RIGHT_PATH_CREATE_FILE)
;; The right to invoke `__wasi_path_link()` with the file descriptor as the
;; The right to invoke `path_link` with the file descriptor as the
;; source directory.
(flag $RIGHT_PATH_LINK_SOURCE)
;; The right to invoke `__wasi_path_link()` with the file descriptor as the
;; The right to invoke `path_link` with the file descriptor as the
;; target directory.
(flag $RIGHT_PATH_LINK_TARGET)
;; The right to invoke `__wasi_path_open()`.
;; The right to invoke `path_open`.
(flag $RIGHT_PATH_OPEN)
;; The right to invoke `__wasi_fd_readdir()`.
;; The right to invoke `fd_readdir`.
(flag $RIGHT_FD_READDIR)
;; The right to invoke `__wasi_path_readlink()`.
;; The right to invoke `path_readlink`.
(flag $RIGHT_PATH_READLINK)
;; The right to invoke `__wasi_path_rename()` with the file descriptor as the source directory.
;; The right to invoke `path_rename` with the file descriptor as the source directory.
(flag $RIGHT_PATH_RENAME_SOURCE)
;; The right to invoke `__wasi_path_rename()` with the file descriptor as the target directory.
;; The right to invoke `path_rename` with the file descriptor as the target directory.
(flag $RIGHT_PATH_RENAME_TARGET)
;; The right to invoke `__wasi_path_filestat_get()`.
;; The right to invoke `path_filestat_get`.
(flag $RIGHT_PATH_FILESTAT_GET)
;; The right to change a file's size (there is no `__wasi_path_filestat_set_size()`).
;; If `__WASI_RIGHT_PATH_OPEN` is set, includes the right to invoke `__wasi_path_open()` with `__WASI_O_TRUNC`.
;; The right to change a file's size (there is no `path_filestat_set_size`).
;; If `RIGHT_PATH_OPEN` is set, includes the right to invoke `path_open` with `O_TRUNC`.
(flag $RIGHT_PATH_FILESTAT_SET_SIZE)
;; The right to invoke `__wasi_path_filestat_set_times()`.
;; The right to invoke `path_filestat_set_times`.
(flag $RIGHT_PATH_FILESTAT_SET_TIMES)
;; The right to invoke `__wasi_fd_filestat_get()`.
;; The right to invoke `fd_filestat_get`.
(flag $RIGHT_FD_FILESTAT_GET)
;; The right to invoke `__wasi_fd_filestat_set_size()`.
;; The right to invoke `fd_filestat_set_size`.
(flag $RIGHT_FD_FILESTAT_SET_SIZE)
;; The right to invoke `__wasi_fd_filestat_set_times()`.
;; The right to invoke `fd_filestat_set_times`.
(flag $RIGHT_FD_FILESTAT_SET_TIMES)
;; The right to invoke `__wasi_path_symlink()`.
;; The right to invoke `path_symlink`.
(flag $RIGHT_PATH_SYMLINK)
;; The right to invoke `__wasi_path_unlink_file()`.
;; The right to invoke `path_unlink_file`.
(flag $RIGHT_PATH_UNLINK_FILE)
;; The right to invoke `__wasi_path_remove_directory()`.
;; The right to invoke `path_remove_directory`.
(flag $RIGHT_PATH_REMOVE_DIRECTORY)
;; If `__WASI_RIGHT_FD_READ` is set, includes the right to invoke `__wasi_poll_oneoff()` to subscribe to `__WASI_EVENTTYPE_FD_READ`.
;; If `__WASI_RIGHT_FD_WRITE` is set, includes the right to invoke `__wasi_poll_oneoff()` to subscribe to `__WASI_EVENTTYPE_FD_WRITE`.
;; If `RIGHT_FD_READ` is set, includes the right to invoke `poll_oneoff` to subscribe to `EVENTTYPE_FD_READ`.
;; If `RIGHT_FD_WRITE` is set, includes the right to invoke `poll_oneoff` to subscribe to `EVENTTYPE_FD_WRITE`.
(flag $RIGHT_POLL_FD_READWRITE)
;; The right to invoke `__wasi_sock_shutdown()`.
;; The right to invoke `sock_shutdown`.
(flag $RIGHT_SOCK_SHUTDOWN)
)
)
Expand Down Expand Up @@ -381,15 +380,13 @@
;; Rights that apply to this file descriptor.
(field $fs_rights_base $rights_t)
;; Maximum set of rights that may be installed on new file descriptors that
;; are created through this file descriptor, e.g., through
;; `__wasi_path_open()`.
;; are created through this file descriptor, e.g., through `path_open`.
(field $fs_rights_inheriting $rights_t)
)
)

;; Identifier for a device containing a file system. Can be used in combination
;; with __wasi_inode_t to uniquely identify a file or directory in the
;; filesystem.
;; with `inode_t` to uniquely identify a file or directory in the filesystem.
(typename $device_t u64)

;; The type of a file descriptor or file.
Expand Down Expand Up @@ -417,13 +414,13 @@
;; Which file time attributes to adjust.
(typename $fstflags_t
(flags u16
;; Adjust the last data access timestamp to the value stored in __wasi_filestat_t::st_atim.
;; Adjust the last data access timestamp to the value stored in `filestat_t::st_atim`.
(flag $FILESTAT_SET_ATIM)
;; Adjust the last data access timestamp to the time of clock `__WASI_CLOCK_REALTIME`.
;; Adjust the last data access timestamp to the time of clock `CLOCK_REALTIME`.
(flag $FILESTAT_SET_ATIM_NOW)
;; Adjust the last data modification timestamp to the value stored in __wasi_filestat_t::st_mtim.
;; Adjust the last data modification timestamp to the value stored in `filestat_t::st_mtim`.
(flag $FILESTAT_SET_MTIM)
;; Adjust the last data modification timestamp to the time of clock `__WASI_CLOCK_REALTIME`.
;; Adjust the last data modification timestamp to the time of clock `CLOCK_REALTIME`.
(flag $FILESTAT_SET_MTIM_NOW)
)
)
Expand All @@ -439,7 +436,7 @@
)
)

;; Open flags used by `__wasi_path_open()`.
;; Open flags used by `path_open`.
(typename $oflags_t
(flags u16
;; Create file if it does not exist.
Expand Down Expand Up @@ -485,7 +482,7 @@
;; An event that occurred.
(typename $event_t
(struct
;; User-provided value that got attached to __wasi_subscription_t::userdata.
;; User-provided value that got attached to `subscription_t::userdata`.
(field $userdata $userdata_t)
;; If non-zero, an error that occurred while processing the subscription request.
(field $error $errno_t)
Expand All @@ -499,13 +496,13 @@
;; The contents of an $event_t.
(typename $event_u
(union
;; When type is `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`:
;; When type is `EVENTTYPE_FD_READ` or `EVENTTYPE_FD_WRITE`:
(field $fd_readwrite $event_fd_readwrite_t)
)
)

;; The contents of an $event_t when type is `__WASI_EVENTTYPE_FD_READ` or
;; `__WASI_EVENTTYPE_FD_WRITE`.
;; The contents of an $event_t when type is `EVENTTYPE_FD_READ` or
;; `EVENTTYPE_FD_WRITE`.
(typename $event_fd_readwrite_t
(struct
;; The number of bytes available for reading or writing.
Expand All @@ -516,7 +513,7 @@
)

;; The state of the file descriptor subscribed to with
;; `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`.
;; `EVENTTYPE_FD_READ` or `EVENTTYPE_FD_WRITE`.
(typename $eventrwflags_t
(flags u16
;; The peer of this socket has closed or disconnected.
Expand All @@ -527,27 +524,27 @@
;; Type of a subscription to an event or its occurrence.
(typename $eventtype_t
(flags u8
;; The time value of clock __wasi_subscription_t::u.clock.clock_id has
;; reached timestamp __wasi_subscription_t::u.clock.timeout.
;; The time value of clock `subscription_t::u.clock.clock_id` has
;; reached timestamp `subscription_t::u.clock.timeout`.
(flag $EVENTTYPE_CLOCK)
;; File descriptor __wasi_subscription_t::u.fd_readwrite.fd has data
;; File descriptor `subscription_t::u.fd_readwrite.fd` has data
;; available for reading. This event always triggers for regular files.
(flag $EVENTTYPE_FD_READ)
;; File descriptor __wasi_subscription_t::u.fd_readwrite.fd has capacity
;; File descriptor `subscription_t::u.fd_readwrite.fd` has capacity
;; available for writing. This event always triggers for regular files.
(flag $EVENTTYPE_FD_WRITE)
)
)

;; Flags determining how to interpret the timestamp provided in
;; __wasi_subscription_t::u.clock.timeout.
;; `subscription_t::u.clock.timeout.`
(typename $subclockflags_t
(flags u16
;; If set, treat the timestamp provided in
;; __wasi_subscription_t::u.clock.timeout as an absolute timestamp of clock
;; __wasi_subscription_t::u.clock.clock_id. If clear, treat the timestamp
;; provided in __wasi_subscription_t::u.clock.timeout relative to the
;; current time value of clock __wasi_subscription_t::u.clock.clock_id.
;; `subscription_t::u.clock.timeout` as an absolute timestamp of clock
;; `subscription_t::u.clock.clock_id.` If clear, treat the timestamp
;; provided in `subscription_t::u.clock.timeout` relative to the
;; current time value of clock `subscription_t::u.clock.clock_id.`
(flag $SUBSCRIPTION_CLOCK_ABSTIME)
)
)
Expand All @@ -556,7 +553,7 @@
(typename $subscription_t
(struct
;; User-provided value that is attached to the subscription in the
;; implementation and returned through __wasi_event_t::userdata.
;; implementation and returned through `event_t::userdata`.
(field $userdata $userdata_t)
;; The type of the event to which to subscribe.
(field $type $eventtype_t)
Expand All @@ -568,14 +565,14 @@
;; The contents of a $subscription_t.
(typename $subscription_u
(union
;; When type is `__WASI_EVENTTYPE_CLOCK`:
;; When type is `EVENTTYPE_CLOCK`:
(field $clock $subscription_clock_t)
;; When type is `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`:
;; When type is `EVENTTYPE_FD_READ` or `EVENTTYPE_FD_WRITE`:
(field $fd_readwrite $subscription_fd_readwrite_t)
)
)

;; The contents of a $subscription_t when type is `__WASI_EVENTTYPE_CLOCK`.
;; The contents of a $subscription_t when type is `EVENTTYPE_CLOCK`.
(typename $subscription_clock_t
(struct
;; The user-defined unique identifier of the clock.
Expand All @@ -593,7 +590,7 @@
)

;; The contents of a $subscription_t when type is type is
;; `__WASI_EVENTTYPE_FD_READ` or `__WASI_EVENTTYPE_FD_WRITE`.
;; `EVENTTYPE_FD_READ` or `EVENTTYPE_FD_WRITE`.
(typename $subscription_fd_readwrite_t
(struct
;; The file descriptor on which to wait for it to become ready for reading or writing.
Expand Down Expand Up @@ -688,7 +685,7 @@
)
)

;; Flags provided to `__wasi_sock_recv()`.
;; Flags provided to `sock_recv`.
(typename $riflags_t
(flags u16
;; Returns the message without removing it from the socket's receive queue.
Expand All @@ -698,15 +695,15 @@
)
)

;; Flags returned by `__wasi_sock_recv()`.
;; Flags returned by `sock_recv`.
(typename $roflags_t
(flags u16
;; Returned by `__wasi_sock_recv()`: Message data has been truncated.
;; Returned by `sock_recv`: Message data has been truncated.
(flag $SOCK_RECV_DATA_TRUNCATED)
)
)

;; Flags provided to `__wasi_sock_send()`. As there are currently no flags
;; Flags provided to `sock_send`. As there are currently no flags
;; defined, it must be set to zero.
(typename $siflags_t u16)

Expand Down
4 changes: 2 additions & 2 deletions design/wasi_unstable/wasi_unstable.witx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
)

;; Remove a directory.
;; Return `__WASI_ENOTEMPTY` if the directory is not empty.
;; Return `ENOTEMPTY` if the directory is not empty.
;; Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
(@interface func (export "path_remove_directory")
(param $fd $fd_t)
Expand Down Expand Up @@ -427,7 +427,7 @@


;; Unlink a file.
;; Return `__WASI_EISDIR` if the path refers to a directory.
;; Return `EISDIR` if the path refers to a directory.
;; Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
(@interface func (export "path_unlink_file")
(param $fd $fd_t)
Expand Down

0 comments on commit 5e5a29c

Please sign in to comment.