commit b791275bfb0fe5d7928c19635e75fd3d98e3ba97 parent e4166e887fc58faa4a8c46038b55b6683faa664f Author: Drew DeVault <sir@cmpwn.com> Date: Mon, 21 Feb 2022 13:33:37 +0100 all: add copyright headers Signed-off-by: Drew DeVault <sir@cmpwn.com> Diffstat:
414 files changed, 1488 insertions(+), 0 deletions(-)
diff --git a/ascii/ctype.ha b/ascii/ctype.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + def U: u8 = 0o1; def L: u8 = 0o2; def N: u8 = 0o4; diff --git a/ascii/strcmp.ha b/ascii/strcmp.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use strings; // Compares two strings by their ASCII sort order. If either string is not diff --git a/bufio/buffered.ha b/bufio/buffered.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use encoding::utf8; use errors; diff --git a/bufio/memstream.ha b/bufio/memstream.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use io; use strings; diff --git a/bufio/scanner.ha b/bufio/scanner.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use encoding::utf8; use io; diff --git a/bytes/contains.ha b/bytes/contains.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + // Returns true if a byte slice contains a byte or a sequence of bytes. export fn contains(haystack: []u8, needle: (u8 | []u8)) bool = match (needle) { case let b: u8 => diff --git a/bytes/equal.ha b/bytes/equal.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Returns true if the two byte sequences are identical. export fn equal(a: []u8, b: []u8) bool = { if (len(a) != len(b)) { diff --git a/bytes/index.ha b/bytes/index.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Returns the offset of the first instance of "needle" in a "haystack" of // bytes, or void if it is not found. export fn index(haystack: []u8, needle: (u8 | []u8)) (size | void) = { diff --git a/bytes/reverse.ha b/bytes/reverse.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Reverses a slice of bytes. export fn reverse(b: []u8) void = { if (len(b) == 0) { diff --git a/bytes/tokenize.ha b/bytes/tokenize.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use types; export type tokenizer = struct { s: []u8, d: []u8, p: size }; diff --git a/bytes/two_way.ha b/bytes/two_way.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> use types; // Implements the so called Two-way string matching algorithm by Crochemore and diff --git a/bytes/zero.ha b/bytes/zero.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Sets all bytes in a slice to zero. This is suitable for erasing private data // from a slice. export fn zero(buf: []u8) void = { diff --git a/cmd/hare/main.ha b/cmd/hare/main.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use getopt; use os; use fmt; diff --git a/cmd/hare/plan.ha b/cmd/hare/plan.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use fs; use hare::ast; diff --git a/cmd/hare/release.ha b/cmd/hare/release.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use errors; use fmt; diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -1,3 +1,8 @@ +// License: GPL-3.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use encoding::hex; use fmt; use fs; diff --git a/cmd/hare/subcmds.ha b/cmd/hare/subcmds.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use bufio; use encoding::utf8; diff --git a/cmd/harec/context.ha b/cmd/harec/context.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use io; use hare::types; diff --git a/cmd/harec/errors.ha b/cmd/harec/errors.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use hare::lex; diff --git a/cmd/harec/gen.ha b/cmd/harec/gen.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use hare::ast; diff --git a/cmd/harec/genutil.ha b/cmd/harec/genutil.ha @@ -1,3 +1,5 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use fmt; fn mklabel(ctx: *context, name: str) str = { diff --git a/cmd/harec/main.ha b/cmd/harec/main.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use fs; diff --git a/cmd/harec/qbe.ha b/cmd/harec/qbe.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use io; use hare::types; diff --git a/cmd/harec/qtype.ha b/cmd/harec/qtype.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use hare::types; use hare::types::{builtin}; diff --git a/cmd/haredoc/docstr.ha b/cmd/haredoc/docstr.ha @@ -1,3 +1,8 @@ +// License: GPL-3.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use ascii; use bufio; use encoding::utf8; diff --git a/cmd/haredoc/env.ha b/cmd/haredoc/env.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2022 Haelwenn (lanodan) Monnier <contact@hacktivis.me> use hare::module; use os::exec; use os; diff --git a/cmd/haredoc/errors.ha b/cmd/haredoc/errors.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::lex; use hare::parse; use io; diff --git a/cmd/haredoc/hare.ha b/cmd/haredoc/hare.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use hare::ast; diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha @@ -1,3 +1,10 @@ +// License: GPL-3.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2022 Byron Torres <b@torresjrjr.com> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + // Note: ast::ident should never have to be escaped use bufio; use encoding::utf8; diff --git a/cmd/haredoc/main.ha b/cmd/haredoc/main.ha @@ -1,3 +1,8 @@ +// License: GPL-3.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use bufio; use fmt; use fs; diff --git a/cmd/haredoc/resolver.ha b/cmd/haredoc/resolver.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; use hare::module; diff --git a/cmd/haredoc/sort.ha b/cmd/haredoc/sort.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use hare::ast; use sort; diff --git a/cmd/haredoc/tty.ha b/cmd/haredoc/tty.ha @@ -1,3 +1,7 @@ +// License: GPL-3.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use bufio; use fmt; diff --git a/cmd/haretype/main.ha b/cmd/haretype/main.ha @@ -1,3 +1,5 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use fmt; use hare::ast; diff --git a/cmd/iobus/main.ha b/cmd/iobus/main.ha @@ -1,3 +1,6 @@ +// License: GPL-3.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use io; diff --git a/compress/flate/inflate.ha b/compress/flate/inflate.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use bytes; use endian; diff --git a/compress/zlib/.testdata/gen.ha b/compress/zlib/.testdata/gen.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use fmt; use fs; diff --git a/compress/zlib/data+test.ha b/compress/zlib/data+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + const null_in: []u8 = [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/compress/zlib/reader.ha b/compress/zlib/reader.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use bufio; use bytes; use compress::flate; diff --git a/crypto/+test/authenc.ha b/crypto/+test/authenc.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use errors; diff --git a/crypto/aes/aes_ct64.ha b/crypto/aes/aes_ct64.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Constant time aes implementation optimized for 64bit CPUs. // The code was ported from BearSSL, which contained the following notice: // diff --git a/crypto/aes/cbc+test.ha b/crypto/aes/cbc+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use crypto::cipher; use bytes; diff --git a/crypto/aes/ct64+test.ha b/crypto/aes/ct64+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use crypto::cipher; use bytes; diff --git a/crypto/aes/ctr+test.ha b/crypto/aes/ctr+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use crypto::cipher; use bytes; diff --git a/crypto/aes/xts/+test.ha b/crypto/aes/xts/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; @test fn oneblock() void = { diff --git a/crypto/aes/xts/xts.ha b/crypto/aes/xts/xts.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use crypto::aes; use bytes; use crypto::cipher; diff --git a/crypto/argon2/+test.ha b/crypto/argon2/+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2022 Drew DeVault <sir@cmpwn.com> use bytes; @test fn mode_d_one_pass() void = { diff --git a/crypto/argon2/argon2.ha b/crypto/argon2/argon2.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> use bufio; use bytes; use crypto::blake2b; diff --git a/crypto/authenc.ha b/crypto/authenc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2022 Drew DeVault <sir@cmpwn.com> use bytes; use crypto::chacha; use crypto::cipher; diff --git a/crypto/blake2b/+test.ha b/crypto/blake2b/+test.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use encoding::hex; use fmt; diff --git a/crypto/blake2b/blake2b.ha b/crypto/blake2b/blake2b.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use crypto::math; use endian; diff --git a/crypto/blake2b/vectors+test.ha b/crypto/blake2b/vectors+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + type vector = struct { in: str, key: str, diff --git a/crypto/chacha/+test.ha b/crypto/chacha/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::cipher; diff --git a/crypto/chacha/chacha20.ha b/crypto/chacha/chacha20.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::cipher; use crypto::math::{rotl32, xor}; diff --git a/crypto/cipher/block.ha b/crypto/cipher/block.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // An abstract interface for implementing block ciphers. export type block = struct { blocksz: size, diff --git a/crypto/cipher/cbc.ha b/crypto/cipher/cbc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use crypto::math; export type cbc_mode = struct { diff --git a/crypto/cipher/cipher.ha b/crypto/cipher/cipher.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> + // Discards any state associated with a block or a stream cipher algorithm, // securely erasing secret data from memory. export fn finish(a: (*block | *stream)) void = { diff --git a/crypto/cipher/ctr.ha b/crypto/cipher/ctr.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bytes; use crypto::math; diff --git a/crypto/cipher/stream.ha b/crypto/cipher/stream.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> + // An abstract interface for implementing cipher streams export type stream = struct { xor: *fn(s: *stream, dest: []u8, src: []u8) void, diff --git a/crypto/curve25519/+test.ha b/crypto/curve25519/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use bytes; use fmt; use io; diff --git a/crypto/curve25519/curve25519.ha b/crypto/curve25519/curve25519.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + // Implements the curve25519 elliptic curve // Implementations used for reference diff --git a/crypto/hmac/+test.ha b/crypto/hmac/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::mac; use crypto::sha1; diff --git a/crypto/hmac/hmac.ha b/crypto/hmac/hmac.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bytes; use crypto::mac; use hash; diff --git a/crypto/hmac/sha256.ha b/crypto/hmac/sha256.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::mac; use crypto::sha256; diff --git a/crypto/keyderiv.ha b/crypto/keyderiv.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> use errors; use crypto::argon2; diff --git a/crypto/mac/mac.ha b/crypto/mac/mac.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use io; // The general purpose interface for a MAC function. diff --git a/crypto/math/bits.ha b/crypto/math/bits.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + // Rotates a 32-bit unsigned integer left by k bits. k may be negative to rotate // right instead, or see [[rotr32]]. export fn rotl32(x: u32, k: int) u32 = { diff --git a/crypto/poly1305/+test.ha b/crypto/poly1305/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::mac; use encoding::hex; diff --git a/crypto/poly1305/poly1305.ha b/crypto/poly1305/poly1305.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> + // This implementation was ported from Loup Vaillants monocypher project. use bytes; diff --git a/crypto/random/+freebsd.ha b/crypto/random/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use io; diff --git a/crypto/random/+linux.ha b/crypto/random/+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use io; diff --git a/crypto/random/random.ha b/crypto/random/random.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use rt; diff --git a/crypto/salsa/+test.ha b/crypto/salsa/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::cipher; use types; diff --git a/crypto/salsa/salsa20.ha b/crypto/salsa/salsa20.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> use bytes; use crypto::cipher; use crypto::math::{rotl32, xor}; diff --git a/crypto/sha1/+test.ha b/crypto/sha1/+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use fmt; use hash; use strings; diff --git a/crypto/sha1/sha1.ha b/crypto/sha1/sha1.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use hash; use io; use bytes; diff --git a/crypto/sha256/+test.ha b/crypto/sha256/+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use fmt; use hash; use strings; diff --git a/crypto/sha256/sha256.ha b/crypto/sha256/sha256.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use crypto::math; use bytes; use endian; diff --git a/crypto/sha512/+test.ha b/crypto/sha512/+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use fmt; use hash; use strings; diff --git a/crypto/sha512/sha512.ha b/crypto/sha512/sha512.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021-2022 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use bytes; use crypto::math; use endian; diff --git a/dirs/xdg.ha b/dirs/xdg.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use fs; use os; use path; diff --git a/encoding/base32/base32.ha b/encoding/base32/base32.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Ajay R <ar324@protonmail.com> use ascii; use bufio; use bytes; diff --git a/encoding/base64/base64.ha b/encoding/base64/base64.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Ajay R <ar324@protonmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Steven Guikal <void@fluix.one> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use ascii; use bufio; use bytes; diff --git a/encoding/hex/hex.ha b/encoding/hex/hex.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use ascii; use bytes; use fmt; diff --git a/encoding/utf8/decode.ha b/encoding/utf8/decode.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use types; fn toutf8(in: str) []u8 = *(&in: *[]u8); diff --git a/encoding/utf8/encode.ha b/encoding/utf8/encode.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Encodes a rune as UTF-8 and returns the result as a slice. The return value // is statically allocated, and will not be consistent after subsequent calls to // encoderune. diff --git a/encoding/utf8/rune.ha b/encoding/utf8/rune.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use types; const masks: [_]u8 = [0x7F, 0x1F, 0x0F, 0x07, 0x03, 0x01]; diff --git a/endian/big.ha b/endian/big.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Reads a u16 from a buffer in big-endian order. export fn begetu16(buf: []u8) u16 = { return diff --git a/endian/endian.ha b/endian/endian.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The set of functions used for endian-aware encoding. export type endian = struct { getu16: *fn(buf: []u8) u16, diff --git a/endian/host+aarch64.ha b/endian/host+aarch64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The [[endian]] functions which map to the host architecture. export const host: *endian = &little; diff --git a/endian/host+riscv64.ha b/endian/host+riscv64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The [[endian]] functions which map to the host architecture. export const host: *endian = &little; diff --git a/endian/host+x86_64.ha b/endian/host+x86_64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The [[endian]] functions which map to the host architecture. export const host: *endian = &little; diff --git a/endian/little.ha b/endian/little.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Reads a u16 from a buffer in little-endian order. export fn legetu16(buf: []u8) u16 = { return diff --git a/endian/network.ha b/endian/network.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Converts a u16 from host order to network order. export fn htonu16(in: u16) u16 = { if (host == &big) return in; diff --git a/errors/common.ha b/errors/common.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Noah Altunian <nbaltunian@gmail.com> + // The requested resource is not available. export type busy = !void; diff --git a/errors/opaque.ha b/errors/opaque.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // An "opaque" error is used as a portable error type for an underlying error // which is implementation-specific. It provides a function which can be used to // produce a string describing the error, and a small storage area for arbitrary diff --git a/errors/rt.ha b/errors/rt.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Wraps an [[rt::errno]] to produce an [[errors::opaque]]. This is a non-portable diff --git a/errors/string.ha b/errors/string.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Converts an [[error]] into a human-friendly string representation. // // Note that this strerror implementation lacks any context-specific information diff --git a/fmt/fmt.ha b/fmt/fmt.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021-2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use bufio; use encoding::utf8; diff --git a/fnmatch/+test.ha b/fnmatch/+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> + type testcase = (str, str, bool, []flags); const testcases: [_]testcase = [ diff --git a/fnmatch/fnmatch.ha b/fnmatch/fnmatch.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Miccah Castorina <contact@miccah.io> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use ascii; use errors; use strings; diff --git a/format/elf/+aarch64.ha b/format/elf/+aarch64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The machine (architecture) of the target. export def TARGET_MACHINE: elf_machine = elf_machine::AARCH64; diff --git a/format/elf/+freebsd.ha b/format/elf/+freebsd.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The ABI of the target. export def TARGET_ABI: ident_abi = ident_abi::SYSV; diff --git a/format/elf/+linux.ha b/format/elf/+linux.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The ABI of the target. export def TARGET_ABI: ident_abi = ident_abi::SYSV; diff --git a/format/elf/+riscv64.ha b/format/elf/+riscv64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The machine (architecture) of the target. export def TARGET_MACHINE: elf_machine = elf_machine::RISCV; diff --git a/format/elf/+x86_64.ha b/format/elf/+x86_64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The machine (architecture) of the target. export def TARGET_MACHINE: elf_machine = elf_machine::X86_64; diff --git a/format/elf/types.ha b/format/elf/types.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + // TODO: // - Flesh out ELF32 structures diff --git a/format/ini/+test.ha b/format/ini/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> use bufio; use io; use strings; diff --git a/format/ini/scan.ha b/format/ini/scan.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use bufio; use encoding::utf8; use fmt; diff --git a/format/ini/types.ha b/format/ini/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use encoding::utf8; use fmt; use io; diff --git a/format/xml/+test.ha b/format/xml/+test.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use bufio; use strings; diff --git a/format/xml/chars.ha b/format/xml/chars.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use ascii; fn isnamestart(rn: rune) bool = { diff --git a/format/xml/parser.ha b/format/xml/parser.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> + // Are you an intrepid programmer seeking to fork this module to create a more // sophisticated XML parser supporting a broader set of features? Good news: all // of the features you need to implement are annotated throughout with diff --git a/format/xml/types.ha b/format/xml/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use encoding::utf8; use io; diff --git a/fs/fs.ha b/fs/fs.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> +// (c) 2021 Umar Getagazov <umar@handlerug.me> use errors; use io; use path; diff --git a/fs/types.ha b/fs/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use path; diff --git a/fs/util.ha b/fs/util.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use errors; use io; use path; diff --git a/getopt/getopts.ha b/getopt/getopts.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Jonathan Halmen <slowjo@halmen.xyz> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use encoding::utf8; use fmt; use io; diff --git a/hare/ast/decl.ha b/hare/ast/decl.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::lex; // A constant declaration. diff --git a/hare/ast/expr.ha b/hare/ast/expr.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use hare::lex; // An identifier access expression. diff --git a/hare/ast/ident.ha b/hare/ast/ident.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use strings; // Identifies a single object, e.g. foo::bar::baz. diff --git a/hare/ast/import.ha b/hare/ast/import.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // use module; export type import_module = ident; diff --git a/hare/ast/type.ha b/hare/ast/type.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::lex; // A type alias. diff --git a/hare/ast/unit.ha b/hare/ast/unit.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // A sub-unit, typically representing a single source file. export type subunit = struct { imports: []import, diff --git a/hare/lex/+test.ha b/hare/lex/+test.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> use bufio; use fmt; use io; diff --git a/hare/lex/lex.ha b/hare/lex/lex.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> use ascii; use bufio; use encoding::utf8; diff --git a/hare/lex/token.ha b/hare/lex/token.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use encoding::utf8; use strings; diff --git a/hare/module/context.ha b/hare/module/context.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use dirs; use fmt; use fs; diff --git a/hare/module/manifest.ha b/hare/module/manifest.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use bufio; use bytes; use encoding::hex; diff --git a/hare/module/scan.ha b/hare/module/scan.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use ascii; use bytes; use crypto::sha256; diff --git a/hare/module/types.ha b/hare/module/types.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fs; use hare::ast; use hare::parse; diff --git a/hare/module/walk.ha b/hare/module/walk.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fs; use hare::ast; diff --git a/hare/parse/+test/expr.ha b/hare/parse/+test/expr.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> + @test fn assignment() void = { roundtrip("export fn main() void = { x = y; diff --git a/hare/parse/+test/ident.ha b/hare/parse/+test/ident.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use hare::ast; use hare::lex; diff --git a/hare/parse/+test/loc.ha b/hare/parse/+test/loc.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use encoding::utf8; use fmt; diff --git a/hare/parse/+test/roundtrip.ha b/hare/parse/+test/roundtrip.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use bufio; use fmt; use hare::ast; diff --git a/hare/parse/+test/types.ha b/hare/parse/+test/types.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + @test fn struct_union() void = { roundtrip("export type foo = struct { @offset(void) x: int, diff --git a/hare/parse/+test/unit.ha b/hare/parse/+test/unit.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use bufio; use fmt; use hare::ast; diff --git a/hare/parse/decl.ha b/hare/parse/decl.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use hare::ast; use hare::lex::{ltok}; diff --git a/hare/parse/expr.ha b/hare/parse/expr.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use hare::ast; use hare::lex::{ltok}; use hare::lex; diff --git a/hare/parse/ident.ha b/hare/parse/ident.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use hare::ast; use hare::lex::{ltok}; diff --git a/hare/parse/import.ha b/hare/parse/import.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; use hare::lex; use hare::lex::{ltok}; diff --git a/hare/parse/parse.ha b/hare/parse/parse.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use hare::ast; use hare::lex::{ltok}; diff --git a/hare/parse/type.ha b/hare/parse/type.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; use hare::ast::{builtin_type}; use hare::lex; diff --git a/hare/parse/unit.ha b/hare/parse/unit.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; use hare::lex; diff --git a/hare/types/+test.ha b/hare/types/+test.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use bufio; use errors; use hare::ast; diff --git a/hare/types/arch.ha b/hare/types/arch.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Configuration for a specific architecture. export type arch = struct { _int: size, diff --git a/hare/types/builtins.ha b/hare/types/builtins.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export let builtin_char: _type = _type { repr = builtin::CHAR, sz = 1, align = 1, diff --git a/hare/types/class.ha b/hare/types/class.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Returns true if the given type is a signed type. export fn is_signed(ty: const *_type) bool = { match (ty.repr) { diff --git a/hare/types/hash.ha b/hare/types/hash.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use endian; use hash::fnv; use hash; diff --git a/hare/types/lookup.ha b/hare/types/lookup.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; // Unwraps a type which may be aliased and returns the underlying type. diff --git a/hare/types/store.ha b/hare/types/store.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use ascii; use errors; use hare::ast; diff --git a/hare/types/types.ha b/hare/types/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; // A type alias. diff --git a/hare/unit/+test.ha b/hare/unit/+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use hare::ast; use hare::lex; diff --git a/hare/unit/check.ha b/hare/unit/check.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::ast; use hare::types; diff --git a/hare/unit/context.ha b/hare/unit/context.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::types; type context = struct { diff --git a/hare/unit/errors.ha b/hare/unit/errors.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::types; // TODO: More errors diff --git a/hare/unit/expr.ha b/hare/unit/expr.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::ast; use hare::lex; use hare::types; diff --git a/hare/unit/process.ha b/hare/unit/process.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use hare::ast; use hare::lex; use hare::types; diff --git a/hare/unit/scan.ha b/hare/unit/scan.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use hare::ast; use hare::types; diff --git a/hare/unit/scope.ha b/hare/unit/scope.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::ast; use hare::types; use hash::fnv; diff --git a/hare/unit/unit.ha b/hare/unit/unit.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use hare::ast; use hare::lex; use hare::types; diff --git a/hare/unparse/decl.ha b/hare/unparse/decl.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use io; use fmt; use hare::ast; diff --git a/hare/unparse/expr.ha b/hare/unparse/expr.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use io; use fmt; use hare::ast; diff --git a/hare/unparse/ident.ha b/hare/unparse/ident.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use hare::ast; use io; diff --git a/hare/unparse/import.ha b/hare/unparse/import.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use io; use hare::ast; diff --git a/hare/unparse/type.ha b/hare/unparse/type.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fmt; use io; use hare::ast; diff --git a/hare/unparse/unit.ha b/hare/unparse/unit.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use fmt; use hare::ast; diff --git a/hare/unparse/util.ha b/hare/unparse/util.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use fmt; diff --git a/hash/adler32/adler32.ha b/hash/adler32/adler32.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use endian; use hash; use io; diff --git a/hash/crc16/crc16.ha b/hash/crc16/crc16.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use endian; use hash; use io; diff --git a/hash/crc32/crc32.ha b/hash/crc32/crc32.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use endian; use hash; use io; diff --git a/hash/crc64/crc64.ha b/hash/crc64/crc64.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use endian; use hash; use io; diff --git a/hash/fnv/fnv.ha b/hash/fnv/fnv.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use endian; use hash; use io; diff --git a/hash/hash.ha b/hash/hash.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Preiml <apreiml@strohwolke.at> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use io; use fmt; diff --git a/io/+freebsd/file.ha b/io/+freebsd/file.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use strings; diff --git a/io/+freebsd/mmap.ha b/io/+freebsd/mmap.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/io/+linux/file.ha b/io/+linux/file.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use strings; diff --git a/io/+linux/mmap.ha b/io/+linux/mmap.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/io/+test/copy.ha b/io/+test/copy.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; fn test_copier_read(s: *stream, buf: []u8) (size | EOF | error) = { diff --git a/io/+test/limit.ha b/io/+test/limit.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; @test fn limit() void = { diff --git a/io/+test/stream.ha b/io/+test/stream.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use strings; type teststream = struct { diff --git a/io/arch+aarch64.ha b/io/arch+aarch64.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export type off = i64; diff --git a/io/arch+riscv64.ha b/io/arch+riscv64.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export type off = i64; diff --git a/io/arch+x86_64.ha b/io/arch+x86_64.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export type off = i64; diff --git a/io/copy.ha b/io/copy.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; // Copies data from one handle into another. Note that this function will never diff --git a/io/drain.ha b/io/drain.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Reads an entire stream into a []u8. The caller must free the return value. export fn drain(in: handle) ([]u8 | error) = { let sink: []u8 = []; diff --git a/io/empty.ha b/io/empty.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + const _empty: stream = stream { reader = &empty_read, writer = &empty_write, diff --git a/io/filestream.ha b/io/filestream.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use errors; export type filestream = struct { diff --git a/io/handle.ha b/io/handle.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // TODO: Examine the ABI constraints of [[handle]]. Would it be better to make // stream an integer representing an internal handle into a stream table? This // would reduce performance for streams somewhat via the indirect lookup, but diff --git a/io/limit.ha b/io/limit.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> + export type limitstream = struct { stream, source: handle, diff --git a/io/println+freebsd.ha b/io/println+freebsd.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Prints strings to stdout, separated by spaces, and followed by a newline. diff --git a/io/println+linux.ha b/io/println+linux.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Prints strings to stdout, separated by spaces, and followed by a newline. diff --git a/io/stream.ha b/io/stream.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use errors; // A stream of bytes which supports some subset of read, write, close, seek, or diff --git a/io/tee.ha b/io/tee.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export type teestream = struct { stream, source: handle, diff --git a/io/types.ha b/io/types.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; // Returned by [[readitem]] and [[readitems]] if the I/O handle returned [[EOF]] diff --git a/io/util.ha b/io/util.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Reads an entire "item", i.e. one Hare object, from an I/O handle. This // function may use multiple reads, but if [[EOF]] is encountered before the // entire object is read, an [[underread]] error is returned. Otherwise, the diff --git a/iobus/io_uring/bus.ha b/iobus/io_uring/bus.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use linux::io_uring; diff --git a/iobus/io_uring/handle.ha b/iobus/io_uring/handle.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use linux::io_uring; // Registers a callback to occur following the completion of an I/O operation. diff --git a/iobus/io_uring/ops.ha b/iobus/io_uring/ops.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fs; use io; use linux::io_uring; diff --git a/iobus/io_uring/pool.ha b/iobus/io_uring/pool.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use linux::io_uring; export type pool = struct { diff --git a/iobus/io_uring/types.ha b/iobus/io_uring/types.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use linux::io_uring; diff --git a/linux/env.ha b/linux/env.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use format::elf; // System V auxillary vector for the current process diff --git a/linux/io_uring/cqe.ha b/linux/io_uring/cqe.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/linux/io_uring/queue.ha b/linux/io_uring/queue.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/linux/io_uring/register.ha b/linux/io_uring/register.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use types; diff --git a/linux/io_uring/setup.ha b/linux/io_uring/setup.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/linux/io_uring/sqe.ha b/linux/io_uring/sqe.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2022 Eyal Sawady <ecs@d2evs.net> use endian; use rt; use types; diff --git a/linux/io_uring/uring.ha b/linux/io_uring/uring.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021-2022 Eyal Sawady <ecs@d2evs.net> use errors; // Returned when buffer pool use was configured for an [[sqe]], but there are no diff --git a/linux/signalfd/signalfd.ha b/linux/signalfd/signalfd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // TODO: Incorporate this model into a top-level 'signal' module and generalize // it a bit. use errors; diff --git a/linux/start+libc.ha b/linux/start+libc.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> use rt; use format::elf; diff --git a/linux/start.ha b/linux/start.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use rt; use format::elf; diff --git a/linux/vdso/vdso.ha b/linux/vdso/vdso.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use strings; use format::elf; use linux; diff --git a/math/data+test.ha b/math/data+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // The test data below is based on Go's implementation, and came with the // following note and copyright notice: // diff --git a/math/fenv+aarch64.ha b/math/fenv+aarch64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> + // Defines flags characterizing types of floating point exceptions, // Each of the flags is only defined when the target platform supports handling // the corresponding exception. Flags NONE and ALL are always diff --git a/math/fenv+x86_64.ha b/math/fenv+x86_64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> + // Defines flags characterizing types of floating point exceptions, // Each of the flags is only defined when the target platform supports handling // the corresponding exception. Flags NONE and ALL are always diff --git a/math/fenv_func.ha b/math/fenv_func.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> use rt; // Accepts a set of flags from [[fexcept]] ORed together and clears diff --git a/math/floats.ha b/math/floats.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021-2022 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> use types; // Returns the binary representation of the given f64. diff --git a/math/ints.ha b/math/ints.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Haelwenn (lanodan) Monnier <contact@hacktivis.me> +// (c) 2021-2022 Vlad-Stefan Harbuz <vlad@vladh.net> use types; // Returns the absolute value of signed integer n. diff --git a/math/math.ha b/math/math.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Sections of the code below, in particular log() and exp(), are based on Go's // implementation, which is, in turn, based on FreeBSD's. The original C code, // as well as the respective comments and constants are from diff --git a/math/random/random.ha b/math/random/random.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Steven Guikal <void@fluix.dev> + // State for a pseudorandom number generator. export type random = u64; diff --git a/math/trig.ha b/math/trig.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Sections of the code below are based on Go's implementation, which is, in // turn, based on: // * the Cephes Mathematical Library (cephes/cmath/{sin,..}), available from diff --git a/math/uints.ha b/math/uints.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Sections of the code below are based on Go's implementation, in particular // https://raw.githubusercontent.com/golang/go/master/src/math/bits/bits.go. // diff --git a/mime/database.ha b/mime/database.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> use hash::fnv; use strings; diff --git a/mime/lookup.ha b/mime/lookup.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> use hash::fnv; use strings; diff --git a/mime/parse.ha b/mime/parse.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> use ascii; use errors; use strings; diff --git a/mime/system.ha b/mime/system.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> use bufio; use errors; use encoding::utf8; diff --git a/net/+freebsd.ha b/net/+freebsd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Some common code for handling sockets on +freebsd use errors; use fmt; diff --git a/net/+linux.ha b/net/+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Some common code for handling sockets on +linux use errors; use fmt; diff --git a/net/dial/dial.ha b/net/dial/dial.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use io; use net; diff --git a/net/dial/ip.ha b/net/dial/ip.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Provides default dialers for tcp and udp use io; use net; diff --git a/net/dial/registry.ha b/net/dial/registry.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use net; diff --git a/net/dial/resolve.ha b/net/dial/resolve.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021-2022 Eyal Sawady <ecs@d2evs.net> use crypto::random; use net::dns; use net::ip; diff --git a/net/dns/decode.ha b/net/dns/decode.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use ascii; use endian; use fmt; diff --git a/net/dns/encode.ha b/net/dns/encode.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use endian; use errors; use fmt; diff --git a/net/dns/error.ha b/net/dns/error.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fmt; use net; diff --git a/net/dns/query.ha b/net/dns/query.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use errors; use io; use net::ip; diff --git a/net/dns/types.ha b/net/dns/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Jonathan Halmen <slowjo@halmen.xyz> use net::ip; // Record type. diff --git a/net/errors.ha b/net/errors.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; diff --git a/net/ip/+freebsd.ha b/net/ip/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use rt; use endian; diff --git a/net/ip/+linux.ha b/net/ip/+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use rt; use endian; diff --git a/net/ip/+test.ha b/net/ip/+test.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Miccah Castorina <contact@miccah.io> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use strings; use fmt; diff --git a/net/ip/ip.ha b/net/ip/ip.ha @@ -1,3 +1,12 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Byron Torres <b@torresjrjr.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Miccah Castorina <contact@miccah.io> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use io; use strio; use fmt; diff --git a/net/listener.ha b/net/listener.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021-2022 Eyal Sawady <ecs@d2evs.net> use errors; use io; diff --git a/net/msg.ha b/net/msg.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // TODO: // - Set name field // - Figure out the portability mess that is this interface diff --git a/net/tcp/+freebsd.ha b/net/tcp/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use net::ip; diff --git a/net/tcp/+linux.ha b/net/tcp/+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use net::ip; diff --git a/net/tcp/listener.ha b/net/tcp/listener.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use io; use net; diff --git a/net/tcp/options.ha b/net/tcp/options.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Enables keep-alive for a socket. export type keepalive = void; diff --git a/net/udp/+freebsd.ha b/net/udp/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use net::ip; diff --git a/net/udp/+linux.ha b/net/udp/+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use net::ip; diff --git a/net/udp/options.ha b/net/udp/options.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // To have the system select an arbitrary unused port for [[listen]], set port to // zero. To retrieve the assigned port, provide this as one of the options and // the addressed u16 will be filled in with the port. diff --git a/net/unix/+freebsd.ha b/net/unix/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fmt; use io; diff --git a/net/unix/+linux.ha b/net/unix/+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use errors; use fmt; use io; diff --git a/net/unix/addr.ha b/net/unix/addr.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + // A UNIX socket address. export type addr = str; diff --git a/net/unix/cmsg.ha b/net/unix/cmsg.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use net; use io; use rt; diff --git a/net/unix/dial.ha b/net/unix/dial.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use net::dial; use net; diff --git a/net/unix/listener.ha b/net/unix/listener.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use io; use net; diff --git a/net/unix/options.ha b/net/unix/options.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Configures the backlog size for a listener. If not specified, a sensible // default (10) is used. export type backlog = u32; diff --git a/net/unix/socketpair.ha b/net/unix/socketpair.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use rt; use io; use net; diff --git a/os/+freebsd/dirfdfs.ha b/os/+freebsd/dirfdfs.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use errors; use encoding::utf8; diff --git a/os/+freebsd/environ.ha b/os/+freebsd/environ.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use rt; use strings; diff --git a/os/+freebsd/exit.ha b/os/+freebsd/exit.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Exit the program with the provided status code. diff --git a/os/+freebsd/fs.ha b/os/+freebsd/fs.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fs; use path; diff --git a/os/+freebsd/stdfd.ha b/os/+freebsd/stdfd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use io; diff --git a/os/+linux/dirfdfs.ha b/os/+linux/dirfdfs.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use errors; use encoding::utf8; diff --git a/os/+linux/environ+libc.ha b/os/+linux/environ+libc.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> use bytes; use rt; use strings; diff --git a/os/+linux/environ.ha b/os/+linux/environ.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use rt; use strings; diff --git a/os/+linux/exit.ha b/os/+linux/exit.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Exit the program with the provided status code. diff --git a/os/+linux/fs.ha b/os/+linux/fs.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fs; use path; diff --git a/os/+linux/stdfd.ha b/os/+linux/stdfd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bufio; use io; diff --git a/os/exec/cmd.ha b/os/exec/cmd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use ascii; use errors; use io; diff --git a/os/exec/exec+freebsd.ha b/os/exec/exec+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use rt; diff --git a/os/exec/exec+linux.ha b/os/exec/exec+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use os; diff --git a/os/exec/process+freebsd.ha b/os/exec/process+freebsd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use fmt; diff --git a/os/exec/process+linux.ha b/os/exec/process+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; use fmt; diff --git a/os/exec/types.ha b/os/exec/types.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; diff --git a/os/fs.ha b/os/fs.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use fs; use io; use path; diff --git a/path/+freebsd.ha b/path/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> + // Path separator, platform-specific. export def PATHSEP: u8 = '/': u32: u8; diff --git a/path/+linux.ha b/path/+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> + // Path separator, platform-specific. export def PATHSEP: u8 = '/': u32: u8; diff --git a/path/buffer.ha b/path/buffer.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Drew DeVault <sir@cmpwn.com> +// (c) 2022 Humm <hummsmith42@gmail.com> use bytes; use errors; use strings; diff --git a/path/iter.ha b/path/iter.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use strings; diff --git a/path/join.ha b/path/join.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> use bytes; use errors; use strings; diff --git a/path/names.ha b/path/names.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use encoding::utf8; use strings; diff --git a/path/util.ha b/path/util.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> use strings; fn getbytes(in: (str | *buffer)) []u8 = { diff --git a/rt/+aarch64/backtrace.ha b/rt/+aarch64/backtrace.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> + fn getfp() **void; // Details for a stack frame. Contents are architecture-specific. diff --git a/rt/+aarch64/jmp.ha b/rt/+aarch64/jmp.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + type arch_jmpbuf = [22]u64; diff --git a/rt/+freebsd/abort.ha b/rt/+freebsd/abort.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + fn platform_abort(msg: str) void = { const prefix = "Abort: "; const linefeed = "\n"; diff --git a/rt/+freebsd/env.ha b/rt/+freebsd/env.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export let argc: size = 0; export let argv: *[*]*char = null: *[*]*char; export let envp: *[*]nullable *char = null: *[*]nullable *char; diff --git a/rt/+freebsd/errno.ha b/rt/+freebsd/errno.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Represents an error returned from the FreeBSD kernel. export type errno = !int; diff --git a/rt/+freebsd/platformstart.ha b/rt/+freebsd/platformstart.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export @noreturn fn start_freebsd(iv: *[*]uintptr) void = { // TODO: Find & parse auxv argc = iv[0]: size; diff --git a/rt/+freebsd/segmalloc.ha b/rt/+freebsd/segmalloc.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Allocates a segment. fn segmalloc(n: size) nullable *void = { return match (mmap(null, n, PROT_READ | PROT_WRITE, diff --git a/rt/+freebsd/signal.ha b/rt/+freebsd/signal.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // TODO: work when _NSIG != 32 export fn sigemptyset(set: *sigset) int = { diff --git a/rt/+freebsd/socket.ha b/rt/+freebsd/socket.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2022 Sebastian <sebastian@sebsite.pw> + export type sa_family_t = u8; export type socklen_t = u32; diff --git a/rt/+freebsd/syscallno.ha b/rt/+freebsd/syscallno.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export def SYS_syscall: u64 = 0; export def SYS_exit: u64 = 1; export def SYS_fork: u64 = 2; diff --git a/rt/+freebsd/syscalls.ha b/rt/+freebsd/syscalls.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + fn syscall0(_: u64) u64; fn syscall1(_: u64, _: u64) u64; fn syscall2(_: u64, _: u64, _: u64) u64; diff --git a/rt/+freebsd/types.ha b/rt/+freebsd/types.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2022 Sebastian <sebastian@sebsite.pw> + export type time_t = i64; export type suseconds_t = i64; export type dev_t = u64; diff --git a/rt/+linux/+aarch64.ha b/rt/+linux/+aarch64.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> + // Returns the new PID to the parent, void to the child, or errno if something // goes wrong. export fn clone( diff --git a/rt/+linux/+riscv64.ha b/rt/+linux/+riscv64.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Michael Forney <mforney@mforney.org> + // Returns the new PID to the parent, void to the child, or errno if something // goes wrong. export fn clone( diff --git a/rt/+linux/+x86_64.ha b/rt/+linux/+x86_64.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Returns the new PID to the parent, void to the child, or errno if something // goes wrong. export fn clone( diff --git a/rt/+linux/abort.ha b/rt/+linux/abort.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + fn platform_abort(msg: str) void = { const prefix = "Abort: "; const linefeed = "\n"; diff --git a/rt/+linux/env.ha b/rt/+linux/env.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export let argc: size = 0; export let argv: *[*]*char = null: *[*]*char; export let envp: *[*]nullable *char = null: *[*]nullable *char; diff --git a/rt/+linux/errno.ha b/rt/+linux/errno.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Represents an error returned from the Linux kernel. export type errno = !int; diff --git a/rt/+linux/platformstart+libc.ha b/rt/+linux/platformstart+libc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> + export fn start_linux() void = { // Here we use a cool strategy of re-constructing argv and argc without // knowing their original values. Since environ is placed just after diff --git a/rt/+linux/platformstart.ha b/rt/+linux/platformstart.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export @noreturn fn start_linux(iv: *[*]uintptr) void = { // TODO: Find & parse auxv argc = iv[0]: size; diff --git a/rt/+linux/prctl.ha b/rt/+linux/prctl.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export def PR_SET_PDEATHSIG: int = 1; export def PR_GET_PDEATHSIG: int = 2; export def PR_GET_DUMPABLE: u64 = 3; diff --git a/rt/+linux/segmalloc.ha b/rt/+linux/segmalloc.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Allocates a segment. fn segmalloc(n: size) nullable *void = { return match (mmap(null, n, PROT_READ | PROT_WRITE, diff --git a/rt/+linux/signal.ha b/rt/+linux/signal.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + // TODO: work when _NSIG != 64 export fn sigemptyset(set: *sigset) int = { diff --git a/rt/+linux/socket.ha b/rt/+linux/socket.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + export type sa_family_t = u16; export type socklen_t = uint; diff --git a/rt/+linux/stat.ha b/rt/+linux/stat.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export fn mkdev(major: u32, minor: u32) dev_t = ((major: u64 & 0xFFFFF000) << 32) | ((major: u64 & 0x00000FFF) << 8) | diff --git a/rt/+linux/syscallno+aarch64.ha b/rt/+linux/syscallno+aarch64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export def SYS_io_setup: u64 = 0; export def SYS_io_destroy: u64 = 1; export def SYS_io_submit: u64 = 2; diff --git a/rt/+linux/syscallno+riscv64.ha b/rt/+linux/syscallno+riscv64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export def SYS_io_setup: u64 = 0; export def SYS_io_destroy: u64 = 1; export def SYS_io_submit: u64 = 2; diff --git a/rt/+linux/syscallno+x86_64.ha b/rt/+linux/syscallno+x86_64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export def SYS_read: u64 = 0; export def SYS_write: u64 = 1; export def SYS_open: u64 = 2; diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -1,3 +1,10 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> + fn syscall0(_: u64) u64; fn syscall1(_: u64, _: u64) u64; fn syscall2(_: u64, _: u64, _: u64) u64; diff --git a/rt/+linux/types.ha b/rt/+linux/types.ha @@ -1,3 +1,12 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> +// (c) 2022 Sebastian <sebastian@sebsite.pw> + export type off_t = u64; export type dev_t = u64; export type ino_t = u64; diff --git a/rt/+riscv64/backtrace.ha b/rt/+riscv64/backtrace.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + fn getfp() **void; // Details for a stack frame. Contents are architecture-specific. diff --git a/rt/+riscv64/jmp.ha b/rt/+riscv64/jmp.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + type arch_jmpbuf = [26]u64; diff --git a/rt/+test/+freebsd.ha b/rt/+test/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + let start: timespec = timespec { ... }; fn time_start() void = { diff --git a/rt/+test/+linux.ha b/rt/+test/+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + let start: timespec = timespec { ... }; fn time_start() void = { diff --git a/rt/+test/cstring.ha b/rt/+test/cstring.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + fn c_strlen(cstr: *const char) size = { const ptr = cstr: *[*]u8; let ln = 0z; diff --git a/rt/+test/run.ha b/rt/+test/run.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + type test = struct { name: str, func: *fn() void, diff --git a/rt/+test/ztos.ha b/rt/+test/ztos.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + fn bytes_reverse(b: []u8) void = { if (len(b) == 0) { return; diff --git a/rt/+x86_64/backtrace.ha b/rt/+x86_64/backtrace.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + fn getfp() **void; // Details for a stack frame. Contents are architecture-specific. diff --git a/rt/+x86_64/jmp.ha b/rt/+x86_64/jmp.ha @@ -1 +1,4 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + type arch_jmpbuf = [8]u64; diff --git a/rt/abort+test.ha b/rt/abort+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export @noreturn @symbol("rt.abort") fn _abort(msg: str) void = { reason = abort_reason { loc = "", msg = msg }; longjmp(&jmp, 1); diff --git a/rt/abort.ha b/rt/abort.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export @noreturn @symbol("rt.abort") fn _abort(msg: str) void = { platform_abort(msg); }; diff --git a/rt/ensure.ha b/rt/ensure.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + export type slice = struct { data: nullable *void, length: size, diff --git a/rt/fenv_defs.ha b/rt/fenv_defs.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> + export fn feclearexcept(ex: uint) void; export fn feraiseexcept(ex: uint) void; export fn fetestexcept(ex: uint) uint; diff --git a/rt/jmp.ha b/rt/jmp.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + type jmpbuf = struct { __jb: arch_jmpbuf, __fl: size, diff --git a/rt/malloc+debug.ha b/rt/malloc+debug.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // This is a very simple "debug" allocator which works by allocating only via // mmap and returning pointers to the end of the segment such that any writes // beyond the end will cause an immediate segfault to occur. diff --git a/rt/malloc+libc.ha b/rt/malloc+libc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> + // Allocates n bytes of memory and returns a pointer to them, or null if there // is insufficient memory. export fn malloc(n: size) nullable *void = { diff --git a/rt/malloc.ha b/rt/malloc.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // This is a simple memory allocator, based on Appel, Andrew W., and David A. // Naumann. "Verified sequential malloc/free." It is not thread-safe. // diff --git a/rt/memcpy.ha b/rt/memcpy.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export fn memcpy(dest: *void, src: *void, amt: size) void = { let a = dest: *[*]u8, b = src: *[*]u8; for (let i = 0z; i < amt; i += 1) { diff --git a/rt/memmove.ha b/rt/memmove.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export fn memmove(dest: *void, src: *void, n: size) void = { let d = dest: *[*]u8, s = src: *[*]u8; if (d: uintptr == s: uintptr) { diff --git a/rt/memset.ha b/rt/memset.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export fn memset(dest: *void, val: u8, amt: size) void = { let a = dest: *[*]u8; for (let i = 0z; i < amt; i += 1) { diff --git a/rt/start+libc.ha b/rt/start+libc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + @symbol("main") fn main() void; @symbol("exit") fn c_exit(status: int) void; diff --git a/rt/start+test+libc.ha b/rt/start+test+libc.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> + export @symbol("main") fn main() int = { const nfail = tests_main(); return if (nfail > 0) 1 else 0; diff --git a/rt/start+test.ha b/rt/start+test.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + const @symbol("__init_array_start") init_start: [*]*fn() void; const @symbol("__init_array_end") init_end: [*]*fn() void; const @symbol("__fini_array_start") fini_start: [*]*fn() void; diff --git a/rt/start.ha b/rt/start.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + @symbol("main") fn main() void; const @symbol("__init_array_start") init_start: [*]*fn() void; diff --git a/rt/strcmp.ha b/rt/strcmp.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + type string = struct { data: *[*]u8, length: size, diff --git a/shlex/+test.ha b/shlex/+test.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> use strings; @test fn split() void = { diff --git a/shlex/split.ha b/shlex/split.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use strings; use strio; diff --git a/slice/reverse.ha b/slice/reverse.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Reverses a slice. export fn reverse(b: []void, membsz: size) void = { if (len(b) == 0) { diff --git a/slice/trunc.ha b/slice/trunc.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use types; // Truncates a slice, setting its length to zero without freeing the underlying diff --git a/slice/void.ha b/slice/void.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; use types; diff --git a/sort/+test.ha b/sort/+test.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + fn ncmp(a: const *void, b: const *void) int = { let a = a: const *int, b = b: const *int; return *a - *b; diff --git a/sort/search.ha b/sort/search.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Performs a binary search over a sorted slice. 'in' shall be the sorted slice, // and 'sz' shall be the size of each array member. The 'cmp' function will be // called with the key value and an array member, and shall return a integer diff --git a/sort/sort.ha b/sort/sort.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Steven Guikal <void@fluix.one> + // Sorts a slice of items in place. Provide a slice of 'items', the size of each // member, and a function to compare one member to another. The 'cmp' function // will be called with two pointers to values within the items slice, and shall diff --git a/strconv/+test/stoi.ha b/strconv/+test/stoi.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + @test fn stoi() void = { assert(stoi64("") as invalid == 0: invalid); assert(stoi64("abc") as invalid == 0: invalid); diff --git a/strconv/+test/stou.ha b/strconv/+test/stou.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + @test fn stou() void = { assert(stou64("") as invalid == 0: invalid); assert(stou64("abc") as invalid == 0: invalid); diff --git a/strconv/ftos.ha b/strconv/ftos.ha @@ -1,3 +1,11 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> +// (c) 2021 Sudipto Mallick <smlckz@envs.net> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Using Ryū: fast float-to-string conversion algorithm by Ulf Adams. // https://doi.org/10.1145/3192366.3192369 // This Hare implementation is translated from the original diff --git a/strconv/itos.ha b/strconv/itos.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bytes; use types; use strings; diff --git a/strconv/numeric.ha b/strconv/numeric.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021-2022 Eyal Sawady <ecs@d2evs.net> use types; // Converts any [[types::signed]] to a string in a given base. The return value is diff --git a/strconv/stof.ha b/strconv/stof.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Using the Eisel-Lemire algorithm [1] for fast parsing of floating-point // numbers, with Simple Decimal Conversion algorithm [2] as fallback. // [1]: https://nigeltao.github.io/blog/2020/eisel-lemire.html diff --git a/strconv/stof_data.ha b/strconv/stof_data.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> + const left_shift_table: [65]u16 = [ 0x0000, 0x0800, 0x0801, 0x0803, 0x1006, 0x1009, 0x100D, 0x1812, 0x1817, 0x181D, 0x2024, 0x202B, 0x2033, 0x203C, 0x2846, 0x2850, 0x285B, 0x3067, diff --git a/strconv/stoi.ha b/strconv/stoi.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use types; use strings; diff --git a/strconv/stou.ha b/strconv/stou.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use strings; use types; use ascii; diff --git a/strconv/types.ha b/strconv/types.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // Indicates that the input string is not an integer. Contains the index of the // first nondigit rune. export type invalid = !size; diff --git a/strconv/utos.ha b/strconv/utos.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021 Armin Weigl <tb46305@gmail.com> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use bytes; use types; diff --git a/strings/concat.ha b/strings/concat.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Concatenates two or more strings. The caller must free the return value. export fn concat(strs: str...) str = { let z = 0z; diff --git a/strings/contains.ha b/strings/contains.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bytes; use encoding::utf8; diff --git a/strings/cstrings.ha b/strings/cstrings.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Vlad-Stefan Harbuz <vlad@vladh.net> use encoding::utf8; use types; use rt; diff --git a/strings/dup.ha b/strings/dup.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use types; // Duplicates a string. Aborts on allocation failure. diff --git a/strings/index.ha b/strings/index.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> use bytes; // Returns the index of the first occurance of 'needle' in the 'haystack', or diff --git a/strings/iter.ha b/strings/iter.ha @@ -1,3 +1,9 @@ +// License: MPL-2.0 +// (c) 2022 Ajay R <ar324@protonmail.com> +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Miccah Castorina <contact@miccah.io> use encoding::utf8; export type iterator = struct { diff --git a/strings/pad.ha b/strings/pad.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> use encoding::utf8; // Pads a string's start with 'prefix' until it reaches length 'target_len'. diff --git a/strings/replace.ha b/strings/replace.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Vlad-Stefan Harbuz <vlad@vladh.net> + // Replaces all instances of 'needle' with 'target' in 's'. // The caller must free the return value. export fn replace(s: str, needle: str, target: str) str = { diff --git a/strings/sub.ha b/strings/sub.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Andri Yngvason <andri@yngvason.is> +// (c) 2021-2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use encoding::utf8; export type end = void; diff --git a/strings/suffix.ha b/strings/suffix.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Thomas Bracht Laumann Jespersen <t@laumann.xyz> use bytes; use encoding::utf8; diff --git a/strings/tokenize.ha b/strings/tokenize.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Bor Grošelj Simić <bor.groseljsimic@telemach.net> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2022 Sebastian <sebastian@sebsite.pw> use bytes; use types; diff --git a/strings/trim.ha b/strings/trim.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Miccah Castorina <contact@miccah.io> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> use encoding::utf8; const whitespace: [_]rune = [' ', '\n', '\t', '\r']; diff --git a/strings/utf8.ha b/strings/utf8.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> use encoding::utf8; use types; diff --git a/strio/dynamic.ha b/strio/dynamic.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use errors; use io; use strings; diff --git a/strio/fixed.ha b/strio/fixed.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use io; use strings; diff --git a/strio/ops.ha b/strio/ops.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> use encoding::utf8; use io; use strings; diff --git a/temp/+freebsd.ha b/temp/+freebsd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use crypto::random; use encoding::hex; use errors; diff --git a/temp/+linux.ha b/temp/+linux.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021-2022 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use crypto::random; use encoding::hex; use errors; diff --git a/time/+freebsd/functions.ha b/time/+freebsd/functions.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use rt; // Converts a [[duration]] to an [[rt::timespec]]. This function is diff --git a/time/+linux/+aarch64.ha b/time/+linux/+aarch64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + export def VDSO_CGT_SYM: str = "__kernel_clock_gettime"; export def VDSO_CGT_VER: str = "LINUX_2.6.39"; diff --git a/time/+linux/+riscv64.ha b/time/+linux/+riscv64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + export def VDSO_CGT_SYM: str = "__kernel_clock_gettime"; export def VDSO_CGT_VER: str = "LINUX_4.15"; diff --git a/time/+linux/+x86_64.ha b/time/+linux/+x86_64.ha @@ -1,2 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> + export def VDSO_CGT_SYM: str = "__vdso_clock_gettime"; export def VDSO_CGT_VER: str = "LINUX_2.6"; diff --git a/time/+linux/functions.ha b/time/+linux/functions.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Mykyta Holubakha <hilobakho@gmail.com> use rt; use linux::vdso; diff --git a/time/arithm.ha b/time/arithm.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Adds a [[duration]] to an [[instant]], returning an instant further in the // future (given a positive duration), or further in the past (given a negative // duration). diff --git a/time/types.ha b/time/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // The elapsed time between two instants, in nanoseconds. The largest // representable duration is about 290 years. export type duration = i64; diff --git a/types/arch+aarch64.ha b/types/arch+aarch64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Minimum value which can be stored in an int type. export def INT_MIN: int = I32_MIN; diff --git a/types/arch+riscv64.ha b/types/arch+riscv64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Minimum value which can be stored in an int type. export def INT_MIN: int = I32_MIN; diff --git a/types/arch+x86_64.ha b/types/arch+x86_64.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // Minimum value which can be stored in an int type. export def INT_MIN: int = I32_MIN; diff --git a/types/classes.ha b/types/classes.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> + // A tagged union of all signed integer types. export type signed = (i8 | i16 | i32 | i64 | int); diff --git a/types/limits.ha b/types/limits.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Sudipto Mallick <smlckz@disroot.org> + // Minimum value which can be stored in an i8 type. export def I8_MIN: i8 = -128; diff --git a/unix/+freebsd/nice.ha b/unix/+freebsd/nice.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/unix/+freebsd/pipe.ha b/unix/+freebsd/pipe.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use rt; diff --git a/unix/+freebsd/umask.ha b/unix/+freebsd/umask.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use errors; use fs; use rt; diff --git a/unix/+linux/nice.ha b/unix/+linux/nice.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use rt; diff --git a/unix/+linux/pipe.ha b/unix/+linux/pipe.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use rt; diff --git a/unix/+linux/umask.ha b/unix/+linux/umask.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Umar Getagazov <umar@handlerug.me> use errors; use fs; use rt; diff --git a/unix/getuid.ha b/unix/getuid.ha @@ -1,3 +1,5 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> use rt; // Returns the current process user ID. diff --git a/unix/hosts/lookup.ha b/unix/hosts/lookup.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use io; use net::ip; diff --git a/unix/passwd/group.ha b/unix/passwd/group.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use io; use os; diff --git a/unix/passwd/passwd.ha b/unix/passwd/passwd.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021-2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use io; use os; diff --git a/unix/passwd/types.ha b/unix/passwd/types.ha @@ -1,2 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> + // An invalid entry was encountered during parsing. export type invalid = !void; diff --git a/unix/poll/+freebsd.ha b/unix/poll/+freebsd.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use rt; diff --git a/unix/poll/+linux.ha b/unix/poll/+linux.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use rt; diff --git a/unix/resolvconf/load.ha b/unix/resolvconf/load.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use io; use net::ip; diff --git a/unix/setuid.ha b/unix/setuid.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use rt; // Sets the caller's user ID to the specified value. This generally requires diff --git a/unix/tty/+freebsd/isatty.ha b/unix/tty/+freebsd/isatty.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use rt; use io; use os; diff --git a/unix/tty/+freebsd/open.ha b/unix/tty/+freebsd/open.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use fs; use io; diff --git a/unix/tty/+freebsd/termios.ha b/unix/tty/+freebsd/termios.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use rt; use errors; diff --git a/unix/tty/+freebsd/winsize.ha b/unix/tty/+freebsd/winsize.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use errors; use io; use os; diff --git a/unix/tty/+linux/isatty.ha b/unix/tty/+linux/isatty.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use rt; use io; use os; diff --git a/unix/tty/+linux/open.ha b/unix/tty/+linux/open.ha @@ -1,3 +1,8 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use errors; use fs; use io; diff --git a/unix/tty/+linux/termios.ha b/unix/tty/+linux/termios.ha @@ -1,3 +1,6 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use io; use rt; use errors; diff --git a/unix/tty/+linux/winsize.ha b/unix/tty/+linux/winsize.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use errors; use io; use os; diff --git a/unix/tty/types.ha b/unix/tty/types.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2021 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> +// (c) 2021 Kiëd Llaentenn <kiedtl@tilde.team> use errors; // Any error that may occur during TTY-related tasks. diff --git a/uuid/uuid.ha b/uuid/uuid.ha @@ -1,3 +1,7 @@ +// License: MPL-2.0 +// (c) 2022 Alexey Yerin <yyp@disroot.org> +// (c) 2021 Drew DeVault <sir@cmpwn.com> +// (c) 2021 Eyal Sawady <ecs@d2evs.net> use bufio; use bytes; use crypto::random;