chiark / gitweb /
mLib
4 days ago@@@ fltfmt fettling mdw/tvec
Mark Wooding [Sun, 27 Apr 2025 03:06:06 +0000 (04:06 +0100)]
@@@ fltfmt fettling

4 days ago@@@ ttyprogress commentary, tty fixes
Mark Wooding [Sun, 27 Apr 2025 02:38:49 +0000 (03:38 +0100)]
@@@ ttyprogress commentary, tty fixes

4 days ago@@@ tty commentary
Mark Wooding [Sat, 26 Apr 2025 23:43:35 +0000 (00:43 +0100)]
@@@ tty commentary

5 days ago@@@ tvec and tty mess
Mark Wooding [Fri, 25 Apr 2025 17:08:35 +0000 (18:08 +0100)]
@@@ tvec and tty mess

6 days ago@@@ more tty mess
Mark Wooding [Fri, 25 Apr 2025 09:02:03 +0000 (10:02 +0100)]
@@@ more tty mess

6 days ago@@@ tty cleanup
Mark Wooding [Fri, 25 Apr 2025 01:19:44 +0000 (02:19 +0100)]
@@@ tty cleanup

6 days ago@@@ utils/t/fltfmt-test.c: Use correct constant name `INFINITY'.
Mark Wooding [Thu, 24 Apr 2025 19:59:26 +0000 (20:59 +0100)]
@@@ utils/t/fltfmt-test.c: Use correct constant name `INFINITY'.

6 days ago@@@ tty mess
Mark Wooding [Thu, 24 Apr 2025 18:12:05 +0000 (19:12 +0100)]
@@@ tty mess

9 months agostruct/sym.c: Fix loading following table extension.
Mark Wooding [Thu, 18 Jul 2024 15:09:18 +0000 (16:09 +0100)]
struct/sym.c: Fix loading following table extension.

The calculation should be based on the previous size, because we've
already spent half of the tokens getting to this point.

9 months agostruct/hash.c: Simplify the table resize reallocation.
Mark Wooding [Thu, 18 Jul 2024 15:08:11 +0000 (16:08 +0100)]
struct/hash.c: Simplify the table resize reallocation.

So much easier with `A_RENEWV'.

9 months ago*.[ch]: Remove unnecessary header files.
Mark Wooding [Thu, 18 Jul 2024 15:05:30 +0000 (16:05 +0100)]
*.[ch]: Remove unnecessary header files.

Not a complete sweep: I concentrated on <stdio.h>, <stdlib.h>, and
<string.h>, which I apparently included without thinking when starting a
new file.

9 months ago@@@ pool upgrade
Mark Wooding [Mon, 15 Jul 2024 22:32:10 +0000 (23:32 +0100)]
@@@ pool upgrade

9 months ago@@@ random mess
Mark Wooding [Mon, 15 Jul 2024 22:32:04 +0000 (23:32 +0100)]
@@@ random mess

9 months agostruct/buf.c: Add new functions `buf_alignskip' and `buf_alignfill'.
Mark Wooding [Tue, 9 Jul 2024 17:09:30 +0000 (18:09 +0100)]
struct/buf.c: Add new functions `buf_alignskip' and `buf_alignfill'.

9 months agostruct/buf.c: Add new function `buf_fill' to include arbitrary padding.
Mark Wooding [Tue, 9 Jul 2024 17:09:03 +0000 (18:09 +0100)]
struct/buf.c: Add new function `buf_fill' to include arbitrary padding.

9 months agostruct/buf.3.in: Correct the type of `buf_put' in the synopsis.
Mark Wooding [Tue, 9 Jul 2024 17:07:59 +0000 (18:07 +0100)]
struct/buf.3.in: Correct the type of `buf_put' in the synopsis.

9 months ago@@@ tvec buffer align power-of-two
Mark Wooding [Tue, 9 Jul 2024 17:07:01 +0000 (18:07 +0100)]
@@@ tvec buffer align power-of-two

9 months ago@@@ more mess
Mark Wooding [Sun, 7 Jul 2024 13:34:54 +0000 (14:34 +0100)]
@@@ more mess

11 months ago@@@ big mess
Mark Wooding [Tue, 21 May 2024 12:13:00 +0000 (13:13 +0100)]
@@@ big mess

12 months ago@@@ fltfmt wip
Mark Wooding [Tue, 23 Apr 2024 23:49:56 +0000 (00:49 +0100)]
@@@ fltfmt wip

12 months ago@@@ doc wip
Mark Wooding [Tue, 23 Apr 2024 01:14:54 +0000 (02:14 +0100)]
@@@ doc wip

12 months ago@@@ mostly bench docs
Mark Wooding [Mon, 22 Apr 2024 17:15:31 +0000 (18:15 +0100)]
@@@ mostly bench docs

12 months ago@@@ fltfmt mess
Mark Wooding [Sun, 21 Apr 2024 23:30:51 +0000 (00:30 +0100)]
@@@ fltfmt mess

12 months agoutils/bits.h: Delete duplicate macro definitions for big-endian targets.
Mark Wooding [Sat, 6 Apr 2024 23:58:08 +0000 (00:58 +0100)]
utils/bits.h: Delete duplicate macro definitions for big-endian targets.

13 months ago@@@ misc wip
Mark Wooding [Sat, 16 Mar 2024 13:37:38 +0000 (13:37 +0000)]
@@@ misc wip

13 months ago@@@ misc mess
Mark Wooding [Thu, 14 Mar 2024 09:15:46 +0000 (09:15 +0000)]
@@@ misc mess

13 months ago@@@ much mess, mostly manpages
Mark Wooding [Wed, 13 Mar 2024 03:43:58 +0000 (03:43 +0000)]
@@@ much mess, mostly manpages

13 months ago@@@ man wip
Mark Wooding [Tue, 12 Mar 2024 01:20:08 +0000 (01:20 +0000)]
@@@ man wip

13 months ago@@@ bench man
Mark Wooding [Mon, 11 Mar 2024 13:04:04 +0000 (13:04 +0000)]
@@@ bench man

13 months ago@@@ bench wip
Mark Wooding [Mon, 11 Mar 2024 03:41:32 +0000 (03:41 +0000)]
@@@ bench wip

13 months agoconfigure.ac: Lightly modernize.
Mark Wooding [Sun, 10 Mar 2024 18:31:39 +0000 (18:31 +0000)]
configure.ac: Lightly modernize.

  * Use `LT_INIT' instead of `AM_PROG_LIBTOOL'.
  * Use `AC_CONFIG_HEADERS' instead of `AC_CONFIG_HEADER'.

13 months ago@@@ man wip
Mark Wooding [Sat, 9 Mar 2024 23:20:43 +0000 (23:20 +0000)]
@@@ man wip

13 months ago@@@ tvec setvar
Mark Wooding [Fri, 8 Mar 2024 22:46:21 +0000 (22:46 +0000)]
@@@ tvec setvar

13 months ago@@@ tvec doc wip
Mark Wooding [Fri, 8 Mar 2024 00:53:40 +0000 (00:53 +0000)]
@@@ tvec doc wip

14 months ago@@@ timeout wip
Mark Wooding [Fri, 1 Mar 2024 10:05:16 +0000 (10:05 +0000)]
@@@ timeout wip

14 months ago@@@ output doc
Mark Wooding [Thu, 22 Feb 2024 19:49:54 +0000 (19:49 +0000)]
@@@ output doc

14 months ago@@@ wip misc
Mark Wooding [Thu, 22 Feb 2024 19:49:15 +0000 (19:49 +0000)]
@@@ wip misc

14 months agoutils/gprintf.c: Fix function name in error message.
Mark Wooding [Thu, 22 Feb 2024 19:45:24 +0000 (19:45 +0000)]
utils/gprintf.c: Fix function name in error message.

14 months agoutils/gprintf.c: Return the correct number of output characters.
Mark Wooding [Thu, 22 Feb 2024 19:43:58 +0000 (19:43 +0000)]
utils/gprintf.c: Return the correct number of output characters.

Also fix the test program to check that the output count is correct.

14 months ago@@@ wip tap 14
Mark Wooding [Wed, 21 Feb 2024 14:21:02 +0000 (14:21 +0000)]
@@@ wip tap 14

14 months ago@@@ wip mostly xfail
Mark Wooding [Wed, 21 Feb 2024 13:06:18 +0000 (13:06 +0000)]
@@@ wip mostly xfail

14 months ago@@@ remote works?
Mark Wooding [Wed, 21 Feb 2024 02:39:21 +0000 (02:39 +0000)]
@@@ remote works?

16 months ago@@@ wip
Mark Wooding [Wed, 27 Dec 2023 17:58:04 +0000 (17:58 +0000)]
@@@ wip

22 months ago@@@ tvec wip
Mark Wooding [Mon, 26 Jun 2023 12:48:58 +0000 (13:48 +0100)]
@@@ tvec wip

22 months ago@@@ BROKEN wip
Mark Wooding [Sat, 3 Jun 2023 09:31:39 +0000 (10:31 +0100)]
@@@ BROKEN wip

23 months ago@@@ more mess
Mark Wooding [Fri, 26 May 2023 09:33:42 +0000 (10:33 +0100)]
@@@ more mess

23 months ago@@@ so much mess
Mark Wooding [Thu, 25 May 2023 07:45:34 +0000 (08:45 +0100)]
@@@ so much mess

23 months ago@@@ adjust bench timings
Mark Wooding [Thu, 11 May 2023 01:55:25 +0000 (02:55 +0100)]
@@@ adjust bench timings

23 months ago@@@ sink bench
Mark Wooding [Thu, 11 May 2023 01:55:16 +0000 (02:55 +0100)]
@@@ sink bench

23 months ago@@@ tvec error return
Mark Wooding [Thu, 11 May 2023 01:46:22 +0000 (02:46 +0100)]
@@@ tvec error return

23 months ago@@@ wip type definitions in manpage synopses
Mark Wooding [Wed, 10 May 2023 01:26:19 +0000 (02:26 +0100)]
@@@ wip type definitions in manpage synopses

23 months agostruct/hash.3: Zap spurious space before pointer argument name.
Mark Wooding [Wed, 10 May 2023 23:09:37 +0000 (00:09 +0100)]
struct/hash.3: Zap spurious space before pointer argument name.

23 months agosys/mdup.3: Add missing `.nf'...`.fi' around the synopsis.
Mark Wooding [Wed, 10 May 2023 23:09:20 +0000 (00:09 +0100)]
sys/mdup.3: Add missing `.nf'...`.fi' around the synopsis.

23 months agocodec/base64.3: Supply missing Oxford comma.
Mark Wooding [Wed, 10 May 2023 23:09:01 +0000 (00:09 +0100)]
codec/base64.3: Supply missing Oxford comma.

23 months ago*/*.3: Align arguments properly to the right of the opening `('.
Mark Wooding [Wed, 10 May 2023 23:02:16 +0000 (00:02 +0100)]
*/*.3: Align arguments properly to the right of the opening `('.

This involves a little stunt roff, but we'll manage somehow.

23 months agotest/testrig.3: Correct return type of `test_do' in the synopsis.
Mark Wooding [Wed, 10 May 2023 23:04:04 +0000 (00:04 +0100)]
test/testrig.3: Correct return type of `test_do' in the synopsis.

The later text explains what the function returns, so it clearly is
meant to have a meaningful return value, so the synopsis was just always
wrong.

23 months agocodec/url.3: Add missing documentation for the `URLF_SEMI' flag.
Mark Wooding [Wed, 10 May 2023 22:56:44 +0000 (23:56 +0100)]
codec/url.3: Add missing documentation for the `URLF_SEMI' flag.

23 months agocodec/url.h: Delete stray blank line.
Mark Wooding [Wed, 10 May 2023 01:25:58 +0000 (02:25 +0100)]
codec/url.h: Delete stray blank line.

23 months ago@@@ all the mess ever
Mark Wooding [Mon, 8 May 2023 23:32:27 +0000 (00:32 +0100)]
@@@ all the mess ever

23 months agoutils/control.h: Allow statement block without terminating semicolon.
Mark Wooding [Mon, 8 May 2023 23:42:32 +0000 (00:42 +0100)]
utils/control.h: Allow statement block without terminating semicolon.

2 years ago@@@ major overhaul, new primitives mdw/control
Mark Wooding [Tue, 25 Apr 2023 00:21:11 +0000 (01:21 +0100)]
@@@ major overhaul, new primitives

2 years ago@@@ better tests
Mark Wooding [Sun, 23 Apr 2023 23:05:35 +0000 (00:05 +0100)]
@@@ better tests

2 years ago@@@ wip@g
Mark Wooding [Sun, 23 Apr 2023 14:47:00 +0000 (15:47 +0100)]
@@@ wip@g

2 years ago@@@ control wip@cb
Mark Wooding [Sat, 22 Apr 2023 20:53:17 +0000 (21:53 +0100)]
@@@ control wip@cb

2 years agocodec/tests.at: Delete stray space before tab.
Mark Wooding [Sat, 30 Apr 2022 15:27:33 +0000 (16:27 +0100)]
codec/tests.at: Delete stray space before tab.

2 years agoutils/macros.h: Add `MUST_CHECK', so return codes aren't ignored.
Mark Wooding [Thu, 22 Dec 2022 17:10:27 +0000 (17:10 +0000)]
utils/macros.h: Add `MUST_CHECK', so return codes aren't ignored.

2 years agoutils/macros.3: Create manpage for the `CLANG_WARNING' macro.
Mark Wooding [Thu, 22 Dec 2022 17:09:33 +0000 (17:09 +0000)]
utils/macros.3: Create manpage for the `CLANG_WARNING' macro.

2 years ago.gitignore: Absorb `t/.gitignore'.
Mark Wooding [Sat, 30 Apr 2022 16:02:14 +0000 (17:02 +0100)]
.gitignore: Absorb `t/.gitignore'.

The ignored files are mostly global machinery which happens to be tucked
away in `t/'.

2 years agoutils/macros.h (STATIC_ASSERT): Boolean-canonify the expression.
Mark Wooding [Thu, 23 Jun 2022 14:01:14 +0000 (15:01 +0100)]
utils/macros.h (STATIC_ASSERT): Boolean-canonify the expression.

6.7.10p3 insists that the expression be an integer constant expression,
but this isn't in a constraint, so the behaviour is undefined if it's
not an integer constant expression.  Apply `!!' to force pointerish
expressions to integer type.

*headdesk*

3 years agoconfigure.ac: Provide a non-empty default manpage extension.
Mark Wooding [Sat, 30 Apr 2022 16:02:14 +0000 (17:02 +0100)]
configure.ac: Provide a non-empty default manpage extension.

This has been a bug forever, but there's been a corresponding bug
in the `mdw_MANEXT' macro forever which ignores the supplied default
and uses `mLib' instead, so nobody noticed.  Until I fixed the
other bug and my build broke.

3 years agovars.am: Quote `$(manext)', or things break if it's empty.
Mark Wooding [Sat, 30 Apr 2022 16:00:22 +0000 (17:00 +0100)]
vars.am: Quote `$(manext)', or things break if it's empty.

It's not usually empty because it's defaulted in `configure.ac', but
it can be overridden to be empty.  Also, there might be bugs.

3 years ago.gitignore: Organize and clean up.
Mark Wooding [Sat, 30 Apr 2022 18:51:14 +0000 (19:51 +0100)]
.gitignore: Organize and clean up.

Divide into sections and add headings; add leading `/' to patterns which
are only expected to match in the same directory as the `.gitignore'
file; and add trailing `/' to patterns which should match directories.

3 years agoutils/compiler.h: Prefer `ifdef' rather than `if defined'.
Mark Wooding [Sat, 4 Sep 2021 18:53:51 +0000 (19:53 +0100)]
utils/compiler.h: Prefer `ifdef' rather than `if defined'.

4 years agostruct/buf.h: Muffle annoying new GCC warning.
Mark Wooding [Fri, 8 May 2020 23:10:54 +0000 (00:10 +0100)]
struct/buf.h: Muffle annoying new GCC warning.

This one seems like more trouble than it's worth.  Just squash it in
GCC versions recent enough to know about the warning.

4 years agoRelease 2.5.0. 2.5.0
Mark Wooding [Fri, 8 May 2020 19:16:53 +0000 (20:16 +0100)]
Release 2.5.0.

4 years agoutils/versioncmp.h: Add a wrapper macro for `versioncmp'.
Mark Wooding [Fri, 8 May 2020 19:15:30 +0000 (20:15 +0100)]
utils/versioncmp.h: Add a wrapper macro for `versioncmp'.

Similar to the macros introduced for `strcmp' end friends in
3618811496a6d131fd4bffa19e262c521d39e819.

4 years agostruct/assoc.[ch]: Fix some commentary typos.
Mark Wooding [Sat, 28 Mar 2020 09:32:52 +0000 (09:32 +0000)]
struct/assoc.[ch]: Fix some commentary typos.

4 years ago*/t/*.py: Fix the various testing scripts for Python 3 compatibility.
Mark Wooding [Fri, 4 Oct 2019 17:30:26 +0000 (18:30 +0100)]
*/t/*.py: Fix the various testing scripts for Python 3 compatibility.

  * Put parentheses around `print' arguments.  (This is most of the
    churn.)

  * Cope with `xrange' being renamed to `range' in Python 3.

  * Cope with `MAP.keys()' not returning a list any more in Python 3.

  * Cope with integer division not returning an integer any more in
    Python 3.  (Use a shift, because that's not changed.)

4 years agoutils/macros.h: Add <ctype.h> and `foocmp' helper macros.
Mark Wooding [Tue, 1 Oct 2019 17:41:17 +0000 (18:41 +0100)]
utils/macros.h: Add <ctype.h> and `foocmp' helper macros.

Both of these have been a nuisance for years.  Do something about it.

The command

git grep -En '\<(is|to)[a-z]+\(|\<(str|mem)[a-z]*cmp\(' -- '*.[ch]'

finds code which it might be good to change.

The hairy Emacs command

(query-replace-regexp
 "\\<\\(\\(str\\|mem\\)\\sw*cmp\\)(\\([^,]*\\), \\([^)]*\\)) \\(==\\|!=\\|<\\|<=\\|>\\|>=\\) 0"
 '(replace-eval-replacement
   . (concat (replace-quote (upcase (match-string 1)))
     "(\\3, \\5, \\4)"))
 nil
 (if (and transient-mark-mode mark-active) (region-beginning))
 (if (and transient-mark-mode mark-active) (region-end))
 nil)

will convert easy cases of `foocmp' calls, but hard ones have to be done
by hand.

4 years agoMerge branch '2.4.x'
Mark Wooding [Fri, 8 May 2020 12:43:59 +0000 (13:43 +0100)]
Merge branch '2.4.x'

* 2.4.x:
  Release 2.4.2.
  sel/bres-adns.c: Fix incorrect array bound.

4 years agoRelease 2.4.2. 2.4.x 2.4.2
Mark Wooding [Fri, 8 May 2020 11:45:33 +0000 (12:45 +0100)]
Release 2.4.2.

4 years agosel/bres-adns.c: Fix incorrect array bound.
Mark Wooding [Tue, 7 Apr 2020 19:30:49 +0000 (20:30 +0100)]
sel/bres-adns.c: Fix incorrect array bound.

GCC helpfully points out that `N(av)' does nothing very useful.  In
fact, I expect that it's almost always zero, which means that we don't
end up assembling addresses correctly.  And we never have done.

How embarrassing.

(cherry picked from commit 5086ffd7745337f5bee3c5c771cfcf1da71b03c3)

5 years agosel/bres-adns.c: Fix incorrect array bound.
Mark Wooding [Tue, 7 Apr 2020 19:30:49 +0000 (20:30 +0100)]
sel/bres-adns.c: Fix incorrect array bound.

GCC helpfully points out that `N(av)' does nothing very useful.  In
fact, I expect that it's almost always zero, which means that we don't
end up assembling addresses correctly.  And we never have done.

How embarrassing.

5 years agoMerge branch '2.4.x'
Mark Wooding [Sat, 19 Oct 2019 13:41:53 +0000 (14:41 +0100)]
Merge branch '2.4.x'

* 2.4.x:
  struct/buf.c (buf_getmem*): Add an explicit `BENSURE'.

5 years agostruct/buf.c (buf_getmem*): Add an explicit `BENSURE'.
Mark Wooding [Fri, 11 Oct 2019 22:15:42 +0000 (23:15 +0100)]
struct/buf.c (buf_getmem*): Add an explicit `BENSURE'.

Otherwise we fail when processing a 64-bit length on a 32-bit platform:
an overlong 64-bit length gets truncated to a possibly-acceptable 32-bit
length in the implicit conversion to `size_t' in the call to `buf_get'.
Using `BENSURE' directly ensures that the comparison gets done with the
correct integer type.

5 years agoMerge branch '2.4.x'
Mark Wooding [Tue, 8 Oct 2019 10:29:17 +0000 (11:29 +0100)]
Merge branch '2.4.x'

* 2.4.x:
  utils/str.3: Fix typeface for mathematics.
  sys/tests.at: Add full stops after header comments.
  codec/codec.3: Fix spacing after ellipsis.
  utils/t/bits-testgen.py: Set the `SEED' from the command-line correctly.
  utils/t/bits-testgen.py: Make `arg' return arguments in the right order.

5 years agodebian/changelog: Prepare for the next version.
Mark Wooding [Fri, 4 Oct 2019 15:24:44 +0000 (16:24 +0100)]
debian/changelog: Prepare for the next version.

5 years agoutils/str.3: Fix typeface for mathematics.
Mark Wooding [Tue, 8 Oct 2019 10:24:37 +0000 (11:24 +0100)]
utils/str.3: Fix typeface for mathematics.

5 years agosys/tests.at: Add full stops after header comments.
Mark Wooding [Tue, 8 Oct 2019 10:24:01 +0000 (11:24 +0100)]
sys/tests.at: Add full stops after header comments.

5 years agocodec/codec.3: Fix spacing after ellipsis.
Mark Wooding [Tue, 8 Oct 2019 10:23:37 +0000 (11:23 +0100)]
codec/codec.3: Fix spacing after ellipsis.

5 years agoutils/t/bits-testgen.py: Set the `SEED' from the command-line correctly.
Mark Wooding [Fri, 4 Oct 2019 17:27:28 +0000 (18:27 +0100)]
utils/t/bits-testgen.py: Set the `SEED' from the command-line correctly.

This never stood a chance before, because `arg' always returned the
script path.  Now that's fixed, instead `int' complains that the hex
number it's being given isn't acceptable.  I can't fix this by
explicitly passing a radix of 0 because that doesn't allow an existing
integer object.  So we have this circumlocution.

5 years agoutils/t/bits-testgen.py: Make `arg' return arguments in the right order.
Mark Wooding [Fri, 4 Oct 2019 17:26:07 +0000 (18:26 +0100)]
utils/t/bits-testgen.py: Make `arg' return arguments in the right order.

Obviously I never watched this run before.

5 years agodebian/: Bump to Debhelper 10.
Mark Wooding [Sun, 29 Sep 2019 14:50:36 +0000 (15:50 +0100)]
debian/: Bump to Debhelper 10.

5 years agoRelease 2.4.1. 2.4.1
Mark Wooding [Sun, 29 Sep 2019 14:13:44 +0000 (15:13 +0100)]
Release 2.4.1.

5 years agodebian/: Ship correct symbols files.
Mark Wooding [Fri, 27 Sep 2019 16:25:15 +0000 (17:25 +0100)]
debian/: Ship correct symbols files.

5 years agodebian/.gitignore: Ignore generated `lib2-adns.install' file.
Mark Wooding [Fri, 27 Sep 2019 16:24:47 +0000 (17:24 +0100)]
debian/.gitignore: Ignore generated `lib2-adns.install' file.

5 years agomem/track.[ch]: Delete ancient debris.
Mark Wooding [Fri, 27 Sep 2019 16:19:53 +0000 (17:19 +0100)]
mem/track.[ch]: Delete ancient debris.

Apparently these got forgotten in the source-tree reorganization back in
2.2.0.  They've been languishing in the version-control system, but
haven't been built or distributed since then -- and nothing has
noticed.  Also, they've never been documented, and don't do anything
very useful anyway.

So just delete them and let history forget they ever existed.

5 years agohash/unihash.c: Replace a dynamic assertion with a static one.
Mark Wooding [Sun, 29 Sep 2019 14:18:53 +0000 (15:18 +0100)]
hash/unihash.c: Replace a dynamic assertion with a static one.

5 years agoutils/macros.h: Introduce a `STATIC_ASSERT' macro.
Mark Wooding [Thu, 26 Sep 2019 19:18:11 +0000 (20:18 +0100)]
utils/macros.h: Introduce a `STATIC_ASSERT' macro.

5 years agoRelease 2.4.0. 2.4.0
Mark Wooding [Sat, 21 Sep 2019 20:38:36 +0000 (21:38 +0100)]
Release 2.4.0.