From: Ralph Corderoy Date: Mon, 15 May 2017 17:52:32 +0000 (+0100) Subject: h/utils.h: Move in PLURALS() macro from h/mh.h. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/3f1f199234e06fdbd18c10860f19bdd1706a0f76?ds=inline;hp=--cc h/utils.h: Move in PLURALS() macro from h/mh.h. --- 3f1f199234e06fdbd18c10860f19bdd1706a0f76 diff --git a/h/mh.h b/h/mh.h index 22e3a0b5..77671f8d 100644 --- a/h/mh.h +++ b/h/mh.h @@ -51,15 +51,6 @@ typedef unsigned char boolean; /* not int so we can pack in a structure */ /* FENDNULL fends off NULL by giving an empty string instead. */ #define FENDNULL(s) ((s) ? (s) : "") -/* 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)) - /* * char array that keeps track of size in both bytes and characters * Usage note: diff --git a/h/utils.h b/h/utils.h index 56dec309..19d71563 100644 --- a/h/utils.h +++ b/h/utils.h @@ -1,6 +1,15 @@ /* utils.h -- utility prototypes */ +/* 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);