Admittedly, some of our glyphs _are_ special, e.g. "O=" for SPECIAL_GLYPH_TOUCH ;)
But we don't need this in the name. The very long names make some invocations
very wordy, e.g. special_glyph(SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY).
Also, I want to add GLYPH_SPACE, which is not special at all.
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],
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))
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;
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(),
exposure / 10, exposure % 10,
badness_table[i].name,
ansi_normal(),
- special_glyph(badness_table[i].smiley));
+ glyph(badness_table[i].smiley));
}
fflush(stdout);
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);
}
if (written) {
if (incomplete)
- fputs(special_glyph(SPECIAL_GLYPH_ELLIPSIS), stdout);
+ fputs(glyph(GLYPH_ELLIPSIS), stdout);
fputc('\n', stdout);
}
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);
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) {
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);
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));
}
}
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
* 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_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] = {
/* 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"🌍",
-
- [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_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"🌍",
+
+ [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];
}
#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_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* glyph_check_mark(bool b) {
+ return b ? glyph(GLYPH_CHECK_MARK) : glyph(GLYPH_CROSS_MARK);
}
-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_space(bool b) {
+ return b ? glyph(GLYPH_CHECK_MARK) : " ";
}
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;
}
}
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;
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];
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);
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);
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);
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;
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);
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));
+ glyph(GLYPH_WARNING_SIGN), full_path, glyph(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));
+ glyph(GLYPH_WARNING_SIGN), full_path, glyph(GLYPH_WARNING_SIGN));
}
return 1;
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)++;
* 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);
}
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.");
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);
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);
}
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;
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);
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);
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);
}
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));
}
}
}
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) {
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) {
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);
}
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));
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);
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);
}
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);
}
}
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;
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);
}
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);
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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) {
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);
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);
} 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)
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;
* 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)
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");
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");
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();
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);
} 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);
} 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);
} 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);
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.");
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");
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");
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");
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");
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 */
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();
}
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);
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;
}
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 */
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);
(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
(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
(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
(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
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(),
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;
}
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;
}
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;
}
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;
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",
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;
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;
}
ansi_normal(),
ansi_highlight(),
ansi_normal(),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT));
+ glyph(GLYPH_ARROW_RIGHT));
return 0;
}
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();
/* 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);
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);
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;
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);
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;
(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);
(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);
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;
}
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)
/* 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));
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;
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;
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());
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);
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);
}
r,
"Failed to copy %s %s %s: %m",
image_path,
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
+ glyph(GLYPH_ARROW_RIGHT),
target);
} else {
errno,
"Failed to link %s %s %s: %m",
image_path,
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT),
+ glyph(GLYPH_ARROW_RIGHT),
target);
}
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"))
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;
}
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;
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,
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];
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();
}
(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();
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));
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;
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)));
printf("%s%s A%s: %s\n",
ansi_highlight_yellow(),
- special_glyph(SPECIAL_GLYPH_ARROW_LEFT),
+ glyph(GLYPH_ARROW_LEFT),
ansi_normal(),
s);
}
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) :
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);
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));
}
_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);
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;
}
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;
}
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();
}
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);
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);
(void) loop_write(ttyfd, passphrase + codepoint, n);
else
(void) loop_write(ttyfd,
- special_glyph(SPECIAL_GLYPH_BULLET),
+ glyph(GLYPH_BULLET),
SIZE_MAX);
codepoint = p;
}
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) {
}
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,
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)
fprintf(stdout, "%s%s %*" PID_PRI " %s\n",
prefix,
- special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET),
+ glyph(GLYPH_TRIANGULAR_BULLET),
width, pids[k],
name);
}
&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());
}
static int show_cgroup_name(
const char *path,
const char *prefix,
- SpecialGlyph glyph,
+ Glyph tree,
OutputFlags flags) {
uint64_t cgroupid = UINT64_MAX;
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() : "");
if (delegate)
printf(" %s%s%s",
ansi_highlight(),
- special_glyph(SPECIAL_GLYPH_ELLIPSIS),
+ glyph(GLYPH_ELLIPSIS),
ansi_normal());
if (cgroupid != UINT64_MAX)
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);
}
}
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;
}
(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;
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);
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;
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;
}
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:
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 */
* 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;
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);
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;
}
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() ? " " : "");
}
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() ? " " : "");
}
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;
}
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;
}
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
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() ? " " : "");
}
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() ? " " : "");
}
"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);
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;
}
"%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;
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 = "--";
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);
}
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));
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);
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;
}
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);
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;
}
}
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)
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",
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;
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;
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;
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;
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;
}
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) {
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);
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);
" 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,
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) {
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;
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) {
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);
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),
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,
"%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());
}
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);
printf("%s\n"
" %s", dir,
- special_glyph(SPECIAL_GLYPH_TREE_RIGHT));
+ glyph(GLYPH_TREE_RIGHT));
}
last = ! (*(dropin + 1) && startswith(*(dropin + 1), dir));
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);
}
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);
}
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 ? "!" : "",
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);
"%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() ? glyph(GLYPH_WARNING_SIGN) : "",
emoji_enabled() ? " " : "");
if (arg_action != ACTION_SYSTEMCTL && running_in_chroot() > 0) {
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 },
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));
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
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);
}
}
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 " ";
}
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;
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;
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)
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);
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;
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;
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)
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();
}
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();
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();
}
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;
}
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;
}
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;
}
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;
}
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);
"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);
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);
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)
log_device_debug(dev, "PCI onboard index identifier: index=%u port=%s %s %s",
idx, strna(port),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(str));
+ glyph(GLYPH_ARROW_RIGHT), empty_to_na(str));
return 0;
}
log_device_debug(dev, "PCI path identifier: domain=%s bus_and_slot=%s func=%s port=%s %s %s",
strna(domain), bus_and_slot, strna(func), strna(port),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(str));
+ glyph(GLYPH_ARROW_RIGHT), empty_to_na(str));
if (pci_get_slot_from_firmware_node_sun(pci_dev, &slot) < 0) {
/* If we don't find a slot using firmware_node/sun, fallback to hotplug_slot */
log_device_debug(dev, "PCI slot identifier: domain=%s slot=%"PRIu32" func=%s port=%s %s %s",
strna(domain), slot, strna(func), strna(port),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), empty_to_na(str));
+ glyph(GLYPH_ARROW_RIGHT), empty_to_na(str));
return 0;
}
if (snprintf_ok(str, sizeof str, "%sv%u", prefix, slotid))
udev_builtin_add_property(event, "ID_NET_NAME_SLOT", str);
log_device_debug(dev, "Vio slot identifier: slotid=%u %s %s",
- slotid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ slotid, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
if (snprintf_ok(str, sizeof str, "%sa%s%xi%u", prefix, vendor, model, instance))
udev_builtin_add_property(event, "ID_NET_NAME_PATH", str);
log_device_debug(dev, "Platform identifier: vendor=%s model=%x instance=%u %s %s",
- vendor, model, instance, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ vendor, model, instance, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
if (snprintf_ok(str, sizeof str, "%sd%u", prefix, i))
udev_builtin_add_property(event, "ID_NET_NAME_ONBOARD", str);
log_device_debug(dev, "DeviceTree identifier: alias_index=%u %s \"%s\"",
- i, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ i, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
log_device_debug(dev, "USB name identifier: ports=%s config=%s interface=%s %s %s",
ports, strna(config), strna(interf),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), buf);
+ glyph(GLYPH_ARROW_RIGHT), buf);
*ret = buf;
return 0;
return log_oom_debug();
log_device_debug(dev, "BCMA core identifier: core=%u %s \"%s\"",
- core, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), strna(buf));
+ core, glyph(GLYPH_ARROW_RIGHT), strna(buf));
*ret = buf;
return 0;
if (snprintf_ok(str, sizeof str, "%sc%s", prefix, bus_id))
udev_builtin_add_property(event, "ID_NET_NAME_PATH", str);
log_device_debug(dev, "CCW identifier: ccw_busid=%s %s \"%s\"",
- bus_id, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ bus_id, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
udev_builtin_add_property(event, "ID_NET_NAME_MAC", str);
log_device_debug(dev, "MAC address identifier: hw_addr=%s %s %s",
HW_ADDR_TO_STR(&hw_addr),
- special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
(void) ieee_oui(event, &hw_addr);
return 0;
if (snprintf_ok(str, sizeof str, "%si%un%s", prefix, addr, phys_port_name))
udev_builtin_add_property(event, "ID_NET_NAME_PATH", str);
log_device_debug(dev, "Netdevsim identifier: address=%u, port_name=%s %s %s",
- addr, phys_port_name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ addr, phys_port_name, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
if (snprintf_ok(str, sizeof str, "%sX%u", prefix, id))
udev_builtin_add_property(event, "ID_NET_NAME_SLOT", str);
log_device_debug(dev, "Xen identifier: id=%u %s %s",
- id, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), str + strlen(prefix));
+ id, glyph(GLYPH_ARROW_RIGHT), str + strlen(prefix));
return 0;
}
prefix = strempty(prefix);
- printf("%s%s%s\n", prefix, special_glyph(more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT), str);
+ printf("%s%s%s\n", prefix, glyph(more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT), str);
- subprefix = strjoin(prefix, special_glyph(more ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE));
+ subprefix = strjoin(prefix, glyph(more ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE));
if (!subprefix)
return log_oom();
- subsubprefix = strjoin(subprefix, special_glyph(SPECIAL_GLYPH_VERTICAL_DOTTED), " ");
+ subsubprefix = strjoin(subprefix, glyph(GLYPH_VERTICAL_DOTTED), " ");
if (!subsubprefix)
return log_oom();
return log_error_errno(SYNTHETIC_ERRNO(EBUSY), "Device '%s' is currently locked.", path);
if (deadline == USEC_INFINITY) {
- log_info("Device '%s' is currently locked, waiting%s", path, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ log_info("Device '%s' is currently locked, waiting%s", path, glyph(GLYPH_ELLIPSIS));
r = lock_generic(fd, LOCK_BSD, LOCK_EX);
} else {
log_info("Device '%s' is currently locked, waiting %s%s",
path, FORMAT_TIMESPAN(left, 0),
- special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ glyph(GLYPH_ELLIPSIS));
r = lock_generic_with_timeout(fd, LOCK_BSD, LOCK_EX, left);
if (r == -ETIMEDOUT)
return log_error_errno(r, "Failed to lock device '%s': %m", path);
}
- log_debug("Successfully locked %s (%u:%u)%s", path, major(devno), minor(devno), special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ log_debug("Successfully locked %s (%u:%u)%s", path, major(devno), minor(devno), glyph(GLYPH_ELLIPSIS));
return TAKE_FD(fd);
}
if (i->test && !i->test())
continue;
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),
+ name = strjoin(glyph(GLYPH_ARROW_DOWN),
" begin ", i->name, " users ",
- special_glyph(SPECIAL_GLYPH_ARROW_DOWN));
+ glyph(GLYPH_ARROW_DOWN));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_TOP),
+ TABLE_STRING, glyph(GLYPH_TREE_TOP),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_STRING, user_disposition_to_string(i->disposition),
return table_log_add_error(r);
free(name);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_UP),
+ name = strjoin(glyph(GLYPH_ARROW_UP),
" end ", i->name, " users ",
- special_glyph(SPECIAL_GLYPH_ARROW_UP));
+ glyph(GLYPH_ARROW_UP));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
+ TABLE_STRING, glyph(GLYPH_TREE_RIGHT),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_STRING, user_disposition_to_string(i->disposition),
assert(table);
assert(start <= end);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),
+ name = strjoin(glyph(GLYPH_ARROW_DOWN),
" begin unavailable users ",
- special_glyph(SPECIAL_GLYPH_ARROW_DOWN));
+ glyph(GLYPH_ARROW_DOWN));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_TOP),
+ TABLE_STRING, glyph(GLYPH_TREE_TOP),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_EMPTY,
return table_log_add_error(r);
free(name);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_UP),
+ name = strjoin(glyph(GLYPH_ARROW_UP),
" end unavailable users ",
- special_glyph(SPECIAL_GLYPH_ARROW_UP));
+ glyph(GLYPH_ARROW_UP));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
+ TABLE_STRING, glyph(GLYPH_TREE_RIGHT),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_EMPTY,
if (i->test && !i->test())
continue;
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),
+ name = strjoin(glyph(GLYPH_ARROW_DOWN),
" begin ", i->name, " groups ",
- special_glyph(SPECIAL_GLYPH_ARROW_DOWN));
+ glyph(GLYPH_ARROW_DOWN));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_TOP),
+ TABLE_STRING, glyph(GLYPH_TREE_TOP),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_STRING, user_disposition_to_string(i->disposition),
return table_log_add_error(r);
free(name);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_UP),
+ name = strjoin(glyph(GLYPH_ARROW_UP),
" end ", i->name, " groups ",
- special_glyph(SPECIAL_GLYPH_ARROW_UP));
+ glyph(GLYPH_ARROW_UP));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
+ TABLE_STRING, glyph(GLYPH_TREE_RIGHT),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_STRING, user_disposition_to_string(i->disposition),
assert(table);
assert(start <= end);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),
+ name = strjoin(glyph(GLYPH_ARROW_DOWN),
" begin unavailable groups ",
- special_glyph(SPECIAL_GLYPH_ARROW_DOWN));
+ glyph(GLYPH_ARROW_DOWN));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_TOP),
+ TABLE_STRING, glyph(GLYPH_TREE_TOP),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_EMPTY,
return table_log_add_error(r);
free(name);
- name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_UP),
+ name = strjoin(glyph(GLYPH_ARROW_UP),
" end unavailable groups ",
- special_glyph(SPECIAL_GLYPH_ARROW_UP));
+ glyph(GLYPH_ARROW_UP));
if (!name)
return log_oom();
r = table_add_many(
table,
- TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT),
+ TABLE_STRING, glyph(GLYPH_TREE_RIGHT),
TABLE_STRING, name,
TABLE_SET_COLOR, ansi_grey(),
TABLE_EMPTY,
(void) gethostname_strict(&hn);
if (emoji_enabled())
- dot = strjoin(special_glyph(SPECIAL_GLYPH_GREEN_CIRCLE), " ");
+ dot = strjoin(glyph(GLYPH_GREEN_CIRCLE), " ");
if (hn)
(void) pty_forward_set_titlef(f, "%sVirtual Machine %s on %s", strempty(dot), arg_machine, hn);
(void) terminal_urlify_path(vm_path, vm_path, &u);
log_info("%s %sSpawning VM %s on %s.%s",
- special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: vm_path, ansi_normal());
+ glyph(GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: vm_path, ansi_normal());
if (arg_console_mode == CONSOLE_INTERACTIVE)
log_info("%s %sPress %sCtrl-]%s three times within 1s to kill VM.%s",
- 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_normal());
else if (arg_console_mode == CONSOLE_NATIVE)
log_info("%s %sPress %sCtrl-a x%s to kill VM.%s",
- 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_normal());
}
r = sd_listen_fds_with_names(true, &names);
STRV_FOREACH(path, autostart_dirs) {
_cleanup_closedir_ DIR *d = NULL;
- log_debug("Scanning autostart directory \"%s\"%s", *path, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ log_debug("Scanning autostart directory \"%s\"%s", *path, glyph(GLYPH_ELLIPSIS));
d = opendir(*path);
if (!d) {
log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, errno,
log_debug("%s: ExecCondition converted to %s --condition \"%s\"%s",
service->path, gnome_autostart_condition_path, e_autostart_condition,
- special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ glyph(GLYPH_ELLIPSIS));
fprintf(f,
"ExecCondition=%s --condition \"%s\"\n",
return log_error_errno(r, "Failed to write unit %s: %m", service->name);
log_debug("%s: symlinking %s in xdg-desktop-autostart.target/.wants%s",
- service->path, service->name, special_glyph(SPECIAL_GLYPH_ELLIPSIS));
+ service->path, service->name, glyph(GLYPH_ELLIPSIS));
return generator_add_symlink(dest, "xdg-desktop-autostart.target", "wants", service->name);
}