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

17 months 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.

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

17 months 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

17 months 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.

17 months 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

  * 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.)

17 months 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

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

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

17 months 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.

17 months 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.

17 months 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)

18 months 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.

2 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'.

2 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.

2 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/ Add full stops after header comments.
  codec/codec.3: Fix spacing after ellipsis.
  utils/t/ Set the `SEED' from the command-line correctly.
  utils/t/ Make `arg' return arguments in the right order.

2 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.

2 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.

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

2 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.

2 years agoutils/t/ Set the `SEED' from the command-line correctly.
Mark Wooding [Fri, 4 Oct 2019 17:27:28 +0000 (18:27 +0100)]
utils/t/ 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.

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

Obviously I never watched this run before.

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

2 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.

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

2 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.

2 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.

2 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.

2 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.

2 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.

2 years agostruct/buf.c: Muffle an annoying Clang warning about a pointless assertion.
Mark Wooding [Wed, 18 Sep 2019 19:22:39 +0000 (20:22 +0100)]
struct/buf.c: Muffle an annoying Clang warning about a pointless assertion.

Of course, since this code is macro-generated, it's not at all

2 years agoutils/macros.h: Sprinkle `__...__' over GCC (and Clang) attribute names.
Mark Wooding [Wed, 18 Sep 2019 16:29:30 +0000 (17:29 +0100)]
utils/macros.h: Sprinkle `__...__' over GCC (and Clang) attribute names.

I suspect that things like `noreturn' might already be macros.  Though,
honestly, this header file is not a shining example of namespace hygiene
in countless other ways.

2 years agohash/, hash/crc32.h: Make the CRC table be `const'.
Mark Wooding [Wed, 4 Sep 2019 17:41:14 +0000 (18:41 +0100)]
hash/, hash/crc32.h: Make the CRC table be `const'.

Yay.  That's an extra kilobyte of sharable data.

2 years agohash/crc-mktab.c, hash/unihash-mkstatic.c: Add `const' option.
Mark Wooding [Wed, 4 Sep 2019 17:39:52 +0000 (18:39 +0100)]
hash/crc-mktab.c, hash/unihash-mkstatic.c: Add `const' option.

Add `-C' option to produce `const' tables.

I'd probably like this to be the default, at least for `crc-mktab', but
currently it isn't for (a) compatibility and (b) consistency between the

2 years agoRelease
Mark Wooding [Fri, 9 Aug 2019 10:33:17 +0000 (11:33 +0100)]

2 years agoutils/macros.h: Define missing fallback for `NORETURN'.
Mark Wooding [Fri, 9 Aug 2019 10:30:09 +0000 (11:30 +0100)]
utils/macros.h: Define missing fallback for `NORETURN'.

2 years agoRelease 2.3.3. 2.3.3
Mark Wooding [Tue, 25 Dec 2018 15:06:42 +0000 (15:06 +0000)]
Release 2.3.3.

2 years agosys/fdpass.c: Allocate extra cmsg space to hack around a Qemu bug.
Mark Wooding [Tue, 25 Dec 2018 18:07:27 +0000 (18:07 +0000)]
sys/fdpass.c: Allocate extra cmsg space to hack around a Qemu bug.

*shakes head sadly*

2 years agosys/t/fdpass-test.c: Add a simple test for file-descriptor passing.
Mark Wooding [Tue, 25 Dec 2018 15:02:08 +0000 (15:02 +0000)]
sys/t/fdpass-test.c: Add a simple test for file-descriptor passing.

2 years agosys/fdpass.c: Fix expected size of descriptor message.
Mark Wooding [Tue, 25 Dec 2018 15:01:18 +0000 (15:01 +0000)]
sys/fdpass.c: Fix expected size of descriptor message.

This typo breaks 64-bit targets, and I'd never noticed because of
inadequate testing.

2 years Link the main library with $(MLIB_LIBS).
Mark Wooding [Wed, 12 Dec 2018 18:54:31 +0000 (18:54 +0000)] Link the main library with $(MLIB_LIBS).

Otherwise we miss out `-ladns' and there is sadness.  I have no idea why
this has only become a problem just now.

2 years agosys/t/mdup-test.c: Cope with Cygwin setting top inode-number bits.
Mark Wooding [Fri, 16 Nov 2018 18:09:19 +0000 (18:09 +0000)]
sys/t/mdup-test.c: Cope with Cygwin setting top inode-number bits.

Maybe it's because the files have been deleted, but in any event it's
rather annoying: Cygwin seems to set high-numbered bits in the result
inode numbers, which causes spurious test failures.  Compensate by
masking the numbers.

2 years agosys/t/mdup-test.c: Introduce a `-v' option to help debug failures.
Mark Wooding [Fri, 16 Nov 2018 18:06:20 +0000 (18:06 +0000)]
sys/t/mdup-test.c: Introduce a `-v' option to help debug failures.

In particular, just reporting `ino FD[I] wrong' isn't very helpful.  But
adding inode numbers won't help unless we've already printed the initial
numbers, and that would add unnecessary verbosity in the usual case.

2 years agosys/t/mdup-test.c: Cope with the idea of arguments which aren't fd pairs.
Mark Wooding [Fri, 16 Nov 2018 18:03:38 +0000 (18:03 +0000)]
sys/t/mdup-test.c: Cope with the idea of arguments which aren't fd pairs.

The code used to assume a fixed relationship between command-line
argument indices and indices in the `mdup_fd' table.  Fix this by
introducing separate index variables in the argument-parsing loop, and
set the table length correctly afterwards.

2 years agosys/t/mdup-test.c: Improve the layout.
Mark Wooding [Fri, 16 Nov 2018 17:59:23 +0000 (17:59 +0000)]
sys/t/mdup-test.c: Improve the layout.

3 years agoutils/macros.h (N): Properly parenthesize the argument.
Mark Wooding [Sun, 15 Jul 2018 18:26:55 +0000 (19:26 +0100)]
utils/macros.h (N): Properly parenthesize the argument.

WTF?  How did I write this wrong?

Fortunately, I don't think it actually matters.  The argument must have
array type.  Postfix operators are higher precedence, so that's not a
problem; prefix operators are in the right place already; and binary
operators don't yield array types.

3 years agobuild: Configure `pkg-config' correctly for static linking.
Mark Wooding [Thu, 14 Jun 2018 10:01:27 +0000 (11:01 +0100)]
build: Configure `pkg-config' correctly for static linking.

3 years agoRelease 2.3.2. 2.3.2
Mark Wooding [Tue, 12 Jun 2018 09:53:33 +0000 (10:53 +0100)]
Release 2.3.2.

3 years agocodec/url.c (encode): Fix bungled cast in previous refactoring.
Mark Wooding [Tue, 12 Jun 2018 09:48:14 +0000 (10:48 +0100)]
codec/url.c (encode): Fix bungled cast in previous refactoring.

3 years agoRelease 2.3.1. 2.3.1
Mark Wooding [Tue, 12 Jun 2018 00:40:34 +0000 (01:40 +0100)]
Release 2.3.1.

3 years agoMerge branch 'master' of
Mark Wooding [Tue, 12 Jun 2018 00:39:14 +0000 (01:39 +0100)]
Merge branch 'master' of

* 'master' of
  Release 2.2.5.
  sel/ident.c: Don't close the descriptor twice on immediate connect failure.

3 years agoRelease 2.3.0. 2.3.0
Mark Wooding [Mon, 11 Jun 2018 23:31:05 +0000 (00:31 +0100)]
Release 2.3.0.

3 years agocodec/url.c (encode): Rewrite more compactly and perspicuously.
Mark Wooding [Mon, 11 Jun 2018 23:17:12 +0000 (00:17 +0100)]
codec/url.c (encode): Rewrite more compactly and perspicuously.

The condition in the `default' case was a bit gnarly: rewrite it as a
ladder of if/else.  Take the opportunity to compress the code, because
the individual case labels really don't deserve all of that vertical space.

3 years agoRelease 2.2.5. 2.2.5
Mark Wooding [Sat, 9 Jun 2018 16:40:36 +0000 (17:40 +0100)]
Release 2.2.5.

3 years agosel/ident.c: Don't close the descriptor twice on immediate connect failure.
Mark Wooding [Sat, 9 Jun 2018 13:54:40 +0000 (14:54 +0100)]
sel/ident.c: Don't close the descriptor twice on immediate connect failure.

Confusingly, `conn_init' has already done that.

3 years agocodec/url.c: Always encode whitespace characters.
Mark Wooding [Sat, 26 May 2018 22:31:00 +0000 (23:31 +0100)]
codec/url.c: Always encode whitespace characters.

Vertical whitespace is obviously bad, so this is a longstanding bug; but
all whitespace should really be escaped.

3 years agoutils/bits.h: Support compiler magic for unaligned loads and stores.
Mark Wooding [Sat, 26 May 2018 22:29:09 +0000 (23:29 +0100)]
utils/bits.h: Support compiler magic for unaligned loads and stores.

Introduce `RAWw' macros to access the raw memory, and implement `LOADwe'
and `STOREwe' in terms of these and `eTOHw'/`HTOew'.

These are remarkably tricky because GCC (I think mistakenly) thinks that
type-based aliasing is applicable when in fact the other type in
question is `unsigned char', which is known to be able to alias
anything.  Hit things with the `may_alias' hammer and hope they quieten

3 years agoutils/bits.h: Add macros for swapping endianness in place.
Mark Wooding [Sat, 26 May 2018 15:32:01 +0000 (16:32 +0100)]
utils/bits.h: Add macros for swapping endianness in place.

Many processors and compilers provide handy instructions for doing this,
and it's a handy primitive for loading and storing.

The HTOLw etc. macros turn out to be remarkably slippery to define.
It's unfortunately nonsensical to speak about an integer value having an

3 years agoutils/bits.h: Reformat `LOAD64_[BL]_' for consistency.
Mark Wooding [Sat, 26 May 2018 15:25:52 +0000 (16:25 +0100)]
utils/bits.h: Reformat `LOAD64_[BL]_' for consistency.

No functional change, just whitespace.

3 years agoutils/bits.h: Refactor the load/store macros.
Mark Wooding [Sat, 26 May 2018 15:22:39 +0000 (16:22 +0100)]
utils/bits.h: Refactor the load/store macros.

  * Each macro is now only defined conditionally.  This allows earlier
    parts of the header file to define a compiler-specific
    implementation, with the generic definitions filling in the blanks.

  * Instead of writing the byte manipulations out longhand, build each
    one out of smaller pieces.  This has two benefits: firstly, the new
    definitions are smaller and easier to understand; and, secondly, if
    there's a compiler-specific trick for, say 16-bit loads, then 32-bit
    loads can win some of the benefit.

3 years agoutils/bits.3: Basically rewrite it, filling in the missing things.
Mark Wooding [Sat, 26 May 2018 17:22:39 +0000 (18:22 +0100)]
utils/bits.3: Basically rewrite it, filling in the missing things.

Oh, dear.  This manpage has been neglected for years.

3 years ago.skelrc: Fix for Skel's GPL rubric reorganization.
Mark Wooding [Sat, 26 May 2018 15:20:02 +0000 (16:20 +0100)]
.skelrc: Fix for Skel's GPL rubric reorganization.

3 years agoutils/: Split compiler-version macros into a separate header.
Mark Wooding [Sat, 26 May 2018 15:18:43 +0000 (16:18 +0100)]
utils/: Split compiler-version macros into a separate header.

This way we can use them in other headers without the namespace mess of

Also, actually document `CLANG_VERSION_P'.

3 years agoutils/macros.3: Document `CLANG_WARNING'.
Mark Wooding [Sat, 26 May 2018 15:16:49 +0000 (16:16 +0100)]
utils/macros.3: Document `CLANG_WARNING'.

Added back in ff3d3f01025b881c7cadf093b0f65309c35f2c53.

4 years ago.mailmap: Add file to fix CVS-ish names in history.
Mark Wooding [Tue, 15 Aug 2017 13:22:59 +0000 (14:22 +0100)]
.mailmap: Add file to fix CVS-ish names in history.

4 years agoRelease 2.2.4. 2.2.4
Mark Wooding [Sun, 13 Aug 2017 19:12:45 +0000 (20:12 +0100)]
Release 2.2.4.

4 years agoRevert "debian: Update for Debhelper 10."
Mark Wooding [Fri, 11 Aug 2017 11:00:57 +0000 (12:00 +0100)]
Revert "debian: Update for Debhelper 10."

I think I might still have to build for wheezy.
This reverts commit 6d061820334c97ed4f3266d7130e089de6b21b55.

4 years agostruct/buf.3: Fix synopsis for `BSTEP'.
Mark Wooding [Wed, 9 Aug 2017 19:48:54 +0000 (20:48 +0100)]
struct/buf.3: Fix synopsis for `BSTEP'.

4 years agodebian/copyright: Fix copyright dates.
Mark Wooding [Fri, 7 Jul 2017 09:48:58 +0000 (10:48 +0100)]
debian/copyright: Fix copyright dates.

4 years agodebian: Update for Debhelper 10.
Mark Wooding [Thu, 6 Jul 2017 09:57:03 +0000 (10:57 +0100)]
debian: Update for Debhelper 10.

4 years agodebian: Multi-Arch support.
Mark Wooding [Fri, 14 Jun 2013 18:24:17 +0000 (19:24 +0100)]
debian: Multi-Arch support.

4 years agodebian/copyright: Convert to machine-readable format.
Mark Wooding [Fri, 28 Jun 2013 20:44:58 +0000 (21:44 +0100)]
debian/copyright: Convert to machine-readable format.

4 years agodebian/control: Use ${binary:Version} instead of ${Source-Version}.
Mark Wooding [Thu, 6 Jul 2017 09:03:39 +0000 (10:03 +0100)]
debian/control: Use ${binary:Version} instead of ${Source-Version}.

4 years Tweak `silent-rules' machinery.
Mark Wooding [Thu, 6 Jul 2017 08:56:44 +0000 (09:56 +0100)] Tweak `silent-rules' machinery.

Since Automake 1.11, the advice for setting up custom silent-rules
recipes has changed, so use the new machinery.

Also, I'm no longer mainly working on wheezy, and Automake has made the
operation field two spaces wider while I wasn't looking, so make the
output line up properly.

This means that mLib now requires Automake 1.11.2 or later to build from
the Git tree.

4 years agoutils/macros.h: Add support for Clang-specific hacks.
Mark Wooding [Wed, 5 Jul 2017 20:25:31 +0000 (21:25 +0100)]
utils/macros.h: Add support for Clang-specific hacks.

These are mostly the same as GCC, but (fortunately!) Clang's diagnostics
handling is less broken than GCC's, so we can do the same job much more

4 years agoutils/macros.h: Refactor the GCC-ish compiler support.
Mark Wooding [Wed, 5 Jul 2017 20:23:00 +0000 (21:23 +0100)]
utils/macros.h: Refactor the GCC-ish compiler support.

Fully define `GCC_VERSION_P' early, and then use it without any other
guard to define the GCC-specific hacks.  This way, it's easy to support
other compilers which behave similarly, by defining an appropriate
`FOO_VERSION_P' macro, and then adding appropriate extra alternatives to
the individual guards.

No functional changes.

4 years agosel/sig.c: Use `DISCARD' to ignore errors from the signal-pipe `write'.
Mark Wooding [Wed, 5 Jul 2017 20:10:06 +0000 (21:10 +0100)]
sel/sig.c: Use `DISCARD' to ignore errors from the signal-pipe `write'.

Annoyingly, Clang complains about the empty consequent being on one line
otherwise.  Still, this is what `DISCARD' was made for.

4 years agotrace/trace.3: Fix misformatting.
Mark Wooding [Wed, 19 Apr 2017 08:54:40 +0000 (09:54 +0100)]
trace/trace.3: Fix misformatting.

4 years Some reformatting.
Mark Wooding [Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)] Some reformatting.

5 years agosys/ Actually make sure the `mdup' tests work.
Mark Wooding [Mon, 11 Jul 2016 08:49:21 +0000 (09:49 +0100)]
sys/ Actually make sure the `mdup' tests work.

Oops.  It's not actually been testing anything.  You can tell because it
tried to run the wrong program.

Fortunately, once this is fixed, the test does seem to run OK.

5 years agosys/ Use the correct name for the `mdup' test program.
Mark Wooding [Mon, 11 Jul 2016 08:48:56 +0000 (09:48 +0100)]
sys/ Use the correct name for the `mdup' test program.

5 years Look in the right place for `socklen_t'.
Mark Wooding [Mon, 11 Jul 2016 08:47:12 +0000 (09:47 +0100)] Look in the right place for `socklen_t'.

The old-fashioned version of `AC_CHECK_TYPE' doesn't look in
<sys/socket.h>, which is the proper place.  Android doesn't appear to
define the type in the usual places where Autoconf looks.

So use the modern version of the check and look in <sys/socket.h>
explicitly.  This seems to fix the build on Android.

5 years agoRelease 2.2.3. 2.2.3
Mark Wooding [Sat, 4 Jun 2016 00:10:04 +0000 (01:10 +0100)]
Release 2.2.3.

5 years agobuild: Abolish the `$e', `$o' and `$t' variables.
Mark Wooding [Sun, 15 May 2016 14:29:05 +0000 (15:29 +0100)]
build: Abolish the `$e', `$o' and `$t' variables.

I don't think anything ever used `$o'.  This project didn't use `$t'.
And use of `$e' gets in the way of Automake's magic handling of
executable suffixes under Cygwin.

5 years Say `-no-undefined' to libtool for the sake of Cygwin.
Mark Wooding [Sat, 14 May 2016 20:12:47 +0000 (21:12 +0100)] Say `-no-undefined' to libtool for the sake of Cygwin.

5 years agostruct/dstr-putf.c: Remove apparently redundant inclusion of <math.h>.
Mark Wooding [Sat, 14 May 2016 20:12:23 +0000 (21:12 +0100)]
struct/dstr-putf.c: Remove apparently redundant inclusion of <math.h>.

Just to make it clear that we don't depend on the floating-point library
in any important way.

5 years agoutils/t/exc-test.c: Print null pointers in a consistent way.
Mark Wooding [Sat, 14 May 2016 18:31:11 +0000 (19:31 +0100)]
utils/t/exc-test.c: Print null pointers in a consistent way.

Cygwin prints `0x0' instead of `(nil)'.  Fortunately, this is the only
pointer value we can reliably check for, so handle this ourselves.

5 years agosel/bres.c: Don't capture `h->h_name' in non-`const' pointer.
Mark Wooding [Sat, 14 May 2016 18:30:10 +0000 (19:30 +0100)]
sel/bres.c: Don't capture `h->h_name' in non-`const' pointer.

It turns out to be `const' under Cygwin.  In fact, we don't need to
capture it at all, so restructure the logic so we don't bother trying.

5 years agobuild: Cope with the `subdir-objects' world Automake wants us to live in.
Mark Wooding [Sun, 15 May 2016 13:11:02 +0000 (14:11 +0100)]
build: Cope with the `subdir-objects' world Automake wants us to live in.

Essentially, the Automake developers want to put the objects for
`PATH/TO/FILE.c' in `PATH/TO/FILE.o'.  This is wrongheaded, but we don't
seem to get much choice.  Unfortunately, it's also buggered.

This causes trouble for our precomputed source files.  The obvious
trouble happens if the source file we reference is explicitly in the
source tree, so we'll need to refer to the files differently in
`mumble_SOURCES' lines and the machinery which makes the generates the
files.  The obvious answer would be to introduce two variables for
referring to the precomptations tree.  This is where Automake's bugs
start to really bite.

The main problem is with Automake's automatic dependency-tracking
machinery.  For each object `FILE.o' which is going to be built, it
wants to make a `.deps/FILE.Po' file to track the detected dependencies.
Furthermore, the generated makefiles get unhappy if these files don't
already exist, so there's magic hung off the side of `config.status' to
make them.

This would be great, but the Automake machinery doesn't actually work
properly.  If you refer to a source file via a variable reference,
something like `$(things)/file.c', then Automake's `config.status' magic
creates a dependency-tracking file which is literally named
`.deps/$(things)/file.Po', and then the makefile gets upset when it
tries to include `$(things)/.deps/file.Po'.

So we have to write explicit relative paths to precomputed source file
names in `nodist_mumble_SOURCES' lists (because we make our own
arrangements for distributing them).

5 years agoMerge branch 'master' of
Mark Wooding [Thu, 18 Feb 2016 18:06:54 +0000 (18:06 +0000)]
Merge branch 'master' of

* 'master' of
  debian/source/format: Apparently these are now mandatory.
  debian/control: Add Build-Depends on python for improved testing.

5 years agoRelease
Mark Wooding [Thu, 18 Feb 2016 08:19:24 +0000 (08:19 +0000)]

5 years agodebian/source/format: Apparently these are now mandatory.
Mark Wooding [Thu, 18 Feb 2016 08:05:00 +0000 (08:05 +0000)]
debian/source/format: Apparently these are now mandatory.

5 years agodebian/control: Add Build-Depends on python for improved testing.
Mark Wooding [Thu, 18 Feb 2016 07:48:59 +0000 (07:48 +0000)]
debian/control: Add Build-Depends on python for improved testing.

5 years agostruct/dstr-putf.c: Fix typo in commentary.
Mark Wooding [Tue, 9 Feb 2016 20:17:58 +0000 (20:17 +0000)]
struct/dstr-putf.c: Fix typo in commentary.

6 years agocodec/codec.3: Minor formatting fix.
Mark Wooding [Fri, 29 May 2015 18:44:13 +0000 (19:44 +0100)]
codec/codec.3: Minor formatting fix.

6 years agoRelease
Mark Wooding [Sun, 18 Jan 2015 16:54:42 +0000 (16:54 +0000)]

6 years agostruct/dstr-putf.c: Don't leak the argument and spec vectors.
Mark Wooding [Sun, 18 Jan 2015 16:50:40 +0000 (16:50 +0000)]
struct/dstr-putf.c: Don't leak the argument and spec vectors.

7 years agoRelease 2.2.2. 2.2.2
Mark Wooding [Sun, 20 Jul 2014 20:35:28 +0000 (21:35 +0100)]
Release 2.2.2.

7 years agostruct/dstr-putf.c: Different way to represent type lengths; new types.
Mark Wooding [Mon, 16 Jun 2014 21:09:38 +0000 (22:09 +0100)]
struct/dstr-putf.c: Different way to represent type lengths; new types.

Support the full menagerie of C99 and POSIX types.

7 years agostruct/dstr-putf.c (dstr_vputf): Rewrite to support `%n$...' specs.
Mark Wooding [Mon, 16 Jun 2014 00:56:16 +0000 (01:56 +0100)]
struct/dstr-putf.c (dstr_vputf): Rewrite to support `%n$...' specs.

The internals are generally just better now, and it should be easier to
support other interesting things.

7 years agosel/bres.c (zap): Don't scramble the freelist when a query is aborted.
Mark Wooding [Sat, 19 Jul 2014 16:14:11 +0000 (17:14 +0100)]
sel/bres.c (zap): Don't scramble the freelist when a query is aborted.

If a query is aborted after it's been committed to a server process,
then we kill the server and return its control block to the freelist.
Unfortunately, the function which does this, `zap', unconditionally
tries to unlink the control block from its current position in the
freelist; but it wasn't actually there before.  The result is that
another server control block might be linked back into the freelist.
Attaching a second client to it while it's already in use fails when
`attach' tries to remove the server's idle timer, which isn't active: at
this point, we get a segfault.

7 years agostruct/dstr-putf.c: Don't segfault on `*' width/precision indicators.
Mark Wooding [Sat, 14 Jun 2014 23:24:48 +0000 (00:24 +0100)]
struct/dstr-putf.c: Don't  segfault on `*' width/precision indicators.

Must have always been broken.  Strange: I thought I'd tested that.