hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 7e89859138660adc267f51de1a9ca05a39c953cd
parent a5a4b7c79bd19e7d4e471cc873d01cadae0cfc6a
Author: Alexey Yerin <yyp@disroot.org>
Date:   Wed, 30 Mar 2022 14:13:23 +0300

Fix undefined references throughout stdlib

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mbufio/README | 6+++---
Mcrypto/aes/xts/xts.ha | 2+-
Mcrypto/hmac/hmac.ha | 2+-
Mcrypto/hmac/sha256.ha | 2+-
Mhare/parse/README | 2+-
Mhare/types/store.ha | 12++++++------
Mhare/unparse/decl.ha | 2+-
Mhare/unparse/expr.ha | 2+-
Mhare/unparse/import.ha | 2+-
Mhare/unparse/type.ha | 2+-
Mhare/unparse/unit.ha | 2+-
Mlinux/io_uring/sqe.ha | 12++++++------
Mlinux/io_uring/uring.ha | 6+++---
Mmath/fenv_func.ha | 2+-
Mmath/floats.ha | 8++++----
Mnet/dial/resolve.ha | 2+-
Mnet/unix/cmsg.ha | 2+-
17 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/bufio/README b/bufio/README @@ -11,9 +11,9 @@ bufio-managed dynamically allocated buffer. This creates an [[io::stream]] which efficiently soaks up writes into a dynamically allocated byte slice. Both [[fixed]] and [[dynamic]] provide access to the underlying buffer via -[[buffer]] or [[finish]]. The user may also call [[reset]], which empties the -buffer but does not free the underlying storage, allowing the user to re-use the -same buffer for many operations. +[[buffer]]. The user may also call [[reset]], which empties the buffer but does +not free the underlying storage, allowing the user to re-use the same buffer +for many operations. A third stream implementation, [[buffered]], is used to batch read and write operations against an underlying stream. The caller may use small, frequent read diff --git a/crypto/aes/xts/xts.ha b/crypto/aes/xts/xts.ha @@ -32,7 +32,7 @@ export fn init(b: *block, key: []u8) void = { def GF_128_FDBK: u8 = 0x87; // Encrypts a block given its 'sector' number. The block must be a multiple of -// [[aes::BLOCKSIZE]] (16 bytes) in length. +// [[crypto::aes::BLOCKSIZE]] (16 bytes) in length. export fn encrypt(b: *block, dest: []u8, src: []u8, sector: u64) void = { assert(len(src) == len(dest) && len(src) % aes::BLOCKSIZE == 0); diff --git a/crypto/hmac/hmac.ha b/crypto/hmac/hmac.ha @@ -17,7 +17,7 @@ export type state = struct { // [[hash::bsz]] bytes. Use the BLOCKSIZE constant of the given hash function to // allocate the memory statically. // -// The caller must take extra care to call [[mac::finish]] when they are +// The caller must take extra care to call [[crypto::mac::finish]] when they are // finished using the MAC function, which, in addition to freeing state // associated with the MAC, will securely erase state which contains secret // information. diff --git a/crypto/hmac/sha256.ha b/crypto/hmac/sha256.ha @@ -15,7 +15,7 @@ export type sha256state = struct { // Creates a [[crypto::mac::mac]] that computes an HMAC with given 'key' using // SHA256 as underlying hash function. // -// The caller must take extra care to call [[mac::finish]] when they are +// The caller must take extra care to call [[crypto::mac::finish]] when they are // finished using the MAC function, which, in addition to freeing state // associated with the MAC, will securely erase state which contains secret // information. diff --git a/hare/parse/README b/hare/parse/README @@ -1,7 +1,7 @@ hare::parse provides a parser for Hare source code. The [[subunit]] function will parse a single Hare source file and return a [[hare::ast::subunit]]. Other functions provide parsers for various important Hare sub-terminals, such as -[[expression]]s and [[imports]]. See the Hare specification for more details: +[[decls]] and [[imports]]. See the Hare specification for more details: https://harelang.org/specification diff --git a/hare/types/store.ha b/hare/types/store.ha @@ -9,8 +9,8 @@ use sort; def BUCKETS: size = 65535; -// A function which evaluates an [[ast::expr]], providing either a size result -// or an error. +// A function which evaluates a [[hare::ast::expr]], providing either a size +// result or an error. export type resolver = fn( rstate: nullable *void, store: *typestore, @@ -29,9 +29,9 @@ export type typestore = struct { }; // Initializes a new type store. Optionally, provide a function which -// type-checks and evaluates an [[ast::expr]]. If a resolver is not provided, -// looking up types with an expression component (e.g. [2 + 2]int) will return -// [[noresolver]]. +// type-checks and evaluates an [[hare::ast::expr]]. If a resolver is not +// provided, looking up types with an expression component (e.g. [2 + 2]int) +// will return [[noresolver]]. export fn store( arch: arch, resolver: nullable *resolver, @@ -66,7 +66,7 @@ export type noresolver = !void; // All possible errors for [[lookup]]. export type error = !(noresolver | errors::opaque); -// Retrieves a [[_type]] for a given [[ast::_type]]. +// Retrieves a [[_type]] for a given [[hare::ast::_type]]. export fn lookup( store: *typestore, ty: *ast::_type, diff --git a/hare/unparse/decl.ha b/hare/unparse/decl.ha @@ -10,7 +10,7 @@ use hare::lex; use strings; use strio; -// Unparses an [[ast::decl]]. +// Unparses a [[hare::ast::decl]]. export fn decl(out: io::handle, d: ast::decl) (size | io::error) = { let n = 0z; if (len(d.docs) > 0) { diff --git a/hare/unparse/expr.ha b/hare/unparse/expr.ha @@ -11,7 +11,7 @@ use hare::lex::{ltok}; use hare::lex; use strings; -// Unparses an [[ast::expr]]. +// Unparses a [[hare::ast::expr]]. export fn expr( out: io::handle, indent: size, diff --git a/hare/unparse/import.ha b/hare/unparse/import.ha @@ -7,7 +7,7 @@ use io; use hare::ast; use strio; -// Unparses an [[ast::import]]. +// Unparses a [[hare::ast::import]]. export fn import(out: io::handle, import: ast::import) (size | io::error) = { let n = 0z; n += fmt::fprint(out, "use ")?; diff --git a/hare/unparse/type.ha b/hare/unparse/type.ha @@ -130,7 +130,7 @@ fn struct_union_type( return z; }; -// Unparses an [[ast::_type]]. +// Unparses a [[hare::ast::_type]]. export fn _type( out: io::handle, indent: size, diff --git a/hare/unparse/unit.ha b/hare/unparse/unit.ha @@ -5,7 +5,7 @@ use io; use fmt; use hare::ast; -// Unparses an [[ast::subunit]]. +// Unparses a [[hare::ast::subunit]]. export fn subunit(out: io::handle, s: ast::subunit) (size | io::error) = { let n = 0z; for (let i = 0z; i < len(s.imports); i += 1) { diff --git a/linux/io_uring/sqe.ha b/linux/io_uring/sqe.ha @@ -148,7 +148,7 @@ export fn fsync( // Adds a request to poll a file descriptor for the given set of poll events. // This will only happen once, the poll request must be submitted with a new SQE -// to re-poll the file descriptor later. The caller must call [[setuser]] to +// to re-poll the file descriptor later. The caller must call [[set_user]] to // provide a user data field in order to use [[poll_remove]] to remove this poll // request later. export fn poll_add( @@ -163,7 +163,7 @@ export fn poll_add( }; // Removes an existing poll request by matching the SQE's user_data field. See -// [[setuser]]. +// [[set_user]]. export fn poll_remove(sqe: *sqe, user_data: *void, flags: flags...) void = { preprw(sqe, op::POLL_REMOVE, -1, null, 0, 0, flags...); set_user(sqe, user_data); @@ -228,7 +228,7 @@ export fn recv( // Prepares a timeout operation for an [[sqe]]. "ts" should be a timespec // describing the desired timeout, and "events" may optionally be used to define // a number of completion events to wake after (or zero to wake only after the -// timeout expires). The caller must call [[setuser]] to provide a user data +// timeout expires). The caller must call [[set_user]] to provide a user data // field in order to use [[timeout_remove]] to cancel this timeout later. export fn timeout( sqe: *sqe, @@ -242,7 +242,7 @@ export fn timeout( }; // Removes an existing timeout request by matching the SQE's user_data field. -// See [[setuser]]. +// See [[set_user]]. export fn timeout_remove( sqe: *sqe, user_data: *void, @@ -254,7 +254,7 @@ export fn timeout_remove( }; // Updates an existing timeout request by matching the SQE's user_data field. -// See [[setuser]]. +// See [[set_user]]. export fn timeout_update( sqe: *sqe, user_data: *void, @@ -271,7 +271,7 @@ export fn timeout_update( // Prepares a timeout operation for an [[sqe]] which is linked to the previous // SQE, effectively setting an upper limit on how long that SQE can take to // complete. "ts" should be a timespec describing the desired timeout. The -// caller must call [[setuser]] to provide a user data field in order to use +// caller must call [[set_user]] to provide a user data field in order to use // [[timeout_remove]] to cancel this timeout later. export fn link_timeout( sqe: *sqe, diff --git a/linux/io_uring/uring.ha b/linux/io_uring/uring.ha @@ -207,7 +207,7 @@ export type cqring_flags = enum u32 { EVENTFD_DISABLED = 1 << 0, }; -// Flags for [[setup]]. +// Flags for setup operation. export type setup_flags = enum u32 { NONE = 0, // io_context is polled @@ -252,7 +252,7 @@ export type features = enum u32 { POLL_32BITS = 1 << 6, }; -// Flags for [[enter]]. +// Flags for enter operation. export type enter_flags = enum uint { NONE = 0, GETEVENTS = 1 << 0, @@ -260,7 +260,7 @@ export type enter_flags = enum uint { SQ_WAIT = 1 << 2, }; -// Operations for [[register]]. +// Register operations. export type regop = enum uint { REGISTER_BUFFERS, UNREGISTER_BUFFERS, diff --git a/math/fenv_func.ha b/math/fenv_func.ha @@ -10,7 +10,7 @@ export fn clearexcept(ex: fexcept) void = rt::feclearexcept(ex: uint); // exceptions corresponding to the given flags. export fn raiseexcept(ex: fexcept) void = rt::feraiseexcept(ex: uint); -// Accepts a set of flags from [[except]] ORed together and returns +// Accepts a set of flags from [[fexcept]] ORed together and returns // the subset that is currently raised export fn testexcept(ex: fexcept) fexcept = rt::fetestexcept(ex: uint): fexcept; diff --git a/math/floats.ha b/math/floats.ha @@ -764,8 +764,8 @@ export fn modfracf32(n: f32) (i32, f32) = { assert(res.1 == 0.50f32); }; -// Returns the f32 that is closest to [[x]] in direction of [[y]]. Returns NaN -// if either parameter is NaN. Returns [[x]] if both parameters are same. +// Returns the f32 that is closest to 'x' in direction of 'y'. Returns NaN +// if either parameter is NaN. Returns 'x' if both parameters are same. export fn nextafterf32(x: f32, y: f32) f32 = { if (isnan(x) || isnan(y)) { return x + y; @@ -791,8 +791,8 @@ export fn nextafterf32(x: f32, y: f32) f32 = { return f32frombits(ux); }; -// Returns the f64 that is closest to [[x]] in direction of [[y]]. Returns NaN -// if either parameter is NaN. Returns [[x]] if both parameters are same. +// Returns the f64 that is closest to 'x' in direction of 'y' Returns NaN +// if either parameter is NaN. Returns 'x' if both parameters are same. export fn nextafterf64(x: f64, y: f64) f64 = { if (isnan(x) || isnan(y)) { return x + y; diff --git a/net/dial/resolve.ha b/net/dial/resolve.ha @@ -12,7 +12,7 @@ use unix::hosts; // including /etc/hosts lookup and SRV resolution, and returns a list of // candidate IP addresses and the appropriate port, or an error. // -// The caller must free the [[ip::addr]] slice. +// The caller must free the [[net::ip::addr]] slice. export fn resolve( proto: str, addr: str, diff --git a/net/unix/cmsg.ha b/net/unix/cmsg.ha @@ -21,7 +21,7 @@ export fn allocfiles(buf: *net::msghdr, nfile: size) void = { }; // Receives files from an ancillary data buffer which was previously prepared -// with [[prepfiles]]. +// with [[allocfiles]]. export fn recvfiles(buf: *net::msghdr, nfile: size) []io::file = { match (net::getcontrol(buf, nfile * size(io::file),