summaryrefslogtreecommitdiff
path: root/src/locale
AgeCommit message (Collapse)AuthorFilesLines
2019-07-12tree-wide: get rid of strappend()Lennart Poettering1-2/+2
It's a special case of strjoin(), so no need to keep both. In particular as typing strjoin() is even shoert than strappend().
2019-06-28Rename EXTRACT_QUOTES to EXTRACT_UNQUOTEZbigniew Jędrzejewski-Szmek1-3/+3
Whenever I see EXTRACT_QUOTES, I'm always confused whether it means to leave the quotes in or to take them out. Let's say "unquote", like we say "cunescape".
2019-06-20tree-wide: drop alloca() in loopYu Watanabe1-2/+2
2019-05-08Enable log colors for most of tools in /usr/binZbigniew Jędrzejewski-Szmek1-0/+1
When emitting the calendarspec warning we want to see some color. Follow-up for 04220fda5c. Exceptions: - systemctl, because it has a lot hand-crafted coloring - tmpfiles, sysusers, stdio-bridge, etc, because they are also used in services and I'm not sure if this wouldn't mess up something.
2019-04-12Make fopen_temporary and fopen_temporary_label unlockedZbigniew Jędrzejewski-Szmek1-2/+0
This is partially a refactoring, but also makes many more places use unlocked operations implicitly, i.e. all users of fopen_temporary(). AFAICT, the uses are always for short-lived files which are not shared externally, and are just used within the same context. Locking is not necessary.
2019-04-08basic: add new helper call empty_or_dash_to_null()Lennart Poettering1-12/+8
We have a function like this at two places already. Let's unify it in one generic location and let's port a number of users over.
2019-04-08tree-wide: introduce empty_or_dash() helperLennart Poettering1-1/+1
At quite a few places we check isempty() || streq(…, "-"), let's add a helper to simplify that, and replace that by a single function call.
2019-03-27Voidify more mkdir_p callsZbigniew Jędrzejewski-Szmek1-2/+1
2019-03-27headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2-0/+4
This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
2019-03-14util: split out nulstr related stuff to nulstr-util.[ch]Lennart Poettering1-0/+1
2019-03-14util: split out kbd related stuffLennart Poettering2-3/+3
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.
2019-03-13util: split out memcmp()/memset() related calls into memory-util.[ch]Lennart Poettering1-1/+1
Just some source rearranging.
2019-03-04tests: use the test helpers in more placesZbigniew Jędrzejewski-Szmek1-2/+2
This is mostly cosmetic. It makes those test binaries support SYSTEMD_LOG_* environment variables.
2018-12-04Merge pull request #11041 from yuwata/update-missing-v2Lennart Poettering1-0/+1
missing: separate missing.h more
2018-12-04util: drop missing.h from util.hYu Watanabe1-0/+1
2018-12-04tree-wide: add whitespace between type and variable nameYu Watanabe1-1/+1
2018-12-02util-lib: split out env file parsing code into env-file.cLennart Poettering1-0/+2
It's quite complex, let's split this out. No code changes, just some file rearranging.
2018-12-02util-lib: split out all temporary file related calls into tmpfiles-util.cLennart Poettering1-0/+1
This splits out a bunch of functions from fileio.c that have to do with temporary files. Simply to make the header files a bit shorter, and to group things more nicely. No code changes, just some rearranging of source files.
2018-11-23locale: define main through macroYu Watanabe1-22/+15
2018-11-23locale: store polkit_registry in ContextYu Watanabe3-7/+9
2018-11-23locale: rename context_free() to context_clear()Yu Watanabe4-5/+5
2018-11-22coccinelle: make use of SYNTHETIC_ERRNOZbigniew Jędrzejewski-Szmek1-4/+3
Ideally, coccinelle would strip unnecessary braces too. But I do not see any option in coccinelle for this, so instead, I edited the patch text using search&replace to remove the braces. Unfortunately this is not fully automatic, in particular it didn't deal well with if-else-if-else blocks and ifdefs, so there is an increased likelikehood be some bugs in such spots. I also removed part of the patch that coccinelle generated for udev, where we returns -1 for failure. This should be fixed independently.
2018-11-20Split out pretty-print.c and move pager.c and main-func.h to shared/Zbigniew Jędrzejewski-Szmek1-1/+1
This is high-level functionality, and fits better in shared/ (which is for our executables), than in basic/ (which is also for libraries).
2018-11-20locale: make "arg_host" constYu Watanabe1-1/+1
2018-11-20localectl: define main through macroZbigniew Jędrzejewski-Szmek1-16/+9
2018-11-20log: introduce new helper call log_setup_service()Lennart Poettering1-3/+1
Let's reduce the common boilerplate and have a single setup function used by all service code to setup logging.
2018-11-15Merge pull request #10742 from poettering/c-utf8Zbigniew Jędrzejewski-Szmek3-55/+43
default to C.UTF-8 locale, and many improvements to env var file parsing/kernel cmdline parsing
2018-11-14Merge pull request #10753 from keszybz/pager-no-interruptLennart Poettering1-5/+5
Add mode in journalctl where ^C is handled by the pager
2018-11-14locale-util: introduce common helper locale_variables_free() for freeing ↵Lennart Poettering2-17/+7
locale variable arrays
2018-11-14fileio: automatically add NULL sentinel to parse_env_file()Lennart Poettering1-4/+2
Let's modernize things a bit.
2018-11-14localed: be more careful with the used typesLennart Poettering1-1/+2
2018-11-14fileio: drop "newline" parameter for env file parsersLennart Poettering1-3/+3
Now that we don't (mis-)use the env file parser to parse kernel command lines there's no need anymore to override the used newline character set. Let's hence drop the argument and just "\n\r" always. This nicely simplifies our code.
2018-11-14tree-wide: replace all remaining uses of parse_env_file() for parsing ↵Lennart Poettering1-18/+18
/proc/cmdline Let's always go through the proc-cmdline.c APIs.
2018-11-14localed: no need to log twice about reload requestsLennart Poettering1-4/+2
2018-11-14localed: show proper bus error if we can in log messageLennart Poettering1-1/+1
2018-11-14localed: don't silently eat up errors, log somethingLennart Poettering1-7/+8
2018-11-14basic/pager: convert the pager options to a flags argumentZbigniew Jędrzejewski-Szmek1-5/+5
Pretty much everything uses just the first argument, and this doesn't make this common pattern more complicated, but makes it simpler to pass multiple options.
2018-11-12hostnamed,localed,timedate: properly propagate errors from sd_event_add_signal()Lennart Poettering1-4/+8
main() can't doesn't expect negative error codes as return.
2018-10-19Merge pull request #10450 from poettering/foreach-line-excorcismYu Watanabe1-2/+8
FOREACH_LINE excorcism
2018-10-18localectl: FOREACH_LINE excorcismLennart Poettering1-2/+8
2018-10-18keymap-util: fgets() excorcismLennart Poettering1-14/+17
2018-08-20tree-wide: add clickable man page link to all --help textsLennart Poettering1-1/+12
This is a bit like the info link in most of GNU's --help texts, but we don't do info but man pages, and we make them properly clickable on terminal supporting that, because awesome. I think it's generally advisable to link up our (brief) --help texts and our (more comprehensive) man pages a bit, so this should be an easy and straight-forward way to do it.
2018-08-07tree-wide: shorten error logging a bitYu Watanabe2-10/+9
Continuation of 4027f96aa08c73f109aa46b89842ca0e25c9c0e9.
2018-07-26locale: increment reference count of sd_bus_messageYu Watanabe1-12/+22
2018-07-20locale: set sd_event_add_signal()Yu Watanabe1-1/+12
2018-06-25tree-wide: add multiple inclusion guardYu Watanabe1-0/+1
2018-06-20tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek4-12/+0
Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
2018-06-14Drop my copyright headersZbigniew Jędrzejewski-Szmek2-5/+0
perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
2018-06-14tree-wide: beautify remaining copyright statementsLennart Poettering6-6/+6
Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
2018-06-14tree-wide: remove Lennart's copyright linesLennart Poettering4-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.