Fix bootctl status to not print strange glyphs in logs (#36745)

This commit is contained in:
Yu Watanabe
2025-03-16 05:56:55 +09:00
committed by GitHub
107 changed files with 561 additions and 550 deletions
+2 -2
View File
@@ -298,13 +298,13 @@ int verb_chid(int argc, char *argv[], void *userdata) {
if (!strextend(&legend,
ansi_grey(),
separator ? " " : "",
separator ? special_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED) : "",
separator ? glyph(GLYPH_HORIZONTAL_DOTTED) : "",
separator ? " " : "",
ansi_normal(),
CHAR_TO_STR(chid_smbios_fields_char[f]),
ansi_grey(),
" ",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
" ",
ansi_normal(),
chid_smbios_friendly[f],
+2 -2
View File
@@ -24,9 +24,9 @@ static int list_dependencies_print(
BootTimes *boot) {
for (unsigned i = level; i > 0; i--)
printf("%s", special_glyph(branches & (1 << (i-1)) ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE));
printf("%s", glyph(branches & (1 << (i-1)) ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE));
printf("%s", special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH));
printf("%s", glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH));
if (times && times->activating >= boot->userspace_time) {
if (timestamp_is_set(times->time))
+11 -11
View File
@@ -1724,15 +1724,15 @@ static int assess(const SecurityInfo *info,
uint64_t exposure;
const char *name;
const char* (*color)(void);
SpecialGlyph smiley;
Glyph smiley;
} badness_table[] = {
{ 100, "DANGEROUS", ansi_highlight_red, SPECIAL_GLYPH_DEPRESSED_SMILEY },
{ 90, "UNSAFE", ansi_highlight_red, SPECIAL_GLYPH_UNHAPPY_SMILEY },
{ 75, "EXPOSED", ansi_highlight_yellow, SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY },
{ 50, "MEDIUM", NULL, SPECIAL_GLYPH_NEUTRAL_SMILEY },
{ 10, "OK", ansi_highlight_green, SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY },
{ 1, "SAFE", ansi_highlight_green, SPECIAL_GLYPH_HAPPY_SMILEY },
{ 0, "PERFECT", ansi_highlight_green, SPECIAL_GLYPH_ECSTATIC_SMILEY },
{ 100, "DANGEROUS", ansi_highlight_red, GLYPH_DEPRESSED_SMILEY },
{ 90, "UNSAFE", ansi_highlight_red, GLYPH_UNHAPPY_SMILEY },
{ 75, "EXPOSED", ansi_highlight_yellow, GLYPH_SLIGHTLY_UNHAPPY_SMILEY },
{ 50, "MEDIUM", NULL, GLYPH_NEUTRAL_SMILEY },
{ 10, "OK", ansi_highlight_green, GLYPH_SLIGHTLY_HAPPY_SMILEY },
{ 1, "SAFE", ansi_highlight_green, GLYPH_HAPPY_SMILEY },
{ 0, "PERFECT", ansi_highlight_green, GLYPH_ECSTATIC_SMILEY },
};
uint64_t badness_sum = 0, weight_sum = 0, exposure;
@@ -1906,7 +1906,7 @@ static int assess(const SecurityInfo *info,
name = info->id;
printf("\n%s %sOverall exposure level for %s%s: %s%" PRIu64 ".%" PRIu64 " %s%s %s\n",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
ansi_highlight(),
name,
ansi_normal(),
@@ -1914,7 +1914,7 @@ static int assess(const SecurityInfo *info,
exposure / 10, exposure % 10,
badness_table[i].name,
ansi_normal(),
special_glyph(badness_table[i].smiley));
glyph(badness_table[i].smiley));
}
fflush(stdout);
@@ -1938,7 +1938,7 @@ static int assess(const SecurityInfo *info,
TABLE_SET_ALIGN_PERCENT, 100,
TABLE_STRING, badness_table[i].name,
TABLE_SET_COLOR, badness_table[i].color ? badness_table[i].color() : "",
TABLE_STRING, special_glyph(badness_table[i].smiley));
TABLE_STRING, glyph(badness_table[i].smiley));
if (r < 0)
return table_log_add_error(r);
}
+1 -1
View File
@@ -53,7 +53,7 @@ int verb_smbios11(int argc, char *argv[], void *userdata) {
if (written) {
if (incomplete)
fputs(special_glyph(SPECIAL_GLYPH_ELLIPSIS), stdout);
fputs(glyph(GLYPH_ELLIPSIS), stdout);
fputc('\n', stdout);
}
+1 -1
View File
@@ -42,7 +42,7 @@ int verb_timespan(int argc, char *argv[], void *userdata) {
if (r < 0)
return table_log_add_error(r);
r = table_add_cell_stringf_full(table, NULL, TABLE_FIELD, "%ss", special_glyph(SPECIAL_GLYPH_MU));
r = table_add_cell_stringf_full(table, NULL, TABLE_FIELD, "%ss", glyph(GLYPH_MU));
if (r < 0)
return table_log_add_error(r);
+1 -1
View File
@@ -41,7 +41,7 @@ static int log_unsafe_transition(int a, int b, const char *path, ChaseFlags flag
return log_warning_errno(SYNTHETIC_ERRNO(ENOLINK),
"Detected unsafe path transition %s (owned by %s) %s %s (owned by %s) during canonicalization of %s.",
strna(n1), strna(user_a), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), strna(n2), strna(user_b), path);
strna(n1), strna(user_a), glyph(GLYPH_ARROW_RIGHT), strna(n2), strna(user_b), path);
}
static int log_autofs_mount_point(int fd, const char *path, ChaseFlags flags) {
+3 -3
View File
@@ -407,7 +407,7 @@ int conf_file_read(
f = stdin;
fn = "<stdin>";
log_debug("Reading config from stdin%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Reading config from stdin%s", glyph(GLYPH_ELLIPSIS));
} else if (is_path(fn)) {
r = path_make_absolute_cwd(fn, &_fn);
@@ -419,14 +419,14 @@ int conf_file_read(
if (!_f)
r = -errno;
else
log_debug("Reading config file \"%s\"%s", fn, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Reading config file \"%s\"%s", fn, glyph(GLYPH_ELLIPSIS));
} else {
r = search_and_fopen(fn, "re", root, config_dirs, &_f, &_fn);
if (r >= 0) {
f = _f;
fn = _fn;
log_debug("Reading config file \"%s\"%s", fn, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Reading config file \"%s\"%s", fn, glyph(GLYPH_ELLIPSIS));
}
}
+106 -102
View File
@@ -23,7 +23,7 @@ bool emoji_enabled(void) {
return cached_emoji_enabled;
}
const char* special_glyph_full(SpecialGlyph code, bool force_utf) {
const char* glyph_full(Glyph code, bool force_utf) {
/* A list of a number of interesting unicode glyphs we can use to decorate our output. It's probably wise to be
* conservative here, and primarily stick to the glyphs defined in the eurlatgr font, so that display still
@@ -32,135 +32,139 @@ const char* special_glyph_full(SpecialGlyph code, bool force_utf) {
* http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=blob;f=data/consolefonts/README.eurlatgr
*/
static const char* const draw_table[2][_SPECIAL_GLYPH_MAX] = {
static const char* const draw_table[2][_GLYPH_MAX] = {
/* ASCII fallback */
[false] = {
[SPECIAL_GLYPH_TREE_VERTICAL] = "| ",
[SPECIAL_GLYPH_TREE_BRANCH] = "|-",
[SPECIAL_GLYPH_TREE_RIGHT] = "`-",
[SPECIAL_GLYPH_TREE_SPACE] = " ",
[SPECIAL_GLYPH_TREE_TOP] = ",-",
[SPECIAL_GLYPH_VERTICAL_DOTTED] = ":",
[SPECIAL_GLYPH_HORIZONTAL_DOTTED] = "-",
[SPECIAL_GLYPH_HORIZONTAL_FAT] = "=",
[SPECIAL_GLYPH_TRIANGULAR_BULLET] = ">",
[SPECIAL_GLYPH_BLACK_CIRCLE] = "*",
[SPECIAL_GLYPH_WHITE_CIRCLE] = "*",
[SPECIAL_GLYPH_MULTIPLICATION_SIGN] = "x",
[SPECIAL_GLYPH_CIRCLE_ARROW] = "*",
[SPECIAL_GLYPH_BULLET] = "*",
[SPECIAL_GLYPH_MU] = "u",
[SPECIAL_GLYPH_CHECK_MARK] = "+",
[SPECIAL_GLYPH_CROSS_MARK] = "-",
[SPECIAL_GLYPH_LIGHT_SHADE] = "-",
[SPECIAL_GLYPH_DARK_SHADE] = "X",
[SPECIAL_GLYPH_FULL_BLOCK] = "#",
[SPECIAL_GLYPH_SIGMA] = "S",
[SPECIAL_GLYPH_ARROW_UP] = "^",
[SPECIAL_GLYPH_ARROW_DOWN] = "v",
[SPECIAL_GLYPH_ARROW_LEFT] = "<-",
[SPECIAL_GLYPH_ARROW_RIGHT] = "->",
[SPECIAL_GLYPH_ELLIPSIS] = "...",
[SPECIAL_GLYPH_EXTERNAL_LINK] = "[LNK]",
[SPECIAL_GLYPH_ECSTATIC_SMILEY] = ":-]",
[SPECIAL_GLYPH_HAPPY_SMILEY] = ":-}",
[SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = ":-)",
[SPECIAL_GLYPH_NEUTRAL_SMILEY] = ":-|",
[SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = ":-(",
[SPECIAL_GLYPH_UNHAPPY_SMILEY] = ":-{",
[SPECIAL_GLYPH_DEPRESSED_SMILEY] = ":-[",
[SPECIAL_GLYPH_LOCK_AND_KEY] = "o-,",
[SPECIAL_GLYPH_TOUCH] = "O=", /* Yeah, not very convincing, can you do it better? */
[SPECIAL_GLYPH_RECYCLING] = "~",
[SPECIAL_GLYPH_DOWNLOAD] = "\\",
[SPECIAL_GLYPH_SPARKLES] = "*",
[SPECIAL_GLYPH_LOW_BATTERY] = "!",
[SPECIAL_GLYPH_WARNING_SIGN] = "!",
[SPECIAL_GLYPH_RED_CIRCLE] = "o",
[SPECIAL_GLYPH_YELLOW_CIRCLE] = "o",
[SPECIAL_GLYPH_BLUE_CIRCLE] = "o",
[SPECIAL_GLYPH_GREEN_CIRCLE] = "o",
[SPECIAL_GLYPH_SUPERHERO] = "S",
[SPECIAL_GLYPH_IDCARD] = "@",
[SPECIAL_GLYPH_HOME] = "^",
[GLYPH_SPACE] = " ",
[GLYPH_TREE_VERTICAL] = "| ",
[GLYPH_TREE_BRANCH] = "|-",
[GLYPH_TREE_RIGHT] = "`-",
[GLYPH_TREE_SPACE] = " ",
[GLYPH_TREE_TOP] = ",-",
[GLYPH_VERTICAL_DOTTED] = ":",
[GLYPH_HORIZONTAL_DOTTED] = "-",
[GLYPH_HORIZONTAL_FAT] = "=",
[GLYPH_TRIANGULAR_BULLET] = ">",
[GLYPH_BLACK_CIRCLE] = "*",
[GLYPH_WHITE_CIRCLE] = "*",
[GLYPH_MULTIPLICATION_SIGN] = "x",
[GLYPH_CIRCLE_ARROW] = "*",
[GLYPH_BULLET] = "*",
[GLYPH_MU] = "u",
[GLYPH_CHECK_MARK] = "+",
[GLYPH_CROSS_MARK] = "-",
[GLYPH_LIGHT_SHADE] = "-",
[GLYPH_DARK_SHADE] = "X",
[GLYPH_FULL_BLOCK] = "#",
[GLYPH_SIGMA] = "S",
[GLYPH_ARROW_UP] = "^",
[GLYPH_ARROW_DOWN] = "v",
[GLYPH_ARROW_LEFT] = "<-",
[GLYPH_ARROW_RIGHT] = "->",
[GLYPH_ELLIPSIS] = "...",
[GLYPH_EXTERNAL_LINK] = "[LNK]",
[GLYPH_ECSTATIC_SMILEY] = ":-]",
[GLYPH_HAPPY_SMILEY] = ":-}",
[GLYPH_SLIGHTLY_HAPPY_SMILEY] = ":-)",
[GLYPH_NEUTRAL_SMILEY] = ":-|",
[GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = ":-(",
[GLYPH_UNHAPPY_SMILEY] = ":-{",
[GLYPH_DEPRESSED_SMILEY] = ":-[",
[GLYPH_LOCK_AND_KEY] = "o-,",
[GLYPH_TOUCH] = "O=", /* Yeah, not very convincing, can you do it better? */
[GLYPH_RECYCLING] = "~",
[GLYPH_DOWNLOAD] = "\\",
[GLYPH_SPARKLES] = "*",
[GLYPH_LOW_BATTERY] = "!",
[GLYPH_WARNING_SIGN] = "!",
[GLYPH_RED_CIRCLE] = "o",
[GLYPH_YELLOW_CIRCLE] = "o",
[GLYPH_BLUE_CIRCLE] = "o",
[GLYPH_GREEN_CIRCLE] = "o",
[GLYPH_SUPERHERO] = "S",
[GLYPH_IDCARD] = "@",
[GLYPH_HOME] = "^",
},
/* UTF-8 */
[true] = {
/* This exists to allow more consistent handling of optional whitespace */
[GLYPH_SPACE] = " ",
/* The following are multiple glyphs in both ASCII and in UNICODE */
[SPECIAL_GLYPH_TREE_VERTICAL] = u8"│ ",
[SPECIAL_GLYPH_TREE_BRANCH] = u8"├─",
[SPECIAL_GLYPH_TREE_RIGHT] = u8"└─",
[SPECIAL_GLYPH_TREE_SPACE] = u8" ",
[SPECIAL_GLYPH_TREE_TOP] = u8"┌─",
[GLYPH_TREE_VERTICAL] = u8"│ ",
[GLYPH_TREE_BRANCH] = u8"├─",
[GLYPH_TREE_RIGHT] = u8"└─",
[GLYPH_TREE_SPACE] = u8" ",
[GLYPH_TREE_TOP] = u8"┌─",
/* Single glyphs in both cases */
[SPECIAL_GLYPH_VERTICAL_DOTTED] = u8"┆",
[SPECIAL_GLYPH_HORIZONTAL_DOTTED] = u8"┄",
[SPECIAL_GLYPH_HORIZONTAL_FAT] = u8"━",
[SPECIAL_GLYPH_TRIANGULAR_BULLET] = u8"‣",
[SPECIAL_GLYPH_BLACK_CIRCLE] = u8"●",
[SPECIAL_GLYPH_WHITE_CIRCLE] = u8"○",
[SPECIAL_GLYPH_MULTIPLICATION_SIGN] = u8"×",
[SPECIAL_GLYPH_CIRCLE_ARROW] = u8"↻",
[SPECIAL_GLYPH_BULLET] = u8"•",
[SPECIAL_GLYPH_MU] = u8"μ", /* actually called: GREEK SMALL LETTER MU */
[SPECIAL_GLYPH_CHECK_MARK] = u8"✓",
[SPECIAL_GLYPH_CROSS_MARK] = u8"✗", /* actually called: BALLOT X */
[SPECIAL_GLYPH_LIGHT_SHADE] = u8"░",
[SPECIAL_GLYPH_DARK_SHADE] = u8"▒",
[SPECIAL_GLYPH_FULL_BLOCK] = u8"█",
[SPECIAL_GLYPH_SIGMA] = u8"Σ",
[SPECIAL_GLYPH_ARROW_UP] = u8"↑", /* actually called: UPWARDS ARROW */
[SPECIAL_GLYPH_ARROW_DOWN] = u8"↓", /* actually called: DOWNWARDS ARROW */
[GLYPH_VERTICAL_DOTTED] = u8"┆",
[GLYPH_HORIZONTAL_DOTTED] = u8"┄",
[GLYPH_HORIZONTAL_FAT] = u8"━",
[GLYPH_TRIANGULAR_BULLET] = u8"‣",
[GLYPH_BLACK_CIRCLE] = u8"●",
[GLYPH_WHITE_CIRCLE] = u8"○",
[GLYPH_MULTIPLICATION_SIGN] = u8"×",
[GLYPH_CIRCLE_ARROW] = u8"↻",
[GLYPH_BULLET] = u8"•",
[GLYPH_MU] = u8"μ", /* actually called: GREEK SMALL LETTER MU */
[GLYPH_CHECK_MARK] = u8"✓",
[GLYPH_CROSS_MARK] = u8"✗", /* actually called: BALLOT X */
[GLYPH_LIGHT_SHADE] = u8"░",
[GLYPH_DARK_SHADE] = u8"▒",
[GLYPH_FULL_BLOCK] = u8"█",
[GLYPH_SIGMA] = u8"Σ",
[GLYPH_ARROW_UP] = u8"↑", /* actually called: UPWARDS ARROW */
[GLYPH_ARROW_DOWN] = u8"↓", /* actually called: DOWNWARDS ARROW */
/* Single glyph in Unicode, two in ASCII */
[SPECIAL_GLYPH_ARROW_LEFT] = u8"←", /* actually called: LEFTWARDS ARROW */
[SPECIAL_GLYPH_ARROW_RIGHT] = u8"→", /* actually called: RIGHTWARDS ARROW */
[GLYPH_ARROW_LEFT] = u8"←", /* actually called: LEFTWARDS ARROW */
[GLYPH_ARROW_RIGHT] = u8"→", /* actually called: RIGHTWARDS ARROW */
/* Single glyph in Unicode, three in ASCII */
[SPECIAL_GLYPH_ELLIPSIS] = u8"…", /* actually called: HORIZONTAL ELLIPSIS */
[GLYPH_ELLIPSIS] = u8"…", /* actually called: HORIZONTAL ELLIPSIS */
/* Three glyphs in Unicode, five in ASCII */
[SPECIAL_GLYPH_EXTERNAL_LINK] = u8"[🡕]", /* actually called: NORTH EAST SANS-SERIF ARROW, enclosed in [] */
[GLYPH_EXTERNAL_LINK] = u8"[🡕]", /* actually called: NORTH EAST SANS-SERIF ARROW, enclosed in [] */
/* These smileys are a single glyph in Unicode, and three in ASCII */
[SPECIAL_GLYPH_ECSTATIC_SMILEY] = u8"😇", /* actually called: SMILING FACE WITH HALO */
[SPECIAL_GLYPH_HAPPY_SMILEY] = u8"😀", /* actually called: GRINNING FACE */
[SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = u8"🙂", /* actually called: SLIGHTLY SMILING FACE */
[SPECIAL_GLYPH_NEUTRAL_SMILEY] = u8"😐", /* actually called: NEUTRAL FACE */
[SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = u8"🙁", /* actually called: SLIGHTLY FROWNING FACE */
[SPECIAL_GLYPH_UNHAPPY_SMILEY] = u8"😨", /* actually called: FEARFUL FACE */
[SPECIAL_GLYPH_DEPRESSED_SMILEY] = u8"🤢", /* actually called: NAUSEATED FACE */
[GLYPH_ECSTATIC_SMILEY] = u8"😇", /* actually called: SMILING FACE WITH HALO */
[GLYPH_HAPPY_SMILEY] = u8"😀", /* actually called: GRINNING FACE */
[GLYPH_SLIGHTLY_HAPPY_SMILEY] = u8"🙂", /* actually called: SLIGHTLY SMILING FACE */
[GLYPH_NEUTRAL_SMILEY] = u8"😐", /* actually called: NEUTRAL FACE */
[GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = u8"🙁", /* actually called: SLIGHTLY FROWNING FACE */
[GLYPH_UNHAPPY_SMILEY] = u8"😨", /* actually called: FEARFUL FACE */
[GLYPH_DEPRESSED_SMILEY] = u8"🤢", /* actually called: NAUSEATED FACE */
/* This emoji is a single character cell glyph in Unicode, and three in ASCII */
[SPECIAL_GLYPH_LOCK_AND_KEY] = u8"🔐", /* actually called: CLOSED LOCK WITH KEY */
[GLYPH_LOCK_AND_KEY] = u8"🔐", /* actually called: CLOSED LOCK WITH KEY */
/* This emoji is a single character cell glyph in Unicode, and two in ASCII */
[SPECIAL_GLYPH_TOUCH] = u8"👆", /* actually called: BACKHAND INDEX POINTING UP */
[GLYPH_TOUCH] = u8"👆", /* actually called: BACKHAND INDEX POINTING UP */
/* These four emojis are single character cell glyphs in Unicode and also in ASCII. */
[SPECIAL_GLYPH_RECYCLING] = u8"♻️", /* actually called: UNIVERSAL RECYCLNG SYMBOL */
[SPECIAL_GLYPH_DOWNLOAD] = u8"⤵️", /* actually called: RIGHT ARROW CURVING DOWN */
[SPECIAL_GLYPH_SPARKLES] = u8"✨",
[SPECIAL_GLYPH_LOW_BATTERY] = u8"🪫",
[SPECIAL_GLYPH_WARNING_SIGN] = u8"⚠️",
[SPECIAL_GLYPH_COMPUTER_DISK] = u8"💽",
[SPECIAL_GLYPH_WORLD] = u8"🌍",
[GLYPH_RECYCLING] = u8"♻️", /* actually called: UNIVERSAL RECYCLNG SYMBOL */
[GLYPH_DOWNLOAD] = u8"⤵️", /* actually called: RIGHT ARROW CURVING DOWN */
[GLYPH_SPARKLES] = u8"✨",
[GLYPH_LOW_BATTERY] = u8"🪫",
[GLYPH_WARNING_SIGN] = u8"⚠️",
[GLYPH_COMPUTER_DISK] = u8"💽",
[GLYPH_WORLD] = u8"🌍",
[SPECIAL_GLYPH_RED_CIRCLE] = u8"🔴",
[SPECIAL_GLYPH_YELLOW_CIRCLE] = u8"🟡",
[SPECIAL_GLYPH_BLUE_CIRCLE] = u8"🔵",
[SPECIAL_GLYPH_GREEN_CIRCLE] = u8"🟢",
[SPECIAL_GLYPH_SUPERHERO] = u8"🦸",
[SPECIAL_GLYPH_IDCARD] = u8"🪪",
[SPECIAL_GLYPH_HOME] = u8"🏠",
[GLYPH_RED_CIRCLE] = u8"🔴",
[GLYPH_YELLOW_CIRCLE] = u8"🟡",
[GLYPH_BLUE_CIRCLE] = u8"🔵",
[GLYPH_GREEN_CIRCLE] = u8"🟢",
[GLYPH_SUPERHERO] = u8"🦸",
[GLYPH_IDCARD] = u8"🪪",
[GLYPH_HOME] = u8"🏠",
},
};
if (code < 0)
return NULL;
assert(code < _SPECIAL_GLYPH_MAX);
return draw_table[force_utf || (code >= _SPECIAL_GLYPH_FIRST_EMOJI ? emoji_enabled() : is_locale_utf8())][code];
assert(code < _GLYPH_MAX);
return draw_table[force_utf || (code >= _GLYPH_FIRST_EMOJI ? emoji_enabled() : is_locale_utf8())][code];
}
+67 -62
View File
@@ -6,74 +6,79 @@
#include "macro.h"
typedef enum SpecialGlyph {
SPECIAL_GLYPH_TREE_VERTICAL,
SPECIAL_GLYPH_TREE_BRANCH,
SPECIAL_GLYPH_TREE_RIGHT,
SPECIAL_GLYPH_TREE_SPACE,
SPECIAL_GLYPH_TREE_TOP,
SPECIAL_GLYPH_VERTICAL_DOTTED,
SPECIAL_GLYPH_HORIZONTAL_DOTTED,
SPECIAL_GLYPH_HORIZONTAL_FAT,
SPECIAL_GLYPH_TRIANGULAR_BULLET,
SPECIAL_GLYPH_BLACK_CIRCLE,
SPECIAL_GLYPH_WHITE_CIRCLE,
SPECIAL_GLYPH_MULTIPLICATION_SIGN,
SPECIAL_GLYPH_CIRCLE_ARROW,
SPECIAL_GLYPH_BULLET,
SPECIAL_GLYPH_MU,
SPECIAL_GLYPH_CHECK_MARK,
SPECIAL_GLYPH_CROSS_MARK,
SPECIAL_GLYPH_LIGHT_SHADE,
SPECIAL_GLYPH_DARK_SHADE,
SPECIAL_GLYPH_FULL_BLOCK,
SPECIAL_GLYPH_SIGMA,
SPECIAL_GLYPH_ARROW_UP,
SPECIAL_GLYPH_ARROW_DOWN,
SPECIAL_GLYPH_ARROW_LEFT,
SPECIAL_GLYPH_ARROW_RIGHT,
SPECIAL_GLYPH_ELLIPSIS,
SPECIAL_GLYPH_EXTERNAL_LINK,
_SPECIAL_GLYPH_FIRST_EMOJI,
SPECIAL_GLYPH_ECSTATIC_SMILEY = _SPECIAL_GLYPH_FIRST_EMOJI,
SPECIAL_GLYPH_HAPPY_SMILEY,
SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY,
SPECIAL_GLYPH_NEUTRAL_SMILEY,
SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY,
SPECIAL_GLYPH_UNHAPPY_SMILEY,
SPECIAL_GLYPH_DEPRESSED_SMILEY,
SPECIAL_GLYPH_LOCK_AND_KEY,
SPECIAL_GLYPH_TOUCH,
SPECIAL_GLYPH_RECYCLING,
SPECIAL_GLYPH_DOWNLOAD,
SPECIAL_GLYPH_SPARKLES,
SPECIAL_GLYPH_LOW_BATTERY,
SPECIAL_GLYPH_WARNING_SIGN,
SPECIAL_GLYPH_COMPUTER_DISK,
SPECIAL_GLYPH_WORLD,
SPECIAL_GLYPH_RED_CIRCLE,
SPECIAL_GLYPH_YELLOW_CIRCLE,
SPECIAL_GLYPH_BLUE_CIRCLE,
SPECIAL_GLYPH_GREEN_CIRCLE,
SPECIAL_GLYPH_SUPERHERO,
SPECIAL_GLYPH_IDCARD,
SPECIAL_GLYPH_HOME,
_SPECIAL_GLYPH_MAX,
_SPECIAL_GLYPH_INVALID = -EINVAL,
} SpecialGlyph;
typedef enum Glyph {
GLYPH_SPACE,
GLYPH_TREE_VERTICAL,
GLYPH_TREE_BRANCH,
GLYPH_TREE_RIGHT,
GLYPH_TREE_SPACE,
GLYPH_TREE_TOP,
GLYPH_VERTICAL_DOTTED,
GLYPH_HORIZONTAL_DOTTED,
GLYPH_HORIZONTAL_FAT,
GLYPH_TRIANGULAR_BULLET,
GLYPH_BLACK_CIRCLE,
GLYPH_WHITE_CIRCLE,
GLYPH_MULTIPLICATION_SIGN,
GLYPH_CIRCLE_ARROW,
GLYPH_BULLET,
GLYPH_MU,
GLYPH_CHECK_MARK,
GLYPH_CROSS_MARK,
GLYPH_LIGHT_SHADE,
GLYPH_DARK_SHADE,
GLYPH_FULL_BLOCK,
GLYPH_SIGMA,
GLYPH_ARROW_UP,
GLYPH_ARROW_DOWN,
GLYPH_ARROW_LEFT,
GLYPH_ARROW_RIGHT,
GLYPH_ELLIPSIS,
GLYPH_EXTERNAL_LINK,
_GLYPH_FIRST_EMOJI,
GLYPH_ECSTATIC_SMILEY = _GLYPH_FIRST_EMOJI,
GLYPH_HAPPY_SMILEY,
GLYPH_SLIGHTLY_HAPPY_SMILEY,
GLYPH_NEUTRAL_SMILEY,
GLYPH_SLIGHTLY_UNHAPPY_SMILEY,
GLYPH_UNHAPPY_SMILEY,
GLYPH_DEPRESSED_SMILEY,
GLYPH_LOCK_AND_KEY,
GLYPH_TOUCH,
GLYPH_RECYCLING,
GLYPH_DOWNLOAD,
GLYPH_SPARKLES,
GLYPH_LOW_BATTERY,
GLYPH_WARNING_SIGN,
GLYPH_COMPUTER_DISK,
GLYPH_WORLD,
GLYPH_RED_CIRCLE,
GLYPH_YELLOW_CIRCLE,
GLYPH_BLUE_CIRCLE,
GLYPH_GREEN_CIRCLE,
GLYPH_SUPERHERO,
GLYPH_IDCARD,
GLYPH_HOME,
_GLYPH_MAX,
_GLYPH_INVALID = -EINVAL,
} Glyph;
bool emoji_enabled(void);
const char* special_glyph_full(SpecialGlyph code, bool force_utf) _const_;
const char* glyph_full(Glyph code, bool force_utf) _const_;
static inline const char* special_glyph(SpecialGlyph code) {
return special_glyph_full(code, false);
static inline const char* glyph(Glyph code) {
return glyph_full(code, false);
}
static inline const char* special_glyph_check_mark(bool b) {
return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : special_glyph(SPECIAL_GLYPH_CROSS_MARK);
static inline const char* optional_glyph(Glyph code) {
return emoji_enabled() ? glyph(code) : "";
}
static inline const char* special_glyph_check_mark_space(bool b) {
return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : " ";
static inline const char* glyph_check_mark(bool b) {
return b ? glyph(GLYPH_CHECK_MARK) : glyph(GLYPH_CROSS_MARK);
}
static inline const char* glyph_check_mark_space(bool b) {
return b ? glyph(GLYPH_CHECK_MARK) : " ";
}
+1 -1
View File
@@ -138,7 +138,7 @@ static int extension_release_strict_xattr_value(int extension_release_fd, const
log_debug("%s/%s: 'user.extension-release.strict' attribute is false%s",
extension_release_dir_path, filename,
special_glyph(SPECIAL_GLYPH_ELLIPSIS));
glyph(GLYPH_ELLIPSIS));
return false;
}
+1 -1
View File
@@ -247,7 +247,7 @@ bool string_has_cc(const char *p, const char *ok) {
}
static int write_ellipsis(char *buf, bool unicode) {
const char *s = special_glyph_full(SPECIAL_GLYPH_ELLIPSIS, unicode);
const char *s = glyph_full(GLYPH_ELLIPSIS, unicode);
assert(strlen(s) == 3);
memcpy(buf, s, 3);
return 3;
+11 -11
View File
@@ -358,20 +358,20 @@ static const char* const job_mode_table[_JOB_MODE_MAX] = {
DEFINE_STRING_TABLE_LOOKUP(job_mode, JobMode);
SpecialGlyph unit_active_state_to_glyph(UnitActiveState state) {
static const SpecialGlyph map[_UNIT_ACTIVE_STATE_MAX] = {
[UNIT_ACTIVE] = SPECIAL_GLYPH_BLACK_CIRCLE,
[UNIT_RELOADING] = SPECIAL_GLYPH_CIRCLE_ARROW,
[UNIT_REFRESHING] = SPECIAL_GLYPH_CIRCLE_ARROW,
[UNIT_INACTIVE] = SPECIAL_GLYPH_WHITE_CIRCLE,
[UNIT_FAILED] = SPECIAL_GLYPH_MULTIPLICATION_SIGN,
[UNIT_ACTIVATING] = SPECIAL_GLYPH_BLACK_CIRCLE,
[UNIT_DEACTIVATING] = SPECIAL_GLYPH_BLACK_CIRCLE,
[UNIT_MAINTENANCE] = SPECIAL_GLYPH_WHITE_CIRCLE,
Glyph unit_active_state_to_glyph(UnitActiveState state) {
static const Glyph map[_UNIT_ACTIVE_STATE_MAX] = {
[UNIT_ACTIVE] = GLYPH_BLACK_CIRCLE,
[UNIT_RELOADING] = GLYPH_CIRCLE_ARROW,
[UNIT_REFRESHING] = GLYPH_CIRCLE_ARROW,
[UNIT_INACTIVE] = GLYPH_WHITE_CIRCLE,
[UNIT_FAILED] = GLYPH_MULTIPLICATION_SIGN,
[UNIT_ACTIVATING] = GLYPH_BLACK_CIRCLE,
[UNIT_DEACTIVATING] = GLYPH_BLACK_CIRCLE,
[UNIT_MAINTENANCE] = GLYPH_WHITE_CIRCLE,
};
if (state < 0)
return _SPECIAL_GLYPH_INVALID;
return _GLYPH_INVALID;
assert(state < _UNIT_ACTIVE_STATE_MAX);
return map[state];
+1 -1
View File
@@ -363,4 +363,4 @@ NotifyAccess notify_access_from_string(const char *s) _pure_;
const char* job_mode_to_string(JobMode t) _const_;
JobMode job_mode_from_string(const char *s) _pure_;
SpecialGlyph unit_active_state_to_glyph(UnitActiveState state);
Glyph unit_active_state_to_glyph(UnitActiveState state);
+3 -3
View File
@@ -144,7 +144,7 @@ static int run(int argc, char *argv[]) {
if (r == 0)
return 0;
log_struct(LOG_EMERG,
LOG_MESSAGE("%s " BATTERY_LOW_MESSAGE, special_glyph(SPECIAL_GLYPH_LOW_BATTERY)),
LOG_MESSAGE("%s " BATTERY_LOW_MESSAGE, glyph(GLYPH_LOW_BATTERY)),
"MESSAGE_ID=" SD_MESSAGE_BATTERY_LOW_WARNING_STR);
fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
@@ -152,10 +152,10 @@ static int run(int argc, char *argv[]) {
log_warning_errno(fd, "Failed to open console, ignoring: %m");
else
dprintf(fd, ANSI_HIGHLIGHT_RED "%s " BATTERY_LOW_MESSAGE ANSI_NORMAL "\n",
special_glyph_full(SPECIAL_GLYPH_LOW_BATTERY, /* force_utf = */ false));
glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ false));
if (asprintf(&plymouth_message, "%s " BATTERY_LOW_MESSAGE,
special_glyph_full(SPECIAL_GLYPH_LOW_BATTERY, /* force_utf = */ true)) < 0)
glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ true)) < 0)
return log_oom();
(void) plymouth_send_message("shutdown", plymouth_message);
+1 -1
View File
@@ -82,7 +82,7 @@ static int apply_file(const char *filename, bool ignore_enoent) {
return log_error_errno(r, "Failed to open file '%s': %m", filename);
}
log_debug("Applying %s%s", pp, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Applying %s%s", pp, glyph(GLYPH_ELLIPSIS));
for (unsigned line = 1;; line++) {
_cleanup_free_ char *text = NULL;
int k;
+1 -1
View File
@@ -935,7 +935,7 @@ static int are_we_installed(const char *esp_path) {
if (!p)
return log_oom();
log_debug("Checking whether %s contains any files%s", p, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Checking whether %s contains any files%s", p, glyph(GLYPH_ELLIPSIS));
r = dir_is_empty(p, /* ignore_hidden_or_backup= */ false);
if (r < 0 && r != -ENOENT)
return log_error_errno(r, "Failed to check whether %s contains any files: %m", p);
+9 -7
View File
@@ -40,13 +40,15 @@ static int random_seed_verify_permissions(int fd, mode_t expected_type) {
return 0;
if (S_ISREG(expected_type))
log_warning("%s Random seed file '%s' is world accessible, which is a security hole! %s",
special_glyph(SPECIAL_GLYPH_WARNING_SIGN), full_path, special_glyph(SPECIAL_GLYPH_WARNING_SIGN));
else {
assert(S_ISDIR(expected_type));
log_warning("%s Mount point '%s' which backs the random seed file is world accessible, which is a security hole! %s",
special_glyph(SPECIAL_GLYPH_WARNING_SIGN), full_path, special_glyph(SPECIAL_GLYPH_WARNING_SIGN));
}
log_error("%s%sRandom seed file '%s' is world accessible, which is a security hole!%s%s",
optional_glyph(GLYPH_WARNING_SIGN), optional_glyph(GLYPH_SPACE),
full_path,
optional_glyph(GLYPH_SPACE), optional_glyph(GLYPH_WARNING_SIGN));
else
log_error("%s%s Mount point '%s' which backs the random seed file is world accessible, which is a security hole! %s%s",
optional_glyph(GLYPH_WARNING_SIGN), optional_glyph(GLYPH_SPACE),
full_path,
optional_glyph(GLYPH_SPACE), optional_glyph(GLYPH_WARNING_SIGN));
return 1;
}
+5 -5
View File
@@ -137,7 +137,7 @@ static int print_efi_option(uint16_t id, int *n_printed, bool in_order) {
printf(" Status: %sactive%s\n", active ? "" : "in", in_order ? ", boot-order" : "");
printf(" Partition: /dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "\n",
SD_ID128_FORMAT_VAL(partition));
printf(" File: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), path);
printf(" File: %s%s\n", glyph(GLYPH_TREE_RIGHT), path);
printf("\n");
(*n_printed)++;
@@ -230,7 +230,7 @@ static int enumerate_binaries(
* one more, and can draw the tree glyph properly. */
printf(" %s %s%s\n",
*is_first ? "File:" : " ",
special_glyph(SPECIAL_GLYPH_TREE_BRANCH), *previous);
glyph(GLYPH_TREE_BRANCH), *previous);
*is_first = false;
*previous = mfree(*previous);
}
@@ -281,7 +281,7 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) {
if (last) /* let's output the last entry now, since now we know that there will be no more, and can draw the tree glyph properly */
printf(" %s %s%s\n",
is_first ? "File:" : " ",
special_glyph(SPECIAL_GLYPH_TREE_RIGHT), last);
glyph(GLYPH_TREE_RIGHT), last);
if (r == 0 && !arg_quiet)
log_info("systemd-boot not installed in ESP.");
@@ -505,7 +505,7 @@ int verb_status(int argc, char *argv[], void *userdata) {
printf(" Partition: n/a\n");
if (loader_path)
printf(" Loader: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), strna(loader_path));
printf(" Loader: %s%s\n", glyph(GLYPH_TREE_RIGHT), strna(loader_path));
if (loader_url)
printf(" Net Boot URL: %s\n", loader_url);
@@ -546,7 +546,7 @@ int verb_status(int argc, char *argv[], void *userdata) {
printf(" Partition: n/a\n");
if (stub_path)
printf(" Stub: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), strna(stub_path));
printf(" Stub: %s%s\n", glyph(GLYPH_TREE_RIGHT), strna(stub_path));
if (stub_url)
printf(" Net Boot URL: %s\n", stub_url);
+3 -3
View File
@@ -401,8 +401,8 @@ static void print_subtree(const char *prefix, const char *path, char **l) {
}
const char
*vertical = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)),
*space = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_SPACE));
*vertical = strjoina(prefix, glyph(GLYPH_TREE_VERTICAL)),
*space = strjoina(prefix, glyph(GLYPH_TREE_SPACE));
for (;;) {
bool has_more = false;
@@ -426,7 +426,7 @@ static void print_subtree(const char *prefix, const char *path, char **l) {
printf("%s%s %s\n",
prefix,
special_glyph(has_more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT),
glyph(has_more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT),
*l);
print_subtree(has_more ? vertical : space, *l, l);
+1 -1
View File
@@ -2073,7 +2073,7 @@ static int method_enqueue_marked_jobs(sd_bus_message *message, void *userdata, s
if (r == 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
log_info("Queuing reload/restart jobs for marked units%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Queuing reload/restart jobs for marked units%s", glyph(GLYPH_ELLIPSIS));
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
r = sd_bus_message_new_method_return(message, &reply);
+1 -1
View File
@@ -641,7 +641,7 @@ static int bus_service_set_transient_property(
if (!UNIT_WRITE_FLAGS_NOOP(flags))
log_unit_notice(u, "Transient unit's PIDFile= property references path below legacy directory /var/run, updating %s %s %s; please update client accordingly.",
n, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), z);
n, glyph(GLYPH_ARROW_RIGHT), z);
free_and_replace(n, z);
}
+2 -2
View File
@@ -303,10 +303,10 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
r = fd_get_path(fd, &fn);
if (r < 0)
log_debug_errno(r, "Received serialized fd %i %s %m",
fd, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT));
fd, glyph(GLYPH_ARROW_RIGHT));
else
log_debug("Received serialized fd %i %s %s",
fd, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), strna(fn));
fd, glyph(GLYPH_ARROW_RIGHT), strna(fn));
}
}
}
+2 -2
View File
@@ -1882,7 +1882,7 @@ static void manager_coldplug(Manager *m) {
assert(m);
log_debug("Invoking unit coldplug() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Invoking unit coldplug() handlers%s", glyph(GLYPH_ELLIPSIS));
/* Let's place the units back into their deserialized state */
HASHMAP_FOREACH_KEY(u, k, m->units) {
@@ -1903,7 +1903,7 @@ static void manager_catchup(Manager *m) {
assert(m);
log_debug("Invoking unit catchup() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Invoking unit catchup() handlers%s", glyph(GLYPH_ELLIPSIS));
/* Let's catch up on any state changes that happened while we were reloading/reexecing */
HASHMAP_FOREACH_KEY(u, k, m->units) {
+1 -1
View File
@@ -850,7 +850,7 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
continue;
fprintf(f, "%s%s %s:\n",
prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mount_exec_command_to_string(c));
prefix, glyph(GLYPH_ARROW_RIGHT), mount_exec_command_to_string(c));
exec_command_dump(m->exec_command + c, f, prefix2);
}
+2 -2
View File
@@ -1649,7 +1649,7 @@ static int follow_symlink(
mount_entry_path(m));
log_debug("Followed mount entry path symlink %s %s %s.",
mount_entry_path(m), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), target);
mount_entry_path(m), glyph(GLYPH_ARROW_RIGHT), target);
mount_entry_consume_prefix(m, TAKE_PTR(target));
@@ -1821,7 +1821,7 @@ static int apply_one_mount(
return log_debug_errno(r, "Failed to follow symlinks on %s: %m", mount_entry_source(m));
log_debug("Followed source symlinks %s %s %s.",
mount_entry_source(m), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), chased);
mount_entry_source(m), glyph(GLYPH_ARROW_RIGHT), chased);
free_and_replace(m->source_malloc, chased);
+1 -1
View File
@@ -1069,7 +1069,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) {
continue;
fprintf(f, "%s%s %s:\n",
prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), service_exec_command_to_string(c));
prefix, glyph(GLYPH_ARROW_RIGHT), service_exec_command_to_string(c));
exec_command_dump_list(s->exec_command[c], f, prefix2);
}
+2 -2
View File
@@ -821,7 +821,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
continue;
fprintf(f, "%s%s %s:\n",
prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), socket_exec_command_to_string(c));
prefix, glyph(GLYPH_ARROW_RIGHT), socket_exec_command_to_string(c));
exec_command_dump_list(s->exec_command[c], f, prefix2);
}
@@ -1315,7 +1315,7 @@ static int socket_symlink(Socket *s) {
}
if (r < 0)
log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s %s %s, ignoring: %m",
p, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), *i);
p, glyph(GLYPH_ARROW_RIGHT), *i);
}
return 0;
+1 -1
View File
@@ -613,7 +613,7 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) {
continue;
fprintf(f, "%s%s %s:\n",
prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), swap_exec_command_to_string(c));
prefix, glyph(GLYPH_ARROW_RIGHT), swap_exec_command_to_string(c));
exec_command_dump(s->exec_command + c, f, prefix2);
}
+1 -1
View File
@@ -457,7 +457,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
fprintf(f,
"%s%s Unit %s:\n",
prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), u->id);
prefix, glyph(GLYPH_ARROW_RIGHT), u->id);
SET_FOREACH(t, u->aliases)
fprintf(f, "%s\tAlias: %s\n", prefix, t);
+1 -1
View File
@@ -178,7 +178,7 @@ int enroll_fido2(
fprintf(stderr,
"A FIDO2 credential has been registered for this volume:\n\n"
" %s%sfido2-cid=%s",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? " " : "",
ansi_highlight());
fflush(stderr);
+1 -1
View File
@@ -47,7 +47,7 @@ int enroll_recovery(
fprintf(stderr,
"A secret recovery key has been generated for this volume:\n\n"
" %s%s%s",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? " " : "",
ansi_highlight());
fflush(stderr);
+10 -10
View File
@@ -89,7 +89,7 @@ static int notify_override_masked(const char *top, const char *bottom) {
printf("%s%s%s %s %s %s\n",
ansi_highlight_red(), "[MASKED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom);
top, glyph(GLYPH_ARROW_RIGHT), bottom);
return 1;
}
@@ -99,7 +99,7 @@ static int notify_override_equivalent(const char *top, const char *bottom) {
printf("%s%s%s %s %s %s\n",
ansi_highlight_green(), "[EQUIVALENT]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom);
top, glyph(GLYPH_ARROW_RIGHT), bottom);
return 1;
}
@@ -109,7 +109,7 @@ static int notify_override_redirected(const char *top, const char *bottom) {
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[REDIRECTED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom);
top, glyph(GLYPH_ARROW_RIGHT), bottom);
return 1;
}
@@ -119,7 +119,7 @@ static int notify_override_overridden(const char *top, const char *bottom) {
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[OVERRIDDEN]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom);
top, glyph(GLYPH_ARROW_RIGHT), bottom);
return 1;
}
@@ -129,7 +129,7 @@ static int notify_override_extended(const char *top, const char *bottom) {
printf("%s%s%s %s %s %s\n",
ansi_highlight(), "[EXTENDED]", ansi_normal(),
top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom);
top, glyph(GLYPH_ARROW_RIGHT), bottom);
return 1;
}
@@ -237,7 +237,7 @@ static int enumerate_dir_d(
return -ENOMEM;
d = p + strlen(toppath) + 1;
log_debug("Adding at top: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
log_debug("Adding at top: %s %s %s", d, glyph(GLYPH_ARROW_RIGHT), p);
r = ordered_hashmap_ensure_put(top, &string_hash_ops_value_free, d, p);
if (r >= 0) {
p = strdup(p);
@@ -249,7 +249,7 @@ static int enumerate_dir_d(
return r;
}
log_debug("Adding at bottom: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
log_debug("Adding at bottom: %s %s %s", d, glyph(GLYPH_ARROW_RIGHT), p);
free(ordered_hashmap_remove(*bottom, d));
r = ordered_hashmap_ensure_put(bottom, &string_hash_ops_value_free, d, p);
if (r < 0) {
@@ -277,7 +277,7 @@ static int enumerate_dir_d(
return -ENOMEM;
log_debug("Adding to drops: %s %s %s %s %s",
unit, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
unit, glyph(GLYPH_ARROW_RIGHT), basename(p), glyph(GLYPH_ARROW_RIGHT), p);
r = ordered_hashmap_put(h, basename(p), p);
if (r < 0) {
free(p);
@@ -353,7 +353,7 @@ static int enumerate_dir(
if (!p)
return -ENOMEM;
log_debug("Adding at top: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
log_debug("Adding at top: %s %s %s", basename(p), glyph(GLYPH_ARROW_RIGHT), p);
r = ordered_hashmap_ensure_put(top, &string_hash_ops_value_free, basename(p), p);
if (r >= 0) {
p = strdup(p);
@@ -362,7 +362,7 @@ static int enumerate_dir(
} else if (r != -EEXIST)
return r;
log_debug("Adding at bottom: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
log_debug("Adding at bottom: %s %s %s", basename(p), glyph(GLYPH_ARROW_RIGHT), p);
free(ordered_hashmap_remove(*bottom, basename(p)));
r = ordered_hashmap_ensure_put(bottom, &string_hash_ops_value_free, basename(p), p);
if (r < 0)
+2 -2
View File
@@ -2114,12 +2114,12 @@ static int action_validate(void) {
return r;
if (isatty_safe(STDOUT_FILENO) && emoji_enabled())
printf("%s ", special_glyph(SPECIAL_GLYPH_SPARKLES));
printf("%s ", glyph(GLYPH_SPARKLES));
printf("%sOK%s", ansi_highlight_green(), ansi_normal());
if (isatty_safe(STDOUT_FILENO) && emoji_enabled())
printf(" %s", special_glyph(SPECIAL_GLYPH_SPARKLES));
printf(" %s", glyph(GLYPH_SPARKLES));
putc('\n', stdout);
return 0;
@@ -57,7 +57,7 @@ static int load_and_print(void) {
* that in case of failure, a partial update is better than none. */
STRV_FOREACH(i, files) {
log_debug("Reading %s%s", *i, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Reading %s%s", *i, glyph(GLYPH_ELLIPSIS));
r = merge_env_file(&env, NULL, *i);
if (r == -ENOMEM)
+4 -4
View File
@@ -131,7 +131,7 @@ static void print_welcome(int rfd) {
putchar('\n');
if (emoji_enabled()) {
fputs(special_glyph(SPECIAL_GLYPH_SPARKLES), stdout);
fputs(glyph(GLYPH_SPARKLES), stdout);
putchar(' ');
}
printf("Please configure your new system!\n");
@@ -188,7 +188,7 @@ static int prompt_loop(
l,
strv_isempty(l) ? "%s %s (empty to skip): "
: "%s %s (empty to skip, \"list\" to list options): ",
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), text);
glyph(GLYPH_TRIANGULAR_BULLET), text);
if (r < 0)
return log_error_errno(r, "Failed to query user: %m");
@@ -785,8 +785,8 @@ static int prompt_root_password(int rfd) {
print_welcome(rfd);
msg1 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter the new root password (empty to skip):");
msg2 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter the new root password again:");
msg1 = strjoina(glyph(GLYPH_TRIANGULAR_BULLET), " Please enter the new root password (empty to skip):");
msg2 = strjoina(glyph(GLYPH_TRIANGULAR_BULLET), " Please enter the new root password again:");
suggest_passwords();
+1 -1
View File
@@ -140,7 +140,7 @@ int identity_add_recovery_key(sd_json_variant **v) {
fprintf(stderr,
"A secret recovery key has been generated for this account:\n\n"
" %s%s%s",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "",
emoji_enabled() ? " " : "",
ansi_highlight());
fflush(stderr);
+11 -11
View File
@@ -492,7 +492,7 @@ static int handle_generic_user_record_error(
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_PROTECTED_AUTHENTICATION_PATH_NEEDED)) {
log_notice("%s%sPlease authenticate physically on security token.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
r = user_record_set_pkcs11_protected_authentication_path_permitted(hr, true);
@@ -502,7 +502,7 @@ static int handle_generic_user_record_error(
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_USER_PRESENCE_NEEDED)) {
log_notice("%s%sPlease confirm presence on security token.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
r = user_record_set_fido2_user_presence_permitted(hr, true);
@@ -512,7 +512,7 @@ static int handle_generic_user_record_error(
} else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_USER_VERIFICATION_NEEDED)) {
log_notice("%s%sPlease verify user on security token.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
r = user_record_set_fido2_user_verification_permitted(hr, true);
@@ -2085,11 +2085,11 @@ static int passwd_home(int argc, char *argv[], void *userdata) {
if (arg_pkcs11_token_uri)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"To change the PKCS#11 security token use 'homectl update --pkcs11-token-uri=%s'.",
special_glyph(SPECIAL_GLYPH_ELLIPSIS));
glyph(GLYPH_ELLIPSIS));
if (arg_fido2_device)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"To change the FIDO2 security token use 'homectl update --fido2-device=%s'.",
special_glyph(SPECIAL_GLYPH_ELLIPSIS));
glyph(GLYPH_ELLIPSIS));
if (identity_properties_specified())
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The 'passwd' verb does not permit changing other record properties at the same time.");
@@ -2712,7 +2712,7 @@ static int create_interactively(void) {
putchar('\n');
if (emoji_enabled()) {
fputs(special_glyph(SPECIAL_GLYPH_HOME), stdout);
fputs(glyph(GLYPH_HOME), stdout);
putchar(' ');
}
printf("Please create your user account!\n");
@@ -2729,7 +2729,7 @@ static int create_interactively(void) {
r = ask_string(&username,
"%s Please enter user name to create (empty to skip): ",
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET));
glyph(GLYPH_TRIANGULAR_BULLET));
if (r < 0)
return log_error_errno(r, "Failed to query user for username: %m");
@@ -2785,7 +2785,7 @@ static int create_interactively(void) {
r = ask_string_full(&s,
group_completion_callback, &available,
"%s Please enter an auxiliary group for user %s (empty to continue, \"list\" to list available groups): ",
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), username);
glyph(GLYPH_TRIANGULAR_BULLET), username);
if (r < 0)
return log_error_errno(r, "Failed to query user for auxiliary group: %m");
@@ -2870,7 +2870,7 @@ static int create_interactively(void) {
r = ask_string(&shell,
"%s Please enter the shell to use for user %s (empty for default): ",
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), username);
glyph(GLYPH_TRIANGULAR_BULLET), username);
if (r < 0)
return log_error_errno(r, "Failed to query user for username: %m");
@@ -4619,7 +4619,7 @@ static int parse_argv(int argc, char *argv[]) {
if (u < REBALANCE_WEIGHT_MIN || u > REBALANCE_WEIGHT_MAX)
return log_error_errno(SYNTHETIC_ERRNO(ERANGE), "Rebalancing weight out of valid range %" PRIu64 "%s%" PRIu64 ": %s",
REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX, optarg);
REBALANCE_WEIGHT_MIN, glyph(GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX, optarg);
}
/* Drop from per machine stuff and everywhere */
@@ -5257,7 +5257,7 @@ static int verb_list_signing_keys(int argc, char *argv[], void *userdata) {
if (m < 0)
return log_oom();
if (n > 64) /* check if we truncated the original version */
if (!strextend(&h, special_glyph(SPECIAL_GLYPH_ELLIPSIS)))
if (!strextend(&h, glyph(GLYPH_ELLIPSIS)))
return log_oom();
}
+1 -1
View File
@@ -530,7 +530,7 @@ static void home_set_state(Home *h, HomeState state) {
log_info("%s: changing state %s %s %s", h->user_name,
home_state_to_string(old_state),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
home_state_to_string(new_state));
home_update_pin_fd(h, new_state);
+1 -1
View File
@@ -1953,7 +1953,7 @@ static int manager_rebalance_calculate(Manager *m) {
else {
log_debug("Rebalancing home directory '%s' %s %s %s.", h->user_name,
FORMAT_BYTES(h->rebalance_size),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(h->rebalance_goal));
h->rebalance_pending = true;
}
+3 -3
View File
@@ -3387,13 +3387,13 @@ int home_resize_luks(
log_info("Ready to resize image size %s %s %s, partition size %s %s %s, file system size %s %s %s.",
FORMAT_BYTES(old_image_size),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(new_image_size),
FORMAT_BYTES(setup->partition_size),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(new_partition_size),
FORMAT_BYTES(old_fs_size),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(new_fs_size));
if (new_fs_size > old_fs_size) { /* → Grow */
+1 -1
View File
@@ -302,7 +302,7 @@ int home_shift_uid(int dir_fd, const char *target, uid_t stored_uid, uid_t expos
return log_error_errno(errno, "Failed to apply UID/GID map: %m");
log_debug("Applied uidmap mount to %s. Mapping is " UID_FMT " %s " UID_FMT ".",
strna(target), stored_uid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), exposed_uid);
strna(target), stored_uid, glyph(GLYPH_ARROW_RIGHT), exposed_uid);
if (ret_mount_fd)
*ret_mount_fd = TAKE_FD(mount_fd);
+1 -1
View File
@@ -128,7 +128,7 @@ static void raw_export_report_progress(RawExport *e) {
(void) draw_progress_barf(
percent,
"%s %s/%s",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(e->written_uncompressed),
FORMAT_BYTES(e->st.st_size));
else
+1 -1
View File
@@ -138,7 +138,7 @@ static void tar_export_report_progress(TarExport *e) {
(void) draw_progress_barf(
percent,
"%s %s/%s",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(e->written_uncompressed),
FORMAT_BYTES(e->quota_referenced));
else
+1 -1
View File
@@ -154,7 +154,7 @@ static void raw_import_report_progress(RawImport *i) {
(void) draw_progress_barf(
percent,
"%s %s/%s",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(i->written_compressed),
FORMAT_BYTES(i->input_stat.st_size));
else
+1 -1
View File
@@ -155,7 +155,7 @@ static void tar_import_report_progress(TarImport *i) {
(void) draw_progress_barf(
percent,
"%s %s/%s",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
FORMAT_BYTES(i->written_compressed),
FORMAT_BYTES(i->input_stat.st_size));
else
+1 -1
View File
@@ -67,7 +67,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) {
m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() :
m->header->type == SD_BUS_MESSAGE_METHOD_RETURN ? ansi_highlight_green() :
m->header->type != SD_BUS_MESSAGE_SIGNAL ? ansi_highlight() : "",
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET),
glyph(GLYPH_TRIANGULAR_BULLET),
ansi_normal(),
ansi_highlight(),
+1 -1
View File
@@ -541,7 +541,7 @@ void bus_set_state(sd_bus *bus, enum bus_state state) {
return;
log_debug("Bus %s: changing state %s %s %s", strna(bus->description),
table[bus->state], special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), table[state]);
table[bus->state], glyph(GLYPH_ARROW_RIGHT), table[state]);
bus->state = state;
}
+1 -1
View File
@@ -431,7 +431,7 @@ _public_ int sd_event_new(sd_event** ret) {
if (secure_getenv("SD_EVENT_PROFILE_DELAYS")) {
log_debug("Event loop profiling enabled. Logarithmic histogram of event loop iterations in the range 2^0 %s 2^63 us will be logged every 5s.",
special_glyph(SPECIAL_GLYPH_ELLIPSIS));
glyph(GLYPH_ELLIPSIS));
e->profile_delays = true;
}
+1 -1
View File
@@ -61,7 +61,7 @@ int json_dispatch_byte_array_iovec(const char *name, sd_json_variant *variant, s
if (b > 0xff)
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"Element %zu of JSON field '%s' is out of range 0%s255.",
k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
k, strna(name), glyph(GLYPH_ELLIPSIS));
buffer[k++] = (uint8_t) b;
}
+1 -1
View File
@@ -110,7 +110,7 @@ static void varlink_set_state(sd_varlink *v, VarlinkState state) {
else
varlink_log(v, "Changing state %s %s %s",
varlink_state_to_string(v->state),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
varlink_state_to_string(state));
v->state = state;
+4 -4
View File
@@ -88,7 +88,7 @@ static int show_sysfs_one(
if (!k)
return -ENOMEM;
printf("%s%s%s\n", prefix, special_glyph(lookahead < n_dev ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT), k);
printf("%s%s%s\n", prefix, glyph(lookahead < n_dev ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT), k);
if (asprintf(&l,
"%s%s:%s%s%s%s",
@@ -102,12 +102,12 @@ static int show_sysfs_one(
if (!k)
return -ENOMEM;
printf("%s%s%s\n", prefix, lookahead < n_dev ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " ", k);
printf("%s%s%s\n", prefix, lookahead < n_dev ? glyph(GLYPH_TREE_VERTICAL) : " ", k);
if (++(*i_dev) < n_dev) {
_cleanup_free_ char *p = NULL;
p = strjoin(prefix, lookahead < n_dev ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " ");
p = strjoin(prefix, lookahead < n_dev ? glyph(GLYPH_TREE_VERTICAL) : " ");
if (!p)
return -ENOMEM;
@@ -158,7 +158,7 @@ int show_sysfs(const char *seat, const char *prefix, unsigned n_columns, OutputF
if (dev_list && n_dev > 0)
show_sysfs_one(seat, dev_list, &i, n_dev, "/", prefix, n_columns, flags);
else
printf("%s%s%s\n", prefix, special_glyph(SPECIAL_GLYPH_TREE_RIGHT), "(none)");
printf("%s%s%s\n", prefix, glyph(GLYPH_TREE_RIGHT), "(none)");
return 0;
}
+1 -1
View File
@@ -122,7 +122,7 @@ static int help(int argc, char *argv[], void *userdata) {
ansi_normal(),
ansi_highlight(),
ansi_normal(),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT));
glyph(GLYPH_ARROW_RIGHT));
return 0;
}
+3 -3
View File
@@ -232,9 +232,9 @@ static int format_config_files(char ***files, const char *main_config) {
STRV_FOREACH(d, *files) {
_cleanup_free_ char *s = NULL;
int glyph = *(d + 1) == NULL ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH;
Glyph tree = *(d + 1) == NULL ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH;
s = strjoin(special_glyph(glyph), *d);
s = strjoin(glyph(tree), *d);
if (!s)
return log_oom();
@@ -918,7 +918,7 @@ static int link_status_one(
/* First line: circle, ifindex, ifname. */
printf("%s%s%s %d: %s\n",
on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational,
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
info->ifindex, info->name);
r = table_print(table, NULL);
+1 -1
View File
@@ -116,7 +116,7 @@ int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
return r;
printf("%s%s%s Interfaces: %s\n",
on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational,
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
strna(netifs_joined));
r = table_print(table, NULL);
+3 -3
View File
@@ -2215,7 +2215,7 @@ static int link_update_master(Link *link, sd_netlink_message *message) {
log_link_debug(link, "Detached from master interface: %i", link->master_ifindex);
else
log_link_debug(link, "Master interface changed: %i %s %i", link->master_ifindex,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), master_ifindex);
glyph(GLYPH_ARROW_RIGHT), master_ifindex);
link_drop_from_master(link);
link->master_ifindex = master_ifindex;
@@ -2358,7 +2358,7 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message)
else {
log_link_debug(link, "Hardware address is changed: %s %s %s",
HW_ADDR_TO_STR(&link->hw_addr),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
HW_ADDR_TO_STR(&addr));
hashmap_remove_value(link->manager->links_by_hw_addr, &link->hw_addr, link);
@@ -2456,7 +2456,7 @@ static int link_update_mtu(Link *link, sd_netlink_message *message) {
if (link->mtu != 0)
log_link_debug(link, "MTU is changed: %"PRIu32" %s %"PRIu32" (min: %"PRIu32", max: %"PRIu32")",
link->mtu, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mtu,
link->mtu, glyph(GLYPH_ARROW_RIGHT), mtu,
link->min_mtu, link->max_mtu);
link->mtu = mtu;
+4 -4
View File
@@ -4681,7 +4681,7 @@ static void set_window_title(PTYForward *f) {
(void) gethostname_strict(&hn);
if (emoji_enabled())
dot = strjoin(special_glyph(SPECIAL_GLYPH_BLUE_CIRCLE), " ");
dot = strjoin(glyph(GLYPH_BLUE_CIRCLE), " ");
if (hn)
(void) pty_forward_set_titlef(f, "%sContainer %s on %s", strempty(dot), arg_machine, hn);
@@ -6394,13 +6394,13 @@ static int run(int argc, char *argv[]) {
(void) terminal_urlify_path(t, t, &u);
log_info("%s %sSpawning container %s on %s.%s",
special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal());
glyph(GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal());
if (arg_console_mode == CONSOLE_INTERACTIVE)
log_info("%s %sPress %sCtrl-]%s three times within 1s to kill container; two times followed by %sr%s\n"
"%s %sto reboot container; two times followed by %sp%s to poweroff container.%s",
special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_highlight(), ansi_normal(),
special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal());
glyph(GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_highlight(), ansi_normal(),
glyph(GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal());
}
assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, SIGRTMIN+18) >= 0);
+1 -1
View File
@@ -165,7 +165,7 @@ static int json_dispatch_address(const char *name, sd_json_variant *variant, sd_
if (b < 0 || b > 0xff)
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"Element %zu of JSON field '%s' is out of range 0%s255.",
k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
k, strna(name), glyph(GLYPH_ELLIPSIS));
buf.bytes[k++] = (uint8_t) b;
}
+11 -11
View File
@@ -2115,7 +2115,7 @@ static int show_log_table(EventLog *el, sd_json_variant **ret_variant) {
r = table_add_many(table,
TABLE_UINT32, record->pcr,
TABLE_STRING, special_glyph(SPECIAL_GLYPH_FULL_BLOCK),
TABLE_STRING, glyph(GLYPH_FULL_BLOCK),
TABLE_SET_COLOR, color_for_pcr(el, record->pcr),
TABLE_STRING, tpm2_pcr_index_to_string(record->pcr));
if (r < 0)
@@ -2260,15 +2260,15 @@ static int show_pcr_table(EventLog *el, sd_json_variant **ret_variant) {
/* Whether any unmatched components touch this PCR */
bool missing_components = BIT_SET(el->missing_component_pcrs, pcr);
const char *emoji = special_glyph(
!hash_match ? SPECIAL_GLYPH_DEPRESSED_SMILEY :
!fully_recognized ? SPECIAL_GLYPH_UNHAPPY_SMILEY :
missing_components ? SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY :
SPECIAL_GLYPH_HAPPY_SMILEY);
const char *emoji = glyph(
!hash_match ? GLYPH_DEPRESSED_SMILEY :
!fully_recognized ? GLYPH_UNHAPPY_SMILEY :
missing_components ? GLYPH_SLIGHTLY_HAPPY_SMILEY :
GLYPH_HAPPY_SMILEY);
r = table_add_many(table,
TABLE_UINT32, pcr,
TABLE_STRING, special_glyph(SPECIAL_GLYPH_FULL_BLOCK),
TABLE_STRING, glyph(GLYPH_FULL_BLOCK),
TABLE_SET_COLOR, color_for_pcr(el, pcr),
TABLE_STRING, emoji,
TABLE_STRING, tpm2_pcr_index_to_string(pcr));
@@ -2614,10 +2614,10 @@ static int verb_list_components(int argc, char *argv[], void *userdata) {
case BEFORE_LOCATION:
if (arg_location_end && strcmp((*c)->id, arg_location_end) >= 0) {
loc = AFTER_LOCATION;
marker = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " location '", arg_location_end, "' ", special_glyph(SPECIAL_GLYPH_ARROW_LEFT));
marker = strjoin(glyph(GLYPH_ARROW_RIGHT), " location '", arg_location_end, "' ", glyph(GLYPH_ARROW_LEFT));
} else if (arg_location_start && strcmp((*c)->id, arg_location_start) >= 0) {
loc = BETWEEN_LOCATION;
marker = strjoin(special_glyph(SPECIAL_GLYPH_TREE_TOP), " start location '", arg_location_start, "' ", special_glyph(SPECIAL_GLYPH_ARROW_DOWN));
marker = strjoin(glyph(GLYPH_TREE_TOP), " start location '", arg_location_start, "' ", glyph(GLYPH_ARROW_DOWN));
}
break;
@@ -2625,7 +2625,7 @@ static int verb_list_components(int argc, char *argv[], void *userdata) {
case BETWEEN_LOCATION:
if (arg_location_end && strcmp((*c)->id, arg_location_end) >= 0) {
loc = AFTER_LOCATION;
marker = strjoin(special_glyph(SPECIAL_GLYPH_TREE_RIGHT), " end location '", arg_location_end, "' ", special_glyph(SPECIAL_GLYPH_ARROW_UP));
marker = strjoin(glyph(GLYPH_TREE_RIGHT), " end location '", arg_location_end, "' ", glyph(GLYPH_ARROW_UP));
}
break;
@@ -4577,7 +4577,7 @@ static int make_policy(bool force, RecoveryPinMode recovery_pin_mode) {
if (recovery_pin_mode == RECOVERY_PIN_SHOW)
printf("%s Selected recovery PIN is: %s%s%s\n",
special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY),
glyph(GLYPH_LOCK_AND_KEY),
ansi_highlight_cyan(),
pin,
ansi_normal());
+4 -4
View File
@@ -1262,7 +1262,7 @@ static int install_profile_dropin(
r = copy_file_atomic(from, dropin, 0644, copy_flags);
if (r < 0)
return log_debug_errno(r, "Failed to copy %s %s %s: %m", from, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dropin);
return log_debug_errno(r, "Failed to copy %s %s %s: %m", from, glyph(GLYPH_ARROW_RIGHT), dropin);
(void) portable_changes_add(changes, n_changes, PORTABLE_COPY, dropin, from);
@@ -1273,7 +1273,7 @@ static int install_profile_dropin(
else
r = RET_NERRNO(symlink(from, dropin));
if (r < 0)
return log_debug_errno(r, "Failed to link %s %s %s: %m", from, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dropin);
return log_debug_errno(r, "Failed to link %s %s %s: %m", from, glyph(GLYPH_ARROW_RIGHT), dropin);
(void) portable_changes_add(changes, n_changes, PORTABLE_SYMLINK, dropin, from);
}
@@ -1472,7 +1472,7 @@ static int install_image(
r,
"Failed to copy %s %s %s: %m",
image_path,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
target);
} else {
@@ -1481,7 +1481,7 @@ static int install_image(
errno,
"Failed to link %s %s %s: %m",
image_path,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
target);
}
+2 -2
View File
@@ -533,12 +533,12 @@ static int print_changes(sd_bus_message *m) {
break;
if (streq(type, "symlink"))
log_info("Created symlink %s %s %s.", path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), source);
log_info("Created symlink %s %s %s.", path, glyph(GLYPH_ARROW_RIGHT), source);
else if (streq(type, "copy")) {
if (isempty(source))
log_info("Copied %s.", path);
else
log_info("Copied %s %s %s.", source, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), path);
log_info("Copied %s %s %s.", source, glyph(GLYPH_ARROW_RIGHT), path);
} else if (streq(type, "unlink"))
log_info("Removed %s.", path);
else if (streq(type, "write"))
+15 -15
View File
@@ -1658,7 +1658,7 @@ static int config_parse_size4096(
if (*sz != parsed)
log_syntax(unit, LOG_NOTICE, filename, line, r, "Rounded %s= size %" PRIu64 " %s %" PRIu64 ", a multiple of 4096.",
lvalue, parsed, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), *sz);
lvalue, parsed, glyph(GLYPH_ARROW_RIGHT), *sz);
return 0;
}
@@ -3491,9 +3491,9 @@ static int format_size_change(uint64_t from, uint64_t to, char **ret) {
if (from == to || to == UINT64_MAX)
t = strdup(FORMAT_BYTES(from));
else
t = strjoin(FORMAT_BYTES(from), " ", special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to));
t = strjoin(FORMAT_BYTES(from), " ", glyph(GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to));
} else if (to != UINT64_MAX)
t = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to));
t = strjoin(glyph(GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to));
else {
*ret = NULL;
return 0;
@@ -3641,8 +3641,8 @@ static int context_dump_partitions(Context *context) {
if (!sd_json_format_enabled(arg_json_format_flags) && (sum_padding > 0 || sum_size > 0)) {
const char *a, *b;
a = strjoina(special_glyph(SPECIAL_GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_size));
b = strjoina(special_glyph(SPECIAL_GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_padding));
a = strjoina(glyph(GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_size));
b = strjoina(glyph(GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_padding));
r = table_add_many(
t,
@@ -3804,10 +3804,10 @@ static int context_dump_partition_bar(Context *context) {
z = !z;
fputs(z ? ansi_green() : ansi_yellow(), stdout);
fputs(special_glyph(SPECIAL_GLYPH_DARK_SHADE), stdout);
fputs(glyph(GLYPH_DARK_SHADE), stdout);
} else {
fputs(ansi_normal(), stdout);
fputs(special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), stdout);
fputs(glyph(GLYPH_LIGHT_SHADE), stdout);
}
last = bar[i];
@@ -3838,16 +3838,16 @@ static int context_dump_partition_bar(Context *context) {
const char *e;
/* Upgrade final corner to the right with a branch to the right */
e = startswith(line[start_array[j-1]], special_glyph(SPECIAL_GLYPH_TREE_RIGHT));
e = startswith(line[start_array[j-1]], glyph(GLYPH_TREE_RIGHT));
if (e) {
d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_BRANCH), e);
d = strjoin(glyph(GLYPH_TREE_BRANCH), e);
if (!d)
return log_oom();
}
}
if (!d) {
d = strdup(special_glyph(SPECIAL_GLYPH_TREE_VERTICAL));
d = strdup(glyph(GLYPH_TREE_VERTICAL));
if (!d)
return log_oom();
}
@@ -3857,10 +3857,10 @@ static int context_dump_partition_bar(Context *context) {
(void) partition_hint(p, context->node, &hint);
if (streq_ptr(line[start_array[j-1]], special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)))
d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_BRANCH), " ", strna(hint));
if (streq_ptr(line[start_array[j-1]], glyph(GLYPH_TREE_VERTICAL)))
d = strjoin(glyph(GLYPH_TREE_BRANCH), " ", strna(hint));
else
d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_RIGHT), " ", strna(hint));
d = strjoin(glyph(GLYPH_TREE_RIGHT), " ", strna(hint));
if (!d)
return log_oom();
@@ -5163,7 +5163,7 @@ static int progress_bytes(uint64_t n_bytes, void *userdata) {
100.0 * (double) p->copy_blocks_done / (double) p->copy_blocks_size,
"%s %s %s %s/%s",
strna(p->copy_blocks_path),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
strna(p->definition_path),
FORMAT_BYTES(p->copy_blocks_done),
FORMAT_BYTES(p->copy_blocks_size));
@@ -8274,7 +8274,7 @@ static int parse_argv(int argc, char *argv[], X509 **ret_certificate, EVP_PKEY *
if (rounded != parsed)
log_warning("Specified size is not a multiple of 4096, rounding up automatically. (%" PRIu64 " %s %" PRIu64 ")",
parsed, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), rounded);
parsed, glyph(GLYPH_ARROW_RIGHT), rounded);
arg_size = rounded;
arg_size_auto = false;
+3 -3
View File
@@ -2824,7 +2824,7 @@ static int print_question(char prefix, const char *color, sd_json_variant *quest
printf("%s%s %c%s: %s\n",
color,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
prefix,
ansi_normal(),
dns_resource_key_to_string(key, buf, sizeof(buf)));
@@ -2868,7 +2868,7 @@ static int print_answer(sd_json_variant *answer) {
printf("%s%s A%s: %s\n",
ansi_highlight_yellow(),
special_glyph(SPECIAL_GLYPH_ARROW_LEFT),
glyph(GLYPH_ARROW_LEFT),
ansi_normal(),
s);
}
@@ -2928,7 +2928,7 @@ static void monitor_query_dump(sd_json_variant *v) {
printf("%s%s S%s: %s",
streq_ptr(p.state, "success") ? ansi_highlight_green() : ansi_highlight_red(),
special_glyph(SPECIAL_GLYPH_ARROW_LEFT),
glyph(GLYPH_ARROW_LEFT),
ansi_normal(),
strna(streq_ptr(p.state, "errno") ? errno_to_name(p.error) :
streq_ptr(p.state, "rcode-failure") ? dns_rcode_to_string(p.rcode) :
+2 -2
View File
@@ -1155,7 +1155,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
if (r > 0)
log_debug("Following CNAME/DNAME %s %s %s.",
dns_question_first_name(q->question_idna),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
dns_question_first_name(nq_idna));
k = dns_question_is_equal(q->question_idna, q->question_utf8);
@@ -1172,7 +1172,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname)
if (k > 0)
log_debug("Following UTF8 CNAME/DNAME %s %s %s.",
dns_question_first_name(q->question_utf8),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
dns_question_first_name(nq_utf8));
}
+1 -1
View File
@@ -2772,7 +2772,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) {
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *ds = NULL;
log_debug("Requesting DS (%s %s) to validate transaction %" PRIu16 " (%s empty response).",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), name, t->id,
glyph(GLYPH_ARROW_RIGHT), name, t->id,
dns_resource_key_name(dns_transaction_key(t)));
ds = dns_resource_key_new(dns_transaction_key(t)->class, DNS_TYPE_DS, name);
+1 -1
View File
@@ -398,7 +398,7 @@ static int json_dispatch_address(const char *name, sd_json_variant *variant, sd_
if (b < 0 || b > 0xff)
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"Element %zu of JSON field '%s' is out of range 0%s255.",
k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
k, strna(name), glyph(GLYPH_ELLIPSIS));
buf.bytes[k++] = (uint8_t) b;
}
+1 -1
View File
@@ -118,7 +118,7 @@ static int generate(void) {
p = strjoina(arg_dest, "/" SPECIAL_DEFAULT_TARGET);
if (symlink("kernel-command-line.target", p) < 0)
return log_error_errno(errno, "Failed to link unit file kernel-command-line.target %s %s: %m",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p);
glyph(GLYPH_ARROW_RIGHT), p);
return 0;
}
+2 -2
View File
@@ -1101,7 +1101,7 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) {
if (!arg_shell_prompt_prefix)
return log_oom();
} else if (emoji_enabled()) {
arg_shell_prompt_prefix = strjoin(special_glyph(privileged_execution() ? SPECIAL_GLYPH_SUPERHERO : SPECIAL_GLYPH_IDCARD), " ");
arg_shell_prompt_prefix = strjoin(glyph(privileged_execution() ? GLYPH_SUPERHERO : GLYPH_IDCARD), " ");
if (!arg_shell_prompt_prefix)
return log_oom();
}
@@ -1988,7 +1988,7 @@ static void set_window_title(PTYForward *f) {
return (void) log_oom();
if (emoji_enabled())
dot = strjoin(special_glyph(privileged_execution() ? SPECIAL_GLYPH_RED_CIRCLE : SPECIAL_GLYPH_YELLOW_CIRCLE), " ");
dot = strjoin(glyph(privileged_execution() ? GLYPH_RED_CIRCLE : GLYPH_YELLOW_CIRCLE), " ");
if (arg_host || hn)
(void) pty_forward_set_titlef(f, "%s%s on %s", strempty(dot), cl, arg_host ?: hn);
+2 -2
View File
@@ -506,7 +506,7 @@ int ask_password_tty(
const char *keyring = req->keyring;
if (!FLAGS_SET(flags, ASK_PASSWORD_HIDE_EMOJI) && emoji_enabled())
message = strjoina(special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY), " ", message);
message = strjoina(glyph(GLYPH_LOCK_AND_KEY), " ", message);
if (req->flag_file || (FLAGS_SET(flags, ASK_PASSWORD_ACCEPT_CACHED) && keyring)) {
inotify_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK);
@@ -761,7 +761,7 @@ int ask_password_tty(
(void) loop_write(ttyfd, passphrase + codepoint, n);
else
(void) loop_write(ttyfd,
special_glyph(SPECIAL_GLYPH_BULLET),
glyph(GLYPH_BULLET),
SIZE_MAX);
codepoint = p;
}
+1 -1
View File
@@ -1664,7 +1664,7 @@ static void print_addon(
const char *addon_str) {
printf(" %s: %s\n", addon_str, addon->location);
printf(" options: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), addon->cmdline);
printf(" options: %s%s\n", glyph(GLYPH_TREE_RIGHT), addon->cmdline);
}
static int indent_embedded_newlines(char *cmdline, char **ret_cmdline) {
+4 -4
View File
@@ -188,7 +188,7 @@ static int dump_processes(
}
more = i+1 < n || cg->children;
special = special_glyph(more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT);
special = glyph(more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT);
fprintf(stdout, "%s%s%s%*"PID_PRI" %s%s\n",
prefix,
@@ -225,14 +225,14 @@ static int dump_processes(
name++;
more = i+1 < n;
special = special_glyph(more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT);
special = glyph(more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT);
fputs(prefix, stdout);
fputs(special, stdout);
fputs(name, stdout);
fputc('\n', stdout);
special = special_glyph(more ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE);
special = glyph(more ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE);
pp = strjoin(prefix, special);
if (!pp)
@@ -314,7 +314,7 @@ static int dump_extra_processes(
fprintf(stdout, "%s%s %*" PID_PRI " %s\n",
prefix,
special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET),
glyph(GLYPH_TRIANGULAR_BULLET),
width, pids[k],
name);
}
+10 -10
View File
@@ -71,9 +71,9 @@ static void show_pid_array(
&t);
if (extra)
printf("%s%s ", prefix, special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET));
printf("%s%s ", prefix, glyph(GLYPH_TRIANGULAR_BULLET));
else
printf("%s%s", prefix, special_glyph(((more || i < n_pids-1) ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT)));
printf("%s%s", prefix, glyph(((more || i < n_pids-1) ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT)));
printf("%s%*"PID_PRI" %s%s\n", ansi_grey(), (int) pid_width, pids[i], strna(t), ansi_normal());
}
@@ -132,7 +132,7 @@ static int show_cgroup_one_by_path(
static int show_cgroup_name(
const char *path,
const char *prefix,
SpecialGlyph glyph,
Glyph tree,
OutputFlags flags) {
uint64_t cgroupid = UINT64_MAX;
@@ -161,7 +161,7 @@ static int show_cgroup_name(
return log_error_errno(r, "Failed to extract filename from cgroup path: %m");
printf("%s%s%s%s%s",
prefix, special_glyph(glyph),
prefix, glyph(tree),
delegate ? ansi_underline() : "",
cg_unescape(b),
delegate ? ansi_normal() : "");
@@ -169,7 +169,7 @@ static int show_cgroup_name(
if (delegate)
printf(" %s%s%s",
ansi_highlight(),
special_glyph(SPECIAL_GLYPH_ELLIPSIS),
glyph(GLYPH_ELLIPSIS),
ansi_normal());
if (cgroupid != UINT64_MAX)
@@ -207,8 +207,8 @@ static int show_cgroup_name(
printf("%s%s%s %s%s%s: %s\n",
prefix,
glyph == SPECIAL_GLYPH_TREE_BRANCH ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " ",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
tree == GLYPH_TREE_BRANCH ? glyph(GLYPH_TREE_VERTICAL) : " ",
glyph(GLYPH_ARROW_RIGHT),
ansi_blue(), x, ansi_normal(),
y);
}
@@ -261,12 +261,12 @@ int show_cgroup_by_path(
}
if (last) {
r = show_cgroup_name(last, prefix, SPECIAL_GLYPH_TREE_BRANCH, flags);
r = show_cgroup_name(last, prefix, GLYPH_TREE_BRANCH, flags);
if (r < 0)
return r;
if (!p1) {
p1 = strjoin(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL));
p1 = strjoin(prefix, glyph(GLYPH_TREE_VERTICAL));
if (!p1)
return -ENOMEM;
}
@@ -285,7 +285,7 @@ int show_cgroup_by_path(
(void) show_cgroup_one_by_path(path, prefix, n_columns, !!last, flags);
if (last) {
r = show_cgroup_name(last, prefix, SPECIAL_GLYPH_TREE_RIGHT, flags);
r = show_cgroup_name(last, prefix, GLYPH_TREE_RIGHT, flags);
if (r < 0)
return r;
+1 -1
View File
@@ -212,7 +212,7 @@ int devnode_acl_all(const char *seat,
int k;
log_debug("Changing ACLs at %s for seat %s (uid "UID_FMT"%s"UID_FMT"%s%s)",
n, seat, old_uid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), new_uid,
n, seat, old_uid, glyph(GLYPH_ARROW_RIGHT), new_uid,
del ? " del" : "", add ? " add" : "");
k = devnode_acl(n, flush, del, old_uid, add, new_uid);
+3 -3
View File
@@ -1386,7 +1386,7 @@ int dns_name_apply_idna(const char *name, char **ret) {
r = sym_idn2_lookup_u8((uint8_t*) name, (uint8_t**) &t,
IDN2_NFC_INPUT | IDN2_TRANSITIONAL);
log_debug("idn2_lookup_u8: %s %s %s", name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), t);
log_debug("idn2_lookup_u8: %s %s %s", name, glyph(GLYPH_ARROW_RIGHT), t);
if (r == IDN2_OK) {
if (!startswith(name, "xn--")) {
_cleanup_free_ char *s = NULL;
@@ -1401,8 +1401,8 @@ int dns_name_apply_idna(const char *name, char **ret) {
if (!streq_ptr(name, s)) {
log_debug("idn2 roundtrip failed: \"%s\" %s \"%s\" %s \"%s\", ignoring.",
name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), t,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), s);
name, glyph(GLYPH_ARROW_RIGHT), t,
glyph(GLYPH_ARROW_RIGHT), s);
*ret = NULL;
return 0;
}
+3 -3
View File
@@ -1651,7 +1651,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas
return yes_no(d->boolean);
case TABLE_BOOLEAN_CHECKMARK:
return special_glyph(d->boolean ? SPECIAL_GLYPH_CHECK_MARK : SPECIAL_GLYPH_CROSS_MARK);
return glyph(d->boolean ? GLYPH_CHECK_MARK : GLYPH_CROSS_MARK);
case TABLE_TIMESTAMP:
case TABLE_TIMESTAMP_UTC:
@@ -2341,7 +2341,7 @@ int table_print(Table *t, FILE *f) {
req_width = MAX(req_width,
utf8_console_width(last) +
utf8_console_width(special_glyph(SPECIAL_GLYPH_ELLIPSIS)));
utf8_console_width(glyph(GLYPH_ELLIPSIS)));
}
/* Determine the biggest width that any cell in this column would like to have */
@@ -2563,7 +2563,7 @@ int table_print(Table *t, FILE *f) {
* right after. This will truncate the ellipsis and add a new
* one. */
padded = strjoin(field, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
padded = strjoin(field, glyph(GLYPH_ELLIPSIS));
if (!padded)
return -ENOMEM;
+2 -2
View File
@@ -348,7 +348,7 @@ static void install_change_dump_success(const InstallChange *change) {
case INSTALL_CHANGE_SYMLINK:
return log_info("Created symlink '%s' %s '%s'.",
change->path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), change->source);
change->path, glyph(GLYPH_ARROW_RIGHT), change->source);
case INSTALL_CHANGE_UNLINK:
return log_info("Removed '%s'.", change->path);
@@ -604,7 +604,7 @@ static int create_symlink(
if (chroot_unit_symlinks_equivalent(lp, new_path, dest, old_path)) {
log_debug("Symlink %s %s %s already exists",
new_path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dest);
new_path, glyph(GLYPH_ARROW_RIGHT), dest);
return 1;
}
+10 -10
View File
@@ -447,7 +447,7 @@ static int fido2_use_hmac_hash_specific_token(
if (FLAGS_SET(required, FIDO2ENROLL_UP))
log_notice("%s%sPlease confirm presence on security token to unlock.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
}
@@ -461,7 +461,7 @@ static int fido2_use_hmac_hash_specific_token(
if (FLAGS_SET(required, FIDO2ENROLL_UV))
log_notice("%s%sPlease verify user on security token to unlock.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
}
@@ -500,7 +500,7 @@ static int fido2_use_hmac_hash_specific_token(
if (FLAGS_SET(required, FIDO2ENROLL_UP_IF_NEEDED)) {
log_notice("%s%sPlease confirm presence on security to unlock.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
retry_with_up = true;
}
@@ -513,7 +513,7 @@ static int fido2_use_hmac_hash_specific_token(
if (has_up && (required & (FIDO2ENROLL_UP|FIDO2ENROLL_UP_IF_NEEDED)) == FIDO2ENROLL_UP_IF_NEEDED) {
log_notice("%s%sGot unsupported option error when user presence test is turned off. Trying with user presence test turned on.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
retry_with_up = true;
}
@@ -834,7 +834,7 @@ int fido2_generate_hmac_hash(
if (has_uv || has_up)
log_notice("%s%s(Hint: This might require confirmation of user presence on security token.)",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
/* If we are using the user PIN, then we must pass that PIN to the get_assertion call below, or
@@ -952,7 +952,7 @@ int fido2_generate_hmac_hash(
if (FLAGS_SET(lock_with, FIDO2ENROLL_UP))
log_notice("%s%sIn order to allow secret key generation, please confirm presence on security token.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
}
@@ -966,7 +966,7 @@ int fido2_generate_hmac_hash(
if (FLAGS_SET(lock_with, FIDO2ENROLL_UV))
log_notice("%s%sIn order to allow secret key generation, please verify user on security token.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
}
@@ -990,7 +990,7 @@ int fido2_generate_hmac_hash(
"Token asks for user presence test but was already enabled.");
log_notice("%s%sLocking without user presence test requested, but FIDO2 device %s requires it, enabling.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "",
device);
@@ -1006,7 +1006,7 @@ int fido2_generate_hmac_hash(
if (has_up && !FLAGS_SET(lock_with, FIDO2ENROLL_UP)) {
log_notice("%s%sGot unsupported option error when user presence test is turned off. Trying with user presence test turned on.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "",
emoji_enabled() ? glyph(GLYPH_TOUCH) : "",
emoji_enabled() ? " " : "");
retry_with_up = true;
}
@@ -1192,7 +1192,7 @@ int fido2_list_devices(void) {
"%1$s UP %2$s User presence%3$s\n"
"%1$s UV %2$s User verification%3$s\n",
ansi_grey(),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
ansi_normal());
r = 0;
+2 -2
View File
@@ -61,7 +61,7 @@ static int print_catalog(FILE *f, sd_journal *j) {
return log_error_errno(r, "Failed to find catalog entry: %m");
if (is_locale_utf8())
prefix = strjoina(special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), special_glyph(SPECIAL_GLYPH_LIGHT_SHADE));
prefix = strjoina(glyph(GLYPH_LIGHT_SHADE), glyph(GLYPH_LIGHT_SHADE));
else
prefix = "--";
@@ -694,7 +694,7 @@ static int output_short(
if (c) {
_cleanup_free_ char *urlified = NULL;
if (terminal_urlify(c, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK), &urlified) >= 0) {
if (terminal_urlify(c, glyph(GLYPH_EXTERNAL_LINK), &urlified) >= 0) {
fputs(urlified, f);
fputc(' ', f);
}
+1 -1
View File
@@ -714,7 +714,7 @@ int mount_verbose_full(
what, where, strnull(fl), strempty(o));
else if (f & MS_MOVE)
log_debug("Moving mount %s %s %s (%s \"%s\")...",
what, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), where, strnull(fl), strempty(o));
what, glyph(GLYPH_ARROW_RIGHT), where, strnull(fl), strempty(o));
else
log_debug("Mounting %s (%s) on %s (%s \"%s\")...",
strna(what), strna(type), where, strnull(fl), strempty(o));
+2 -2
View File
@@ -525,14 +525,14 @@ void draw_progress_bar_unbuffered(const char *prefix, double percentage) {
fprintf(stderr, "\x1B[38;2;%u;%u;%um", r8, g8, b8);
}
fputs(special_glyph(SPECIAL_GLYPH_HORIZONTAL_FAT), stderr);
fputs(glyph(GLYPH_HORIZONTAL_FAT), stderr);
} else if (i+1 < length && !separator_done) {
fputs(ansi_normal(), stderr);
fputc(' ', stderr);
separator_done = true;
fputs(ansi_grey(), stderr);
} else
fputs(special_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED), stderr);
fputs(glyph(GLYPH_HORIZONTAL_DOTTED), stderr);
}
fputs(ansi_normal(), stderr);
+2 -2
View File
@@ -34,13 +34,13 @@ int conf_files_cat(const char *root, const char *name, CatFlags flags);
static inline const char* red_cross_mark_internal(char buffer[static RED_CROSS_MARK_MAX]) {
assert(buffer);
assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_red()), special_glyph(SPECIAL_GLYPH_CROSS_MARK)), ansi_normal()) < buffer + RED_CROSS_MARK_MAX);
assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_red()), glyph(GLYPH_CROSS_MARK)), ansi_normal()) < buffer + RED_CROSS_MARK_MAX);
return buffer;
}
static inline const char* green_check_mark_internal(char buffer[static GREEN_CHECK_MARK_MAX]) {
assert(buffer);
assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_green()), special_glyph(SPECIAL_GLYPH_CHECK_MARK)), ansi_normal()) < buffer + GREEN_CHECK_MARK_MAX);
assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_green()), glyph(GLYPH_CHECK_MARK)), ansi_normal()) < buffer + GREEN_CHECK_MARK_MAX);
return buffer;
}
+4 -4
View File
@@ -338,12 +338,12 @@ int unit_file_resolve_symlink(
return r;
if (is_path(tail))
log_warning("Suspicious symlink %s/%s %s %s, treating as alias.",
dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified);
dir, filename, glyph(GLYPH_ARROW_RIGHT), simplified);
dst = resolve_destination_target ? TAKE_PTR(simplified) : TAKE_PTR(target_name);
} else {
log_debug("Linked unit file: %s/%s %s %s", dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified);
log_debug("Linked unit file: %s/%s %s %s", dir, filename, glyph(GLYPH_ARROW_RIGHT), simplified);
if (resolve_destination_target)
dst = TAKE_PTR(simplified);
@@ -559,7 +559,7 @@ int unit_file_build_name_map(
r = hashmap_ensure_put(&ids, &string_hash_ops_free_free, key, dst);
if (r < 0)
return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m",
de->d_name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dst);
de->d_name, glyph(GLYPH_ARROW_RIGHT), dst);
key = dst = NULL;
}
}
@@ -602,7 +602,7 @@ int unit_file_build_name_map(
r = string_strv_hashmap_put(&names, dst, src);
if (r < 0)
return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m",
dst, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), src);
dst, glyph(GLYPH_ARROW_RIGHT), src);
}
if (cache_timestamp_hash)
+1 -1
View File
@@ -298,7 +298,7 @@ void user_record_show(UserRecord *hr, bool show_full_group_info) {
hash = hexmem(hash_bytes, SHA256_DIGEST_SIZE);
printf(" %s %s %s(%s)%s\n",
special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH),
glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH),
link ?: filename,
ansi_grey(),
hash ?: "can't display hash",
+5 -5
View File
@@ -473,7 +473,7 @@ static int json_dispatch_umask(const char *name, sd_json_variant *variant, sd_js
if (k > 0777)
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"JSON field '%s' outside of valid range 0%s0777.",
strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
strna(name), glyph(GLYPH_ELLIPSIS));
*m = (mode_t) k;
return 0;
@@ -495,7 +495,7 @@ static int json_dispatch_access_mode(const char *name, sd_json_variant *variant,
if (k > 07777)
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL),
"JSON field '%s' outside of valid range 0%s07777.",
strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
strna(name), glyph(GLYPH_ELLIPSIS));
*m = (mode_t) k;
return 0;
@@ -575,7 +575,7 @@ static int json_dispatch_tasks_or_memory_max(const char *name, sd_json_variant *
if (k <= 0 || k >= UINT64_MAX)
return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
"JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".",
strna(name), (uint64_t) 1, special_glyph(SPECIAL_GLYPH_ELLIPSIS), UINT64_MAX-1);
strna(name), (uint64_t) 1, glyph(GLYPH_ELLIPSIS), UINT64_MAX-1);
*limit = k;
return 0;
@@ -597,7 +597,7 @@ static int json_dispatch_weight(const char *name, sd_json_variant *variant, sd_j
return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
"JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".",
strna(name), (uint64_t) CGROUP_WEIGHT_MIN,
special_glyph(SPECIAL_GLYPH_ELLIPSIS), (uint64_t) CGROUP_WEIGHT_MAX);
glyph(GLYPH_ELLIPSIS), (uint64_t) CGROUP_WEIGHT_MAX);
*weight = k;
return 0;
@@ -983,7 +983,7 @@ static int dispatch_rebalance_weight(const char *name, sd_json_variant *variant,
else
return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE),
"Rebalance weight is out of valid range %" PRIu64 "%s%" PRIu64 ".",
REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX);
REBALANCE_WEIGHT_MIN, glyph(GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX);
return 0;
}
+6 -6
View File
@@ -706,8 +706,8 @@ static int nvme_subsystem_report(NvmeSubsystem *subsystem, NvmePort *ipv4, NvmeP
return log_error_errno(n_addresses, "Failed to determine local IP addresses: %m");
log_notice("NVMe-TCP: %s %s%s%s (%s)",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_COMPUTER_DISK) : "", emoji_enabled() ? " " : "",
glyph(GLYPH_ARROW_RIGHT),
emoji_enabled() ? glyph(GLYPH_COMPUTER_DISK) : "", emoji_enabled() ? " " : "",
subsystem->name, subsystem->device);
FOREACH_ARRAY(a, addresses, n_addresses) {
@@ -717,7 +717,7 @@ static int nvme_subsystem_report(NvmeSubsystem *subsystem, NvmePort *ipv4, NvmeP
continue;
log_info(" %s Try for specific device: nvme connect -t tcp -n '%s' -a %s -s %" PRIu16,
special_glyph(a >= addresses + (n_addresses - 1) ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH),
glyph(a >= addresses + (n_addresses - 1) ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH),
subsystem->name,
IN_ADDR_TO_STRING(a->family, &a->address),
port->portnr);
@@ -771,14 +771,14 @@ static int nvme_port_report(NvmePort *port, bool *plymouth_done) {
return log_error_errno(n_addresses, "Failed to determine local IP addresses: %m");
log_notice("NVMe-TCP: %s %s%sListening on %s (port %" PRIu16 ")",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_WORLD) : "", emoji_enabled() ? " " : "",
glyph(GLYPH_ARROW_RIGHT),
emoji_enabled() ? glyph(GLYPH_WORLD) : "", emoji_enabled() ? " " : "",
af_to_ipv4_ipv6(port->ip_family),
port->portnr);
FOREACH_ARRAY(a, addresses, n_addresses)
log_info(" %s Try for all devices: nvme connect-all -t tcp -a %s -s %" PRIu16,
special_glyph(a >= addresses + (n_addresses - 1) ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH),
glyph(a >= addresses + (n_addresses - 1) ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH),
IN_ADDR_TO_STRING(a->family, &a->address),
port->portnr);
+1 -1
View File
@@ -278,7 +278,7 @@ int verb_enable(int argc, char *argv[], void *userdata) {
" D-Bus, udev, scripted systemctl call, ...).\n"
"%1$s In case of template units, the unit is meant to be enabled with some\n"
" instance name specified.",
special_glyph(SPECIAL_GLYPH_BULLET));
glyph(GLYPH_BULLET));
if (streq(verb, "disable") && arg_runtime_scope == RUNTIME_SCOPE_USER && !arg_quiet && !arg_no_warn) {
/* If some of the units are disabled in user scope but still enabled in global scope,
+3 -3
View File
@@ -36,7 +36,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int
on = ansi_highlight_red();
}
printf("%s%s%s ", on, special_glyph(unit_active_state_to_glyph(state)), ansi_normal());
printf("%s%s%s ", on, glyph(unit_active_state_to_glyph(state)), ansi_normal());
}
if (!arg_plain) {
@@ -46,7 +46,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int
printf("%s...\n",max_len % 2 ? "" : " ");
return 0;
}
printf("%s", special_glyph(branches & (1 << i) ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE));
printf("%s", glyph(branches & (1 << i) ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE));
}
len += 2;
@@ -55,7 +55,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int
return 0;
}
printf("%s", special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH));
printf("%s", glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH));
}
if (arg_full) {
+1 -1
View File
@@ -33,7 +33,7 @@ static int output_waiting_jobs(sd_bus *bus, Table *table, uint32_t id, const cha
return log_oom();
r = table_add_many(table,
TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
TABLE_STRING, glyph(GLYPH_TREE_RIGHT),
TABLE_STRING, row,
TABLE_EMPTY,
TABLE_EMPTY);
+1 -1
View File
@@ -200,7 +200,7 @@ static int output_machines_list(struct machine_info *machine_infos, unsigned n)
mname = strjoin(strna(m->name), " (host)");
r = table_add_many(table,
TABLE_STRING, circle ? special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE) : " ",
TABLE_STRING, circle ? glyph(GLYPH_BLACK_CIRCLE) : " ",
TABLE_SET_COLOR, on_state,
TABLE_STRING, m->is_host ? mname : strna(m->name),
TABLE_STRING, strna(m->state),
+3 -3
View File
@@ -173,7 +173,7 @@ static int output_units_list(const UnitInfo *unit_infos, size_t c) {
return log_oom();
r = table_add_many(table,
TABLE_STRING, circle ? special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE) : " ",
TABLE_STRING, circle ? glyph(GLYPH_BLACK_CIRCLE) : " ",
TABLE_SET_COLOR, on_circle,
TABLE_SET_BOTH_UNDERLINES, underline,
TABLE_STRING, id,
@@ -220,12 +220,12 @@ static int output_units_list(const UnitInfo *unit_infos, size_t c) {
"%1$s ACTIVE %2$s The high-level unit activation state, i.e. generalization of SUB.%3$s\n"
"%1$s SUB %2$s The low-level unit activation state, values depend on unit type.%3$s\n",
ansi_grey(),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
ansi_normal());
if (job_count > 0)
printf("%s JOB %s Pending job for the unit.%s\n",
ansi_grey(),
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
ansi_normal());
}
+7 -7
View File
@@ -346,9 +346,9 @@ static void print_status_info(
format_enable_state(i->unit_file_state, &enable_on, &enable_off);
format_enable_state(i->unit_file_preset, &preset_on, &preset_off);
const SpecialGlyph glyph = unit_active_state_to_glyph(unit_active_state_from_string(i->active_state));
const Glyph icon = unit_active_state_to_glyph(unit_active_state_from_string(i->active_state));
printf("%s%s%s %s", active_on, special_glyph(glyph), active_off, strna(i->id));
printf("%s%s%s %s", active_on, glyph(icon), active_off, strna(i->id));
if (i->description && !streq_ptr(i->id, i->description))
printf(" - %s", i->description);
@@ -414,7 +414,7 @@ static void print_status_info(
printf("%s\n"
" %s", dir,
special_glyph(SPECIAL_GLYPH_TREE_RIGHT));
glyph(GLYPH_TREE_RIGHT));
}
last = ! (*(dropin + 1) && startswith(*(dropin + 1), dir));
@@ -489,7 +489,7 @@ static void print_status_info(
printf("%s %s%s%s %s\n",
t == i->triggered_by ? "TriggeredBy:" : " ",
on, special_glyph(unit_active_state_to_glyph(state)), off,
on, glyph(unit_active_state_to_glyph(state)), off,
*t);
}
@@ -516,7 +516,7 @@ static void print_status_info(
printf("%s %s%s%s %s\n",
t == i->triggers ? " Triggers:" : " ",
on, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off,
on, glyph(GLYPH_BLACK_CIRCLE), off,
*t);
}
@@ -535,7 +535,7 @@ static void print_status_info(
LIST_FOREACH(conditions, c, i->conditions)
if (c->tristate < 0)
printf(" %s %s=%s%s%s was not met\n",
--n ? special_glyph(SPECIAL_GLYPH_TREE_BRANCH) : special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
--n ? glyph(GLYPH_TREE_BRANCH) : glyph(GLYPH_TREE_RIGHT),
c->name,
c->trigger ? "|" : "",
c->negate ? "!" : "",
@@ -2343,7 +2343,7 @@ static int show_system_status(sd_bus *bus) {
off = ansi_normal();
}
printf("%s%s%s %s\n", on, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off, arg_host ?: hn);
printf("%s%s%s %s\n", on, glyph(GLYPH_BLACK_CIRCLE), off, arg_host ?: hn);
printf(" State: %s%s%s\n",
on, strna(mi.state), off);
+2 -2
View File
@@ -1274,8 +1274,8 @@ static int run(int argc, char *argv[]) {
"%s%s/proc/ is not mounted. This is not a supported mode of operation. Please fix\n"
"your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.\n"
"Your mileage may vary.",
emoji_enabled() ? special_glyph(SPECIAL_GLYPH_WARNING_SIGN) : "",
emoji_enabled() ? " " : "");
optional_glyph(GLYPH_WARNING_SIGN),
optional_glyph(GLYPH_SPACE));
if (arg_action != ACTION_SYSTEMCTL && running_in_chroot() > 0) {
if (!arg_quiet)
+2 -2
View File
@@ -288,8 +288,8 @@ static int download_manifest(
if (pipe2(pfd, O_CLOEXEC) < 0)
return log_error_errno(errno, "Failed to allocate pipe: %m");
log_info("%s Acquiring manifest file %s%s", special_glyph(SPECIAL_GLYPH_DOWNLOAD),
suffixed_url, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("%s Acquiring manifest file %s%s", glyph(GLYPH_DOWNLOAD),
suffixed_url, glyph(GLYPH_ELLIPSIS));
r = safe_fork_full("(sd-pull)",
(int[]) { -EBADF, pfd[1], STDERR_FILENO },
+4 -4
View File
@@ -816,7 +816,7 @@ int transfer_vacuum(
assert(oldest->resource);
log_info("%s Removing %s '%s' (%s).",
special_glyph(SPECIAL_GLYPH_RECYCLING),
glyph(GLYPH_RECYCLING),
space == UINT64_MAX ? "disabled" : "old",
oldest->path,
resource_type_to_string(oldest->resource->type));
@@ -1196,7 +1196,7 @@ int transfer_acquire_instance(Transfer *t, Instance *i, TransferProgress cb, voi
assert(where);
log_info("%s Acquiring %s %s %s...", special_glyph(SPECIAL_GLYPH_DOWNLOAD), i->path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), where);
log_info("%s Acquiring %s %s %s...", glyph(GLYPH_DOWNLOAD), i->path, glyph(GLYPH_ARROW_RIGHT), where);
if (RESOURCE_IS_URL(i->resource->type)) {
/* For URL sources we require the SHA256 sum to be known so that we can validate the
@@ -1542,11 +1542,11 @@ int transfer_install_instance(
if (r < 0)
return log_error_errno(r, "Failed to update current symlink '%s' %s '%s': %m",
link_path,
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
glyph(GLYPH_ARROW_RIGHT),
relative);
log_info("Updated symlink '%s' %s '%s'.",
link_path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), relative);
link_path, glyph(GLYPH_ARROW_RIGHT), relative);
}
}
+4 -4
View File
@@ -28,16 +28,16 @@ const char* update_set_flags_to_color(UpdateSetFlags flags) {
const char* update_set_flags_to_glyph(UpdateSetFlags flags) {
if (flags == 0 || (flags & UPDATE_OBSOLETE))
return special_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN);
return glyph(GLYPH_MULTIPLICATION_SIGN);
if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_NEWEST))
return special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE);
return glyph(GLYPH_BLACK_CIRCLE);
if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_PROTECTED))
return special_glyph(SPECIAL_GLYPH_WHITE_CIRCLE);
return glyph(GLYPH_WHITE_CIRCLE);
if ((flags & (UPDATE_AVAILABLE|UPDATE_INSTALLED|UPDATE_NEWEST|UPDATE_OBSOLETE)) == (UPDATE_AVAILABLE|UPDATE_NEWEST))
return special_glyph(SPECIAL_GLYPH_CIRCLE_ARROW);
return glyph(GLYPH_CIRCLE_ARROW);
return " ";
}
+10 -10
View File
@@ -259,7 +259,7 @@ static int context_load_installed_instances(Context *c) {
assert(c);
log_info("Discovering installed instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Discovering installed instances%s", glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -291,7 +291,7 @@ static int context_load_available_instances(Context *c) {
assert(c);
log_info("Discovering available instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Discovering available instances%s", glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -497,14 +497,14 @@ static int context_discover_update_sets(Context *c) {
assert(c);
log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(c, UPDATE_INSTALLED);
if (r < 0)
return r;
if (!arg_offline) {
log_info("Determining available update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining available update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(c, UPDATE_AVAILABLE);
if (r < 0)
@@ -540,9 +540,9 @@ static int context_show_table(Context *c) {
TABLE_SET_COLOR, color,
TABLE_STRING, us->version,
TABLE_SET_COLOR, color,
TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)),
TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)),
TABLE_SET_COLOR, color,
TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)),
TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)),
TABLE_SET_COLOR, color,
TABLE_STRING, update_set_flags_to_string(us->flags),
TABLE_SET_COLOR, color);
@@ -847,9 +847,9 @@ static int context_vacuum(
assert(c);
if (space == 0)
log_info("Making room%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Making room%s", glyph(GLYPH_ELLIPSIS));
else
log_info("Making room for %" PRIu64 " updates%s", space, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Making room for %" PRIu64 " updates%s", space, glyph(GLYPH_ELLIPSIS));
FOREACH_ARRAY(tr, c->transfers, c->n_transfers) {
Transfer *t = *tr;
@@ -1083,7 +1083,7 @@ static int context_apply(
return r;
}
log_info("%s Successfully installed update '%s'.", special_glyph(SPECIAL_GLYPH_SPARKLES), us->version);
log_info("%s Successfully installed update '%s'.", glyph(GLYPH_SPARKLES), us->version);
if (ret_applied)
*ret_applied = us;
@@ -1473,7 +1473,7 @@ static int verb_pending_or_reboot(int argc, char **argv, void *userdata) {
if (r < 0)
return r;
log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS));
r = context_discover_update_sets_by_flag(context, UPDATE_INSTALLED);
if (r < 0)
+4 -4
View File
@@ -421,7 +421,7 @@ static int list_versions_finished(sd_bus_message *reply, void *userdata, sd_bus_
color = update_set_flags_to_color(v.flags);
if (urlify_enabled() && !strv_isempty(v.changelog)) {
version_link = strjoin(v.version, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK));
version_link = strjoin(v.version, glyph(GLYPH_EXTERNAL_LINK));
if (!version_link)
return log_oom();
}
@@ -688,10 +688,10 @@ static int check_describe_finished(sd_bus_message *reply, void *userdata, sd_bus
return bus_log_parse_error(r);
if (urlify_enabled() && !strv_isempty(v.changelog))
lnk = special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK);
lnk = glyph(GLYPH_EXTERNAL_LINK);
update = strjoin(empty_to_dash(current), " ",
special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ",
glyph(GLYPH_ARROW_RIGHT), " ",
v.version, strempty(lnk));
if (!update)
return log_oom();
@@ -1328,7 +1328,7 @@ static int list_features(sd_bus *bus) {
return r;
if (urlify_enabled() && f.documentation) {
name_link = strjoin(f.name, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK));
name_link = strjoin(f.name, glyph(GLYPH_EXTERNAL_LINK));
if (!name_link)
return log_oom();
}
+6 -6
View File
@@ -481,7 +481,7 @@ static int write_temporary_passwd(
return 0;
if (arg_dry_run) {
log_info("Would write /etc/passwd%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Would write /etc/passwd%s", glyph(GLYPH_ELLIPSIS));
return 0;
}
@@ -624,7 +624,7 @@ static int write_temporary_shadow(
return 0;
if (arg_dry_run) {
log_info("Would write /etc/shadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Would write /etc/shadow%s", glyph(GLYPH_ELLIPSIS));
return 0;
}
@@ -759,7 +759,7 @@ static int write_temporary_group(
return 0;
if (arg_dry_run) {
log_info("Would write /etc/group%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Would write /etc/group%s", glyph(GLYPH_ELLIPSIS));
return 0;
}
@@ -872,7 +872,7 @@ static int write_temporary_gshadow(
return 0;
if (arg_dry_run) {
log_info("Would write /etc/gshadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_info("Would write /etc/gshadow%s", glyph(GLYPH_ELLIPSIS));
return 0;
}
@@ -2224,13 +2224,13 @@ static int read_config_files(Context *c, char **args) {
STRV_FOREACH(f, files)
if (p && path_equal(*f, p)) {
log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Parsing arguments at position \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS));
r = parse_arguments(c, args);
if (r < 0)
return r;
} else {
log_debug("Reading config file \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Reading config file \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS));
/* Just warn, ignore result otherwise */
(void) read_config_file(c, *f, /* ignore_enoent= */ true);
+2 -2
View File
@@ -768,8 +768,8 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
"Please update package to include a native systemd unit file.\n"
"%s This compatibility logic is deprecated, expect removal soon. %s",
fpath,
special_glyph(SPECIAL_GLYPH_WARNING_SIGN),
special_glyph(SPECIAL_GLYPH_WARNING_SIGN)),
glyph(GLYPH_WARNING_SIGN),
glyph(GLYPH_WARNING_SIGN)),
"MESSAGE_ID=" SD_MESSAGE_SYSV_GENERATOR_DEPRECATED_STR,
"SYSVSCRIPT=%s", fpath,
"UNIT=%s", name);
+53 -53
View File
@@ -80,62 +80,62 @@ TEST(keymaps) {
assert_se(keymap_is_valid("unicode"));
}
#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x))
TEST(dump_special_glyphs) {
assert_cc(SPECIAL_GLYPH_HOME + 1 == _SPECIAL_GLYPH_MAX);
#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", glyph(x))
TEST(dump_glyphs) {
assert_cc(GLYPH_HOME + 1 == _GLYPH_MAX);
log_info("is_locale_utf8: %s", yes_no(is_locale_utf8()));
dump_glyph(SPECIAL_GLYPH_TREE_VERTICAL);
dump_glyph(SPECIAL_GLYPH_TREE_BRANCH);
dump_glyph(SPECIAL_GLYPH_TREE_RIGHT);
dump_glyph(SPECIAL_GLYPH_TREE_SPACE);
dump_glyph(SPECIAL_GLYPH_TREE_TOP);
dump_glyph(SPECIAL_GLYPH_VERTICAL_DOTTED);
dump_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED);
dump_glyph(SPECIAL_GLYPH_HORIZONTAL_FAT);
dump_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET);
dump_glyph(SPECIAL_GLYPH_BLACK_CIRCLE);
dump_glyph(SPECIAL_GLYPH_WHITE_CIRCLE);
dump_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN);
dump_glyph(SPECIAL_GLYPH_CIRCLE_ARROW);
dump_glyph(SPECIAL_GLYPH_BULLET);
dump_glyph(SPECIAL_GLYPH_MU);
dump_glyph(SPECIAL_GLYPH_CHECK_MARK);
dump_glyph(SPECIAL_GLYPH_CROSS_MARK);
dump_glyph(SPECIAL_GLYPH_LIGHT_SHADE);
dump_glyph(SPECIAL_GLYPH_DARK_SHADE);
dump_glyph(SPECIAL_GLYPH_FULL_BLOCK);
dump_glyph(SPECIAL_GLYPH_SIGMA);
dump_glyph(SPECIAL_GLYPH_ARROW_UP);
dump_glyph(SPECIAL_GLYPH_ARROW_DOWN);
dump_glyph(SPECIAL_GLYPH_ARROW_LEFT);
dump_glyph(SPECIAL_GLYPH_ARROW_RIGHT);
dump_glyph(SPECIAL_GLYPH_ELLIPSIS);
dump_glyph(SPECIAL_GLYPH_EXTERNAL_LINK);
dump_glyph(SPECIAL_GLYPH_ECSTATIC_SMILEY);
dump_glyph(SPECIAL_GLYPH_HAPPY_SMILEY);
dump_glyph(SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY);
dump_glyph(SPECIAL_GLYPH_NEUTRAL_SMILEY);
dump_glyph(SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY);
dump_glyph(SPECIAL_GLYPH_UNHAPPY_SMILEY);
dump_glyph(SPECIAL_GLYPH_DEPRESSED_SMILEY);
dump_glyph(SPECIAL_GLYPH_LOCK_AND_KEY);
dump_glyph(SPECIAL_GLYPH_TOUCH);
dump_glyph(SPECIAL_GLYPH_RECYCLING);
dump_glyph(SPECIAL_GLYPH_DOWNLOAD);
dump_glyph(SPECIAL_GLYPH_SPARKLES);
dump_glyph(SPECIAL_GLYPH_LOW_BATTERY);
dump_glyph(SPECIAL_GLYPH_WARNING_SIGN);
dump_glyph(SPECIAL_GLYPH_COMPUTER_DISK);
dump_glyph(SPECIAL_GLYPH_WORLD);
dump_glyph(SPECIAL_GLYPH_RED_CIRCLE);
dump_glyph(SPECIAL_GLYPH_YELLOW_CIRCLE);
dump_glyph(SPECIAL_GLYPH_BLUE_CIRCLE);
dump_glyph(SPECIAL_GLYPH_GREEN_CIRCLE);
dump_glyph(SPECIAL_GLYPH_SUPERHERO);
dump_glyph(SPECIAL_GLYPH_IDCARD);
dump_glyph(SPECIAL_GLYPH_HOME);
dump_glyph(GLYPH_TREE_VERTICAL);
dump_glyph(GLYPH_TREE_BRANCH);
dump_glyph(GLYPH_TREE_RIGHT);
dump_glyph(GLYPH_TREE_SPACE);
dump_glyph(GLYPH_TREE_TOP);
dump_glyph(GLYPH_VERTICAL_DOTTED);
dump_glyph(GLYPH_HORIZONTAL_DOTTED);
dump_glyph(GLYPH_HORIZONTAL_FAT);
dump_glyph(GLYPH_TRIANGULAR_BULLET);
dump_glyph(GLYPH_BLACK_CIRCLE);
dump_glyph(GLYPH_WHITE_CIRCLE);
dump_glyph(GLYPH_MULTIPLICATION_SIGN);
dump_glyph(GLYPH_CIRCLE_ARROW);
dump_glyph(GLYPH_BULLET);
dump_glyph(GLYPH_MU);
dump_glyph(GLYPH_CHECK_MARK);
dump_glyph(GLYPH_CROSS_MARK);
dump_glyph(GLYPH_LIGHT_SHADE);
dump_glyph(GLYPH_DARK_SHADE);
dump_glyph(GLYPH_FULL_BLOCK);
dump_glyph(GLYPH_SIGMA);
dump_glyph(GLYPH_ARROW_UP);
dump_glyph(GLYPH_ARROW_DOWN);
dump_glyph(GLYPH_ARROW_LEFT);
dump_glyph(GLYPH_ARROW_RIGHT);
dump_glyph(GLYPH_ELLIPSIS);
dump_glyph(GLYPH_EXTERNAL_LINK);
dump_glyph(GLYPH_ECSTATIC_SMILEY);
dump_glyph(GLYPH_HAPPY_SMILEY);
dump_glyph(GLYPH_SLIGHTLY_HAPPY_SMILEY);
dump_glyph(GLYPH_NEUTRAL_SMILEY);
dump_glyph(GLYPH_SLIGHTLY_UNHAPPY_SMILEY);
dump_glyph(GLYPH_UNHAPPY_SMILEY);
dump_glyph(GLYPH_DEPRESSED_SMILEY);
dump_glyph(GLYPH_LOCK_AND_KEY);
dump_glyph(GLYPH_TOUCH);
dump_glyph(GLYPH_RECYCLING);
dump_glyph(GLYPH_DOWNLOAD);
dump_glyph(GLYPH_SPARKLES);
dump_glyph(GLYPH_LOW_BATTERY);
dump_glyph(GLYPH_WARNING_SIGN);
dump_glyph(GLYPH_COMPUTER_DISK);
dump_glyph(GLYPH_WORLD);
dump_glyph(GLYPH_RED_CIRCLE);
dump_glyph(GLYPH_YELLOW_CIRCLE);
dump_glyph(GLYPH_BLUE_CIRCLE);
dump_glyph(GLYPH_GREEN_CIRCLE);
dump_glyph(GLYPH_SUPERHERO);
dump_glyph(GLYPH_IDCARD);
dump_glyph(GLYPH_HOME);
}
DEFINE_TEST_MAIN(LOG_INFO);
+1 -1
View File
@@ -4481,7 +4481,7 @@ static int read_config_files(
STRV_FOREACH(f, files)
if (p && path_equal(*f, p)) {
log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
log_debug("Parsing arguments at position \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS));
r = parse_arguments(c, config_dirs, args, invalid_config);
if (r < 0)

Some files were not shown because too many files have changed in this diff Show More