MCPcopy Create free account
hub / github.com/coreutils/coreutils / select_plural

Function select_plural

src/system.h:218–225  ·  view source on GitHub ↗

Return a value that pluralizes the same way that N does, in all languages we know of. */

Source from the content-addressed store, hash-verified

216/* Return a value that pluralizes the same way that N does, in all
217 languages we know of. */
218static inline unsigned long int
219select_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)

Callers 7

print_xfer_statsFunction · 0.85
print_statsFunction · 0.85
ireadFunction · 0.85
print_uptimeFunction · 0.85
key_warningsFunction · 0.85
mainFunction · 0.85
digest_checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected