]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - lib/color-names.c
rev: be careful with close()
[thirdparty/util-linux.git] / lib / color-names.c
index 923b2f039847dcf12dbfb1e3e2419759d3811751..72add50d708fafeb81b2c0c012e4e8ef2b5f0ea6 100644 (file)
@@ -12,8 +12,9 @@ struct ul_color_name {
  */
 static int cmp_color_name(const void *a0, const void *b0)
 {
-       struct ul_color_name    *a = (struct ul_color_name *) a0,
-                               *b = (struct ul_color_name *) b0;
+       const struct ul_color_name
+               *a = (const struct ul_color_name *) a0,
+               *b = (const struct ul_color_name *) b0;
        return strcmp(a->name, b->name);
 }
 
@@ -24,12 +25,15 @@ const char *color_sequence_from_colorname(const char *str)
 {
        static const struct ul_color_name basic_schemes[] = {
                { "black",      UL_COLOR_BLACK           },
+               { "blink",      UL_COLOR_BLINK           },
                { "blue",       UL_COLOR_BLUE            },
+               { "bold",       UL_COLOR_BOLD            },
                { "brown",      UL_COLOR_BROWN           },
                { "cyan",       UL_COLOR_CYAN            },
                { "darkgray",   UL_COLOR_DARK_GRAY       },
                { "gray",       UL_COLOR_GRAY            },
                { "green",      UL_COLOR_GREEN           },
+               { "halfbright", UL_COLOR_HALFBRIGHT      },
                { "lightblue",  UL_COLOR_BOLD_BLUE       },
                { "lightcyan",  UL_COLOR_BOLD_CYAN       },
                { "lightgray,", UL_COLOR_GRAY            },
@@ -38,9 +42,11 @@ const char *color_sequence_from_colorname(const char *str)
                { "lightred",   UL_COLOR_BOLD_RED        },
                { "magenta",    UL_COLOR_MAGENTA         },
                { "red",        UL_COLOR_RED             },
+               { "reset",      UL_COLOR_RESET,          },
+               { "reverse",    UL_COLOR_REVERSE         },
                { "yellow",     UL_COLOR_BOLD_YELLOW     },
        };
-       struct ul_color_name key = { .name = (char *) str }, *res;
+       struct ul_color_name key = { .name = str }, *res;
 
        if (!str)
                return NULL;