chiark / gitweb /
shared: add is_efiboot()
[elogind.git] / src / shared / util.h
index ca80bfe2e8c520d0c844d1491e58d21714d226e5..99972cc637205d516ace021094f526a00663020e 100644 (file)
@@ -90,6 +90,8 @@ union dirent_storage {
 #define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
 #define ANSI_HIGHLIGHT_OFF "\x1B[0m"
 
+bool is_efiboot(void);
+
 usec_t now(clockid_t clock);
 
 dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
@@ -339,7 +341,7 @@ unsigned long long random_ull(void);
                         if (name##_table[i] &&                          \
                             streq(name##_table[i], s))                  \
                                 return i;                               \
-                if (safe_atou(s, &u) >= 0 && u < max)                   \
+                if (safe_atou(s, &u) >= 0 && u <= max)                  \
                         return (type) u;                                \
                 return (type) -1;                                       \
         }                                                               \
@@ -598,3 +600,14 @@ int parse_timestamp(const char *t, usec_t *usec);
 void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
                  int (*compar) (const void *, const void *, void *),
                  void *arg);
+
+bool is_locale_utf8(void);
+
+typedef enum DrawSpecialChar {
+        DRAW_BOX_VERT,
+        DRAW_BOX_VERT_AND_RIGHT,
+        DRAW_BOX_UP_AND_RIGHT,
+        DRAW_TRIANGULAR_BULLET,
+        _DRAW_SPECIAL_CHAR_MAX
+} DrawSpecialChar;
+const char *draw_special_char(DrawSpecialChar ch);