From: Zbigniew Jędrzejewski-Szmek Date: Fri, 14 Mar 2025 09:42:04 +0000 (+0100) Subject: basic/glyph-util: rename "special glyph" to just "glyph" X-Git-Tag: v258-rc1~1073^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ae9b0cfa84c32b094fa9d8eddd5ab640260c315;p=thirdparty%2Fsystemd.git basic/glyph-util: rename "special glyph" to just "glyph" 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. --- diff --git a/src/analyze/analyze-chid.c b/src/analyze/analyze-chid.c index 5e68da3ebf9..43ca408af0e 100644 --- a/src/analyze/analyze-chid.c +++ b/src/analyze/analyze-chid.c @@ -298,13 +298,13 @@ int verb_chid(int argc, char *argv[], void *userdata) { if (!strextend(&legend, ansi_grey(), separator ? " " : "", - separator ? special_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED) : "", + separator ? glyph(GLYPH_HORIZONTAL_DOTTED) : "", separator ? " " : "", ansi_normal(), CHAR_TO_STR(chid_smbios_fields_char[f]), ansi_grey(), " ", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), " ", ansi_normal(), chid_smbios_friendly[f], diff --git a/src/analyze/analyze-critical-chain.c b/src/analyze/analyze-critical-chain.c index 03c014d4023..40d669bcd5c 100644 --- a/src/analyze/analyze-critical-chain.c +++ b/src/analyze/analyze-critical-chain.c @@ -24,9 +24,9 @@ static int list_dependencies_print( BootTimes *boot) { for (unsigned i = level; i > 0; i--) - printf("%s", special_glyph(branches & (1 << (i-1)) ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE)); + printf("%s", glyph(branches & (1 << (i-1)) ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE)); - printf("%s", special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH)); + printf("%s", glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH)); if (times && times->activating >= boot->userspace_time) { if (timestamp_is_set(times->time)) diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c index 8e18681be7b..450124693ab 100644 --- a/src/analyze/analyze-security.c +++ b/src/analyze/analyze-security.c @@ -1724,15 +1724,15 @@ static int assess(const SecurityInfo *info, uint64_t exposure; const char *name; const char* (*color)(void); - SpecialGlyph smiley; + Glyph smiley; } badness_table[] = { - { 100, "DANGEROUS", ansi_highlight_red, SPECIAL_GLYPH_DEPRESSED_SMILEY }, - { 90, "UNSAFE", ansi_highlight_red, SPECIAL_GLYPH_UNHAPPY_SMILEY }, - { 75, "EXPOSED", ansi_highlight_yellow, SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY }, - { 50, "MEDIUM", NULL, SPECIAL_GLYPH_NEUTRAL_SMILEY }, - { 10, "OK", ansi_highlight_green, SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY }, - { 1, "SAFE", ansi_highlight_green, SPECIAL_GLYPH_HAPPY_SMILEY }, - { 0, "PERFECT", ansi_highlight_green, SPECIAL_GLYPH_ECSTATIC_SMILEY }, + { 100, "DANGEROUS", ansi_highlight_red, GLYPH_DEPRESSED_SMILEY }, + { 90, "UNSAFE", ansi_highlight_red, GLYPH_UNHAPPY_SMILEY }, + { 75, "EXPOSED", ansi_highlight_yellow, GLYPH_SLIGHTLY_UNHAPPY_SMILEY }, + { 50, "MEDIUM", NULL, GLYPH_NEUTRAL_SMILEY }, + { 10, "OK", ansi_highlight_green, GLYPH_SLIGHTLY_HAPPY_SMILEY }, + { 1, "SAFE", ansi_highlight_green, GLYPH_HAPPY_SMILEY }, + { 0, "PERFECT", ansi_highlight_green, GLYPH_ECSTATIC_SMILEY }, }; uint64_t badness_sum = 0, weight_sum = 0, exposure; @@ -1906,7 +1906,7 @@ static int assess(const SecurityInfo *info, name = info->id; printf("\n%s %sOverall exposure level for %s%s: %s%" PRIu64 ".%" PRIu64 " %s%s %s\n", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), ansi_highlight(), name, ansi_normal(), @@ -1914,7 +1914,7 @@ static int assess(const SecurityInfo *info, exposure / 10, exposure % 10, badness_table[i].name, ansi_normal(), - special_glyph(badness_table[i].smiley)); + glyph(badness_table[i].smiley)); } fflush(stdout); @@ -1938,7 +1938,7 @@ static int assess(const SecurityInfo *info, TABLE_SET_ALIGN_PERCENT, 100, TABLE_STRING, badness_table[i].name, TABLE_SET_COLOR, badness_table[i].color ? badness_table[i].color() : "", - TABLE_STRING, special_glyph(badness_table[i].smiley)); + TABLE_STRING, glyph(badness_table[i].smiley)); if (r < 0) return table_log_add_error(r); } diff --git a/src/analyze/analyze-smbios11.c b/src/analyze/analyze-smbios11.c index cee5a3ad0be..e9d82bbbd36 100644 --- a/src/analyze/analyze-smbios11.c +++ b/src/analyze/analyze-smbios11.c @@ -53,7 +53,7 @@ int verb_smbios11(int argc, char *argv[], void *userdata) { if (written) { if (incomplete) - fputs(special_glyph(SPECIAL_GLYPH_ELLIPSIS), stdout); + fputs(glyph(GLYPH_ELLIPSIS), stdout); fputc('\n', stdout); } diff --git a/src/analyze/analyze-timespan.c b/src/analyze/analyze-timespan.c index 3fdf0f964c1..5b29eedb09e 100644 --- a/src/analyze/analyze-timespan.c +++ b/src/analyze/analyze-timespan.c @@ -42,7 +42,7 @@ int verb_timespan(int argc, char *argv[], void *userdata) { if (r < 0) return table_log_add_error(r); - r = table_add_cell_stringf_full(table, NULL, TABLE_FIELD, "%ss", special_glyph(SPECIAL_GLYPH_MU)); + r = table_add_cell_stringf_full(table, NULL, TABLE_FIELD, "%ss", glyph(GLYPH_MU)); if (r < 0) return table_log_add_error(r); diff --git a/src/basic/chase.c b/src/basic/chase.c index 5d064921b5b..776c50ad181 100644 --- a/src/basic/chase.c +++ b/src/basic/chase.c @@ -41,7 +41,7 @@ static int log_unsafe_transition(int a, int b, const char *path, ChaseFlags flag return log_warning_errno(SYNTHETIC_ERRNO(ENOLINK), "Detected unsafe path transition %s (owned by %s) %s %s (owned by %s) during canonicalization of %s.", - strna(n1), strna(user_a), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), strna(n2), strna(user_b), path); + strna(n1), strna(user_a), glyph(GLYPH_ARROW_RIGHT), strna(n2), strna(user_b), path); } static int log_autofs_mount_point(int fd, const char *path, ChaseFlags flags) { diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index 7fdcc71356f..22d2bebe83e 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -407,7 +407,7 @@ int conf_file_read( f = stdin; fn = ""; - log_debug("Reading config from stdin%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Reading config from stdin%s", glyph(GLYPH_ELLIPSIS)); } else if (is_path(fn)) { r = path_make_absolute_cwd(fn, &_fn); @@ -419,14 +419,14 @@ int conf_file_read( if (!_f) r = -errno; else - log_debug("Reading config file \"%s\"%s", fn, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Reading config file \"%s\"%s", fn, glyph(GLYPH_ELLIPSIS)); } else { r = search_and_fopen(fn, "re", root, config_dirs, &_f, &_fn); if (r >= 0) { f = _f; fn = _fn; - log_debug("Reading config file \"%s\"%s", fn, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Reading config file \"%s\"%s", fn, glyph(GLYPH_ELLIPSIS)); } } diff --git a/src/basic/glyph-util.c b/src/basic/glyph-util.c index fa4c5888bd8..dd16dad9b67 100644 --- a/src/basic/glyph-util.c +++ b/src/basic/glyph-util.c @@ -23,7 +23,7 @@ bool emoji_enabled(void) { return cached_emoji_enabled; } -const char* special_glyph_full(SpecialGlyph code, bool force_utf) { +const char* glyph_full(Glyph code, bool force_utf) { /* A list of a number of interesting unicode glyphs we can use to decorate our output. It's probably wise to be * conservative here, and primarily stick to the glyphs defined in the eurlatgr font, so that display still @@ -32,135 +32,135 @@ const char* special_glyph_full(SpecialGlyph code, bool force_utf) { * http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=blob;f=data/consolefonts/README.eurlatgr */ - static const char* const draw_table[2][_SPECIAL_GLYPH_MAX] = { + static const char* const draw_table[2][_GLYPH_MAX] = { /* ASCII fallback */ [false] = { - [SPECIAL_GLYPH_TREE_VERTICAL] = "| ", - [SPECIAL_GLYPH_TREE_BRANCH] = "|-", - [SPECIAL_GLYPH_TREE_RIGHT] = "`-", - [SPECIAL_GLYPH_TREE_SPACE] = " ", - [SPECIAL_GLYPH_TREE_TOP] = ",-", - [SPECIAL_GLYPH_VERTICAL_DOTTED] = ":", - [SPECIAL_GLYPH_HORIZONTAL_DOTTED] = "-", - [SPECIAL_GLYPH_HORIZONTAL_FAT] = "=", - [SPECIAL_GLYPH_TRIANGULAR_BULLET] = ">", - [SPECIAL_GLYPH_BLACK_CIRCLE] = "*", - [SPECIAL_GLYPH_WHITE_CIRCLE] = "*", - [SPECIAL_GLYPH_MULTIPLICATION_SIGN] = "x", - [SPECIAL_GLYPH_CIRCLE_ARROW] = "*", - [SPECIAL_GLYPH_BULLET] = "*", - [SPECIAL_GLYPH_MU] = "u", - [SPECIAL_GLYPH_CHECK_MARK] = "+", - [SPECIAL_GLYPH_CROSS_MARK] = "-", - [SPECIAL_GLYPH_LIGHT_SHADE] = "-", - [SPECIAL_GLYPH_DARK_SHADE] = "X", - [SPECIAL_GLYPH_FULL_BLOCK] = "#", - [SPECIAL_GLYPH_SIGMA] = "S", - [SPECIAL_GLYPH_ARROW_UP] = "^", - [SPECIAL_GLYPH_ARROW_DOWN] = "v", - [SPECIAL_GLYPH_ARROW_LEFT] = "<-", - [SPECIAL_GLYPH_ARROW_RIGHT] = "->", - [SPECIAL_GLYPH_ELLIPSIS] = "...", - [SPECIAL_GLYPH_EXTERNAL_LINK] = "[LNK]", - [SPECIAL_GLYPH_ECSTATIC_SMILEY] = ":-]", - [SPECIAL_GLYPH_HAPPY_SMILEY] = ":-}", - [SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = ":-)", - [SPECIAL_GLYPH_NEUTRAL_SMILEY] = ":-|", - [SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = ":-(", - [SPECIAL_GLYPH_UNHAPPY_SMILEY] = ":-{", - [SPECIAL_GLYPH_DEPRESSED_SMILEY] = ":-[", - [SPECIAL_GLYPH_LOCK_AND_KEY] = "o-,", - [SPECIAL_GLYPH_TOUCH] = "O=", /* Yeah, not very convincing, can you do it better? */ - [SPECIAL_GLYPH_RECYCLING] = "~", - [SPECIAL_GLYPH_DOWNLOAD] = "\\", - [SPECIAL_GLYPH_SPARKLES] = "*", - [SPECIAL_GLYPH_LOW_BATTERY] = "!", - [SPECIAL_GLYPH_WARNING_SIGN] = "!", - [SPECIAL_GLYPH_RED_CIRCLE] = "o", - [SPECIAL_GLYPH_YELLOW_CIRCLE] = "o", - [SPECIAL_GLYPH_BLUE_CIRCLE] = "o", - [SPECIAL_GLYPH_GREEN_CIRCLE] = "o", - [SPECIAL_GLYPH_SUPERHERO] = "S", - [SPECIAL_GLYPH_IDCARD] = "@", - [SPECIAL_GLYPH_HOME] = "^", + [GLYPH_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]; } diff --git a/src/basic/glyph-util.h b/src/basic/glyph-util.h index 84c01a5fedc..cb2fc78b07d 100644 --- a/src/basic/glyph-util.h +++ b/src/basic/glyph-util.h @@ -6,74 +6,74 @@ #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) : " "; } diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 21b6f669e6a..2e1b4e3f05b 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -138,7 +138,7 @@ static int extension_release_strict_xattr_value(int extension_release_fd, const log_debug("%s/%s: 'user.extension-release.strict' attribute is false%s", extension_release_dir_path, filename, - special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + glyph(GLYPH_ELLIPSIS)); return false; } diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 89c9dd4af19..6cba0403d00 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -247,7 +247,7 @@ bool string_has_cc(const char *p, const char *ok) { } static int write_ellipsis(char *buf, bool unicode) { - const char *s = special_glyph_full(SPECIAL_GLYPH_ELLIPSIS, unicode); + const char *s = glyph_full(GLYPH_ELLIPSIS, unicode); assert(strlen(s) == 3); memcpy(buf, s, 3); return 3; diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index 3be9d16333b..227c96e18b5 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -358,20 +358,20 @@ static const char* const job_mode_table[_JOB_MODE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(job_mode, JobMode); -SpecialGlyph unit_active_state_to_glyph(UnitActiveState state) { - static const SpecialGlyph map[_UNIT_ACTIVE_STATE_MAX] = { - [UNIT_ACTIVE] = SPECIAL_GLYPH_BLACK_CIRCLE, - [UNIT_RELOADING] = SPECIAL_GLYPH_CIRCLE_ARROW, - [UNIT_REFRESHING] = SPECIAL_GLYPH_CIRCLE_ARROW, - [UNIT_INACTIVE] = SPECIAL_GLYPH_WHITE_CIRCLE, - [UNIT_FAILED] = SPECIAL_GLYPH_MULTIPLICATION_SIGN, - [UNIT_ACTIVATING] = SPECIAL_GLYPH_BLACK_CIRCLE, - [UNIT_DEACTIVATING] = SPECIAL_GLYPH_BLACK_CIRCLE, - [UNIT_MAINTENANCE] = SPECIAL_GLYPH_WHITE_CIRCLE, +Glyph unit_active_state_to_glyph(UnitActiveState state) { + static const Glyph map[_UNIT_ACTIVE_STATE_MAX] = { + [UNIT_ACTIVE] = GLYPH_BLACK_CIRCLE, + [UNIT_RELOADING] = GLYPH_CIRCLE_ARROW, + [UNIT_REFRESHING] = GLYPH_CIRCLE_ARROW, + [UNIT_INACTIVE] = GLYPH_WHITE_CIRCLE, + [UNIT_FAILED] = GLYPH_MULTIPLICATION_SIGN, + [UNIT_ACTIVATING] = GLYPH_BLACK_CIRCLE, + [UNIT_DEACTIVATING] = GLYPH_BLACK_CIRCLE, + [UNIT_MAINTENANCE] = GLYPH_WHITE_CIRCLE, }; if (state < 0) - return _SPECIAL_GLYPH_INVALID; + return _GLYPH_INVALID; assert(state < _UNIT_ACTIVE_STATE_MAX); return map[state]; diff --git a/src/basic/unit-def.h b/src/basic/unit-def.h index a9548e29913..06bf902e454 100644 --- a/src/basic/unit-def.h +++ b/src/basic/unit-def.h @@ -363,4 +363,4 @@ NotifyAccess notify_access_from_string(const char *s) _pure_; const char* job_mode_to_string(JobMode t) _const_; JobMode job_mode_from_string(const char *s) _pure_; -SpecialGlyph unit_active_state_to_glyph(UnitActiveState state); +Glyph unit_active_state_to_glyph(UnitActiveState state); diff --git a/src/battery-check/battery-check.c b/src/battery-check/battery-check.c index a2ed5cbafd1..a7749b7b9c7 100644 --- a/src/battery-check/battery-check.c +++ b/src/battery-check/battery-check.c @@ -144,7 +144,7 @@ static int run(int argc, char *argv[]) { if (r == 0) return 0; log_struct(LOG_EMERG, - LOG_MESSAGE("%s " BATTERY_LOW_MESSAGE, special_glyph(SPECIAL_GLYPH_LOW_BATTERY)), + LOG_MESSAGE("%s " BATTERY_LOW_MESSAGE, glyph(GLYPH_LOW_BATTERY)), "MESSAGE_ID=" SD_MESSAGE_BATTERY_LOW_WARNING_STR); fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC); @@ -152,10 +152,10 @@ static int run(int argc, char *argv[]) { log_warning_errno(fd, "Failed to open console, ignoring: %m"); else dprintf(fd, ANSI_HIGHLIGHT_RED "%s " BATTERY_LOW_MESSAGE ANSI_NORMAL "\n", - special_glyph_full(SPECIAL_GLYPH_LOW_BATTERY, /* force_utf = */ false)); + glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ false)); if (asprintf(&plymouth_message, "%s " BATTERY_LOW_MESSAGE, - special_glyph_full(SPECIAL_GLYPH_LOW_BATTERY, /* force_utf = */ true)) < 0) + glyph_full(GLYPH_LOW_BATTERY, /* force_utf = */ true)) < 0) return log_oom(); (void) plymouth_send_message("shutdown", plymouth_message); diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c index d21f3f79ff5..76c00562121 100644 --- a/src/binfmt/binfmt.c +++ b/src/binfmt/binfmt.c @@ -82,7 +82,7 @@ static int apply_file(const char *filename, bool ignore_enoent) { return log_error_errno(r, "Failed to open file '%s': %m", filename); } - log_debug("Applying %s%s", pp, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Applying %s%s", pp, glyph(GLYPH_ELLIPSIS)); for (unsigned line = 1;; line++) { _cleanup_free_ char *text = NULL; int k; diff --git a/src/bootctl/bootctl-install.c b/src/bootctl/bootctl-install.c index 4171e4aeee0..61e172a037e 100644 --- a/src/bootctl/bootctl-install.c +++ b/src/bootctl/bootctl-install.c @@ -935,7 +935,7 @@ static int are_we_installed(const char *esp_path) { if (!p) return log_oom(); - log_debug("Checking whether %s contains any files%s", p, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Checking whether %s contains any files%s", p, glyph(GLYPH_ELLIPSIS)); r = dir_is_empty(p, /* ignore_hidden_or_backup= */ false); if (r < 0 && r != -ENOENT) return log_error_errno(r, "Failed to check whether %s contains any files: %m", p); diff --git a/src/bootctl/bootctl-random-seed.c b/src/bootctl/bootctl-random-seed.c index 93cb4f9493b..0c6f2e72579 100644 --- a/src/bootctl/bootctl-random-seed.c +++ b/src/bootctl/bootctl-random-seed.c @@ -41,11 +41,11 @@ static int random_seed_verify_permissions(int fd, mode_t expected_type) { 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; diff --git a/src/bootctl/bootctl-status.c b/src/bootctl/bootctl-status.c index bf29a957601..b409d461d0f 100644 --- a/src/bootctl/bootctl-status.c +++ b/src/bootctl/bootctl-status.c @@ -137,7 +137,7 @@ static int print_efi_option(uint16_t id, int *n_printed, bool in_order) { printf(" Status: %sactive%s\n", active ? "" : "in", in_order ? ", boot-order" : ""); printf(" Partition: /dev/disk/by-partuuid/" SD_ID128_UUID_FORMAT_STR "\n", SD_ID128_FORMAT_VAL(partition)); - printf(" File: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), path); + printf(" File: %s%s\n", glyph(GLYPH_TREE_RIGHT), path); printf("\n"); (*n_printed)++; @@ -230,7 +230,7 @@ static int enumerate_binaries( * one more, and can draw the tree glyph properly. */ printf(" %s %s%s\n", *is_first ? "File:" : " ", - special_glyph(SPECIAL_GLYPH_TREE_BRANCH), *previous); + glyph(GLYPH_TREE_BRANCH), *previous); *is_first = false; *previous = mfree(*previous); } @@ -281,7 +281,7 @@ static int status_binaries(const char *esp_path, sd_id128_t partition) { if (last) /* let's output the last entry now, since now we know that there will be no more, and can draw the tree glyph properly */ printf(" %s %s%s\n", is_first ? "File:" : " ", - special_glyph(SPECIAL_GLYPH_TREE_RIGHT), last); + glyph(GLYPH_TREE_RIGHT), last); if (r == 0 && !arg_quiet) log_info("systemd-boot not installed in ESP."); @@ -505,7 +505,7 @@ int verb_status(int argc, char *argv[], void *userdata) { printf(" Partition: n/a\n"); if (loader_path) - printf(" Loader: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), strna(loader_path)); + printf(" Loader: %s%s\n", glyph(GLYPH_TREE_RIGHT), strna(loader_path)); if (loader_url) printf(" Net Boot URL: %s\n", loader_url); @@ -546,7 +546,7 @@ int verb_status(int argc, char *argv[], void *userdata) { printf(" Partition: n/a\n"); if (stub_path) - printf(" Stub: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), strna(stub_path)); + printf(" Stub: %s%s\n", glyph(GLYPH_TREE_RIGHT), strna(stub_path)); if (stub_url) printf(" Net Boot URL: %s\n", stub_url); diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 8971d8c28fc..2e25e6a0066 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -401,8 +401,8 @@ static void print_subtree(const char *prefix, const char *path, char **l) { } const char - *vertical = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)), - *space = strjoina(prefix, special_glyph(SPECIAL_GLYPH_TREE_SPACE)); + *vertical = strjoina(prefix, glyph(GLYPH_TREE_VERTICAL)), + *space = strjoina(prefix, glyph(GLYPH_TREE_SPACE)); for (;;) { bool has_more = false; @@ -426,7 +426,7 @@ static void print_subtree(const char *prefix, const char *path, char **l) { printf("%s%s %s\n", prefix, - special_glyph(has_more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT), + glyph(has_more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT), *l); print_subtree(has_more ? vertical : space, *l, l); diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index b59f9dec76e..018c1d465a9 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -2073,7 +2073,7 @@ static int method_enqueue_marked_jobs(sd_bus_message *message, void *userdata, s if (r == 0) return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ - log_info("Queuing reload/restart jobs for marked units%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Queuing reload/restart jobs for marked units%s", glyph(GLYPH_ELLIPSIS)); _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; r = sd_bus_message_new_method_return(message, &reply); diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c index a1c452e29f4..aaa2291d691 100644 --- a/src/core/dbus-service.c +++ b/src/core/dbus-service.c @@ -641,7 +641,7 @@ static int bus_service_set_transient_property( if (!UNIT_WRITE_FLAGS_NOOP(flags)) log_unit_notice(u, "Transient unit's PIDFile= property references path below legacy directory /var/run, updating %s %s %s; please update client accordingly.", - n, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), z); + n, glyph(GLYPH_ARROW_RIGHT), z); free_and_replace(n, z); } diff --git a/src/core/manager-serialize.c b/src/core/manager-serialize.c index fbc1475bcf5..05021654fae 100644 --- a/src/core/manager-serialize.c +++ b/src/core/manager-serialize.c @@ -303,10 +303,10 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) { r = fd_get_path(fd, &fn); if (r < 0) log_debug_errno(r, "Received serialized fd %i %s %m", - fd, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT)); + fd, glyph(GLYPH_ARROW_RIGHT)); else log_debug("Received serialized fd %i %s %s", - fd, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), strna(fn)); + fd, glyph(GLYPH_ARROW_RIGHT), strna(fn)); } } } diff --git a/src/core/manager.c b/src/core/manager.c index 2382592d4ef..c6c97799763 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1882,7 +1882,7 @@ static void manager_coldplug(Manager *m) { assert(m); - log_debug("Invoking unit coldplug() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Invoking unit coldplug() handlers%s", glyph(GLYPH_ELLIPSIS)); /* Let's place the units back into their deserialized state */ HASHMAP_FOREACH_KEY(u, k, m->units) { @@ -1903,7 +1903,7 @@ static void manager_catchup(Manager *m) { assert(m); - log_debug("Invoking unit catchup() handlers%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Invoking unit catchup() handlers%s", glyph(GLYPH_ELLIPSIS)); /* Let's catch up on any state changes that happened while we were reloading/reexecing */ HASHMAP_FOREACH_KEY(u, k, m->units) { diff --git a/src/core/mount.c b/src/core/mount.c index 664f214f20a..dbd8ea55dae 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -850,7 +850,7 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) { continue; fprintf(f, "%s%s %s:\n", - prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mount_exec_command_to_string(c)); + prefix, glyph(GLYPH_ARROW_RIGHT), mount_exec_command_to_string(c)); exec_command_dump(m->exec_command + c, f, prefix2); } diff --git a/src/core/namespace.c b/src/core/namespace.c index c99233ce65b..c3e9030dd63 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -1649,7 +1649,7 @@ static int follow_symlink( mount_entry_path(m)); log_debug("Followed mount entry path symlink %s %s %s.", - mount_entry_path(m), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), target); + mount_entry_path(m), glyph(GLYPH_ARROW_RIGHT), target); mount_entry_consume_prefix(m, TAKE_PTR(target)); @@ -1821,7 +1821,7 @@ static int apply_one_mount( return log_debug_errno(r, "Failed to follow symlinks on %s: %m", mount_entry_source(m)); log_debug("Followed source symlinks %s %s %s.", - mount_entry_source(m), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), chased); + mount_entry_source(m), glyph(GLYPH_ARROW_RIGHT), chased); free_and_replace(m->source_malloc, chased); diff --git a/src/core/service.c b/src/core/service.c index ccfa439dd0a..8f4ed6040b7 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1069,7 +1069,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { continue; fprintf(f, "%s%s %s:\n", - prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), service_exec_command_to_string(c)); + prefix, glyph(GLYPH_ARROW_RIGHT), service_exec_command_to_string(c)); exec_command_dump_list(s->exec_command[c], f, prefix2); } diff --git a/src/core/socket.c b/src/core/socket.c index ecdd6cf51be..e7e8584d81d 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -821,7 +821,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) { continue; fprintf(f, "%s%s %s:\n", - prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), socket_exec_command_to_string(c)); + prefix, glyph(GLYPH_ARROW_RIGHT), socket_exec_command_to_string(c)); exec_command_dump_list(s->exec_command[c], f, prefix2); } @@ -1315,7 +1315,7 @@ static int socket_symlink(Socket *s) { } if (r < 0) log_unit_warning_errno(UNIT(s), r, "Failed to create symlink %s %s %s, ignoring: %m", - p, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), *i); + p, glyph(GLYPH_ARROW_RIGHT), *i); } return 0; diff --git a/src/core/swap.c b/src/core/swap.c index 16072e5a713..cc5a21ee780 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -613,7 +613,7 @@ static void swap_dump(Unit *u, FILE *f, const char *prefix) { continue; fprintf(f, "%s%s %s:\n", - prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), swap_exec_command_to_string(c)); + prefix, glyph(GLYPH_ARROW_RIGHT), swap_exec_command_to_string(c)); exec_command_dump(s->exec_command + c, f, prefix2); } diff --git a/src/core/unit-serialize.c b/src/core/unit-serialize.c index 78ceb006a46..13aea615dd6 100644 --- a/src/core/unit-serialize.c +++ b/src/core/unit-serialize.c @@ -457,7 +457,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) { fprintf(f, "%s%s Unit %s:\n", - prefix, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), u->id); + prefix, glyph(GLYPH_ARROW_RIGHT), u->id); SET_FOREACH(t, u->aliases) fprintf(f, "%s\tAlias: %s\n", prefix, t); diff --git a/src/cryptenroll/cryptenroll-fido2.c b/src/cryptenroll/cryptenroll-fido2.c index af085520fee..f412aac928b 100644 --- a/src/cryptenroll/cryptenroll-fido2.c +++ b/src/cryptenroll/cryptenroll-fido2.c @@ -178,7 +178,7 @@ int enroll_fido2( fprintf(stderr, "A FIDO2 credential has been registered for this volume:\n\n" " %s%sfido2-cid=%s", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "", + emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "", emoji_enabled() ? " " : "", ansi_highlight()); fflush(stderr); diff --git a/src/cryptenroll/cryptenroll-recovery.c b/src/cryptenroll/cryptenroll-recovery.c index 33b58eeb37f..acc43417125 100644 --- a/src/cryptenroll/cryptenroll-recovery.c +++ b/src/cryptenroll/cryptenroll-recovery.c @@ -47,7 +47,7 @@ int enroll_recovery( fprintf(stderr, "A secret recovery key has been generated for this volume:\n\n" " %s%s%s", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "", + emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "", emoji_enabled() ? " " : "", ansi_highlight()); fflush(stderr); diff --git a/src/delta/delta.c b/src/delta/delta.c index 62f4be578f4..89815758b38 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -89,7 +89,7 @@ static int notify_override_masked(const char *top, const char *bottom) { printf("%s%s%s %s %s %s\n", ansi_highlight_red(), "[MASKED]", ansi_normal(), - top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom); + top, glyph(GLYPH_ARROW_RIGHT), bottom); return 1; } @@ -99,7 +99,7 @@ static int notify_override_equivalent(const char *top, const char *bottom) { printf("%s%s%s %s %s %s\n", ansi_highlight_green(), "[EQUIVALENT]", ansi_normal(), - top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom); + top, glyph(GLYPH_ARROW_RIGHT), bottom); return 1; } @@ -109,7 +109,7 @@ static int notify_override_redirected(const char *top, const char *bottom) { printf("%s%s%s %s %s %s\n", ansi_highlight(), "[REDIRECTED]", ansi_normal(), - top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom); + top, glyph(GLYPH_ARROW_RIGHT), bottom); return 1; } @@ -119,7 +119,7 @@ static int notify_override_overridden(const char *top, const char *bottom) { printf("%s%s%s %s %s %s\n", ansi_highlight(), "[OVERRIDDEN]", ansi_normal(), - top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom); + top, glyph(GLYPH_ARROW_RIGHT), bottom); return 1; } @@ -129,7 +129,7 @@ static int notify_override_extended(const char *top, const char *bottom) { printf("%s%s%s %s %s %s\n", ansi_highlight(), "[EXTENDED]", ansi_normal(), - top, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), bottom); + top, glyph(GLYPH_ARROW_RIGHT), bottom); return 1; } @@ -237,7 +237,7 @@ static int enumerate_dir_d( return -ENOMEM; d = p + strlen(toppath) + 1; - log_debug("Adding at top: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + log_debug("Adding at top: %s %s %s", d, glyph(GLYPH_ARROW_RIGHT), p); r = ordered_hashmap_ensure_put(top, &string_hash_ops_value_free, d, p); if (r >= 0) { p = strdup(p); @@ -249,7 +249,7 @@ static int enumerate_dir_d( return r; } - log_debug("Adding at bottom: %s %s %s", d, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + log_debug("Adding at bottom: %s %s %s", d, glyph(GLYPH_ARROW_RIGHT), p); free(ordered_hashmap_remove(*bottom, d)); r = ordered_hashmap_ensure_put(bottom, &string_hash_ops_value_free, d, p); if (r < 0) { @@ -277,7 +277,7 @@ static int enumerate_dir_d( return -ENOMEM; log_debug("Adding to drops: %s %s %s %s %s", - unit, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + unit, glyph(GLYPH_ARROW_RIGHT), basename(p), glyph(GLYPH_ARROW_RIGHT), p); r = ordered_hashmap_put(h, basename(p), p); if (r < 0) { free(p); @@ -353,7 +353,7 @@ static int enumerate_dir( if (!p) return -ENOMEM; - log_debug("Adding at top: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + log_debug("Adding at top: %s %s %s", basename(p), glyph(GLYPH_ARROW_RIGHT), p); r = ordered_hashmap_ensure_put(top, &string_hash_ops_value_free, basename(p), p); if (r >= 0) { p = strdup(p); @@ -362,7 +362,7 @@ static int enumerate_dir( } else if (r != -EEXIST) return r; - log_debug("Adding at bottom: %s %s %s", basename(p), special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + log_debug("Adding at bottom: %s %s %s", basename(p), glyph(GLYPH_ARROW_RIGHT), p); free(ordered_hashmap_remove(*bottom, basename(p))); r = ordered_hashmap_ensure_put(bottom, &string_hash_ops_value_free, basename(p), p); if (r < 0) diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 99d483f1147..fc03df5cc68 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -2114,12 +2114,12 @@ static int action_validate(void) { return r; if (isatty_safe(STDOUT_FILENO) && emoji_enabled()) - printf("%s ", special_glyph(SPECIAL_GLYPH_SPARKLES)); + printf("%s ", glyph(GLYPH_SPARKLES)); printf("%sOK%s", ansi_highlight_green(), ansi_normal()); if (isatty_safe(STDOUT_FILENO) && emoji_enabled()) - printf(" %s", special_glyph(SPECIAL_GLYPH_SPARKLES)); + printf(" %s", glyph(GLYPH_SPARKLES)); putc('\n', stdout); return 0; diff --git a/src/environment-d-generator/environment-d-generator.c b/src/environment-d-generator/environment-d-generator.c index fa751cbd9cc..7affff5c1f3 100644 --- a/src/environment-d-generator/environment-d-generator.c +++ b/src/environment-d-generator/environment-d-generator.c @@ -57,7 +57,7 @@ static int load_and_print(void) { * that in case of failure, a partial update is better than none. */ STRV_FOREACH(i, files) { - log_debug("Reading %s%s", *i, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Reading %s%s", *i, glyph(GLYPH_ELLIPSIS)); r = merge_env_file(&env, NULL, *i); if (r == -ENOMEM) diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index a5a6ff7a846..e324af8cfc5 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -131,7 +131,7 @@ static void print_welcome(int rfd) { putchar('\n'); if (emoji_enabled()) { - fputs(special_glyph(SPECIAL_GLYPH_SPARKLES), stdout); + fputs(glyph(GLYPH_SPARKLES), stdout); putchar(' '); } printf("Please configure your new system!\n"); @@ -188,7 +188,7 @@ static int prompt_loop( l, strv_isempty(l) ? "%s %s (empty to skip): " : "%s %s (empty to skip, \"list\" to list options): ", - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), text); + glyph(GLYPH_TRIANGULAR_BULLET), text); if (r < 0) return log_error_errno(r, "Failed to query user: %m"); @@ -785,8 +785,8 @@ static int prompt_root_password(int rfd) { print_welcome(rfd); - msg1 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter the new root password (empty to skip):"); - msg2 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter the new root password again:"); + msg1 = strjoina(glyph(GLYPH_TRIANGULAR_BULLET), " Please enter the new root password (empty to skip):"); + msg2 = strjoina(glyph(GLYPH_TRIANGULAR_BULLET), " Please enter the new root password again:"); suggest_passwords(); diff --git a/src/home/homectl-recovery-key.c b/src/home/homectl-recovery-key.c index 2b76303edd0..cac7d234691 100644 --- a/src/home/homectl-recovery-key.c +++ b/src/home/homectl-recovery-key.c @@ -140,7 +140,7 @@ int identity_add_recovery_key(sd_json_variant **v) { fprintf(stderr, "A secret recovery key has been generated for this account:\n\n" " %s%s%s", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY) : "", + emoji_enabled() ? glyph(GLYPH_LOCK_AND_KEY) : "", emoji_enabled() ? " " : "", ansi_highlight()); fflush(stderr); diff --git a/src/home/homectl.c b/src/home/homectl.c index 4ac53be2890..4d68bfd3dca 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -492,7 +492,7 @@ static int handle_generic_user_record_error( } else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_PROTECTED_AUTHENTICATION_PATH_NEEDED)) { log_notice("%s%sPlease authenticate physically on security token.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); r = user_record_set_pkcs11_protected_authentication_path_permitted(hr, true); @@ -502,7 +502,7 @@ static int handle_generic_user_record_error( } else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_USER_PRESENCE_NEEDED)) { log_notice("%s%sPlease confirm presence on security token.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); r = user_record_set_fido2_user_presence_permitted(hr, true); @@ -512,7 +512,7 @@ static int handle_generic_user_record_error( } else if (sd_bus_error_has_name(error, BUS_ERROR_TOKEN_USER_VERIFICATION_NEEDED)) { log_notice("%s%sPlease verify user on security token.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); r = user_record_set_fido2_user_verification_permitted(hr, true); @@ -2085,11 +2085,11 @@ static int passwd_home(int argc, char *argv[], void *userdata) { if (arg_pkcs11_token_uri) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "To change the PKCS#11 security token use 'homectl update --pkcs11-token-uri=%s'.", - special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + glyph(GLYPH_ELLIPSIS)); if (arg_fido2_device) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "To change the FIDO2 security token use 'homectl update --fido2-device=%s'.", - special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + glyph(GLYPH_ELLIPSIS)); if (identity_properties_specified()) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "The 'passwd' verb does not permit changing other record properties at the same time."); @@ -2712,7 +2712,7 @@ static int create_interactively(void) { putchar('\n'); if (emoji_enabled()) { - fputs(special_glyph(SPECIAL_GLYPH_HOME), stdout); + fputs(glyph(GLYPH_HOME), stdout); putchar(' '); } printf("Please create your user account!\n"); @@ -2729,7 +2729,7 @@ static int create_interactively(void) { r = ask_string(&username, "%s Please enter user name to create (empty to skip): ", - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET)); + glyph(GLYPH_TRIANGULAR_BULLET)); if (r < 0) return log_error_errno(r, "Failed to query user for username: %m"); @@ -2785,7 +2785,7 @@ static int create_interactively(void) { r = ask_string_full(&s, group_completion_callback, &available, "%s Please enter an auxiliary group for user %s (empty to continue, \"list\" to list available groups): ", - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), username); + glyph(GLYPH_TRIANGULAR_BULLET), username); if (r < 0) return log_error_errno(r, "Failed to query user for auxiliary group: %m"); @@ -2870,7 +2870,7 @@ static int create_interactively(void) { r = ask_string(&shell, "%s Please enter the shell to use for user %s (empty for default): ", - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), username); + glyph(GLYPH_TRIANGULAR_BULLET), username); if (r < 0) return log_error_errno(r, "Failed to query user for username: %m"); @@ -4619,7 +4619,7 @@ static int parse_argv(int argc, char *argv[]) { if (u < REBALANCE_WEIGHT_MIN || u > REBALANCE_WEIGHT_MAX) return log_error_errno(SYNTHETIC_ERRNO(ERANGE), "Rebalancing weight out of valid range %" PRIu64 "%s%" PRIu64 ": %s", - REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX, optarg); + REBALANCE_WEIGHT_MIN, glyph(GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX, optarg); } /* Drop from per machine stuff and everywhere */ @@ -5257,7 +5257,7 @@ static int verb_list_signing_keys(int argc, char *argv[], void *userdata) { if (m < 0) return log_oom(); if (n > 64) /* check if we truncated the original version */ - if (!strextend(&h, special_glyph(SPECIAL_GLYPH_ELLIPSIS))) + if (!strextend(&h, glyph(GLYPH_ELLIPSIS))) return log_oom(); } diff --git a/src/home/homed-home.c b/src/home/homed-home.c index 9b6d2ee404c..71ec0ba598c 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -530,7 +530,7 @@ static void home_set_state(Home *h, HomeState state) { log_info("%s: changing state %s %s %s", h->user_name, home_state_to_string(old_state), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), home_state_to_string(new_state)); home_update_pin_fd(h, new_state); diff --git a/src/home/homed-manager.c b/src/home/homed-manager.c index 5ce0fc33007..47bcaddfc8a 100644 --- a/src/home/homed-manager.c +++ b/src/home/homed-manager.c @@ -1953,7 +1953,7 @@ static int manager_rebalance_calculate(Manager *m) { else { log_debug("Rebalancing home directory '%s' %s %s %s.", h->user_name, FORMAT_BYTES(h->rebalance_size), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(h->rebalance_goal)); h->rebalance_pending = true; } diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 9723d8511f4..75632f5d474 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -3387,13 +3387,13 @@ int home_resize_luks( log_info("Ready to resize image size %s %s %s, partition size %s %s %s, file system size %s %s %s.", FORMAT_BYTES(old_image_size), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(new_image_size), FORMAT_BYTES(setup->partition_size), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(new_partition_size), FORMAT_BYTES(old_fs_size), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(new_fs_size)); if (new_fs_size > old_fs_size) { /* → Grow */ diff --git a/src/home/homework-mount.c b/src/home/homework-mount.c index d6bb9649735..085ba09e81e 100644 --- a/src/home/homework-mount.c +++ b/src/home/homework-mount.c @@ -302,7 +302,7 @@ int home_shift_uid(int dir_fd, const char *target, uid_t stored_uid, uid_t expos return log_error_errno(errno, "Failed to apply UID/GID map: %m"); log_debug("Applied uidmap mount to %s. Mapping is " UID_FMT " %s " UID_FMT ".", - strna(target), stored_uid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), exposed_uid); + strna(target), stored_uid, glyph(GLYPH_ARROW_RIGHT), exposed_uid); if (ret_mount_fd) *ret_mount_fd = TAKE_FD(mount_fd); diff --git a/src/import/export-raw.c b/src/import/export-raw.c index 5e34fd372e8..b47f4ba1200 100644 --- a/src/import/export-raw.c +++ b/src/import/export-raw.c @@ -128,7 +128,7 @@ static void raw_export_report_progress(RawExport *e) { (void) draw_progress_barf( percent, "%s %s/%s", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(e->written_uncompressed), FORMAT_BYTES(e->st.st_size)); else diff --git a/src/import/export-tar.c b/src/import/export-tar.c index e025efe411b..1596d23e820 100644 --- a/src/import/export-tar.c +++ b/src/import/export-tar.c @@ -138,7 +138,7 @@ static void tar_export_report_progress(TarExport *e) { (void) draw_progress_barf( percent, "%s %s/%s", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(e->written_uncompressed), FORMAT_BYTES(e->quota_referenced)); else diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 6400995a9e8..4ddf78794b0 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -154,7 +154,7 @@ static void raw_import_report_progress(RawImport *i) { (void) draw_progress_barf( percent, "%s %s/%s", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(i->written_compressed), FORMAT_BYTES(i->input_stat.st_size)); else diff --git a/src/import/import-tar.c b/src/import/import-tar.c index b95596c50c3..4b4cf119376 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -155,7 +155,7 @@ static void tar_import_report_progress(TarImport *i) { (void) draw_progress_barf( percent, "%s %s/%s", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), FORMAT_BYTES(i->written_compressed), FORMAT_BYTES(i->input_stat.st_size)); else diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c index 5fc3614afb7..7c7dfc74d60 100644 --- a/src/libsystemd/sd-bus/bus-dump.c +++ b/src/libsystemd/sd-bus/bus-dump.c @@ -67,7 +67,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) { m->header->type == SD_BUS_MESSAGE_METHOD_ERROR ? ansi_highlight_red() : m->header->type == SD_BUS_MESSAGE_METHOD_RETURN ? ansi_highlight_green() : m->header->type != SD_BUS_MESSAGE_SIGNAL ? ansi_highlight() : "", - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), + glyph(GLYPH_TRIANGULAR_BULLET), ansi_normal(), ansi_highlight(), diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 20e65284817..7c6183d1bbd 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -541,7 +541,7 @@ void bus_set_state(sd_bus *bus, enum bus_state state) { return; log_debug("Bus %s: changing state %s %s %s", strna(bus->description), - table[bus->state], special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), table[state]); + table[bus->state], glyph(GLYPH_ARROW_RIGHT), table[state]); bus->state = state; } diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index ab977153fd9..64d01c54572 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -431,7 +431,7 @@ _public_ int sd_event_new(sd_event** ret) { if (secure_getenv("SD_EVENT_PROFILE_DELAYS")) { log_debug("Event loop profiling enabled. Logarithmic histogram of event loop iterations in the range 2^0 %s 2^63 us will be logged every 5s.", - special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + glyph(GLYPH_ELLIPSIS)); e->profile_delays = true; } diff --git a/src/libsystemd/sd-json/json-util.c b/src/libsystemd/sd-json/json-util.c index aa2d7f5e648..f1493e564c9 100644 --- a/src/libsystemd/sd-json/json-util.c +++ b/src/libsystemd/sd-json/json-util.c @@ -61,7 +61,7 @@ int json_dispatch_byte_array_iovec(const char *name, sd_json_variant *variant, s if (b > 0xff) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is out of range 0%s255.", - k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + k, strna(name), glyph(GLYPH_ELLIPSIS)); buffer[k++] = (uint8_t) b; } diff --git a/src/libsystemd/sd-varlink/sd-varlink.c b/src/libsystemd/sd-varlink/sd-varlink.c index ebefbe38529..222ccaac5d0 100644 --- a/src/libsystemd/sd-varlink/sd-varlink.c +++ b/src/libsystemd/sd-varlink/sd-varlink.c @@ -110,7 +110,7 @@ static void varlink_set_state(sd_varlink *v, VarlinkState state) { else varlink_log(v, "Changing state %s %s %s", varlink_state_to_string(v->state), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), varlink_state_to_string(state)); v->state = state; diff --git a/src/login/sysfs-show.c b/src/login/sysfs-show.c index 0a8c02a2a26..43eb13ac83e 100644 --- a/src/login/sysfs-show.c +++ b/src/login/sysfs-show.c @@ -88,7 +88,7 @@ static int show_sysfs_one( if (!k) return -ENOMEM; - printf("%s%s%s\n", prefix, special_glyph(lookahead < n_dev ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT), k); + printf("%s%s%s\n", prefix, glyph(lookahead < n_dev ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT), k); if (asprintf(&l, "%s%s:%s%s%s%s", @@ -102,12 +102,12 @@ static int show_sysfs_one( if (!k) return -ENOMEM; - printf("%s%s%s\n", prefix, lookahead < n_dev ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " ", k); + printf("%s%s%s\n", prefix, lookahead < n_dev ? glyph(GLYPH_TREE_VERTICAL) : " ", k); if (++(*i_dev) < n_dev) { _cleanup_free_ char *p = NULL; - p = strjoin(prefix, lookahead < n_dev ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " "); + p = strjoin(prefix, lookahead < n_dev ? glyph(GLYPH_TREE_VERTICAL) : " "); if (!p) return -ENOMEM; @@ -158,7 +158,7 @@ int show_sysfs(const char *seat, const char *prefix, unsigned n_columns, OutputF if (dev_list && n_dev > 0) show_sysfs_one(seat, dev_list, &i, n_dev, "/", prefix, n_columns, flags); else - printf("%s%s%s\n", prefix, special_glyph(SPECIAL_GLYPH_TREE_RIGHT), "(none)"); + printf("%s%s%s\n", prefix, glyph(GLYPH_TREE_RIGHT), "(none)"); return 0; } diff --git a/src/measure/measure.c b/src/measure/measure.c index f46000756b1..328b306fea5 100644 --- a/src/measure/measure.c +++ b/src/measure/measure.c @@ -122,7 +122,7 @@ static int help(int argc, char *argv[], void *userdata) { ansi_normal(), ansi_highlight(), ansi_normal(), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT)); + glyph(GLYPH_ARROW_RIGHT)); return 0; } diff --git a/src/network/networkctl-status-link.c b/src/network/networkctl-status-link.c index ae13eba9ae0..c79478495d8 100644 --- a/src/network/networkctl-status-link.c +++ b/src/network/networkctl-status-link.c @@ -232,9 +232,9 @@ static int format_config_files(char ***files, const char *main_config) { STRV_FOREACH(d, *files) { _cleanup_free_ char *s = NULL; - int glyph = *(d + 1) == NULL ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH; + Glyph tree = *(d + 1) == NULL ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH; - s = strjoin(special_glyph(glyph), *d); + s = strjoin(glyph(tree), *d); if (!s) return log_oom(); @@ -918,7 +918,7 @@ static int link_status_one( /* First line: circle, ifindex, ifname. */ printf("%s%s%s %d: %s\n", - on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational, + on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational, info->ifindex, info->name); r = table_print(table, NULL); diff --git a/src/network/networkctl-status-system.c b/src/network/networkctl-status-system.c index f7aa537a386..dbdaa97a19e 100644 --- a/src/network/networkctl-status-system.c +++ b/src/network/networkctl-status-system.c @@ -116,7 +116,7 @@ int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) { return r; printf("%s%s%s Interfaces: %s\n", - on_color_operational, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off_color_operational, + on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational, strna(netifs_joined)); r = table_print(table, NULL); diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 14cf7197bb6..8a8c41eaacd 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2215,7 +2215,7 @@ static int link_update_master(Link *link, sd_netlink_message *message) { log_link_debug(link, "Detached from master interface: %i", link->master_ifindex); else log_link_debug(link, "Master interface changed: %i %s %i", link->master_ifindex, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), master_ifindex); + glyph(GLYPH_ARROW_RIGHT), master_ifindex); link_drop_from_master(link); link->master_ifindex = master_ifindex; @@ -2358,7 +2358,7 @@ static int link_update_hardware_address(Link *link, sd_netlink_message *message) else { log_link_debug(link, "Hardware address is changed: %s %s %s", HW_ADDR_TO_STR(&link->hw_addr), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), HW_ADDR_TO_STR(&addr)); hashmap_remove_value(link->manager->links_by_hw_addr, &link->hw_addr, link); @@ -2456,7 +2456,7 @@ static int link_update_mtu(Link *link, sd_netlink_message *message) { if (link->mtu != 0) log_link_debug(link, "MTU is changed: %"PRIu32" %s %"PRIu32" (min: %"PRIu32", max: %"PRIu32")", - link->mtu, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), mtu, + link->mtu, glyph(GLYPH_ARROW_RIGHT), mtu, link->min_mtu, link->max_mtu); link->mtu = mtu; diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 952516bc78f..1916e441d8f 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -4681,7 +4681,7 @@ static void set_window_title(PTYForward *f) { (void) gethostname_strict(&hn); if (emoji_enabled()) - dot = strjoin(special_glyph(SPECIAL_GLYPH_BLUE_CIRCLE), " "); + dot = strjoin(glyph(GLYPH_BLUE_CIRCLE), " "); if (hn) (void) pty_forward_set_titlef(f, "%sContainer %s on %s", strempty(dot), arg_machine, hn); @@ -6394,13 +6394,13 @@ static int run(int argc, char *argv[]) { (void) terminal_urlify_path(t, t, &u); log_info("%s %sSpawning container %s on %s.%s", - special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal()); + glyph(GLYPH_LIGHT_SHADE), ansi_grey(), arg_machine, u ?: t, ansi_normal()); if (arg_console_mode == CONSOLE_INTERACTIVE) log_info("%s %sPress %sCtrl-]%s three times within 1s to kill container; two times followed by %sr%s\n" "%s %sto reboot container; two times followed by %sp%s to poweroff container.%s", - special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_highlight(), ansi_normal(), - special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal()); + glyph(GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_highlight(), ansi_normal(), + glyph(GLYPH_LIGHT_SHADE), ansi_grey(), ansi_highlight(), ansi_grey(), ansi_normal()); } assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGCHLD, SIGWINCH, SIGTERM, SIGINT, SIGRTMIN+18) >= 0); diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index 1c64ac2fd0d..efcba2543d4 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -165,7 +165,7 @@ static int json_dispatch_address(const char *name, sd_json_variant *variant, sd_ if (b < 0 || b > 0xff) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is out of range 0%s255.", - k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + k, strna(name), glyph(GLYPH_ELLIPSIS)); buf.bytes[k++] = (uint8_t) b; } diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index 0b7697ad69e..bf7437ef141 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -2115,7 +2115,7 @@ static int show_log_table(EventLog *el, sd_json_variant **ret_variant) { r = table_add_many(table, TABLE_UINT32, record->pcr, - TABLE_STRING, special_glyph(SPECIAL_GLYPH_FULL_BLOCK), + TABLE_STRING, glyph(GLYPH_FULL_BLOCK), TABLE_SET_COLOR, color_for_pcr(el, record->pcr), TABLE_STRING, tpm2_pcr_index_to_string(record->pcr)); if (r < 0) @@ -2260,15 +2260,15 @@ static int show_pcr_table(EventLog *el, sd_json_variant **ret_variant) { /* Whether any unmatched components touch this PCR */ bool missing_components = BIT_SET(el->missing_component_pcrs, pcr); - const char *emoji = special_glyph( - !hash_match ? SPECIAL_GLYPH_DEPRESSED_SMILEY : - !fully_recognized ? SPECIAL_GLYPH_UNHAPPY_SMILEY : - missing_components ? SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY : - SPECIAL_GLYPH_HAPPY_SMILEY); + const char *emoji = glyph( + !hash_match ? GLYPH_DEPRESSED_SMILEY : + !fully_recognized ? GLYPH_UNHAPPY_SMILEY : + missing_components ? GLYPH_SLIGHTLY_HAPPY_SMILEY : + GLYPH_HAPPY_SMILEY); r = table_add_many(table, TABLE_UINT32, pcr, - TABLE_STRING, special_glyph(SPECIAL_GLYPH_FULL_BLOCK), + TABLE_STRING, glyph(GLYPH_FULL_BLOCK), TABLE_SET_COLOR, color_for_pcr(el, pcr), TABLE_STRING, emoji, TABLE_STRING, tpm2_pcr_index_to_string(pcr)); @@ -2614,10 +2614,10 @@ static int verb_list_components(int argc, char *argv[], void *userdata) { case BEFORE_LOCATION: if (arg_location_end && strcmp((*c)->id, arg_location_end) >= 0) { loc = AFTER_LOCATION; - marker = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " location '", arg_location_end, "' ", special_glyph(SPECIAL_GLYPH_ARROW_LEFT)); + marker = strjoin(glyph(GLYPH_ARROW_RIGHT), " location '", arg_location_end, "' ", glyph(GLYPH_ARROW_LEFT)); } else if (arg_location_start && strcmp((*c)->id, arg_location_start) >= 0) { loc = BETWEEN_LOCATION; - marker = strjoin(special_glyph(SPECIAL_GLYPH_TREE_TOP), " start location '", arg_location_start, "' ", special_glyph(SPECIAL_GLYPH_ARROW_DOWN)); + marker = strjoin(glyph(GLYPH_TREE_TOP), " start location '", arg_location_start, "' ", glyph(GLYPH_ARROW_DOWN)); } break; @@ -2625,7 +2625,7 @@ static int verb_list_components(int argc, char *argv[], void *userdata) { case BETWEEN_LOCATION: if (arg_location_end && strcmp((*c)->id, arg_location_end) >= 0) { loc = AFTER_LOCATION; - marker = strjoin(special_glyph(SPECIAL_GLYPH_TREE_RIGHT), " end location '", arg_location_end, "' ", special_glyph(SPECIAL_GLYPH_ARROW_UP)); + marker = strjoin(glyph(GLYPH_TREE_RIGHT), " end location '", arg_location_end, "' ", glyph(GLYPH_ARROW_UP)); } break; @@ -4577,7 +4577,7 @@ static int make_policy(bool force, RecoveryPinMode recovery_pin_mode) { if (recovery_pin_mode == RECOVERY_PIN_SHOW) printf("%s Selected recovery PIN is: %s%s%s\n", - special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY), + glyph(GLYPH_LOCK_AND_KEY), ansi_highlight_cyan(), pin, ansi_normal()); diff --git a/src/portable/portable.c b/src/portable/portable.c index 61c13abe12d..15e0156f90f 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -1262,7 +1262,7 @@ static int install_profile_dropin( r = copy_file_atomic(from, dropin, 0644, copy_flags); if (r < 0) - return log_debug_errno(r, "Failed to copy %s %s %s: %m", from, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dropin); + return log_debug_errno(r, "Failed to copy %s %s %s: %m", from, glyph(GLYPH_ARROW_RIGHT), dropin); (void) portable_changes_add(changes, n_changes, PORTABLE_COPY, dropin, from); @@ -1273,7 +1273,7 @@ static int install_profile_dropin( else r = RET_NERRNO(symlink(from, dropin)); if (r < 0) - return log_debug_errno(r, "Failed to link %s %s %s: %m", from, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dropin); + return log_debug_errno(r, "Failed to link %s %s %s: %m", from, glyph(GLYPH_ARROW_RIGHT), dropin); (void) portable_changes_add(changes, n_changes, PORTABLE_SYMLINK, dropin, from); } @@ -1472,7 +1472,7 @@ static int install_image( r, "Failed to copy %s %s %s: %m", image_path, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), target); } else { @@ -1481,7 +1481,7 @@ static int install_image( errno, "Failed to link %s %s %s: %m", image_path, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), target); } diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index b5678e094b8..6624f36299c 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -533,12 +533,12 @@ static int print_changes(sd_bus_message *m) { break; if (streq(type, "symlink")) - log_info("Created symlink %s %s %s.", path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), source); + log_info("Created symlink %s %s %s.", path, glyph(GLYPH_ARROW_RIGHT), source); else if (streq(type, "copy")) { if (isempty(source)) log_info("Copied %s.", path); else - log_info("Copied %s %s %s.", source, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), path); + log_info("Copied %s %s %s.", source, glyph(GLYPH_ARROW_RIGHT), path); } else if (streq(type, "unlink")) log_info("Removed %s.", path); else if (streq(type, "write")) diff --git a/src/repart/repart.c b/src/repart/repart.c index 9827d032b5c..0526c4c803b 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -1658,7 +1658,7 @@ static int config_parse_size4096( if (*sz != parsed) log_syntax(unit, LOG_NOTICE, filename, line, r, "Rounded %s= size %" PRIu64 " %s %" PRIu64 ", a multiple of 4096.", - lvalue, parsed, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), *sz); + lvalue, parsed, glyph(GLYPH_ARROW_RIGHT), *sz); return 0; } @@ -3491,9 +3491,9 @@ static int format_size_change(uint64_t from, uint64_t to, char **ret) { if (from == to || to == UINT64_MAX) t = strdup(FORMAT_BYTES(from)); else - t = strjoin(FORMAT_BYTES(from), " ", special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to)); + t = strjoin(FORMAT_BYTES(from), " ", glyph(GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to)); } else if (to != UINT64_MAX) - t = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to)); + t = strjoin(glyph(GLYPH_ARROW_RIGHT), " ", FORMAT_BYTES(to)); else { *ret = NULL; return 0; @@ -3641,8 +3641,8 @@ static int context_dump_partitions(Context *context) { if (!sd_json_format_enabled(arg_json_format_flags) && (sum_padding > 0 || sum_size > 0)) { const char *a, *b; - a = strjoina(special_glyph(SPECIAL_GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_size)); - b = strjoina(special_glyph(SPECIAL_GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_padding)); + a = strjoina(glyph(GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_size)); + b = strjoina(glyph(GLYPH_SIGMA), " = ", FORMAT_BYTES(sum_padding)); r = table_add_many( t, @@ -3804,10 +3804,10 @@ static int context_dump_partition_bar(Context *context) { z = !z; fputs(z ? ansi_green() : ansi_yellow(), stdout); - fputs(special_glyph(SPECIAL_GLYPH_DARK_SHADE), stdout); + fputs(glyph(GLYPH_DARK_SHADE), stdout); } else { fputs(ansi_normal(), stdout); - fputs(special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), stdout); + fputs(glyph(GLYPH_LIGHT_SHADE), stdout); } last = bar[i]; @@ -3838,16 +3838,16 @@ static int context_dump_partition_bar(Context *context) { const char *e; /* Upgrade final corner to the right with a branch to the right */ - e = startswith(line[start_array[j-1]], special_glyph(SPECIAL_GLYPH_TREE_RIGHT)); + e = startswith(line[start_array[j-1]], glyph(GLYPH_TREE_RIGHT)); if (e) { - d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_BRANCH), e); + d = strjoin(glyph(GLYPH_TREE_BRANCH), e); if (!d) return log_oom(); } } if (!d) { - d = strdup(special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)); + d = strdup(glyph(GLYPH_TREE_VERTICAL)); if (!d) return log_oom(); } @@ -3857,10 +3857,10 @@ static int context_dump_partition_bar(Context *context) { (void) partition_hint(p, context->node, &hint); - if (streq_ptr(line[start_array[j-1]], special_glyph(SPECIAL_GLYPH_TREE_VERTICAL))) - d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_BRANCH), " ", strna(hint)); + if (streq_ptr(line[start_array[j-1]], glyph(GLYPH_TREE_VERTICAL))) + d = strjoin(glyph(GLYPH_TREE_BRANCH), " ", strna(hint)); else - d = strjoin(special_glyph(SPECIAL_GLYPH_TREE_RIGHT), " ", strna(hint)); + d = strjoin(glyph(GLYPH_TREE_RIGHT), " ", strna(hint)); if (!d) return log_oom(); @@ -5163,7 +5163,7 @@ static int progress_bytes(uint64_t n_bytes, void *userdata) { 100.0 * (double) p->copy_blocks_done / (double) p->copy_blocks_size, "%s %s %s %s/%s", strna(p->copy_blocks_path), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), strna(p->definition_path), FORMAT_BYTES(p->copy_blocks_done), FORMAT_BYTES(p->copy_blocks_size)); @@ -8274,7 +8274,7 @@ static int parse_argv(int argc, char *argv[], X509 **ret_certificate, EVP_PKEY * if (rounded != parsed) log_warning("Specified size is not a multiple of 4096, rounding up automatically. (%" PRIu64 " %s %" PRIu64 ")", - parsed, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), rounded); + parsed, glyph(GLYPH_ARROW_RIGHT), rounded); arg_size = rounded; arg_size_auto = false; diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index b34ade13788..f02fd137776 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -2824,7 +2824,7 @@ static int print_question(char prefix, const char *color, sd_json_variant *quest printf("%s%s %c%s: %s\n", color, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), prefix, ansi_normal(), dns_resource_key_to_string(key, buf, sizeof(buf))); @@ -2868,7 +2868,7 @@ static int print_answer(sd_json_variant *answer) { printf("%s%s A%s: %s\n", ansi_highlight_yellow(), - special_glyph(SPECIAL_GLYPH_ARROW_LEFT), + glyph(GLYPH_ARROW_LEFT), ansi_normal(), s); } @@ -2928,7 +2928,7 @@ static void monitor_query_dump(sd_json_variant *v) { printf("%s%s S%s: %s", streq_ptr(p.state, "success") ? ansi_highlight_green() : ansi_highlight_red(), - special_glyph(SPECIAL_GLYPH_ARROW_LEFT), + glyph(GLYPH_ARROW_LEFT), ansi_normal(), strna(streq_ptr(p.state, "errno") ? errno_to_name(p.error) : streq_ptr(p.state, "rcode-failure") ? dns_rcode_to_string(p.rcode) : diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index 4867ff0426e..f0004671530 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -1155,7 +1155,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname) if (r > 0) log_debug("Following CNAME/DNAME %s %s %s.", dns_question_first_name(q->question_idna), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), dns_question_first_name(nq_idna)); k = dns_question_is_equal(q->question_idna, q->question_utf8); @@ -1172,7 +1172,7 @@ static int dns_query_cname_redirect(DnsQuery *q, const DnsResourceRecord *cname) if (k > 0) log_debug("Following UTF8 CNAME/DNAME %s %s %s.", dns_question_first_name(q->question_utf8), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), dns_question_first_name(nq_utf8)); } diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 9e539a54f3a..3e26f8390ef 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -2772,7 +2772,7 @@ int dns_transaction_request_dnssec_keys(DnsTransaction *t) { _cleanup_(dns_resource_key_unrefp) DnsResourceKey *ds = NULL; log_debug("Requesting DS (%s %s) to validate transaction %" PRIu16 " (%s empty response).", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), name, t->id, + glyph(GLYPH_ARROW_RIGHT), name, t->id, dns_resource_key_name(dns_transaction_key(t))); ds = dns_resource_key_new(dns_transaction_key(t)->class, DNS_TYPE_DS, name); diff --git a/src/resolve/resolved-varlink.c b/src/resolve/resolved-varlink.c index 74a437e5d56..a69cfb7f2df 100644 --- a/src/resolve/resolved-varlink.c +++ b/src/resolve/resolved-varlink.c @@ -398,7 +398,7 @@ static int json_dispatch_address(const char *name, sd_json_variant *variant, sd_ if (b < 0 || b > 0xff) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "Element %zu of JSON field '%s' is out of range 0%s255.", - k, strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + k, strna(name), glyph(GLYPH_ELLIPSIS)); buf.bytes[k++] = (uint8_t) b; } diff --git a/src/run-generator/run-generator.c b/src/run-generator/run-generator.c index 5692b7a58ef..089790104e3 100644 --- a/src/run-generator/run-generator.c +++ b/src/run-generator/run-generator.c @@ -118,7 +118,7 @@ static int generate(void) { p = strjoina(arg_dest, "/" SPECIAL_DEFAULT_TARGET); if (symlink("kernel-command-line.target", p) < 0) return log_error_errno(errno, "Failed to link unit file kernel-command-line.target %s %s: %m", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), p); + glyph(GLYPH_ARROW_RIGHT), p); return 0; } diff --git a/src/run/run.c b/src/run/run.c index c5578b0157e..acec362a40b 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1101,7 +1101,7 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) { if (!arg_shell_prompt_prefix) return log_oom(); } else if (emoji_enabled()) { - arg_shell_prompt_prefix = strjoin(special_glyph(privileged_execution() ? SPECIAL_GLYPH_SUPERHERO : SPECIAL_GLYPH_IDCARD), " "); + arg_shell_prompt_prefix = strjoin(glyph(privileged_execution() ? GLYPH_SUPERHERO : GLYPH_IDCARD), " "); if (!arg_shell_prompt_prefix) return log_oom(); } @@ -1988,7 +1988,7 @@ static void set_window_title(PTYForward *f) { return (void) log_oom(); if (emoji_enabled()) - dot = strjoin(special_glyph(privileged_execution() ? SPECIAL_GLYPH_RED_CIRCLE : SPECIAL_GLYPH_YELLOW_CIRCLE), " "); + dot = strjoin(glyph(privileged_execution() ? GLYPH_RED_CIRCLE : GLYPH_YELLOW_CIRCLE), " "); if (arg_host || hn) (void) pty_forward_set_titlef(f, "%s%s on %s", strempty(dot), cl, arg_host ?: hn); diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index d1a4f24661e..62a99eb7a08 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -506,7 +506,7 @@ int ask_password_tty( const char *keyring = req->keyring; if (!FLAGS_SET(flags, ASK_PASSWORD_HIDE_EMOJI) && emoji_enabled()) - message = strjoina(special_glyph(SPECIAL_GLYPH_LOCK_AND_KEY), " ", message); + message = strjoina(glyph(GLYPH_LOCK_AND_KEY), " ", message); if (req->flag_file || (FLAGS_SET(flags, ASK_PASSWORD_ACCEPT_CACHED) && keyring)) { inotify_fd = inotify_init1(IN_CLOEXEC|IN_NONBLOCK); @@ -761,7 +761,7 @@ int ask_password_tty( (void) loop_write(ttyfd, passphrase + codepoint, n); else (void) loop_write(ttyfd, - special_glyph(SPECIAL_GLYPH_BULLET), + glyph(GLYPH_BULLET), SIZE_MAX); codepoint = p; } diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 12d2a9d1472..c0f97aff0e1 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1664,7 +1664,7 @@ static void print_addon( const char *addon_str) { printf(" %s: %s\n", addon_str, addon->location); - printf(" options: %s%s\n", special_glyph(SPECIAL_GLYPH_TREE_RIGHT), addon->cmdline); + printf(" options: %s%s\n", glyph(GLYPH_TREE_RIGHT), addon->cmdline); } static int indent_embedded_newlines(char *cmdline, char **ret_cmdline) { diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c index 4d6f2be3c48..ff4852150be 100644 --- a/src/shared/bus-unit-procs.c +++ b/src/shared/bus-unit-procs.c @@ -188,7 +188,7 @@ static int dump_processes( } more = i+1 < n || cg->children; - special = special_glyph(more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT); + special = glyph(more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT); fprintf(stdout, "%s%s%s%*"PID_PRI" %s%s\n", prefix, @@ -225,14 +225,14 @@ static int dump_processes( name++; more = i+1 < n; - special = special_glyph(more ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT); + special = glyph(more ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT); fputs(prefix, stdout); fputs(special, stdout); fputs(name, stdout); fputc('\n', stdout); - special = special_glyph(more ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE); + special = glyph(more ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE); pp = strjoin(prefix, special); if (!pp) @@ -314,7 +314,7 @@ static int dump_extra_processes( fprintf(stdout, "%s%s %*" PID_PRI " %s\n", prefix, - special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), + glyph(GLYPH_TRIANGULAR_BULLET), width, pids[k], name); } diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index 3d7e936a91e..21d72ea0dcf 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -71,9 +71,9 @@ static void show_pid_array( &t); if (extra) - printf("%s%s ", prefix, special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET)); + printf("%s%s ", prefix, glyph(GLYPH_TRIANGULAR_BULLET)); else - printf("%s%s", prefix, special_glyph(((more || i < n_pids-1) ? SPECIAL_GLYPH_TREE_BRANCH : SPECIAL_GLYPH_TREE_RIGHT))); + printf("%s%s", prefix, glyph(((more || i < n_pids-1) ? GLYPH_TREE_BRANCH : GLYPH_TREE_RIGHT))); printf("%s%*"PID_PRI" %s%s\n", ansi_grey(), (int) pid_width, pids[i], strna(t), ansi_normal()); } @@ -132,7 +132,7 @@ static int show_cgroup_one_by_path( static int show_cgroup_name( const char *path, const char *prefix, - SpecialGlyph glyph, + Glyph tree, OutputFlags flags) { uint64_t cgroupid = UINT64_MAX; @@ -161,7 +161,7 @@ static int show_cgroup_name( return log_error_errno(r, "Failed to extract filename from cgroup path: %m"); printf("%s%s%s%s%s", - prefix, special_glyph(glyph), + prefix, glyph(tree), delegate ? ansi_underline() : "", cg_unescape(b), delegate ? ansi_normal() : ""); @@ -169,7 +169,7 @@ static int show_cgroup_name( if (delegate) printf(" %s%s%s", ansi_highlight(), - special_glyph(SPECIAL_GLYPH_ELLIPSIS), + glyph(GLYPH_ELLIPSIS), ansi_normal()); if (cgroupid != UINT64_MAX) @@ -207,8 +207,8 @@ static int show_cgroup_name( printf("%s%s%s %s%s%s: %s\n", prefix, - glyph == SPECIAL_GLYPH_TREE_BRANCH ? special_glyph(SPECIAL_GLYPH_TREE_VERTICAL) : " ", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + tree == GLYPH_TREE_BRANCH ? glyph(GLYPH_TREE_VERTICAL) : " ", + glyph(GLYPH_ARROW_RIGHT), ansi_blue(), x, ansi_normal(), y); } @@ -261,12 +261,12 @@ int show_cgroup_by_path( } if (last) { - r = show_cgroup_name(last, prefix, SPECIAL_GLYPH_TREE_BRANCH, flags); + r = show_cgroup_name(last, prefix, GLYPH_TREE_BRANCH, flags); if (r < 0) return r; if (!p1) { - p1 = strjoin(prefix, special_glyph(SPECIAL_GLYPH_TREE_VERTICAL)); + p1 = strjoin(prefix, glyph(GLYPH_TREE_VERTICAL)); if (!p1) return -ENOMEM; } @@ -285,7 +285,7 @@ int show_cgroup_by_path( (void) show_cgroup_one_by_path(path, prefix, n_columns, !!last, flags); if (last) { - r = show_cgroup_name(last, prefix, SPECIAL_GLYPH_TREE_RIGHT, flags); + r = show_cgroup_name(last, prefix, GLYPH_TREE_RIGHT, flags); if (r < 0) return r; diff --git a/src/shared/devnode-acl.c b/src/shared/devnode-acl.c index b239699e8ac..2015bd76416 100644 --- a/src/shared/devnode-acl.c +++ b/src/shared/devnode-acl.c @@ -212,7 +212,7 @@ int devnode_acl_all(const char *seat, int k; log_debug("Changing ACLs at %s for seat %s (uid "UID_FMT"%s"UID_FMT"%s%s)", - n, seat, old_uid, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), new_uid, + n, seat, old_uid, glyph(GLYPH_ARROW_RIGHT), new_uid, del ? " del" : "", add ? " add" : ""); k = devnode_acl(n, flush, del, old_uid, add, new_uid); diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index 9f72b38c8ce..f6143922623 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -1386,7 +1386,7 @@ int dns_name_apply_idna(const char *name, char **ret) { r = sym_idn2_lookup_u8((uint8_t*) name, (uint8_t**) &t, IDN2_NFC_INPUT | IDN2_TRANSITIONAL); - log_debug("idn2_lookup_u8: %s %s %s", name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), t); + log_debug("idn2_lookup_u8: %s %s %s", name, glyph(GLYPH_ARROW_RIGHT), t); if (r == IDN2_OK) { if (!startswith(name, "xn--")) { _cleanup_free_ char *s = NULL; @@ -1401,8 +1401,8 @@ int dns_name_apply_idna(const char *name, char **ret) { if (!streq_ptr(name, s)) { log_debug("idn2 roundtrip failed: \"%s\" %s \"%s\" %s \"%s\", ignoring.", - name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), t, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), s); + name, glyph(GLYPH_ARROW_RIGHT), t, + glyph(GLYPH_ARROW_RIGHT), s); *ret = NULL; return 0; } diff --git a/src/shared/format-table.c b/src/shared/format-table.c index e30cdb55077..a6d07139815 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -1651,7 +1651,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas return yes_no(d->boolean); case TABLE_BOOLEAN_CHECKMARK: - return special_glyph(d->boolean ? SPECIAL_GLYPH_CHECK_MARK : SPECIAL_GLYPH_CROSS_MARK); + return glyph(d->boolean ? GLYPH_CHECK_MARK : GLYPH_CROSS_MARK); case TABLE_TIMESTAMP: case TABLE_TIMESTAMP_UTC: @@ -2341,7 +2341,7 @@ int table_print(Table *t, FILE *f) { req_width = MAX(req_width, utf8_console_width(last) + - utf8_console_width(special_glyph(SPECIAL_GLYPH_ELLIPSIS))); + utf8_console_width(glyph(GLYPH_ELLIPSIS))); } /* Determine the biggest width that any cell in this column would like to have */ @@ -2563,7 +2563,7 @@ int table_print(Table *t, FILE *f) { * right after. This will truncate the ellipsis and add a new * one. */ - padded = strjoin(field, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + padded = strjoin(field, glyph(GLYPH_ELLIPSIS)); if (!padded) return -ENOMEM; diff --git a/src/shared/install.c b/src/shared/install.c index 6d87858a3ce..cbbf8b0706a 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -348,7 +348,7 @@ static void install_change_dump_success(const InstallChange *change) { case INSTALL_CHANGE_SYMLINK: return log_info("Created symlink '%s' %s '%s'.", - change->path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), change->source); + change->path, glyph(GLYPH_ARROW_RIGHT), change->source); case INSTALL_CHANGE_UNLINK: return log_info("Removed '%s'.", change->path); @@ -604,7 +604,7 @@ static int create_symlink( if (chroot_unit_symlinks_equivalent(lp, new_path, dest, old_path)) { log_debug("Symlink %s %s %s already exists", - new_path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dest); + new_path, glyph(GLYPH_ARROW_RIGHT), dest); return 1; } diff --git a/src/shared/libfido2-util.c b/src/shared/libfido2-util.c index 9cce9fa5120..48140ade21d 100644 --- a/src/shared/libfido2-util.c +++ b/src/shared/libfido2-util.c @@ -447,7 +447,7 @@ static int fido2_use_hmac_hash_specific_token( if (FLAGS_SET(required, FIDO2ENROLL_UP)) log_notice("%s%sPlease confirm presence on security token to unlock.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); } @@ -461,7 +461,7 @@ static int fido2_use_hmac_hash_specific_token( if (FLAGS_SET(required, FIDO2ENROLL_UV)) log_notice("%s%sPlease verify user on security token to unlock.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); } @@ -500,7 +500,7 @@ static int fido2_use_hmac_hash_specific_token( if (FLAGS_SET(required, FIDO2ENROLL_UP_IF_NEEDED)) { log_notice("%s%sPlease confirm presence on security to unlock.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); retry_with_up = true; } @@ -513,7 +513,7 @@ static int fido2_use_hmac_hash_specific_token( if (has_up && (required & (FIDO2ENROLL_UP|FIDO2ENROLL_UP_IF_NEEDED)) == FIDO2ENROLL_UP_IF_NEEDED) { log_notice("%s%sGot unsupported option error when user presence test is turned off. Trying with user presence test turned on.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); retry_with_up = true; } @@ -834,7 +834,7 @@ int fido2_generate_hmac_hash( if (has_uv || has_up) log_notice("%s%s(Hint: This might require confirmation of user presence on security token.)", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); /* If we are using the user PIN, then we must pass that PIN to the get_assertion call below, or @@ -952,7 +952,7 @@ int fido2_generate_hmac_hash( if (FLAGS_SET(lock_with, FIDO2ENROLL_UP)) log_notice("%s%sIn order to allow secret key generation, please confirm presence on security token.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); } @@ -966,7 +966,7 @@ int fido2_generate_hmac_hash( if (FLAGS_SET(lock_with, FIDO2ENROLL_UV)) log_notice("%s%sIn order to allow secret key generation, please verify user on security token.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); } @@ -990,7 +990,7 @@ int fido2_generate_hmac_hash( "Token asks for user presence test but was already enabled."); log_notice("%s%sLocking without user presence test requested, but FIDO2 device %s requires it, enabling.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : "", device); @@ -1006,7 +1006,7 @@ int fido2_generate_hmac_hash( if (has_up && !FLAGS_SET(lock_with, FIDO2ENROLL_UP)) { log_notice("%s%sGot unsupported option error when user presence test is turned off. Trying with user presence test turned on.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_TOUCH) : "", + emoji_enabled() ? glyph(GLYPH_TOUCH) : "", emoji_enabled() ? " " : ""); retry_with_up = true; } @@ -1192,7 +1192,7 @@ int fido2_list_devices(void) { "%1$s UP %2$s User presence%3$s\n" "%1$s UV %2$s User verification%3$s\n", ansi_grey(), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), ansi_normal()); r = 0; diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 41a3a5adc57..cc66503819f 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -61,7 +61,7 @@ static int print_catalog(FILE *f, sd_journal *j) { return log_error_errno(r, "Failed to find catalog entry: %m"); if (is_locale_utf8()) - prefix = strjoina(special_glyph(SPECIAL_GLYPH_LIGHT_SHADE), special_glyph(SPECIAL_GLYPH_LIGHT_SHADE)); + prefix = strjoina(glyph(GLYPH_LIGHT_SHADE), glyph(GLYPH_LIGHT_SHADE)); else prefix = "--"; @@ -694,7 +694,7 @@ static int output_short( if (c) { _cleanup_free_ char *urlified = NULL; - if (terminal_urlify(c, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK), &urlified) >= 0) { + if (terminal_urlify(c, glyph(GLYPH_EXTERNAL_LINK), &urlified) >= 0) { fputs(urlified, f); fputc(' ', f); } diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index b43ea73b9b1..97ff6d0764d 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -714,7 +714,7 @@ int mount_verbose_full( what, where, strnull(fl), strempty(o)); else if (f & MS_MOVE) log_debug("Moving mount %s %s %s (%s \"%s\")...", - what, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), where, strnull(fl), strempty(o)); + what, glyph(GLYPH_ARROW_RIGHT), where, strnull(fl), strempty(o)); else log_debug("Mounting %s (%s) on %s (%s \"%s\")...", strna(what), strna(type), where, strnull(fl), strempty(o)); diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c index 4eb4858931e..5457a807018 100644 --- a/src/shared/pretty-print.c +++ b/src/shared/pretty-print.c @@ -525,14 +525,14 @@ void draw_progress_bar_unbuffered(const char *prefix, double percentage) { fprintf(stderr, "\x1B[38;2;%u;%u;%um", r8, g8, b8); } - fputs(special_glyph(SPECIAL_GLYPH_HORIZONTAL_FAT), stderr); + fputs(glyph(GLYPH_HORIZONTAL_FAT), stderr); } else if (i+1 < length && !separator_done) { fputs(ansi_normal(), stderr); fputc(' ', stderr); separator_done = true; fputs(ansi_grey(), stderr); } else - fputs(special_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED), stderr); + fputs(glyph(GLYPH_HORIZONTAL_DOTTED), stderr); } fputs(ansi_normal(), stderr); diff --git a/src/shared/pretty-print.h b/src/shared/pretty-print.h index 8ea1e964a3f..fbfccb0a2e5 100644 --- a/src/shared/pretty-print.h +++ b/src/shared/pretty-print.h @@ -34,13 +34,13 @@ int conf_files_cat(const char *root, const char *name, CatFlags flags); static inline const char* red_cross_mark_internal(char buffer[static RED_CROSS_MARK_MAX]) { assert(buffer); - assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_red()), special_glyph(SPECIAL_GLYPH_CROSS_MARK)), ansi_normal()) < buffer + RED_CROSS_MARK_MAX); + assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_red()), glyph(GLYPH_CROSS_MARK)), ansi_normal()) < buffer + RED_CROSS_MARK_MAX); return buffer; } static inline const char* green_check_mark_internal(char buffer[static GREEN_CHECK_MARK_MAX]) { assert(buffer); - assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_green()), special_glyph(SPECIAL_GLYPH_CHECK_MARK)), ansi_normal()) < buffer + GREEN_CHECK_MARK_MAX); + assert_se(stpcpy(stpcpy(stpcpy(buffer, ansi_highlight_green()), glyph(GLYPH_CHECK_MARK)), ansi_normal()) < buffer + GREEN_CHECK_MARK_MAX); return buffer; } diff --git a/src/shared/unit-file.c b/src/shared/unit-file.c index 01e10c596d6..77985c79179 100644 --- a/src/shared/unit-file.c +++ b/src/shared/unit-file.c @@ -338,12 +338,12 @@ int unit_file_resolve_symlink( return r; if (is_path(tail)) log_warning("Suspicious symlink %s/%s %s %s, treating as alias.", - dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified); + dir, filename, glyph(GLYPH_ARROW_RIGHT), simplified); dst = resolve_destination_target ? TAKE_PTR(simplified) : TAKE_PTR(target_name); } else { - log_debug("Linked unit file: %s/%s %s %s", dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified); + log_debug("Linked unit file: %s/%s %s %s", dir, filename, glyph(GLYPH_ARROW_RIGHT), simplified); if (resolve_destination_target) dst = TAKE_PTR(simplified); @@ -559,7 +559,7 @@ int unit_file_build_name_map( r = hashmap_ensure_put(&ids, &string_hash_ops_free_free, key, dst); if (r < 0) return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m", - de->d_name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dst); + de->d_name, glyph(GLYPH_ARROW_RIGHT), dst); key = dst = NULL; } } @@ -602,7 +602,7 @@ int unit_file_build_name_map( r = string_strv_hashmap_put(&names, dst, src); if (r < 0) return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m", - dst, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), src); + dst, glyph(GLYPH_ARROW_RIGHT), src); } if (cache_timestamp_hash) diff --git a/src/shared/user-record-show.c b/src/shared/user-record-show.c index 7a45c6048d2..5f8ad9ca0bf 100644 --- a/src/shared/user-record-show.c +++ b/src/shared/user-record-show.c @@ -298,7 +298,7 @@ void user_record_show(UserRecord *hr, bool show_full_group_info) { hash = hexmem(hash_bytes, SHA256_DIGEST_SIZE); printf(" %s %s %s(%s)%s\n", - special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH), + glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH), link ?: filename, ansi_grey(), hash ?: "can't display hash", diff --git a/src/shared/user-record.c b/src/shared/user-record.c index 2744d146f7f..4ce48066f97 100644 --- a/src/shared/user-record.c +++ b/src/shared/user-record.c @@ -473,7 +473,7 @@ static int json_dispatch_umask(const char *name, sd_json_variant *variant, sd_js if (k > 0777) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' outside of valid range 0%s0777.", - strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + strna(name), glyph(GLYPH_ELLIPSIS)); *m = (mode_t) k; return 0; @@ -495,7 +495,7 @@ static int json_dispatch_access_mode(const char *name, sd_json_variant *variant, if (k > 07777) return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' outside of valid range 0%s07777.", - strna(name), special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + strna(name), glyph(GLYPH_ELLIPSIS)); *m = (mode_t) k; return 0; @@ -575,7 +575,7 @@ static int json_dispatch_tasks_or_memory_max(const char *name, sd_json_variant * if (k <= 0 || k >= UINT64_MAX) return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".", - strna(name), (uint64_t) 1, special_glyph(SPECIAL_GLYPH_ELLIPSIS), UINT64_MAX-1); + strna(name), (uint64_t) 1, glyph(GLYPH_ELLIPSIS), UINT64_MAX-1); *limit = k; return 0; @@ -597,7 +597,7 @@ static int json_dispatch_weight(const char *name, sd_json_variant *variant, sd_j return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "JSON field '%s' is not in valid range %" PRIu64 "%s%" PRIu64 ".", strna(name), (uint64_t) CGROUP_WEIGHT_MIN, - special_glyph(SPECIAL_GLYPH_ELLIPSIS), (uint64_t) CGROUP_WEIGHT_MAX); + glyph(GLYPH_ELLIPSIS), (uint64_t) CGROUP_WEIGHT_MAX); *weight = k; return 0; @@ -983,7 +983,7 @@ static int dispatch_rebalance_weight(const char *name, sd_json_variant *variant, else return json_log(variant, flags, SYNTHETIC_ERRNO(ERANGE), "Rebalance weight is out of valid range %" PRIu64 "%s%" PRIu64 ".", - REBALANCE_WEIGHT_MIN, special_glyph(SPECIAL_GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX); + REBALANCE_WEIGHT_MIN, glyph(GLYPH_ELLIPSIS), REBALANCE_WEIGHT_MAX); return 0; } diff --git a/src/storagetm/storagetm.c b/src/storagetm/storagetm.c index 1b703218a47..1e3f10ca0a9 100644 --- a/src/storagetm/storagetm.c +++ b/src/storagetm/storagetm.c @@ -706,8 +706,8 @@ static int nvme_subsystem_report(NvmeSubsystem *subsystem, NvmePort *ipv4, NvmeP return log_error_errno(n_addresses, "Failed to determine local IP addresses: %m"); log_notice("NVMe-TCP: %s %s%s%s (%s)", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_COMPUTER_DISK) : "", emoji_enabled() ? " " : "", + glyph(GLYPH_ARROW_RIGHT), + emoji_enabled() ? glyph(GLYPH_COMPUTER_DISK) : "", emoji_enabled() ? " " : "", subsystem->name, subsystem->device); FOREACH_ARRAY(a, addresses, n_addresses) { @@ -717,7 +717,7 @@ static int nvme_subsystem_report(NvmeSubsystem *subsystem, NvmePort *ipv4, NvmeP continue; log_info(" %s Try for specific device: nvme connect -t tcp -n '%s' -a %s -s %" PRIu16, - special_glyph(a >= addresses + (n_addresses - 1) ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH), + glyph(a >= addresses + (n_addresses - 1) ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH), subsystem->name, IN_ADDR_TO_STRING(a->family, &a->address), port->portnr); @@ -771,14 +771,14 @@ static int nvme_port_report(NvmePort *port, bool *plymouth_done) { return log_error_errno(n_addresses, "Failed to determine local IP addresses: %m"); log_notice("NVMe-TCP: %s %s%sListening on %s (port %" PRIu16 ")", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_WORLD) : "", emoji_enabled() ? " " : "", + glyph(GLYPH_ARROW_RIGHT), + emoji_enabled() ? glyph(GLYPH_WORLD) : "", emoji_enabled() ? " " : "", af_to_ipv4_ipv6(port->ip_family), port->portnr); FOREACH_ARRAY(a, addresses, n_addresses) log_info(" %s Try for all devices: nvme connect-all -t tcp -a %s -s %" PRIu16, - special_glyph(a >= addresses + (n_addresses - 1) ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH), + glyph(a >= addresses + (n_addresses - 1) ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH), IN_ADDR_TO_STRING(a->family, &a->address), port->portnr); diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c index 537b6cbb45a..c46bd5ea2dc 100644 --- a/src/systemctl/systemctl-enable.c +++ b/src/systemctl/systemctl-enable.c @@ -278,7 +278,7 @@ int verb_enable(int argc, char *argv[], void *userdata) { " D-Bus, udev, scripted systemctl call, ...).\n" "%1$s In case of template units, the unit is meant to be enabled with some\n" " instance name specified.", - special_glyph(SPECIAL_GLYPH_BULLET)); + glyph(GLYPH_BULLET)); if (streq(verb, "disable") && arg_runtime_scope == RUNTIME_SCOPE_USER && !arg_quiet && !arg_no_warn) { /* If some of the units are disabled in user scope but still enabled in global scope, diff --git a/src/systemctl/systemctl-list-dependencies.c b/src/systemctl/systemctl-list-dependencies.c index 4ceba1c891f..335e32f71c4 100644 --- a/src/systemctl/systemctl-list-dependencies.c +++ b/src/systemctl/systemctl-list-dependencies.c @@ -36,7 +36,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int on = ansi_highlight_red(); } - printf("%s%s%s ", on, special_glyph(unit_active_state_to_glyph(state)), ansi_normal()); + printf("%s%s%s ", on, glyph(unit_active_state_to_glyph(state)), ansi_normal()); } if (!arg_plain) { @@ -46,7 +46,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int printf("%s...\n",max_len % 2 ? "" : " "); return 0; } - printf("%s", special_glyph(branches & (1 << i) ? SPECIAL_GLYPH_TREE_VERTICAL : SPECIAL_GLYPH_TREE_SPACE)); + printf("%s", glyph(branches & (1 << i) ? GLYPH_TREE_VERTICAL : GLYPH_TREE_SPACE)); } len += 2; @@ -55,7 +55,7 @@ static int list_dependencies_print(const char *name, UnitActiveState state, int return 0; } - printf("%s", special_glyph(last ? SPECIAL_GLYPH_TREE_RIGHT : SPECIAL_GLYPH_TREE_BRANCH)); + printf("%s", glyph(last ? GLYPH_TREE_RIGHT : GLYPH_TREE_BRANCH)); } if (arg_full) { diff --git a/src/systemctl/systemctl-list-jobs.c b/src/systemctl/systemctl-list-jobs.c index 44054fda007..098914b5d3b 100644 --- a/src/systemctl/systemctl-list-jobs.c +++ b/src/systemctl/systemctl-list-jobs.c @@ -33,7 +33,7 @@ static int output_waiting_jobs(sd_bus *bus, Table *table, uint32_t id, const cha return log_oom(); r = table_add_many(table, - TABLE_STRING, special_glyph(SPECIAL_GLYPH_TREE_RIGHT), + TABLE_STRING, glyph(GLYPH_TREE_RIGHT), TABLE_STRING, row, TABLE_EMPTY, TABLE_EMPTY); diff --git a/src/systemctl/systemctl-list-machines.c b/src/systemctl/systemctl-list-machines.c index 1926b386911..e53f314c8f0 100644 --- a/src/systemctl/systemctl-list-machines.c +++ b/src/systemctl/systemctl-list-machines.c @@ -200,7 +200,7 @@ static int output_machines_list(struct machine_info *machine_infos, unsigned n) mname = strjoin(strna(m->name), " (host)"); r = table_add_many(table, - TABLE_STRING, circle ? special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE) : " ", + TABLE_STRING, circle ? glyph(GLYPH_BLACK_CIRCLE) : " ", TABLE_SET_COLOR, on_state, TABLE_STRING, m->is_host ? mname : strna(m->name), TABLE_STRING, strna(m->state), diff --git a/src/systemctl/systemctl-list-units.c b/src/systemctl/systemctl-list-units.c index b7cb103513d..c284be9f0d4 100644 --- a/src/systemctl/systemctl-list-units.c +++ b/src/systemctl/systemctl-list-units.c @@ -173,7 +173,7 @@ static int output_units_list(const UnitInfo *unit_infos, size_t c) { return log_oom(); r = table_add_many(table, - TABLE_STRING, circle ? special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE) : " ", + TABLE_STRING, circle ? glyph(GLYPH_BLACK_CIRCLE) : " ", TABLE_SET_COLOR, on_circle, TABLE_SET_BOTH_UNDERLINES, underline, TABLE_STRING, id, @@ -220,12 +220,12 @@ static int output_units_list(const UnitInfo *unit_infos, size_t c) { "%1$s ACTIVE %2$s The high-level unit activation state, i.e. generalization of SUB.%3$s\n" "%1$s SUB %2$s The low-level unit activation state, values depend on unit type.%3$s\n", ansi_grey(), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), ansi_normal()); if (job_count > 0) printf("%s JOB %s Pending job for the unit.%s\n", ansi_grey(), - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), ansi_normal()); } diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index bd61412cca6..dcf560e3be7 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -346,9 +346,9 @@ static void print_status_info( format_enable_state(i->unit_file_state, &enable_on, &enable_off); format_enable_state(i->unit_file_preset, &preset_on, &preset_off); - const SpecialGlyph glyph = unit_active_state_to_glyph(unit_active_state_from_string(i->active_state)); + const Glyph icon = unit_active_state_to_glyph(unit_active_state_from_string(i->active_state)); - printf("%s%s%s %s", active_on, special_glyph(glyph), active_off, strna(i->id)); + printf("%s%s%s %s", active_on, glyph(icon), active_off, strna(i->id)); if (i->description && !streq_ptr(i->id, i->description)) printf(" - %s", i->description); @@ -414,7 +414,7 @@ static void print_status_info( printf("%s\n" " %s", dir, - special_glyph(SPECIAL_GLYPH_TREE_RIGHT)); + glyph(GLYPH_TREE_RIGHT)); } last = ! (*(dropin + 1) && startswith(*(dropin + 1), dir)); @@ -489,7 +489,7 @@ static void print_status_info( printf("%s %s%s%s %s\n", t == i->triggered_by ? "TriggeredBy:" : " ", - on, special_glyph(unit_active_state_to_glyph(state)), off, + on, glyph(unit_active_state_to_glyph(state)), off, *t); } @@ -516,7 +516,7 @@ static void print_status_info( printf("%s %s%s%s %s\n", t == i->triggers ? " Triggers:" : " ", - on, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off, + on, glyph(GLYPH_BLACK_CIRCLE), off, *t); } @@ -535,7 +535,7 @@ static void print_status_info( LIST_FOREACH(conditions, c, i->conditions) if (c->tristate < 0) printf(" %s %s=%s%s%s was not met\n", - --n ? special_glyph(SPECIAL_GLYPH_TREE_BRANCH) : special_glyph(SPECIAL_GLYPH_TREE_RIGHT), + --n ? glyph(GLYPH_TREE_BRANCH) : glyph(GLYPH_TREE_RIGHT), c->name, c->trigger ? "|" : "", c->negate ? "!" : "", @@ -2343,7 +2343,7 @@ static int show_system_status(sd_bus *bus) { off = ansi_normal(); } - printf("%s%s%s %s\n", on, special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE), off, arg_host ?: hn); + printf("%s%s%s %s\n", on, glyph(GLYPH_BLACK_CIRCLE), off, arg_host ?: hn); printf(" State: %s%s%s\n", on, strna(mi.state), off); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 176fb137ab8..51b4af47437 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1274,7 +1274,7 @@ static int run(int argc, char *argv[]) { "%s%s/proc/ is not mounted. This is not a supported mode of operation. Please fix\n" "your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway.\n" "Your mileage may vary.", - emoji_enabled() ? special_glyph(SPECIAL_GLYPH_WARNING_SIGN) : "", + emoji_enabled() ? glyph(GLYPH_WARNING_SIGN) : "", emoji_enabled() ? " " : ""); if (arg_action != ACTION_SYSTEMCTL && running_in_chroot() > 0) { diff --git a/src/sysupdate/sysupdate-resource.c b/src/sysupdate/sysupdate-resource.c index 842722c6825..424f10b2960 100644 --- a/src/sysupdate/sysupdate-resource.c +++ b/src/sysupdate/sysupdate-resource.c @@ -288,8 +288,8 @@ static int download_manifest( if (pipe2(pfd, O_CLOEXEC) < 0) return log_error_errno(errno, "Failed to allocate pipe: %m"); - log_info("%s Acquiring manifest file %s%s", special_glyph(SPECIAL_GLYPH_DOWNLOAD), - suffixed_url, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("%s Acquiring manifest file %s%s", glyph(GLYPH_DOWNLOAD), + suffixed_url, glyph(GLYPH_ELLIPSIS)); r = safe_fork_full("(sd-pull)", (int[]) { -EBADF, pfd[1], STDERR_FILENO }, diff --git a/src/sysupdate/sysupdate-transfer.c b/src/sysupdate/sysupdate-transfer.c index f81c3c18a1e..26d65d4078e 100644 --- a/src/sysupdate/sysupdate-transfer.c +++ b/src/sysupdate/sysupdate-transfer.c @@ -816,7 +816,7 @@ int transfer_vacuum( assert(oldest->resource); log_info("%s Removing %s '%s' (%s).", - special_glyph(SPECIAL_GLYPH_RECYCLING), + glyph(GLYPH_RECYCLING), space == UINT64_MAX ? "disabled" : "old", oldest->path, resource_type_to_string(oldest->resource->type)); @@ -1196,7 +1196,7 @@ int transfer_acquire_instance(Transfer *t, Instance *i, TransferProgress cb, voi assert(where); - log_info("%s Acquiring %s %s %s...", special_glyph(SPECIAL_GLYPH_DOWNLOAD), i->path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), where); + log_info("%s Acquiring %s %s %s...", glyph(GLYPH_DOWNLOAD), i->path, glyph(GLYPH_ARROW_RIGHT), where); if (RESOURCE_IS_URL(i->resource->type)) { /* For URL sources we require the SHA256 sum to be known so that we can validate the @@ -1542,11 +1542,11 @@ int transfer_install_instance( if (r < 0) return log_error_errno(r, "Failed to update current symlink '%s' %s '%s': %m", link_path, - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), + glyph(GLYPH_ARROW_RIGHT), relative); log_info("Updated symlink '%s' %s '%s'.", - link_path, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), relative); + link_path, glyph(GLYPH_ARROW_RIGHT), relative); } } diff --git a/src/sysupdate/sysupdate-update-set-flags.c b/src/sysupdate/sysupdate-update-set-flags.c index d37363e0731..e12c34a4362 100644 --- a/src/sysupdate/sysupdate-update-set-flags.c +++ b/src/sysupdate/sysupdate-update-set-flags.c @@ -28,16 +28,16 @@ const char* update_set_flags_to_color(UpdateSetFlags flags) { const char* update_set_flags_to_glyph(UpdateSetFlags flags) { if (flags == 0 || (flags & UPDATE_OBSOLETE)) - return special_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN); + return glyph(GLYPH_MULTIPLICATION_SIGN); if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_NEWEST)) - return special_glyph(SPECIAL_GLYPH_BLACK_CIRCLE); + return glyph(GLYPH_BLACK_CIRCLE); if (FLAGS_SET(flags, UPDATE_INSTALLED|UPDATE_PROTECTED)) - return special_glyph(SPECIAL_GLYPH_WHITE_CIRCLE); + return glyph(GLYPH_WHITE_CIRCLE); if ((flags & (UPDATE_AVAILABLE|UPDATE_INSTALLED|UPDATE_NEWEST|UPDATE_OBSOLETE)) == (UPDATE_AVAILABLE|UPDATE_NEWEST)) - return special_glyph(SPECIAL_GLYPH_CIRCLE_ARROW); + return glyph(GLYPH_CIRCLE_ARROW); return " "; } diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 9ced67429ac..bdd663a0941 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -259,7 +259,7 @@ static int context_load_installed_instances(Context *c) { assert(c); - log_info("Discovering installed instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Discovering installed instances%s", glyph(GLYPH_ELLIPSIS)); FOREACH_ARRAY(tr, c->transfers, c->n_transfers) { Transfer *t = *tr; @@ -291,7 +291,7 @@ static int context_load_available_instances(Context *c) { assert(c); - log_info("Discovering available instances%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Discovering available instances%s", glyph(GLYPH_ELLIPSIS)); FOREACH_ARRAY(tr, c->transfers, c->n_transfers) { Transfer *t = *tr; @@ -497,14 +497,14 @@ static int context_discover_update_sets(Context *c) { assert(c); - log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS)); r = context_discover_update_sets_by_flag(c, UPDATE_INSTALLED); if (r < 0) return r; if (!arg_offline) { - log_info("Determining available update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Determining available update sets%s", glyph(GLYPH_ELLIPSIS)); r = context_discover_update_sets_by_flag(c, UPDATE_AVAILABLE); if (r < 0) @@ -540,9 +540,9 @@ static int context_show_table(Context *c) { TABLE_SET_COLOR, color, TABLE_STRING, us->version, TABLE_SET_COLOR, color, - TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)), + TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_INSTALLED)), TABLE_SET_COLOR, color, - TABLE_STRING, special_glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)), + TABLE_STRING, glyph_check_mark_space(FLAGS_SET(us->flags, UPDATE_AVAILABLE)), TABLE_SET_COLOR, color, TABLE_STRING, update_set_flags_to_string(us->flags), TABLE_SET_COLOR, color); @@ -847,9 +847,9 @@ static int context_vacuum( assert(c); if (space == 0) - log_info("Making room%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Making room%s", glyph(GLYPH_ELLIPSIS)); else - log_info("Making room for %" PRIu64 " updates%s", space, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Making room for %" PRIu64 " updates%s", space, glyph(GLYPH_ELLIPSIS)); FOREACH_ARRAY(tr, c->transfers, c->n_transfers) { Transfer *t = *tr; @@ -1083,7 +1083,7 @@ static int context_apply( return r; } - log_info("%s Successfully installed update '%s'.", special_glyph(SPECIAL_GLYPH_SPARKLES), us->version); + log_info("%s Successfully installed update '%s'.", glyph(GLYPH_SPARKLES), us->version); if (ret_applied) *ret_applied = us; @@ -1473,7 +1473,7 @@ static int verb_pending_or_reboot(int argc, char **argv, void *userdata) { if (r < 0) return r; - log_info("Determining installed update sets%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Determining installed update sets%s", glyph(GLYPH_ELLIPSIS)); r = context_discover_update_sets_by_flag(context, UPDATE_INSTALLED); if (r < 0) diff --git a/src/sysupdate/updatectl.c b/src/sysupdate/updatectl.c index 53ccc59a7f0..64172fe4c37 100644 --- a/src/sysupdate/updatectl.c +++ b/src/sysupdate/updatectl.c @@ -421,7 +421,7 @@ static int list_versions_finished(sd_bus_message *reply, void *userdata, sd_bus_ color = update_set_flags_to_color(v.flags); if (urlify_enabled() && !strv_isempty(v.changelog)) { - version_link = strjoin(v.version, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK)); + version_link = strjoin(v.version, glyph(GLYPH_EXTERNAL_LINK)); if (!version_link) return log_oom(); } @@ -688,10 +688,10 @@ static int check_describe_finished(sd_bus_message *reply, void *userdata, sd_bus return bus_log_parse_error(r); if (urlify_enabled() && !strv_isempty(v.changelog)) - lnk = special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK); + lnk = glyph(GLYPH_EXTERNAL_LINK); update = strjoin(empty_to_dash(current), " ", - special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), " ", + glyph(GLYPH_ARROW_RIGHT), " ", v.version, strempty(lnk)); if (!update) return log_oom(); @@ -1328,7 +1328,7 @@ static int list_features(sd_bus *bus) { return r; if (urlify_enabled() && f.documentation) { - name_link = strjoin(f.name, special_glyph(SPECIAL_GLYPH_EXTERNAL_LINK)); + name_link = strjoin(f.name, glyph(GLYPH_EXTERNAL_LINK)); if (!name_link) return log_oom(); } diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 3a2cd5129a5..24b20cbd67a 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -481,7 +481,7 @@ static int write_temporary_passwd( return 0; if (arg_dry_run) { - log_info("Would write /etc/passwd%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Would write /etc/passwd%s", glyph(GLYPH_ELLIPSIS)); return 0; } @@ -624,7 +624,7 @@ static int write_temporary_shadow( return 0; if (arg_dry_run) { - log_info("Would write /etc/shadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Would write /etc/shadow%s", glyph(GLYPH_ELLIPSIS)); return 0; } @@ -759,7 +759,7 @@ static int write_temporary_group( return 0; if (arg_dry_run) { - log_info("Would write /etc/group%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Would write /etc/group%s", glyph(GLYPH_ELLIPSIS)); return 0; } @@ -872,7 +872,7 @@ static int write_temporary_gshadow( return 0; if (arg_dry_run) { - log_info("Would write /etc/gshadow%s", special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_info("Would write /etc/gshadow%s", glyph(GLYPH_ELLIPSIS)); return 0; } @@ -2224,13 +2224,13 @@ static int read_config_files(Context *c, char **args) { STRV_FOREACH(f, files) if (p && path_equal(*f, p)) { - log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Parsing arguments at position \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS)); r = parse_arguments(c, args); if (r < 0) return r; } else { - log_debug("Reading config file \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Reading config file \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS)); /* Just warn, ignore result otherwise */ (void) read_config_file(c, *f, /* ignore_enoent= */ true); diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index fde8c057e35..07a3069ca5d 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -768,8 +768,8 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) { "Please update package to include a native systemd unit file.\n" "%s This compatibility logic is deprecated, expect removal soon. %s", fpath, - special_glyph(SPECIAL_GLYPH_WARNING_SIGN), - special_glyph(SPECIAL_GLYPH_WARNING_SIGN)), + glyph(GLYPH_WARNING_SIGN), + glyph(GLYPH_WARNING_SIGN)), "MESSAGE_ID=" SD_MESSAGE_SYSV_GENERATOR_DEPRECATED_STR, "SYSVSCRIPT=%s", fpath, "UNIT=%s", name); diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index 40d07597835..f6386448bc9 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -80,62 +80,62 @@ TEST(keymaps) { assert_se(keymap_is_valid("unicode")); } -#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", special_glyph(x)) -TEST(dump_special_glyphs) { - assert_cc(SPECIAL_GLYPH_HOME + 1 == _SPECIAL_GLYPH_MAX); +#define dump_glyph(x) log_info(STRINGIFY(x) ": %s", glyph(x)) +TEST(dump_glyphs) { + assert_cc(GLYPH_HOME + 1 == _GLYPH_MAX); log_info("is_locale_utf8: %s", yes_no(is_locale_utf8())); - dump_glyph(SPECIAL_GLYPH_TREE_VERTICAL); - dump_glyph(SPECIAL_GLYPH_TREE_BRANCH); - dump_glyph(SPECIAL_GLYPH_TREE_RIGHT); - dump_glyph(SPECIAL_GLYPH_TREE_SPACE); - dump_glyph(SPECIAL_GLYPH_TREE_TOP); - dump_glyph(SPECIAL_GLYPH_VERTICAL_DOTTED); - dump_glyph(SPECIAL_GLYPH_HORIZONTAL_DOTTED); - dump_glyph(SPECIAL_GLYPH_HORIZONTAL_FAT); - dump_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET); - dump_glyph(SPECIAL_GLYPH_BLACK_CIRCLE); - dump_glyph(SPECIAL_GLYPH_WHITE_CIRCLE); - dump_glyph(SPECIAL_GLYPH_MULTIPLICATION_SIGN); - dump_glyph(SPECIAL_GLYPH_CIRCLE_ARROW); - dump_glyph(SPECIAL_GLYPH_BULLET); - dump_glyph(SPECIAL_GLYPH_MU); - dump_glyph(SPECIAL_GLYPH_CHECK_MARK); - dump_glyph(SPECIAL_GLYPH_CROSS_MARK); - dump_glyph(SPECIAL_GLYPH_LIGHT_SHADE); - dump_glyph(SPECIAL_GLYPH_DARK_SHADE); - dump_glyph(SPECIAL_GLYPH_FULL_BLOCK); - dump_glyph(SPECIAL_GLYPH_SIGMA); - dump_glyph(SPECIAL_GLYPH_ARROW_UP); - dump_glyph(SPECIAL_GLYPH_ARROW_DOWN); - dump_glyph(SPECIAL_GLYPH_ARROW_LEFT); - dump_glyph(SPECIAL_GLYPH_ARROW_RIGHT); - dump_glyph(SPECIAL_GLYPH_ELLIPSIS); - dump_glyph(SPECIAL_GLYPH_EXTERNAL_LINK); - dump_glyph(SPECIAL_GLYPH_ECSTATIC_SMILEY); - dump_glyph(SPECIAL_GLYPH_HAPPY_SMILEY); - dump_glyph(SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY); - dump_glyph(SPECIAL_GLYPH_NEUTRAL_SMILEY); - dump_glyph(SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY); - dump_glyph(SPECIAL_GLYPH_UNHAPPY_SMILEY); - dump_glyph(SPECIAL_GLYPH_DEPRESSED_SMILEY); - dump_glyph(SPECIAL_GLYPH_LOCK_AND_KEY); - dump_glyph(SPECIAL_GLYPH_TOUCH); - dump_glyph(SPECIAL_GLYPH_RECYCLING); - dump_glyph(SPECIAL_GLYPH_DOWNLOAD); - dump_glyph(SPECIAL_GLYPH_SPARKLES); - dump_glyph(SPECIAL_GLYPH_LOW_BATTERY); - dump_glyph(SPECIAL_GLYPH_WARNING_SIGN); - dump_glyph(SPECIAL_GLYPH_COMPUTER_DISK); - dump_glyph(SPECIAL_GLYPH_WORLD); - dump_glyph(SPECIAL_GLYPH_RED_CIRCLE); - dump_glyph(SPECIAL_GLYPH_YELLOW_CIRCLE); - dump_glyph(SPECIAL_GLYPH_BLUE_CIRCLE); - dump_glyph(SPECIAL_GLYPH_GREEN_CIRCLE); - dump_glyph(SPECIAL_GLYPH_SUPERHERO); - dump_glyph(SPECIAL_GLYPH_IDCARD); - dump_glyph(SPECIAL_GLYPH_HOME); + dump_glyph(GLYPH_TREE_VERTICAL); + dump_glyph(GLYPH_TREE_BRANCH); + dump_glyph(GLYPH_TREE_RIGHT); + dump_glyph(GLYPH_TREE_SPACE); + dump_glyph(GLYPH_TREE_TOP); + dump_glyph(GLYPH_VERTICAL_DOTTED); + dump_glyph(GLYPH_HORIZONTAL_DOTTED); + dump_glyph(GLYPH_HORIZONTAL_FAT); + dump_glyph(GLYPH_TRIANGULAR_BULLET); + dump_glyph(GLYPH_BLACK_CIRCLE); + dump_glyph(GLYPH_WHITE_CIRCLE); + dump_glyph(GLYPH_MULTIPLICATION_SIGN); + dump_glyph(GLYPH_CIRCLE_ARROW); + dump_glyph(GLYPH_BULLET); + dump_glyph(GLYPH_MU); + dump_glyph(GLYPH_CHECK_MARK); + dump_glyph(GLYPH_CROSS_MARK); + dump_glyph(GLYPH_LIGHT_SHADE); + dump_glyph(GLYPH_DARK_SHADE); + dump_glyph(GLYPH_FULL_BLOCK); + dump_glyph(GLYPH_SIGMA); + dump_glyph(GLYPH_ARROW_UP); + dump_glyph(GLYPH_ARROW_DOWN); + dump_glyph(GLYPH_ARROW_LEFT); + dump_glyph(GLYPH_ARROW_RIGHT); + dump_glyph(GLYPH_ELLIPSIS); + dump_glyph(GLYPH_EXTERNAL_LINK); + dump_glyph(GLYPH_ECSTATIC_SMILEY); + dump_glyph(GLYPH_HAPPY_SMILEY); + dump_glyph(GLYPH_SLIGHTLY_HAPPY_SMILEY); + dump_glyph(GLYPH_NEUTRAL_SMILEY); + dump_glyph(GLYPH_SLIGHTLY_UNHAPPY_SMILEY); + dump_glyph(GLYPH_UNHAPPY_SMILEY); + dump_glyph(GLYPH_DEPRESSED_SMILEY); + dump_glyph(GLYPH_LOCK_AND_KEY); + dump_glyph(GLYPH_TOUCH); + dump_glyph(GLYPH_RECYCLING); + dump_glyph(GLYPH_DOWNLOAD); + dump_glyph(GLYPH_SPARKLES); + dump_glyph(GLYPH_LOW_BATTERY); + dump_glyph(GLYPH_WARNING_SIGN); + dump_glyph(GLYPH_COMPUTER_DISK); + dump_glyph(GLYPH_WORLD); + dump_glyph(GLYPH_RED_CIRCLE); + dump_glyph(GLYPH_YELLOW_CIRCLE); + dump_glyph(GLYPH_BLUE_CIRCLE); + dump_glyph(GLYPH_GREEN_CIRCLE); + dump_glyph(GLYPH_SUPERHERO); + dump_glyph(GLYPH_IDCARD); + dump_glyph(GLYPH_HOME); } DEFINE_TEST_MAIN(LOG_INFO); diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 24bffab034d..98b524831c2 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -4481,7 +4481,7 @@ static int read_config_files( STRV_FOREACH(f, files) if (p && path_equal(*f, p)) { - log_debug("Parsing arguments at position \"%s\"%s", *f, special_glyph(SPECIAL_GLYPH_ELLIPSIS)); + log_debug("Parsing arguments at position \"%s\"%s", *f, glyph(GLYPH_ELLIPSIS)); r = parse_arguments(c, config_dirs, args, invalid_config); if (r < 0) diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 9b3f62ee691..a86ff1d18d9 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -323,7 +323,7 @@ static int names_pci_onboard(UdevEvent *event, sd_device *pci_dev, const char *p 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; } @@ -700,7 +700,7 @@ static int names_pci_slot(UdevEvent *event, sd_device *pci_dev, const char *pref 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 */ @@ -719,7 +719,7 @@ static int names_pci_slot(UdevEvent *event, sd_device *pci_dev, const char *pref 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; } @@ -765,7 +765,7 @@ static int names_vio(UdevEvent *event, const char *prefix) { 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; } @@ -827,7 +827,7 @@ static int names_platform(UdevEvent *event, const char *prefix) { 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; } @@ -934,7 +934,7 @@ static int names_devicetree(UdevEvent *event, const char *prefix) { 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; } @@ -1017,7 +1017,7 @@ static int get_usb_specifier(sd_device *dev, char **ret) { 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; @@ -1080,7 +1080,7 @@ static int get_bcma_specifier(sd_device *dev, char **ret) { 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; @@ -1151,7 +1151,7 @@ static int names_ccw(UdevEvent *event, const char *prefix) { 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; } @@ -1229,7 +1229,7 @@ static int names_mac(UdevEvent *event, const char *prefix) { 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; @@ -1267,7 +1267,7 @@ static int names_netdevsim(UdevEvent *event, const char *prefix) { 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; } @@ -1307,7 +1307,7 @@ static int names_xen(UdevEvent *event, const char *prefix) { 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; } diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 57f063b0108..9735632704c 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -718,13 +718,13 @@ static int output_tree_device( 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(); diff --git a/src/udev/udevadm-lock.c b/src/udev/udevadm-lock.c index e6384e3abae..78dd43ea458 100644 --- a/src/udev/udevadm-lock.c +++ b/src/udev/udevadm-lock.c @@ -204,7 +204,7 @@ static int lock_device( 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 { @@ -212,7 +212,7 @@ static int lock_device( 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) @@ -222,7 +222,7 @@ static int lock_device( 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); } diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c index 8ba12afbb74..2e5a7fc3821 100644 --- a/src/userdb/userdbctl.c +++ b/src/userdb/userdbctl.c @@ -213,9 +213,9 @@ static int table_add_uid_boundaries(Table *table, const UIDRange *p) { 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(); @@ -225,7 +225,7 @@ static int table_add_uid_boundaries(Table *table, const UIDRange *p) { 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), @@ -242,9 +242,9 @@ static int table_add_uid_boundaries(Table *table, const UIDRange *p) { 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(); @@ -255,7 +255,7 @@ static int table_add_uid_boundaries(Table *table, const UIDRange *p) { 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), @@ -284,15 +284,15 @@ static int add_unavailable_uid(Table *table, uid_t start, uid_t end) { 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, @@ -308,15 +308,15 @@ static int add_unavailable_uid(Table *table, uid_t start, uid_t end) { 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, @@ -609,9 +609,9 @@ static int table_add_gid_boundaries(Table *table, const UIDRange *p) { 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(); @@ -621,7 +621,7 @@ static int table_add_gid_boundaries(Table *table, const UIDRange *p) { 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), @@ -635,9 +635,9 @@ static int table_add_gid_boundaries(Table *table, const UIDRange *p) { 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(); @@ -648,7 +648,7 @@ static int table_add_gid_boundaries(Table *table, const UIDRange *p) { 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), @@ -674,15 +674,15 @@ static int add_unavailable_gid(Table *table, uid_t start, uid_t end) { 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, @@ -695,15 +695,15 @@ static int add_unavailable_gid(Table *table, uid_t start, uid_t end) { 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, diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 91259707aa4..5fc24ea1c19 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -1427,7 +1427,7 @@ static void set_window_title(PTYForward *f) { (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); @@ -2471,14 +2471,14 @@ static int run(int argc, char *argv[]) { (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); diff --git a/src/xdg-autostart-generator/xdg-autostart-generator.c b/src/xdg-autostart-generator/xdg-autostart-generator.c index 47252c2e360..9323143fa44 100644 --- a/src/xdg-autostart-generator/xdg-autostart-generator.c +++ b/src/xdg-autostart-generator/xdg-autostart-generator.c @@ -77,7 +77,7 @@ static int enumerate_xdg_autostart(Hashmap *all_services) { 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, diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c index f008556749d..c5852a3d64d 100644 --- a/src/xdg-autostart-generator/xdg-autostart-service.c +++ b/src/xdg-autostart-generator/xdg-autostart-service.c @@ -502,7 +502,7 @@ static int xdg_autostart_generate_desktop_condition( 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", @@ -690,6 +690,6 @@ int xdg_autostart_service_generate_unit( 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); }