summaryrefslogtreecommitdiffstats
path: root/src/basic/locale-util.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* locale-util: fix _() definitionDmitry V. Levin2023-07-191-1/+1
| | | | | | | | | | | The previous definition was not quite appropriate for the library code because it relied on the message domain set by textdomain() invocation which is not necessarily the same message domain defined in GETTEXT_PACKAGE macro. The only code that uses _() so far is located in pam_systemd_home.c. Fixes: 20f56fddcd5 ("Add gettext support")
* locale-setup: merge locale handling in PID1 and localedYu Watanabe2022-06-141-0/+1
|
* basic: split out glyph/emoji related calls from locale-util.[ch] into ↵Lennart Poettering2021-10-051-50/+1
| | | | | | | | glyph-util.[ch] These functions are used pretty much independently of locale, i.e. the only info relevant is whether th locale is UTF-8 or not. Hence let's give this its own pair of .c/.h files.
* util: add one more helper for generating colored check mark glyphsLennart Poettering2021-07-301-0/+4
| | | | | | | | | This one is useful for a outputs with a slightly more "positive" outlook, i.e. where only the checkmarks are shown but the crossmarks are replaced by spaces. (Usecase: a larger table with many checkmarks, where the red crossmarks might just be too much negative noise)
* glyph-util: add three more emojis to emoji listLennart Poettering2021-07-301-0/+3
|
* locale-util: make SpecialGlyph more like our usual enumsLennart Poettering2021-04-081-1/+2
| | | | | | | | Let's define both an enum and a typedef named SpecialGlyph, the way we usually do it. Also, introduce an "invalid" special glyph, assigned to -EINVAL, also like we always do it. (And handle it somewhat sanely in special_glyph()
* util: add helpers for generating colored check mark glyphs from boolsLennart Poettering2021-03-021-0/+4
|
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-1/+1
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* feature: display status with a different shape depending on the status (#17728)Jiehong2021-01-221-0/+3
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* locale-util: add support for touch emojiLennart Poettering2020-07-011-1/+2
| | | | | We can use this to highlight when users are supposed to touch their security tokens.
* locale-util: add glyph for external linksLennart Poettering2020-05-291-0/+1
|
* locale-util: add new helper locale_is_installed()Lennart Poettering2020-05-071-0/+1
| | | | | | | | | | This new helper checks whether the specified locale is installed. It's distinct from locale_is_valid() which just superficially checks if a string looks like something that could be a valid locale. Heavily inspired by @jsynacek's #13964. Replaces: #13964
* locale-util: export emoji_enable() for other code to useLennart Poettering2020-04-151-0/+2
|
* locale-util: add support for lock+key emojiLennart Poettering2020-04-151-2/+3
| | | | | It looks pretty nice on gnome-terminal at least, let's make use of it when asking for passwords.
* locale-util: add special glyph ΣLennart Poettering2020-01-201-0/+1
|
* locale-util: add block drawing special glyphsLennart Poettering2020-01-201-0/+2
|
* locale-util: extend comments on unicode glyph use, and drop mdash (that ↵Lennart Poettering2020-01-071-3/+2
| | | | | | | | | | | | | actually was an ndash) Let's add the actual unicode names of the glyphs we use. Let's also add in comments what the width expectations of these glyphs are on the console. Also, remove the "mdash" definition. First of all it wasn't used, but what's worse the glyph encoded was actually an "ndash"... Fixes: #14075
* util: split out kbd related stuffLennart Poettering2019-03-141-3/+0
| | | | | This stuff is neither generic enough to be in def.h, nor really has much to do with locale, hence give it its own .c/.h file pair.
* locale-util: prefix special glyph enum values with SPECIAL_GLYPH_Lennart Poettering2018-12-141-20/+20
| | | | | | | This has been irritating me for quite a while: let's prefix these enum values with a common prefix, like we do for almost all other enums. No change in behaviour, just some renaming.
* locale-util: add logic to output smiley emojis at various happiness levelsLennart Poettering2018-11-301-0/+8
|
* locale-util: add unicode bullet to special glyphsLennart Poettering2018-11-281-0/+1
|
* locale-util: add special glyph support for check marks/cross marksLennart Poettering2018-11-161-0/+2
|
* locale-util: introduce common helper locale_variables_free() for freeing ↵Lennart Poettering2018-11-141-0/+5
| | | | locale variable arrays
* analyze: Add "timespan" command to dump time span in usecChris Down2018-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | This is useful for a couple of cases, I'm mostly interested in case #1: 1. Verifying "reasonable" values in a trivially scriptable way 2. Debugging unexpected time span parsing directly Test Plan: ``` % build/systemd-analyze timespan 20 Original: 20 μs: 20 Human: 20us % build/systemd-analyze timespan 20ms Original: 20ms μs: 20000 Human: 20ms % build/systemd-analyze timespan 20z Failed to parse time span '20z': Invalid argument ```
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-4/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* locale: add ellipsis as special glyphLennart Poettering2018-04-181-0/+1
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* locale-util: add freelocale() cleanup helperLennart Poettering2018-01-161-0/+8
|
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* systemd-firstboot: add vconsole keymap support (#7035)tblume2017-11-101-0/+3
| | | | | | | Enable systemd-firstboot to set the keymap. RFE: https://github.com/systemd/systemd/issues/6346
* locale-util: mark special_glyph() as _const_Zbigniew Jędrzejewski-Szmek2016-05-091-1/+1
| | | | | | | | _const_ means that the caller can assume that the function will return the same result every time (and will not modify global memory). special_glyph() meets this: even though it depends on global memory, that part of global memory is not expected to change. This allows the calls to special_glyph() to be optimized, even if -flto is not used.
* tree-wide: rename draw_special_char to special_glyphZbigniew Jędrzejewski-Szmek2016-05-091-12/+12
| | | | | | | | | That function doesn't draw anything on it's own, just returns a string, which sometimes is more than one character. Also remove "DRAW_" prefix from character names, TREE_* and ARROW and BLACK_CIRCLE are unambigous on their own, don't draw anything, and are always used as an argument to special_glyph(). Rename "DASH" to "MDASH", as there's more than one type of dash.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* util-lib: move more locale-related calls to locale-util.[ch]Lennart Poettering2015-10-271-0/+21
|
* build-sys: split internal basic/ library from shared/Kay Sievers2015-06-111-0/+54
basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/