/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- This file is part of systemd.
-
- Copyright 2010 Lennart Poettering
-***/
-
#include <alloca.h>
#include <stdbool.h>
#include <stddef.h>
})
char *strstrip(char *s);
-#if 0 /// UNNEEDED by elogind
char *delete_chars(char *s, const char *bad);
-#endif // 0
char *delete_trailing_chars(char *s, const char *bad);
char *truncate_nl(char *s);
-#if 0 /// UNNEEDED by elogind
static inline char *skip_leading_chars(const char *s, const char *bad) {
if (!s)
return (char*) s + strspn(s, bad);
}
+#if 0 /// UNNEEDED by elogind
char ascii_tolower(char x);
char *ascii_strlower(char *s);
char *ascii_strlower_n(char *s, size_t n);
bool string_has_cc(const char *p, const char *ok) _pure_;
char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent);
-char *ellipsize(const char *s, size_t length, unsigned percent);
+static inline char *ellipsize(const char *s, size_t length, unsigned percent) {
+ return ellipsize_mem(s, strlen(s), length, percent);
+}
+
char *cellescape(char *buf, size_t len, const char *s);
/* This limit is arbitrary, enough to give some idea what the string contains */