mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
87a8aafc4f
- add internal/wasm-tools/go.mod file to depend on wasm-tools-go
- copy package cm into src/internal/cm
- remove wasm-tools-go "vendor" submodule
internal/tools: fix typo
go.{mod,sum}, internal/tools: add wit-bindgen-go to tools
GNUmakefile: use go run for wit-bindgen-go
GNUmakefile: add tools target to go:generate tools binaries in internal/tools
GNUmakefile: add .PHONY for lint and spell
GNUmakefile, internal/cm: vendor package cm into internal/cm
go.{mod,sum}: update wasm-tools-go to v0.1.4
internal/wasi: use internal/cm package
remove submodule src/vendor/github.com/ydnar/wasm-tools-go
GNUmakefile: add comment documenting what wasi-cm target does
go.{mod,sum}: remove toolchain; go mod tidy
go.mod: revert to Go 1.19
go.mod: go 1.19
go.{mod,sum}, internal/{tools,wasm-tools}: revert root go.mod file to go1.19
Create a wasm-tools specific module that can require go1.22 for wasm-tools-go.
111 lines
3.0 KiB
Go
111 lines
3.0 KiB
Go
// Code generated by wit-bindgen-go. DO NOT EDIT.
|
|
|
|
//go:build !wasip1
|
|
|
|
// Package poll represents the imported interface "wasi:io/poll@0.2.0".
|
|
//
|
|
// A poll API intended to let users wait for I/O events on multiple handles
|
|
// at once.
|
|
package poll
|
|
|
|
import (
|
|
"internal/cm"
|
|
)
|
|
|
|
// Pollable represents the imported resource "wasi:io/poll@0.2.0#pollable".
|
|
//
|
|
// `pollable` represents a single I/O event which may be ready, or not.
|
|
//
|
|
// resource pollable
|
|
type Pollable cm.Resource
|
|
|
|
// ResourceDrop represents the imported resource-drop for resource "pollable".
|
|
//
|
|
// Drops a resource handle.
|
|
//
|
|
//go:nosplit
|
|
func (self Pollable) ResourceDrop() {
|
|
self0 := cm.Reinterpret[uint32](self)
|
|
wasmimport_PollableResourceDrop((uint32)(self0))
|
|
return
|
|
}
|
|
|
|
//go:wasmimport wasi:io/poll@0.2.0 [resource-drop]pollable
|
|
//go:noescape
|
|
func wasmimport_PollableResourceDrop(self0 uint32)
|
|
|
|
// Block represents the imported method "block".
|
|
//
|
|
// `block` returns immediately if the pollable is ready, and otherwise
|
|
// blocks until ready.
|
|
//
|
|
// This function is equivalent to calling `poll.poll` on a list
|
|
// containing only this pollable.
|
|
//
|
|
// block: func()
|
|
//
|
|
//go:nosplit
|
|
func (self Pollable) Block() {
|
|
self0 := cm.Reinterpret[uint32](self)
|
|
wasmimport_PollableBlock((uint32)(self0))
|
|
return
|
|
}
|
|
|
|
//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.block
|
|
//go:noescape
|
|
func wasmimport_PollableBlock(self0 uint32)
|
|
|
|
// Ready represents the imported method "ready".
|
|
//
|
|
// Return the readiness of a pollable. This function never blocks.
|
|
//
|
|
// Returns `true` when the pollable is ready, and `false` otherwise.
|
|
//
|
|
// ready: func() -> bool
|
|
//
|
|
//go:nosplit
|
|
func (self Pollable) Ready() (result bool) {
|
|
self0 := cm.Reinterpret[uint32](self)
|
|
result0 := wasmimport_PollableReady((uint32)(self0))
|
|
result = cm.U32ToBool((uint32)(result0))
|
|
return
|
|
}
|
|
|
|
//go:wasmimport wasi:io/poll@0.2.0 [method]pollable.ready
|
|
//go:noescape
|
|
func wasmimport_PollableReady(self0 uint32) (result0 uint32)
|
|
|
|
// Poll represents the imported function "poll".
|
|
//
|
|
// Poll for completion on a set of pollables.
|
|
//
|
|
// This function takes a list of pollables, which identify I/O sources of
|
|
// interest, and waits until one or more of the events is ready for I/O.
|
|
//
|
|
// The result `list<u32>` contains one or more indices of handles in the
|
|
// argument list that is ready for I/O.
|
|
//
|
|
// If the list contains more elements than can be indexed with a `u32`
|
|
// value, this function traps.
|
|
//
|
|
// A timeout can be implemented by adding a pollable from the
|
|
// wasi-clocks API to the list.
|
|
//
|
|
// This function does not return a `result`; polling in itself does not
|
|
// do any I/O so it doesn't fail. If any of the I/O sources identified by
|
|
// the pollables has an error, it is indicated by marking the source as
|
|
// being reaedy for I/O.
|
|
//
|
|
// poll: func(in: list<borrow<pollable>>) -> list<u32>
|
|
//
|
|
//go:nosplit
|
|
func Poll(in cm.List[Pollable]) (result cm.List[uint32]) {
|
|
in0, in1 := cm.LowerList(in)
|
|
wasmimport_Poll((*Pollable)(in0), (uint32)(in1), &result)
|
|
return
|
|
}
|
|
|
|
//go:wasmimport wasi:io/poll@0.2.0 poll
|
|
//go:noescape
|
|
func wasmimport_Poll(in0 *Pollable, in1 uint32, result *cm.List[uint32])
|