+/* PLURALS gives a pointer to the string "s" when n isn't 1, and to the
+ * empty string "" when it is. Suitable for obtaining the plural `s'
+ * used for English nouns. It treats -1 as plural, as does GNU gettext.
+ * Having output vary for plurals is annoying for those writing parsers;
+ * better to phrase the output such that no test is needed, e.g.
+ * "messages found: 42". */
+extern const char plurals[];
+#define PLURALS(n) (plurals + ((n) == 1))
+
+/* Call malloc(3), exiting on NULL return. */
+void *mh_xmalloc(size_t size) MALLOC ALLOC_SIZE(1);
+
+/* Call realloc(3), exiting on NULL return. */
+void *mh_xrealloc(void *ptr, size_t size) ALLOC_SIZE(2);
+
+/* Call calloc(3), exiting on NULL return. */
+void *mh_xcalloc(size_t nelem, size_t elsize) MALLOC ALLOC_SIZE(1, 2);
+
+/* Duplicate a NUL-terminated string, exit on failure. */
+char *mh_xstrdup(const char *src) MALLOC;
+
+/* Set p to point to newly allocated, uninitialised, memory. */
+#define NEW(p) ((p) = mh_xmalloc(sizeof *(p)))
+
+/* Set p to point to newly allocated, zeroed, memory. */
+#define NEW0(p) ((p) = mh_xcalloc(1, sizeof *(p)))
+
+/* Zero the bytes to which p points. */
+#define ZERO(p) memset((p), 0, sizeof *(p))
+