Commit Graph

11 Commits (master)

Author SHA1 Message Date
Karel Zak faeb1b64b3 include: add missing license lines
The header files are usually based on code from lib/. This commit
copies relevant license headers from lib/ to include/ to keep
things consistent. The very generic things (e.g. MBR definitions)
are always public domain.

Signed-off-by: Karel Zak <>
2023-01-12 15:33:09 +01:00
Karel Zak 9faba2114a include/nls: remove unnecessary declaration
Signed-off-by: Karel Zak <>
2020-04-22 10:27:12 +02:00
Ruediger Meier 73afd3f8e8 misc: fix typos using codespell
Some more funny typos, please review carefully.

Signed-off-by: Ruediger Meier <>
2018-02-16 11:12:52 +01:00
Rafal Luzynski 4e12a62e88 cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display
months in a standalone form correctly.  These constants have just
been newly added to glibc.  ALTMON_x has been used in BSD family
since 1990s and has been accepted as the future POSIX extension.
_NL_ABALTMON_* is exclusively a GNU extension but it is expected
to be added to POSIX in future.

More info:
2018-01-22 11:50:50 +01:00
Karel Zak 7095232d21 libfdisk: fix NLS support
The current libfdisk code uses gettext() to translate strings. It
means it follows the default text domain (as set by textdomain(3)
usually in the main program). This is useless for public shared

We have call private bindtextdomain() and use dgettext() with private
domain name to be independent on the main program. For this purpose
include/nls.h supports UL_TEXTDOMAIN_EXPLICIT to use dgettext().

Note that libfdisk will continue to use util-linux.po, rather than
keep the texts in the separate file.

The nls.h has to be included only from fdiskP.h to be sure that
nls.h works as expected for the library.

Signed-off-by: Karel Zak <>
2017-04-25 17:05:09 +02:00
maximilian attems ab65d635c8 lib/strutils: circumvent missing localeconv()
Add stub too nls.h, include it instead of locale.h.
Code in strutils handles already returned NULL.

Signed-off-by: maximilian attems <>
2012-06-05 14:54:12 +02:00
Benno Schulenberg 27cc25474f include: [nls.h] define a macro for handling plurals with ngettext()
Signed-off-by: Benno Schulenberg <>
2011-08-02 14:13:44 +02:00
Karel Zak dc61d398ba lib: add fallback for nl_langinfo()
The fallback ignores locales and returns hardcoded static strings. It
should be enough to include "nls.h" to work with nl_langinfo() on all

Signed-off-by: Karel Zak <>
2010-11-15 16:42:45 +01:00
Mike Frysinger 8b7f16fc37 build-sys: nls/locale handling in util-linux-ng general
On Monday 03 September 2007, Karel Zak wrote:
>  I agree that we need a better support for compilation without
>  locales, but from my point of view NLS != all locales stuff. The NLS
>  support is subset only.

thinking about the input from everyone, i'd propose the attached ...

Only pull in locale.h as needed and move it to the common nls.h.

Signed-off-by: Mike Frysinger <>
2007-09-19 23:15:21 +02:00
Gabriel Barazer 392f76cf9a build-sys: missing header when NLS is disabled
Compiling utils fail when disable NLS with the --disable-nls switch.
"mkfs.c:46: error: 'LC_ALL' undeclared (first use in this function)"
It is due to a missing locale.h header : When enabling NLS, nls.h
includes libintl.h, which in turn includes locale.h. When disabling NLS,
libintl.h isn't anymore included nor locale.h, which is needed for the
setlocale() calls.

Signed-off-by: Gabriel Barazer <>
Signed-off-by: Karel Zak <>
2007-07-23 14:03:13 +02:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00