Return a value that pluralizes the same way that N does, in all languages we know of. */
| 216 | /* Return a value that pluralizes the same way that N does, in all |
| 217 | languages we know of. */ |
| 218 | static inline unsigned long int |
| 219 | select_plural (uintmax_t n) |
| 220 | { |
| 221 | /* Reduce by a power of ten, but keep it away from zero. The |
| 222 | gettext manual says 1000000 should be safe. */ |
| 223 | enum { PLURAL_REDUCER = 1000000 }; |
| 224 | return (n <= ULONG_MAX ? n : n % PLURAL_REDUCER + PLURAL_REDUCER); |
| 225 | } |
| 226 | |
| 227 | #define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0) /* n==-1 means unbounded */ |
| 228 | #define STRPREFIX(a, b) (strncmp (a, b, strlen (b)) == 0) |
no outgoing calls
no test coverage detected