hare

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

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:
Mascii/ctype.ha | 4++++
Mascii/strcmp.ha | 3+++
Mbufio/buffered.ha | 5+++++
Mbufio/memstream.ha | 5+++++
Mbufio/scanner.ha | 4++++
Mbytes/contains.ha | 5+++++
Mbytes/equal.ha | 3+++
Mbytes/index.ha | 5+++++
Mbytes/reverse.ha | 3+++
Mbytes/tokenize.ha | 4++++
Mbytes/two_way.ha | 2++
Mbytes/zero.ha | 3+++
Mcmd/hare/main.ha | 3+++
Mcmd/hare/plan.ha | 4++++
Mcmd/hare/release.ha | 3+++
Mcmd/hare/schedule.ha | 5+++++
Mcmd/hare/subcmds.ha | 4++++
Mcmd/harec/context.ha | 3+++
Mcmd/harec/errors.ha | 3+++
Mcmd/harec/gen.ha | 4++++
Mcmd/harec/genutil.ha | 2++
Mcmd/harec/main.ha | 4++++
Mcmd/harec/qbe.ha | 3+++
Mcmd/harec/qtype.ha | 3+++
Mcmd/haredoc/docstr.ha | 5+++++
Mcmd/haredoc/env.ha | 3+++
Mcmd/haredoc/errors.ha | 3+++
Mcmd/haredoc/hare.ha | 4++++
Mcmd/haredoc/html.ha | 7+++++++
Mcmd/haredoc/main.ha | 5+++++
Mcmd/haredoc/resolver.ha | 3+++
Mcmd/haredoc/sort.ha | 3+++
Mcmd/haredoc/tty.ha | 4++++
Mcmd/haretype/main.ha | 2++
Mcmd/iobus/main.ha | 3+++
Mcompress/flate/inflate.ha | 5+++++
Mcompress/zlib/.testdata/gen.ha | 3+++
Mcompress/zlib/data+test.ha | 3+++
Mcompress/zlib/reader.ha | 6++++++
Mcrypto/+test/authenc.ha | 2++
Mcrypto/aes/aes_ct64.ha | 4++++
Mcrypto/aes/cbc+test.ha | 3+++
Mcrypto/aes/ct64+test.ha | 3+++
Mcrypto/aes/ctr+test.ha | 3+++
Mcrypto/aes/xts/+test.ha | 2++
Mcrypto/aes/xts/xts.ha | 2++
Mcrypto/argon2/+test.ha | 3+++
Mcrypto/argon2/argon2.ha | 4++++
Mcrypto/authenc.ha | 3+++
Mcrypto/blake2b/+test.ha | 5+++++
Mcrypto/blake2b/blake2b.ha | 4++++
Mcrypto/blake2b/vectors+test.ha | 3+++
Mcrypto/chacha/+test.ha | 2++
Mcrypto/chacha/chacha20.ha | 2++
Mcrypto/cipher/block.ha | 4++++
Mcrypto/cipher/cbc.ha | 3+++
Mcrypto/cipher/cipher.ha | 3+++
Mcrypto/cipher/ctr.ha | 3+++
Mcrypto/cipher/stream.ha | 3+++
Mcrypto/curve25519/+test.ha | 2++
Mcrypto/curve25519/curve25519.ha | 3+++
Mcrypto/hmac/+test.ha | 2++
Mcrypto/hmac/hmac.ha | 3+++
Mcrypto/hmac/sha256.ha | 2++
Mcrypto/keyderiv.ha | 2++
Mcrypto/mac/mac.ha | 2++
Mcrypto/math/bits.ha | 5+++++
Mcrypto/poly1305/+test.ha | 2++
Mcrypto/poly1305/poly1305.ha | 3+++
Mcrypto/random/+freebsd.ha | 3+++
Mcrypto/random/+linux.ha | 3+++
Mcrypto/random/random.ha | 3+++
Mcrypto/salsa/+test.ha | 2++
Mcrypto/salsa/salsa20.ha | 2++
Mcrypto/sha1/+test.ha | 4++++
Mcrypto/sha1/sha1.ha | 5+++++
Mcrypto/sha256/+test.ha | 4++++
Mcrypto/sha256/sha256.ha | 4++++
Mcrypto/sha512/+test.ha | 4++++
Mcrypto/sha512/sha512.ha | 6++++++
Mdirs/xdg.ha | 4++++
Mencoding/base32/base32.ha | 2++
Mencoding/base64/base64.ha | 6++++++
Mencoding/hex/hex.ha | 5+++++
Mencoding/utf8/decode.ha | 4++++
Mencoding/utf8/encode.ha | 3+++
Mencoding/utf8/rune.ha | 2++
Mendian/big.ha | 4++++
Mendian/endian.ha | 4++++
Mendian/host+aarch64.ha | 3+++
Mendian/host+riscv64.ha | 3+++
Mendian/host+x86_64.ha | 3+++
Mendian/little.ha | 4++++
Mendian/network.ha | 3+++
Merrors/common.ha | 5+++++
Merrors/opaque.ha | 4++++
Merrors/rt.ha | 2++
Merrors/string.ha | 4++++
Mfmt/fmt.ha | 7+++++++
Mfnmatch/+test.ha | 3+++
Mfnmatch/fnmatch.ha | 7+++++++
Mformat/elf/+aarch64.ha | 3+++
Mformat/elf/+freebsd.ha | 3+++
Mformat/elf/+linux.ha | 3+++
Mformat/elf/+riscv64.ha | 3+++
Mformat/elf/+x86_64.ha | 3+++
Mformat/elf/types.ha | 5+++++
Mformat/ini/+test.ha | 2++
Mformat/ini/scan.ha | 5+++++
Mformat/ini/types.ha | 4++++
Mformat/xml/+test.ha | 5+++++
Mformat/xml/chars.ha | 2++
Mformat/xml/parser.ha | 6++++++
Mformat/xml/types.ha | 4++++
Mfs/fs.ha | 7+++++++
Mfs/types.ha | 4++++
Mfs/util.ha | 5+++++
Mgetopt/getopts.ha | 7+++++++
Mhare/ast/decl.ha | 3+++
Mhare/ast/expr.ha | 4++++
Mhare/ast/ident.ha | 4++++
Mhare/ast/import.ha | 4++++
Mhare/ast/type.ha | 4++++
Mhare/ast/unit.ha | 4++++
Mhare/lex/+test.ha | 7+++++++
Mhare/lex/lex.ha | 7+++++++
Mhare/lex/token.ha | 4++++
Mhare/module/context.ha | 4++++
Mhare/module/manifest.ha | 6++++++
Mhare/module/scan.ha | 7+++++++
Mhare/module/types.ha | 3+++
Mhare/module/walk.ha | 3+++
Mhare/parse/+test/expr.ha | 7+++++++
Mhare/parse/+test/ident.ha | 3+++
Mhare/parse/+test/loc.ha | 4++++
Mhare/parse/+test/roundtrip.ha | 5+++++
Mhare/parse/+test/types.ha | 3+++
Mhare/parse/+test/unit.ha | 6++++++
Mhare/parse/decl.ha | 3+++
Mhare/parse/expr.ha | 6++++++
Mhare/parse/ident.ha | 4++++
Mhare/parse/import.ha | 3+++
Mhare/parse/parse.ha | 5+++++
Mhare/parse/type.ha | 4++++
Mhare/parse/unit.ha | 3+++
Mhare/types/+test.ha | 6++++++
Mhare/types/arch.ha | 3+++
Mhare/types/builtins.ha | 3+++
Mhare/types/class.ha | 4++++
Mhare/types/hash.ha | 3+++
Mhare/types/lookup.ha | 3+++
Mhare/types/store.ha | 4++++
Mhare/types/types.ha | 4++++
Mhare/unit/+test.ha | 3+++
Mhare/unit/check.ha | 3+++
Mhare/unit/context.ha | 2++
Mhare/unit/errors.ha | 2++
Mhare/unit/expr.ha | 2++
Mhare/unit/process.ha | 6++++++
Mhare/unit/scan.ha | 4++++
Mhare/unit/scope.ha | 3+++
Mhare/unit/unit.ha | 2++
Mhare/unparse/decl.ha | 5+++++
Mhare/unparse/expr.ha | 5+++++
Mhare/unparse/ident.ha | 4++++
Mhare/unparse/import.ha | 4++++
Mhare/unparse/type.ha | 4++++
Mhare/unparse/unit.ha | 3+++
Mhare/unparse/util.ha | 3+++
Mhash/adler32/adler32.ha | 4++++
Mhash/crc16/crc16.ha | 4++++
Mhash/crc32/crc32.ha | 4++++
Mhash/crc64/crc64.ha | 4++++
Mhash/fnv/fnv.ha | 3+++
Mhash/hash.ha | 4++++
Mio/+freebsd/file.ha | 3+++
Mio/+freebsd/mmap.ha | 3+++
Mio/+linux/file.ha | 4++++
Mio/+linux/mmap.ha | 3+++
Mio/+test/copy.ha | 4++++
Mio/+test/limit.ha | 4++++
Mio/+test/stream.ha | 3+++
Mio/arch+aarch64.ha | 3+++
Mio/arch+riscv64.ha | 3+++
Mio/arch+x86_64.ha | 3+++
Mio/copy.ha | 3+++
Mio/drain.ha | 5+++++
Mio/empty.ha | 4++++
Mio/filestream.ha | 3+++
Mio/handle.ha | 4++++
Mio/limit.ha | 5+++++
Mio/println+freebsd.ha | 2++
Mio/println+linux.ha | 2++
Mio/stream.ha | 4++++
Mio/tee.ha | 4++++
Mio/types.ha | 3+++
Mio/util.ha | 5+++++
Miobus/io_uring/bus.ha | 5+++++
Miobus/io_uring/handle.ha | 4++++
Miobus/io_uring/ops.ha | 4++++
Miobus/io_uring/pool.ha | 2++
Miobus/io_uring/types.ha | 3+++
Mlinux/env.ha | 2++
Mlinux/io_uring/cqe.ha | 4++++
Mlinux/io_uring/queue.ha | 4++++
Mlinux/io_uring/register.ha | 3+++
Mlinux/io_uring/setup.ha | 3+++
Mlinux/io_uring/sqe.ha | 4++++
Mlinux/io_uring/uring.ha | 4++++
Mlinux/signalfd/signalfd.ha | 4++++
Mlinux/start+libc.ha | 2++
Mlinux/start.ha | 2++
Mlinux/vdso/vdso.ha | 4++++
Mmath/data+test.ha | 4++++
Mmath/fenv+aarch64.ha | 3+++
Mmath/fenv+x86_64.ha | 3+++
Mmath/fenv_func.ha | 2++
Mmath/floats.ha | 6++++++
Mmath/ints.ha | 5+++++
Mmath/math.ha | 5+++++
Mmath/random/random.ha | 3+++
Mmath/trig.ha | 3+++
Mmath/uints.ha | 3+++
Mmime/database.ha | 2++
Mmime/lookup.ha | 2++
Mmime/parse.ha | 2++
Mmime/system.ha | 2++
Mnet/+freebsd.ha | 4++++
Mnet/+linux.ha | 4++++
Mnet/dial/dial.ha | 2++
Mnet/dial/ip.ha | 5+++++
Mnet/dial/registry.ha | 3+++
Mnet/dial/resolve.ha | 3+++
Mnet/dns/decode.ha | 2++
Mnet/dns/encode.ha | 2++
Mnet/dns/error.ha | 3+++
Mnet/dns/query.ha | 2++
Mnet/dns/types.ha | 4++++
Mnet/errors.ha | 4++++
Mnet/ip/+freebsd.ha | 3+++
Mnet/ip/+linux.ha | 4++++
Mnet/ip/+test.ha | 6++++++
Mnet/ip/ip.ha | 9+++++++++
Mnet/listener.ha | 3+++
Mnet/msg.ha | 3+++
Mnet/tcp/+freebsd.ha | 3+++
Mnet/tcp/+linux.ha | 3+++
Mnet/tcp/listener.ha | 2++
Mnet/tcp/options.ha | 3+++
Mnet/udp/+freebsd.ha | 3+++
Mnet/udp/+linux.ha | 3+++
Mnet/udp/options.ha | 3+++
Mnet/unix/+freebsd.ha | 3+++
Mnet/unix/+linux.ha | 4++++
Mnet/unix/addr.ha | 4++++
Mnet/unix/cmsg.ha | 2++
Mnet/unix/dial.ha | 3+++
Mnet/unix/listener.ha | 2++
Mnet/unix/options.ha | 3+++
Mnet/unix/socketpair.ha | 3+++
Mos/+freebsd/dirfdfs.ha | 3+++
Mos/+freebsd/environ.ha | 3+++
Mos/+freebsd/exit.ha | 2++
Mos/+freebsd/fs.ha | 3+++
Mos/+freebsd/stdfd.ha | 3+++
Mos/+linux/dirfdfs.ha | 5+++++
Mos/+linux/environ+libc.ha | 2++
Mos/+linux/environ.ha | 3+++
Mos/+linux/exit.ha | 2++
Mos/+linux/fs.ha | 3+++
Mos/+linux/stdfd.ha | 3+++
Mos/exec/cmd.ha | 4++++
Mos/exec/exec+freebsd.ha | 3+++
Mos/exec/exec+linux.ha | 3+++
Mos/exec/process+freebsd.ha | 4++++
Mos/exec/process+linux.ha | 4++++
Mos/exec/types.ha | 3+++
Mos/fs.ha | 4++++
Mpath/+freebsd.ha | 3+++
Mpath/+linux.ha | 3+++
Mpath/buffer.ha | 3+++
Mpath/iter.ha | 4++++
Mpath/join.ha | 2++
Mpath/names.ha | 4++++
Mpath/util.ha | 2++
Mrt/+aarch64/backtrace.ha | 5+++++
Mrt/+aarch64/jmp.ha | 3+++
Mrt/+freebsd/abort.ha | 3+++
Mrt/+freebsd/env.ha | 3+++
Mrt/+freebsd/errno.ha | 3+++
Mrt/+freebsd/platformstart.ha | 3+++
Mrt/+freebsd/segmalloc.ha | 4++++
Mrt/+freebsd/signal.ha | 3+++
Mrt/+freebsd/socket.ha | 4++++
Mrt/+freebsd/syscallno.ha | 3+++
Mrt/+freebsd/syscalls.ha | 5+++++
Mrt/+freebsd/types.ha | 6++++++
Mrt/+linux/+aarch64.ha | 5+++++
Mrt/+linux/+riscv64.ha | 5+++++
Mrt/+linux/+x86_64.ha | 4++++
Mrt/+linux/abort.ha | 3+++
Mrt/+linux/env.ha | 3+++
Mrt/+linux/errno.ha | 4++++
Mrt/+linux/platformstart+libc.ha | 3+++
Mrt/+linux/platformstart.ha | 4++++
Mrt/+linux/prctl.ha | 3+++
Mrt/+linux/segmalloc.ha | 4++++
Mrt/+linux/signal.ha | 3+++
Mrt/+linux/socket.ha | 4++++
Mrt/+linux/stat.ha | 3+++
Mrt/+linux/syscallno+aarch64.ha | 3+++
Mrt/+linux/syscallno+riscv64.ha | 3+++
Mrt/+linux/syscallno+x86_64.ha | 3+++
Mrt/+linux/syscalls.ha | 7+++++++
Mrt/+linux/types.ha | 9+++++++++
Mrt/+riscv64/backtrace.ha | 4++++
Mrt/+riscv64/jmp.ha | 3+++
Mrt/+test/+freebsd.ha | 3+++
Mrt/+test/+linux.ha | 4++++
Mrt/+test/cstring.ha | 3+++
Mrt/+test/run.ha | 5+++++
Mrt/+test/ztos.ha | 3+++
Mrt/+x86_64/backtrace.ha | 5+++++
Mrt/+x86_64/jmp.ha | 3+++
Mrt/abort+test.ha | 4++++
Mrt/abort.ha | 3+++
Mrt/ensure.ha | 4++++
Mrt/fenv_defs.ha | 3+++
Mrt/jmp.ha | 3+++
Mrt/malloc+debug.ha | 3+++
Mrt/malloc+libc.ha | 3+++
Mrt/malloc.ha | 4++++
Mrt/memcpy.ha | 3+++
Mrt/memmove.ha | 3+++
Mrt/memset.ha | 3+++
Mrt/start+libc.ha | 3+++
Mrt/start+test+libc.ha | 3+++
Mrt/start+test.ha | 3+++
Mrt/start.ha | 4++++
Mrt/strcmp.ha | 3+++
Mshlex/+test.ha | 2++
Mshlex/split.ha | 3+++
Mslice/reverse.ha | 3+++
Mslice/trunc.ha | 2++
Mslice/void.ha | 2++
Msort/+test.ha | 4++++
Msort/search.ha | 3+++
Msort/sort.ha | 4++++
Mstrconv/+test/stoi.ha | 6++++++
Mstrconv/+test/stou.ha | 5+++++
Mstrconv/ftos.ha | 8++++++++
Mstrconv/itos.ha | 4++++
Mstrconv/numeric.ha | 3+++
Mstrconv/stof.ha | 5+++++
Mstrconv/stof_data.ha | 3+++
Mstrconv/stoi.ha | 5+++++
Mstrconv/stou.ha | 4++++
Mstrconv/types.ha | 5+++++
Mstrconv/utos.ha | 4++++
Mstrings/concat.ha | 3+++
Mstrings/contains.ha | 3+++
Mstrings/cstrings.ha | 4++++
Mstrings/dup.ha | 5+++++
Mstrings/index.ha | 4++++
Mstrings/iter.ha | 6++++++
Mstrings/pad.ha | 2++
Mstrings/replace.ha | 4++++
Mstrings/sub.ha | 5+++++
Mstrings/suffix.ha | 4++++
Mstrings/tokenize.ha | 5+++++
Mstrings/trim.ha | 5+++++
Mstrings/utf8.ha | 2++
Mstrio/dynamic.ha | 3+++
Mstrio/fixed.ha | 3+++
Mstrio/ops.ha | 3+++
Mtemp/+freebsd.ha | 4++++
Mtemp/+linux.ha | 4++++
Mtime/+freebsd/functions.ha | 3+++
Mtime/+linux/+aarch64.ha | 3+++
Mtime/+linux/+riscv64.ha | 3+++
Mtime/+linux/+x86_64.ha | 3+++
Mtime/+linux/functions.ha | 4++++
Mtime/arithm.ha | 3+++
Mtime/types.ha | 4++++
Mtypes/arch+aarch64.ha | 3+++
Mtypes/arch+riscv64.ha | 3+++
Mtypes/arch+x86_64.ha | 3+++
Mtypes/classes.ha | 3+++
Mtypes/limits.ha | 4++++
Munix/+freebsd/nice.ha | 3+++
Munix/+freebsd/pipe.ha | 3+++
Munix/+freebsd/umask.ha | 2++
Munix/+linux/nice.ha | 3+++
Munix/+linux/pipe.ha | 2++
Munix/+linux/umask.ha | 3+++
Munix/getuid.ha | 2++
Munix/hosts/lookup.ha | 4++++
Munix/passwd/group.ha | 4++++
Munix/passwd/passwd.ha | 4++++
Munix/passwd/types.ha | 4++++
Munix/poll/+freebsd.ha | 3+++
Munix/poll/+linux.ha | 3+++
Munix/resolvconf/load.ha | 4++++
Munix/setuid.ha | 3+++
Munix/tty/+freebsd/isatty.ha | 3+++
Munix/tty/+freebsd/open.ha | 3+++
Munix/tty/+freebsd/termios.ha | 3+++
Munix/tty/+freebsd/winsize.ha | 3+++
Munix/tty/+linux/isatty.ha | 5+++++
Munix/tty/+linux/open.ha | 5+++++
Munix/tty/+linux/termios.ha | 3+++
Munix/tty/+linux/winsize.ha | 4++++
Munix/tty/types.ha | 4++++
Muuid/uuid.ha | 4++++
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;