various: move ptr indicator to return value
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include "hexdecoct.h"
|
||||
#include "macro.h"
|
||||
|
||||
char *bus_label_escape(const char *s) {
|
||||
char* bus_label_escape(const char *s) {
|
||||
char *r, *t;
|
||||
const char *f;
|
||||
|
||||
@@ -42,7 +42,7 @@ char *bus_label_escape(const char *s) {
|
||||
return r;
|
||||
}
|
||||
|
||||
char *bus_label_unescape_n(const char *f, size_t l) {
|
||||
char* bus_label_unescape_n(const char *f, size_t l) {
|
||||
char *r, *t;
|
||||
size_t i;
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "string-util.h"
|
||||
|
||||
char *bus_label_escape(const char *s);
|
||||
char *bus_label_unescape_n(const char *f, size_t l);
|
||||
char* bus_label_escape(const char *s);
|
||||
char* bus_label_unescape_n(const char *f, size_t l);
|
||||
|
||||
static inline char *bus_label_unescape(const char *f) {
|
||||
static inline char* bus_label_unescape(const char *f) {
|
||||
return bus_label_unescape_n(f, strlen_ptr(f));
|
||||
}
|
||||
|
||||
@@ -1691,7 +1691,7 @@ int cg_escape(const char *p, char **ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *cg_unescape(const char *p) {
|
||||
char* cg_unescape(const char *p) {
|
||||
assert(p);
|
||||
|
||||
/* The return value of this function (unlike cg_escape())
|
||||
|
||||
@@ -298,7 +298,7 @@ int cg_path_decode_unit(const char *cgroup, char **ret_unit);
|
||||
|
||||
bool cg_needs_escape(const char *p);
|
||||
int cg_escape(const char *p, char **ret);
|
||||
char *cg_unescape(const char *p) _pure_;
|
||||
char* cg_unescape(const char *p) _pure_;
|
||||
|
||||
bool cg_controller_is_valid(const char *p);
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ char* strv_env_get_n(char * const *l, const char *name, size_t k, ReplaceEnvFlag
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *strv_env_pairs_get(char **l, const char *name) {
|
||||
char* strv_env_pairs_get(char **l, const char *name) {
|
||||
char *result = NULL;
|
||||
|
||||
assert(name);
|
||||
|
||||
@@ -59,7 +59,7 @@ static inline char* strv_env_get(char * const *x, const char *n) {
|
||||
return strv_env_get_n(x, n, SIZE_MAX, 0);
|
||||
}
|
||||
|
||||
char *strv_env_pairs_get(char **l, const char *name) _pure_;
|
||||
char* strv_env_pairs_get(char **l, const char *name) _pure_;
|
||||
|
||||
int getenv_bool(const char *p);
|
||||
int secure_getenv_bool(const char *p);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
|
||||
char *hw_addr_to_string_full(
|
||||
char* hw_addr_to_string_full(
|
||||
const struct hw_addr_data *addr,
|
||||
HardwareAddressToStringFlags flags,
|
||||
char buffer[static HW_ADDR_TO_STRING_MAX]) {
|
||||
|
||||
@@ -36,11 +36,11 @@ typedef enum HardwareAddressToStringFlags {
|
||||
} HardwareAddressToStringFlags;
|
||||
|
||||
#define HW_ADDR_TO_STRING_MAX (3*HW_ADDR_MAX_SIZE)
|
||||
char *hw_addr_to_string_full(
|
||||
char* hw_addr_to_string_full(
|
||||
const struct hw_addr_data *addr,
|
||||
HardwareAddressToStringFlags flags,
|
||||
char buffer[static HW_ADDR_TO_STRING_MAX]);
|
||||
static inline char *hw_addr_to_string(const struct hw_addr_data *addr, char buffer[static HW_ADDR_TO_STRING_MAX]) {
|
||||
static inline char* hw_addr_to_string(const struct hw_addr_data *addr, char buffer[static HW_ADDR_TO_STRING_MAX]) {
|
||||
return hw_addr_to_string_full(addr, 0, buffer);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1104,7 +1104,7 @@ const char* accmode_to_string(int flags) {
|
||||
}
|
||||
}
|
||||
|
||||
char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd) {
|
||||
char* format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd) {
|
||||
assert(buf);
|
||||
assert(fd >= 0);
|
||||
assert(pid >= 0);
|
||||
|
||||
+2
-2
@@ -141,7 +141,7 @@ int fds_are_same_mount(int fd1, int fd2);
|
||||
#define PROC_FD_PATH_MAX \
|
||||
(STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int))
|
||||
|
||||
static inline char *format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int fd) {
|
||||
static inline char* format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int fd) {
|
||||
assert(buf);
|
||||
assert(fd >= 0);
|
||||
assert_se(snprintf_ok(buf, PROC_FD_PATH_MAX, "/proc/self/fd/%i", fd));
|
||||
@@ -155,7 +155,7 @@ static inline char *format_proc_fd_path(char buf[static PROC_FD_PATH_MAX], int f
|
||||
#define PROC_PID_FD_PATH_MAX \
|
||||
(STRLEN("/proc//fd/") + DECIMAL_STR_MAX(pid_t) + DECIMAL_STR_MAX(int))
|
||||
|
||||
char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd);
|
||||
char* format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid, int fd);
|
||||
|
||||
/* Kinda the same as FORMAT_PROC_FD_PATH(), but goes by PID rather than "self" symlink */
|
||||
#define FORMAT_PROC_PID_FD_PATH(pid, fd) \
|
||||
|
||||
@@ -37,7 +37,7 @@ int format_ifname_full_alloc(int ifindex, FormatIfnameFlag flag, char **ret) {
|
||||
return strdup_to(ret, buf);
|
||||
}
|
||||
|
||||
char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
|
||||
char* format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
|
||||
typedef struct {
|
||||
const char *suffix;
|
||||
uint64_t factor;
|
||||
|
||||
@@ -81,7 +81,7 @@ static inline int format_ifname_alloc(int ifindex, char **ret) {
|
||||
return format_ifname_full_alloc(ifindex, 0, ret);
|
||||
}
|
||||
|
||||
static inline char *_format_ifname_full(int ifindex, FormatIfnameFlag flag, char buf[static IF_NAMESIZE]) {
|
||||
static inline char* _format_ifname_full(int ifindex, FormatIfnameFlag flag, char buf[static IF_NAMESIZE]) {
|
||||
(void) format_ifname_full(ifindex, flag, buf);
|
||||
return buf;
|
||||
}
|
||||
@@ -97,10 +97,10 @@ typedef enum {
|
||||
|
||||
#define FORMAT_BYTES_MAX 16U
|
||||
|
||||
char *format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) _warn_unused_result_;
|
||||
char* format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) _warn_unused_result_;
|
||||
|
||||
_warn_unused_result_
|
||||
static inline char *format_bytes(char *buf, size_t l, uint64_t t) {
|
||||
static inline char* format_bytes(char *buf, size_t l, uint64_t t) {
|
||||
return format_bytes_full(buf, l, t, FORMAT_BYTES_USE_IEC | FORMAT_BYTES_BELOW_POINT | FORMAT_BYTES_TRAILING_B);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ int unhexchar(char c) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
char *hexmem(const void *p, size_t l) {
|
||||
char* hexmem(const void *p, size_t l) {
|
||||
const uint8_t *x;
|
||||
char *r, *z;
|
||||
|
||||
@@ -188,7 +188,7 @@ int unbase32hexchar(char c) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
char *base32hexmem(const void *p, size_t l, bool padding) {
|
||||
char* base32hexmem(const void *p, size_t l, bool padding) {
|
||||
char *r, *z;
|
||||
const uint8_t *x;
|
||||
size_t len;
|
||||
|
||||
@@ -17,7 +17,7 @@ int undecchar(char c) _const_;
|
||||
char hexchar(int x) _const_;
|
||||
int unhexchar(char c) _const_;
|
||||
|
||||
char *hexmem(const void *p, size_t l);
|
||||
char* hexmem(const void *p, size_t l);
|
||||
int unhexmem_full(const char *p, size_t l, bool secure, void **ret_data, size_t *ret_size);
|
||||
static inline int unhexmem(const char *p, void **ret_data, size_t *ret_size) {
|
||||
return unhexmem_full(p, SIZE_MAX, false, ret_data, ret_size);
|
||||
@@ -30,7 +30,7 @@ char base64char(int x) _const_;
|
||||
char urlsafe_base64char(int x) _const_;
|
||||
int unbase64char(char c) _const_;
|
||||
|
||||
char *base32hexmem(const void *p, size_t l, bool padding);
|
||||
char* base32hexmem(const void *p, size_t l, bool padding);
|
||||
int unbase32hexmem(const char *p, size_t l, bool padding, void **mem, size_t *len);
|
||||
|
||||
ssize_t base64mem_full(const void *p, size_t l, size_t line_break, char **ret);
|
||||
|
||||
@@ -253,7 +253,7 @@ static bool relaxed_equal_char(char a, char b) {
|
||||
(a == '-' && b == '_');
|
||||
}
|
||||
|
||||
char *proc_cmdline_key_startswith(const char *s, const char *prefix) {
|
||||
char* proc_cmdline_key_startswith(const char *s, const char *prefix) {
|
||||
assert(s);
|
||||
assert(prefix);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ int proc_cmdline_get_bool(const char *key, ProcCmdlineFlags flags, bool *ret);
|
||||
int proc_cmdline_get_key_many_internal(ProcCmdlineFlags flags, ...);
|
||||
#define proc_cmdline_get_key_many(flags, ...) proc_cmdline_get_key_many_internal(flags, __VA_ARGS__, NULL)
|
||||
|
||||
char *proc_cmdline_key_startswith(const char *s, const char *prefix);
|
||||
char* proc_cmdline_key_startswith(const char *s, const char *prefix);
|
||||
bool proc_cmdline_key_streq(const char *x, const char *y);
|
||||
|
||||
/* A little helper call, to be used in proc_cmdline_parse_t callbacks */
|
||||
|
||||
@@ -36,7 +36,7 @@ static int get_variable(const char *b, char **r) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) {
|
||||
char* replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) {
|
||||
char *r, *t;
|
||||
const char *f;
|
||||
size_t l;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata);
|
||||
char* replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata);
|
||||
|
||||
+21
-21
@@ -46,7 +46,7 @@ char* first_word(const char *s, const char *word) {
|
||||
return (char*) nw;
|
||||
}
|
||||
|
||||
char *strnappend(const char *s, const char *suffix, size_t b) {
|
||||
char* strnappend(const char *s, const char *suffix, size_t b) {
|
||||
size_t a;
|
||||
char *r;
|
||||
|
||||
@@ -77,7 +77,7 @@ char *strnappend(const char *s, const char *suffix, size_t b) {
|
||||
return r;
|
||||
}
|
||||
|
||||
char *strjoin_real(const char *x, ...) {
|
||||
char* strjoin_real(const char *x, ...) {
|
||||
va_list ap;
|
||||
size_t l = 1;
|
||||
char *r, *p;
|
||||
@@ -109,7 +109,7 @@ char *strjoin_real(const char *x, ...) {
|
||||
return r;
|
||||
}
|
||||
|
||||
char *strstrip(char *s) {
|
||||
char* strstrip(char *s) {
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
@@ -118,7 +118,7 @@ char *strstrip(char *s) {
|
||||
return delete_trailing_chars(skip_leading_chars(s, WHITESPACE), WHITESPACE);
|
||||
}
|
||||
|
||||
char *delete_chars(char *s, const char *bad) {
|
||||
char* delete_chars(char *s, const char *bad) {
|
||||
char *f, *t;
|
||||
|
||||
/* Drops all specified bad characters, regardless where in the string */
|
||||
@@ -141,7 +141,7 @@ char *delete_chars(char *s, const char *bad) {
|
||||
return s;
|
||||
}
|
||||
|
||||
char *delete_trailing_chars(char *s, const char *bad) {
|
||||
char* delete_trailing_chars(char *s, const char *bad) {
|
||||
char *c = s;
|
||||
|
||||
/* Drops all specified bad characters, at the end of the string */
|
||||
@@ -161,7 +161,7 @@ char *delete_trailing_chars(char *s, const char *bad) {
|
||||
return s;
|
||||
}
|
||||
|
||||
char *truncate_nl_full(char *s, size_t *ret_len) {
|
||||
char* truncate_nl_full(char *s, size_t *ret_len) {
|
||||
size_t n;
|
||||
|
||||
assert(s);
|
||||
@@ -189,7 +189,7 @@ char ascii_toupper(char x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
char *ascii_strlower(char *t) {
|
||||
char* ascii_strlower(char *t) {
|
||||
assert(t);
|
||||
|
||||
for (char *p = t; *p; p++)
|
||||
@@ -198,7 +198,7 @@ char *ascii_strlower(char *t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
char *ascii_strupper(char *t) {
|
||||
char* ascii_strupper(char *t) {
|
||||
assert(t);
|
||||
|
||||
for (char *p = t; *p; p++)
|
||||
@@ -207,7 +207,7 @@ char *ascii_strupper(char *t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
char *ascii_strlower_n(char *t, size_t n) {
|
||||
char* ascii_strlower_n(char *t, size_t n) {
|
||||
if (n <= 0)
|
||||
return t;
|
||||
|
||||
@@ -389,7 +389,7 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le
|
||||
return t;
|
||||
}
|
||||
|
||||
char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
|
||||
char* ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) {
|
||||
size_t x, k, len, len2;
|
||||
const char *i, *j;
|
||||
int r;
|
||||
@@ -524,7 +524,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne
|
||||
return e;
|
||||
}
|
||||
|
||||
char *cellescape(char *buf, size_t len, const char *s) {
|
||||
char* cellescape(char *buf, size_t len, const char *s) {
|
||||
/* Escape and ellipsize s into buffer buf of size len. Only non-control ASCII
|
||||
* characters are copied as they are, everything else is escaped. The result
|
||||
* is different then if escaping and ellipsization was performed in two
|
||||
@@ -630,7 +630,7 @@ int strgrowpad0(char **s, size_t l) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *strreplace(const char *text, const char *old_string, const char *new_string) {
|
||||
char* strreplace(const char *text, const char *old_string, const char *new_string) {
|
||||
size_t l, old_len, new_len;
|
||||
char *t, *ret = NULL;
|
||||
const char *f;
|
||||
@@ -692,7 +692,7 @@ static void advance_offsets(
|
||||
shift[1] += size;
|
||||
}
|
||||
|
||||
char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) {
|
||||
char* strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) {
|
||||
const char *begin = NULL;
|
||||
enum {
|
||||
STATE_OTHER,
|
||||
@@ -824,7 +824,7 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]) {
|
||||
return *ibuf;
|
||||
}
|
||||
|
||||
char *strextend_with_separator_internal(char **x, const char *separator, ...) {
|
||||
char* strextend_with_separator_internal(char **x, const char *separator, ...) {
|
||||
size_t f, l, l_separator;
|
||||
bool need_separator;
|
||||
char *nr, *p;
|
||||
@@ -980,7 +980,7 @@ oom:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
char *strextendn(char **x, const char *s, size_t l) {
|
||||
char* strextendn(char **x, const char *s, size_t l) {
|
||||
assert(x);
|
||||
assert(s || l == 0);
|
||||
|
||||
@@ -1007,7 +1007,7 @@ char *strextendn(char **x, const char *s, size_t l) {
|
||||
return *x;
|
||||
}
|
||||
|
||||
char *strrep(const char *s, unsigned n) {
|
||||
char* strrep(const char *s, unsigned n) {
|
||||
char *r, *p;
|
||||
size_t l;
|
||||
|
||||
@@ -1288,7 +1288,7 @@ bool streq_skip_trailing_chars(const char *s1, const char *s2, const char *ok) {
|
||||
return in_charset(s1, ok) && in_charset(s2, ok);
|
||||
}
|
||||
|
||||
char *string_replace_char(char *str, char old_char, char new_char) {
|
||||
char* string_replace_char(char *str, char old_char, char new_char) {
|
||||
assert(str);
|
||||
assert(old_char != '\0');
|
||||
assert(new_char != '\0');
|
||||
@@ -1358,14 +1358,14 @@ size_t strspn_from_end(const char *str, const char *accept) {
|
||||
return n;
|
||||
}
|
||||
|
||||
char *strdupspn(const char *a, const char *accept) {
|
||||
char* strdupspn(const char *a, const char *accept) {
|
||||
if (isempty(a) || isempty(accept))
|
||||
return strdup("");
|
||||
|
||||
return strndup(a, strspn(a, accept));
|
||||
}
|
||||
|
||||
char *strdupcspn(const char *a, const char *reject) {
|
||||
char* strdupcspn(const char *a, const char *reject) {
|
||||
if (isempty(a))
|
||||
return strdup("");
|
||||
if (isempty(reject))
|
||||
@@ -1374,7 +1374,7 @@ char *strdupcspn(const char *a, const char *reject) {
|
||||
return strndup(a, strcspn(a, reject));
|
||||
}
|
||||
|
||||
char *find_line_startswith(const char *haystack, const char *needle) {
|
||||
char* find_line_startswith(const char *haystack, const char *needle) {
|
||||
char *p;
|
||||
|
||||
assert(haystack);
|
||||
@@ -1485,7 +1485,7 @@ ssize_t strlevenshtein(const char *x, const char *y) {
|
||||
return t1[yl];
|
||||
}
|
||||
|
||||
char *strrstr(const char *haystack, const char *needle) {
|
||||
char* strrstr(const char *haystack, const char *needle) {
|
||||
/* Like strstr() but returns the last rather than the first occurrence of "needle" in "haystack". */
|
||||
|
||||
if (!haystack || !needle)
|
||||
|
||||
+25
-25
@@ -33,7 +33,7 @@ static inline char* strstr_ptr(const char *haystack, const char *needle) {
|
||||
return strstr(haystack, needle);
|
||||
}
|
||||
|
||||
static inline char *strstrafter(const char *haystack, const char *needle) {
|
||||
static inline char* strstrafter(const char *haystack, const char *needle) {
|
||||
char *p;
|
||||
|
||||
/* Returns NULL if not found, or pointer to first character after needle if found */
|
||||
@@ -104,11 +104,11 @@ static inline const char* empty_or_dash_to_null(const char *p) {
|
||||
(typeof(p)) (empty_or_dash(_p) ? NULL : _p); \
|
||||
})
|
||||
|
||||
char *first_word(const char *s, const char *word) _pure_;
|
||||
char* first_word(const char *s, const char *word) _pure_;
|
||||
|
||||
char *strnappend(const char *s, const char *suffix, size_t length);
|
||||
char* strnappend(const char *s, const char *suffix, size_t length);
|
||||
|
||||
char *strjoin_real(const char *x, ...) _sentinel_;
|
||||
char* strjoin_real(const char *x, ...) _sentinel_;
|
||||
#define strjoin(a, ...) strjoin_real((a), __VA_ARGS__, NULL)
|
||||
|
||||
#define strjoina(a, ...) \
|
||||
@@ -126,11 +126,11 @@ char *strjoin_real(const char *x, ...) _sentinel_;
|
||||
_d_; \
|
||||
})
|
||||
|
||||
char *strstrip(char *s);
|
||||
char *delete_chars(char *s, const char *bad);
|
||||
char *delete_trailing_chars(char *s, const char *bad);
|
||||
char *truncate_nl_full(char *s, size_t *ret_len);
|
||||
static inline char *truncate_nl(char *s) {
|
||||
char* strstrip(char *s);
|
||||
char* delete_chars(char *s, const char *bad);
|
||||
char* delete_trailing_chars(char *s, const char *bad);
|
||||
char* truncate_nl_full(char *s, size_t *ret_len);
|
||||
static inline char* truncate_nl(char *s) {
|
||||
return truncate_nl_full(s, NULL);
|
||||
}
|
||||
|
||||
@@ -145,11 +145,11 @@ static inline char* skip_leading_chars(const char *s, const char *bad) {
|
||||
}
|
||||
|
||||
char ascii_tolower(char x);
|
||||
char *ascii_strlower(char *s);
|
||||
char *ascii_strlower_n(char *s, size_t n);
|
||||
char* ascii_strlower(char *s);
|
||||
char* ascii_strlower_n(char *s, size_t n);
|
||||
|
||||
char ascii_toupper(char x);
|
||||
char *ascii_strupper(char *s);
|
||||
char* ascii_strupper(char *s);
|
||||
|
||||
int ascii_strcasecmp_n(const char *a, const char *b, size_t n);
|
||||
int ascii_strcasecmp_nn(const char *a, size_t n, const char *b, size_t m);
|
||||
@@ -172,12 +172,12 @@ static inline bool char_is_cc(char p) {
|
||||
}
|
||||
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);
|
||||
static inline char *ellipsize(const char *s, size_t length, unsigned percent) {
|
||||
char* ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, 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);
|
||||
char* cellescape(char *buf, size_t len, const char *s);
|
||||
|
||||
/* This limit is arbitrary, enough to give some idea what the string contains */
|
||||
#define CELLESCAPE_DEFAULT_LENGTH 64
|
||||
@@ -186,20 +186,20 @@ char* strshorten(char *s, size_t l);
|
||||
|
||||
int strgrowpad0(char **s, size_t l);
|
||||
|
||||
char *strreplace(const char *text, const char *old_string, const char *new_string);
|
||||
char* strreplace(const char *text, const char *old_string, const char *new_string);
|
||||
|
||||
char *strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]);
|
||||
char* strip_tab_ansi(char **ibuf, size_t *_isz, size_t highlight[2]);
|
||||
|
||||
char *strextend_with_separator_internal(char **x, const char *separator, ...) _sentinel_;
|
||||
char* strextend_with_separator_internal(char **x, const char *separator, ...) _sentinel_;
|
||||
#define strextend_with_separator(x, separator, ...) strextend_with_separator_internal(x, separator, __VA_ARGS__, NULL)
|
||||
#define strextend(x, ...) strextend_with_separator_internal(x, NULL, __VA_ARGS__, NULL)
|
||||
|
||||
char *strextendn(char **x, const char *s, size_t l);
|
||||
char* strextendn(char **x, const char *s, size_t l);
|
||||
|
||||
int strextendf_with_separator(char **x, const char *separator, const char *format, ...) _printf_(3,4);
|
||||
#define strextendf(x, ...) strextendf_with_separator(x, NULL, __VA_ARGS__)
|
||||
|
||||
char *strrep(const char *s, unsigned n);
|
||||
char* strrep(const char *s, unsigned n);
|
||||
|
||||
#define strrepa(s, n) \
|
||||
({ \
|
||||
@@ -285,7 +285,7 @@ static inline int string_contains_word(const char *string, const char *separator
|
||||
|
||||
bool streq_skip_trailing_chars(const char *s1, const char *s2, const char *ok);
|
||||
|
||||
char *string_replace_char(char *str, char old_char, char new_char);
|
||||
char* string_replace_char(char *str, char old_char, char new_char);
|
||||
|
||||
typedef enum MakeCStringMode {
|
||||
MAKE_CSTRING_REFUSE_TRAILING_NUL,
|
||||
@@ -299,10 +299,10 @@ int make_cstring(const char *s, size_t n, MakeCStringMode mode, char **ret);
|
||||
|
||||
size_t strspn_from_end(const char *str, const char *accept);
|
||||
|
||||
char *strdupspn(const char *a, const char *accept);
|
||||
char *strdupcspn(const char *a, const char *reject);
|
||||
char* strdupspn(const char *a, const char *accept);
|
||||
char* strdupcspn(const char *a, const char *reject);
|
||||
|
||||
char *find_line_startswith(const char *haystack, const char *needle);
|
||||
char* find_line_startswith(const char *haystack, const char *needle);
|
||||
|
||||
bool version_is_valid(const char *s);
|
||||
|
||||
@@ -310,4 +310,4 @@ bool version_is_valid_versionspec(const char *s);
|
||||
|
||||
ssize_t strlevenshtein(const char *x, const char *y);
|
||||
|
||||
char *strrstr(const char *haystack, const char *needle);
|
||||
char* strrstr(const char *haystack, const char *needle);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "string-util.h"
|
||||
#include "sysctl-util.h"
|
||||
|
||||
char *sysctl_normalize(char *s) {
|
||||
char* sysctl_normalize(char *s) {
|
||||
char *n;
|
||||
|
||||
n = strpbrk(s, "/.");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
char *sysctl_normalize(char *s);
|
||||
char* sysctl_normalize(char *s);
|
||||
int sysctl_read(const char *property, char **value);
|
||||
int sysctl_write(const char *property, const char *value);
|
||||
int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3);
|
||||
|
||||
@@ -312,7 +312,7 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) {
|
||||
return tv;
|
||||
}
|
||||
|
||||
char *format_timestamp_style(
|
||||
char* format_timestamp_style(
|
||||
char *buf,
|
||||
size_t l,
|
||||
usec_t t,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "unit-def.h"
|
||||
#include "unit-name.h"
|
||||
|
||||
char *unit_dbus_path_from_name(const char *name) {
|
||||
char* unit_dbus_path_from_name(const char *name) {
|
||||
_cleanup_free_ char *e = NULL;
|
||||
|
||||
assert(name);
|
||||
|
||||
@@ -280,7 +280,7 @@ typedef enum NotifyAccess {
|
||||
_NOTIFY_ACCESS_INVALID = -EINVAL,
|
||||
} NotifyAccess;
|
||||
|
||||
char *unit_dbus_path_from_name(const char *name);
|
||||
char* unit_dbus_path_from_name(const char *name);
|
||||
int unit_name_from_dbus_path(const char *path, char **name);
|
||||
|
||||
const char* unit_dbus_interface_from_type(UnitType t);
|
||||
|
||||
@@ -331,7 +331,7 @@ static char *do_escape(const char *f, char *t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
char *unit_name_escape(const char *f) {
|
||||
char* unit_name_escape(const char *f) {
|
||||
char *r, *t;
|
||||
|
||||
assert(f);
|
||||
|
||||
@@ -35,7 +35,7 @@ int unit_name_change_suffix(const char *n, const char *suffix, char **ret);
|
||||
int unit_name_build(const char *prefix, const char *instance, const char *suffix, char **ret);
|
||||
int unit_name_build_from_type(const char *prefix, const char *instance, UnitType type, char **ret);
|
||||
|
||||
char *unit_name_escape(const char *f);
|
||||
char* unit_name_escape(const char *f);
|
||||
int unit_name_unescape(const char *f, char **ret);
|
||||
int unit_name_path_escape(const char *f, char **ret);
|
||||
int unit_name_path_unescape(const char *f, char **ret);
|
||||
|
||||
+3
-3
@@ -153,7 +153,7 @@ char* utf8_is_valid_n(const char *str, size_t len_bytes) {
|
||||
return (char*) str;
|
||||
}
|
||||
|
||||
char *utf8_escape_invalid(const char *str) {
|
||||
char* utf8_escape_invalid(const char *str) {
|
||||
char *p, *s;
|
||||
|
||||
assert(str);
|
||||
@@ -195,7 +195,7 @@ int utf8_char_console_width(const char *str) {
|
||||
return unichar_iswide(c) ? 2 : 1;
|
||||
}
|
||||
|
||||
char *utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis) {
|
||||
char* utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis) {
|
||||
char *p, *s, *prev_s;
|
||||
size_t n = 0; /* estimated print width */
|
||||
|
||||
@@ -359,7 +359,7 @@ size_t utf8_encode_unichar(char *out_utf8, char32_t g) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *utf16_to_utf8(const char16_t *s, size_t length /* bytes! */) {
|
||||
char* utf16_to_utf8(const char16_t *s, size_t length /* bytes! */) {
|
||||
const uint8_t *f;
|
||||
char *r, *t;
|
||||
|
||||
|
||||
+4
-4
@@ -29,16 +29,16 @@ int utf8_to_ascii(const char *str, char replacement_char, char **ret);
|
||||
bool utf8_is_printable_newline(const char* str, size_t length, bool allow_newline) _pure_;
|
||||
#define utf8_is_printable(str, length) utf8_is_printable_newline(str, length, true)
|
||||
|
||||
char *utf8_escape_invalid(const char *s);
|
||||
char *utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis);
|
||||
static inline char *utf8_escape_non_printable(const char *str) {
|
||||
char* utf8_escape_invalid(const char *s);
|
||||
char* utf8_escape_non_printable_full(const char *str, size_t console_width, bool force_ellipsis);
|
||||
static inline char* utf8_escape_non_printable(const char *str) {
|
||||
return utf8_escape_non_printable_full(str, SIZE_MAX, false);
|
||||
}
|
||||
|
||||
size_t utf8_encode_unichar(char *out_utf8, char32_t g);
|
||||
size_t utf16_encode_unichar(char16_t *out, char32_t c);
|
||||
|
||||
char *utf16_to_utf8(const char16_t *s, size_t length /* bytes! */);
|
||||
char* utf16_to_utf8(const char16_t *s, size_t length /* bytes! */);
|
||||
char16_t *utf8_to_utf16(const char *s, size_t length);
|
||||
|
||||
size_t char16_strlen(const char16_t *s); /* returns the number of 16-bit words in the string (not bytes!) */
|
||||
|
||||
@@ -212,7 +212,7 @@ char16_t *xstrn8_to_16(const char *str8, size_t n) {
|
||||
return str16;
|
||||
}
|
||||
|
||||
char *startswith8(const char *s, const char *prefix) {
|
||||
char* startswith8(const char *s, const char *prefix) {
|
||||
size_t l;
|
||||
|
||||
assert(prefix);
|
||||
@@ -412,7 +412,7 @@ bool parse_boolean(const char *v, bool *ret) {
|
||||
return false;
|
||||
}
|
||||
|
||||
char *line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value) {
|
||||
char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value) {
|
||||
char *line, *value;
|
||||
size_t linelen;
|
||||
|
||||
|
||||
@@ -79,16 +79,16 @@ static inline bool strcaseeq16(const char16_t *s1, const char16_t *s2) {
|
||||
return strcasecmp16(s1, s2) == 0;
|
||||
}
|
||||
|
||||
char *strcpy8(char * restrict dest, const char * restrict src);
|
||||
char* strcpy8(char * restrict dest, const char * restrict src);
|
||||
char16_t *strcpy16(char16_t * restrict dest, const char16_t * restrict src);
|
||||
|
||||
char *strchr8(const char *s, char c);
|
||||
char* strchr8(const char *s, char c);
|
||||
char16_t *strchr16(const char16_t *s, char16_t c);
|
||||
|
||||
char *xstrndup8(const char *s, size_t n);
|
||||
char* xstrndup8(const char *s, size_t n);
|
||||
char16_t *xstrndup16(const char16_t *s, size_t n);
|
||||
|
||||
static inline char *xstrdup8(const char *s) {
|
||||
static inline char* xstrdup8(const char *s) {
|
||||
return xstrndup8(s, SIZE_MAX);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ static inline char16_t *xstr8_to_16(const char *str8) {
|
||||
return xstrn8_to_16(str8, strlen8(str8));
|
||||
}
|
||||
|
||||
char *startswith8(const char *s, const char *prefix);
|
||||
char* startswith8(const char *s, const char *prefix);
|
||||
|
||||
bool efi_fnmatch(const char16_t *pattern, const char16_t *haystack);
|
||||
|
||||
@@ -110,7 +110,7 @@ bool parse_number16(const char16_t *s, uint64_t *ret_u, const char16_t **ret_tai
|
||||
|
||||
bool parse_boolean(const char *v, bool *ret);
|
||||
|
||||
char *line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value);
|
||||
char* line_get_key_value(char *s, const char *sep, size_t *pos, char **ret_key, char **ret_value);
|
||||
|
||||
char16_t *hexdump(const void *data, size_t size);
|
||||
|
||||
|
||||
+1
-1
@@ -1197,7 +1197,7 @@ void job_add_to_dbus_queue(Job *j) {
|
||||
j->in_dbus_queue = true;
|
||||
}
|
||||
|
||||
char *job_dbus_path(Job *j) {
|
||||
char* job_dbus_path(Job *j) {
|
||||
char *p;
|
||||
|
||||
assert(j);
|
||||
|
||||
+1
-1
@@ -218,7 +218,7 @@ int job_start_timer(Job *j, bool job_running);
|
||||
int job_run_and_invalidate(Job *j);
|
||||
int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool already);
|
||||
|
||||
char *job_dbus_path(Job *j);
|
||||
char* job_dbus_path(Job *j);
|
||||
|
||||
void job_shutdown_magic(Job *j);
|
||||
|
||||
|
||||
+1
-1
@@ -3410,7 +3410,7 @@ static int socket_get_timeout(Unit *u, usec_t *timeout) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *socket_fdname(Socket *s) {
|
||||
char* socket_fdname(Socket *s) {
|
||||
assert(s);
|
||||
|
||||
/* Returns the name to use for $LISTEN_NAMES. If the user
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ int socket_port_to_address(const SocketPort *s, char **ret);
|
||||
|
||||
int socket_load_service_unit(Socket *s, int cfd, Unit **ret);
|
||||
|
||||
char *socket_fdname(Socket *s);
|
||||
char* socket_fdname(Socket *s);
|
||||
|
||||
extern const UnitVTable socket_vtable;
|
||||
|
||||
|
||||
+2
-2
@@ -3337,7 +3337,7 @@ int set_unit_path(const char *p) {
|
||||
return RET_NERRNO(setenv("SYSTEMD_UNIT_PATH", p, 1));
|
||||
}
|
||||
|
||||
char *unit_dbus_path(Unit *u) {
|
||||
char* unit_dbus_path(Unit *u) {
|
||||
assert(u);
|
||||
|
||||
if (!u->id)
|
||||
@@ -3346,7 +3346,7 @@ char *unit_dbus_path(Unit *u) {
|
||||
return unit_dbus_path_from_name(u->id);
|
||||
}
|
||||
|
||||
char *unit_dbus_path_invocation_id(Unit *u) {
|
||||
char* unit_dbus_path_invocation_id(Unit *u) {
|
||||
assert(u);
|
||||
|
||||
if (sd_id128_is_null(u->invocation_id))
|
||||
|
||||
+2
-2
@@ -886,8 +886,8 @@ bool unit_job_is_applicable(Unit *u, JobType j);
|
||||
|
||||
int set_unit_path(const char *p);
|
||||
|
||||
char *unit_dbus_path(Unit *u);
|
||||
char *unit_dbus_path_invocation_id(Unit *u);
|
||||
char* unit_dbus_path(Unit *u);
|
||||
char* unit_dbus_path_invocation_id(Unit *u);
|
||||
|
||||
int unit_load_related_unit(Unit *u, const char *type, Unit **_found);
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ const char* bus_message_type_to_string(uint8_t u) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *bus_address_escape(const char *v) {
|
||||
char* bus_address_escape(const char *v) {
|
||||
const char *a;
|
||||
char *r, *b;
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ bool service_name_is_valid(const char *p) _pure_;
|
||||
bool member_name_is_valid(const char *p) _pure_;
|
||||
bool object_path_is_valid(const char *p) _pure_;
|
||||
|
||||
char *object_path_startswith(const char *a, const char *b) _pure_;
|
||||
char* object_path_startswith(const char *a, const char *b) _pure_;
|
||||
|
||||
bool namespace_complex_pattern(const char *pattern, const char *value) _pure_;
|
||||
bool path_complex_pattern(const char *pattern, const char *value) _pure_;
|
||||
@@ -385,7 +385,7 @@ int bus_rqueue_make_room(sd_bus *bus);
|
||||
|
||||
bool bus_origin_changed(sd_bus *bus);
|
||||
|
||||
char *bus_address_escape(const char *v);
|
||||
char* bus_address_escape(const char *v);
|
||||
|
||||
int bus_attach_io_events(sd_bus *b);
|
||||
int bus_attach_inotify_event(sd_bus *b);
|
||||
|
||||
@@ -823,7 +823,7 @@ int bus_match_parse(
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *bus_match_to_string(struct bus_match_component *components, size_t n_components) {
|
||||
char* bus_match_to_string(struct bus_match_component *components, size_t n_components) {
|
||||
_cleanup_(memstream_done) MemStream m = {};
|
||||
FILE *f;
|
||||
int r;
|
||||
|
||||
@@ -77,6 +77,6 @@ enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n
|
||||
|
||||
int bus_match_parse(const char *match, struct bus_match_component **ret_components, size_t *ret_n_components);
|
||||
void bus_match_parse_free(struct bus_match_component *components, size_t n_components);
|
||||
char *bus_match_to_string(struct bus_match_component *components, size_t n_components);
|
||||
char* bus_match_to_string(struct bus_match_component *components, size_t n_components);
|
||||
|
||||
enum bus_match_scope bus_match_get_scope(const struct bus_match_component *components, size_t n_components);
|
||||
|
||||
@@ -136,7 +136,7 @@ struct sd_journal {
|
||||
Hashmap *errors;
|
||||
};
|
||||
|
||||
char *journal_make_match_string(sd_journal *j);
|
||||
char* journal_make_match_string(sd_journal *j);
|
||||
void journal_print_header(sd_journal *j);
|
||||
int journal_get_directories(sd_journal *j, char ***ret);
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ static char *match_make_string(Match *m) {
|
||||
return TAKE_PTR(p);
|
||||
}
|
||||
|
||||
char *journal_make_match_string(sd_journal *j) {
|
||||
char* journal_make_match_string(sd_journal *j) {
|
||||
assert(j);
|
||||
|
||||
return match_make_string(j->level0);
|
||||
|
||||
@@ -282,7 +282,7 @@ static int seat_object_find(sd_bus *bus, const char *path, const char *interface
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *seat_bus_path(Seat *s) {
|
||||
char* seat_bus_path(Seat *s) {
|
||||
_cleanup_free_ char *t = NULL;
|
||||
|
||||
assert(s);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
extern const BusObjectImplementation seat_object;
|
||||
|
||||
char *seat_bus_path(Seat *s);
|
||||
char* seat_bus_path(Seat *s);
|
||||
|
||||
int seat_send_signal(Seat *s, bool new_seat);
|
||||
int seat_send_changed(Seat *s, const char *properties, ...) _sentinel_;
|
||||
|
||||
@@ -713,7 +713,7 @@ static int session_object_find(sd_bus *bus, const char *path, const char *interf
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *session_bus_path(Session *s) {
|
||||
char* session_bus_path(Session *s) {
|
||||
_cleanup_free_ char *t = NULL;
|
||||
|
||||
assert(s);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
extern const BusObjectImplementation session_object;
|
||||
|
||||
char *session_bus_path(Session *s);
|
||||
char* session_bus_path(Session *s);
|
||||
|
||||
int session_send_signal(Session *s, bool new_session);
|
||||
int session_send_changed(Session *s, const char *properties, ...) _sentinel_;
|
||||
|
||||
@@ -289,7 +289,7 @@ static int user_object_find(sd_bus *bus, const char *path, const char *interface
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *user_bus_path(User *u) {
|
||||
char* user_bus_path(User *u) {
|
||||
char *s;
|
||||
|
||||
assert(u);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
extern const BusObjectImplementation user_object;
|
||||
|
||||
char *user_bus_path(User *s);
|
||||
char* user_bus_path(User *s);
|
||||
|
||||
int user_send_signal(User *u, bool new_user);
|
||||
int user_send_changed(User *u, const char *properties, ...) _sentinel_;
|
||||
|
||||
@@ -461,7 +461,7 @@ static int image_object_find(sd_bus *bus, const char *path, const char *interfac
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *image_bus_path(const char *name) {
|
||||
char* image_bus_path(const char *name) {
|
||||
_cleanup_free_ char *e = NULL;
|
||||
|
||||
assert(name);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
extern const BusObjectImplementation image_object;
|
||||
|
||||
int manager_acquire_image(Manager *m, const char *name, Image **ret);
|
||||
char *image_bus_path(const char *name);
|
||||
char* image_bus_path(const char *name);
|
||||
|
||||
int bus_image_method_remove(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
int bus_image_method_rename(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
|
||||
@@ -1231,7 +1231,7 @@ static int machine_object_find(sd_bus *bus, const char *path, const char *interf
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *machine_bus_path(Machine *m) {
|
||||
char* machine_bus_path(Machine *m) {
|
||||
_cleanup_free_ char *e = NULL;
|
||||
|
||||
assert(m);
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef enum {
|
||||
|
||||
extern const BusObjectImplementation machine_object;
|
||||
|
||||
char *machine_bus_path(Machine *s);
|
||||
char* machine_bus_path(Machine *s);
|
||||
|
||||
int bus_machine_method_unregister(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
int bus_machine_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
|
||||
@@ -802,7 +802,7 @@ static const sd_bus_vtable link_vtable[] = {
|
||||
SD_BUS_VTABLE_END
|
||||
};
|
||||
|
||||
char *link_bus_path(Link *link) {
|
||||
char* link_bus_path(Link *link) {
|
||||
_cleanup_free_ char *ifindex = NULL;
|
||||
char *p;
|
||||
int r;
|
||||
|
||||
@@ -10,7 +10,7 @@ typedef struct Link Link;
|
||||
|
||||
extern const BusObjectImplementation link_object;
|
||||
|
||||
char *link_bus_path(Link *link);
|
||||
char* link_bus_path(Link *link);
|
||||
int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
|
||||
int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
|
||||
int link_send_changed_strv(Link *link, char **properties);
|
||||
|
||||
@@ -800,7 +800,7 @@ static int link_object_find(sd_bus *bus, const char *path, const char *interface
|
||||
return 1;
|
||||
}
|
||||
|
||||
char *link_bus_path(const Link *link) {
|
||||
char* link_bus_path(const Link *link) {
|
||||
char *p, ifindex[DECIMAL_STR_MAX(link->ifindex)];
|
||||
int r;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
extern const BusObjectImplementation link_object;
|
||||
|
||||
char *link_bus_path(const Link *link);
|
||||
char* link_bus_path(const Link *link);
|
||||
|
||||
int bus_link_method_set_dns_servers(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
int bus_link_method_set_dns_servers_ex(sd_bus_message *message, void *userdata, sd_bus_error *error);
|
||||
|
||||
@@ -40,7 +40,7 @@ char* cpu_set_to_string(const CPUSet *a) {
|
||||
return TAKE_PTR(str) ?: strdup("");
|
||||
}
|
||||
|
||||
char *cpu_set_to_range_string(const CPUSet *set) {
|
||||
char* cpu_set_to_range_string(const CPUSet *set) {
|
||||
unsigned range_start = 0, range_end;
|
||||
_cleanup_free_ char *str = NULL;
|
||||
bool in_range = false;
|
||||
|
||||
@@ -26,7 +26,7 @@ int cpu_set_add_all(CPUSet *a, const CPUSet *b);
|
||||
int cpu_set_add(CPUSet *a, unsigned cpu);
|
||||
|
||||
char* cpu_set_to_string(const CPUSet *a);
|
||||
char *cpu_set_to_range_string(const CPUSet *a);
|
||||
char* cpu_set_to_range_string(const CPUSet *a);
|
||||
char* cpu_set_to_mask_string(const CPUSet *a);
|
||||
int cpu_set_realloc(CPUSet *cpu_set, unsigned ncpus);
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
|
||||
return strjoin("/dev/disk/by-", by, "/", t);
|
||||
}
|
||||
|
||||
char *fstab_node_to_udev_node(const char *p) {
|
||||
char* fstab_node_to_udev_node(const char *p) {
|
||||
const char *q;
|
||||
|
||||
assert(p);
|
||||
|
||||
@@ -49,7 +49,7 @@ static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no
|
||||
}
|
||||
int fstab_find_pri(const char *opts, int *ret);
|
||||
|
||||
char *fstab_node_to_udev_node(const char *p);
|
||||
char* fstab_node_to_udev_node(const char *p);
|
||||
|
||||
static inline const char* fstab_path(void) {
|
||||
return secure_getenv("SYSTEMD_FSTAB") ?: "/etc/fstab";
|
||||
|
||||
@@ -201,7 +201,7 @@ CK_RV pkcs11_get_slot_list_malloc(
|
||||
return CKR_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
char *pkcs11_token_label(const CK_TOKEN_INFO *token_info) {
|
||||
char* pkcs11_token_label(const CK_TOKEN_INFO *token_info) {
|
||||
char *t;
|
||||
|
||||
/* The label is not NUL terminated and likely padded with spaces, let's make a copy here, so that we
|
||||
@@ -214,7 +214,7 @@ char *pkcs11_token_label(const CK_TOKEN_INFO *token_info) {
|
||||
return t;
|
||||
}
|
||||
|
||||
char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) {
|
||||
char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) {
|
||||
char *t;
|
||||
|
||||
t = strndup((char*) token_info->manufacturerID, sizeof(token_info->manufacturerID));
|
||||
@@ -225,7 +225,7 @@ char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info) {
|
||||
return t;
|
||||
}
|
||||
|
||||
char *pkcs11_token_model(const CK_TOKEN_INFO *token_info) {
|
||||
char* pkcs11_token_model(const CK_TOKEN_INFO *token_info) {
|
||||
char *t;
|
||||
|
||||
t = strndup((char*) token_info->model, sizeof(token_info->model));
|
||||
|
||||
@@ -48,9 +48,9 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CK_FUNCTION_LIST**, sym_p11_kit_modules_finaliz
|
||||
|
||||
CK_RV pkcs11_get_slot_list_malloc(CK_FUNCTION_LIST *m, CK_SLOT_ID **ret_slotids, CK_ULONG *ret_n_slotids);
|
||||
|
||||
char *pkcs11_token_label(const CK_TOKEN_INFO *token_info);
|
||||
char *pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info);
|
||||
char *pkcs11_token_model(const CK_TOKEN_INFO *token_info);
|
||||
char* pkcs11_token_label(const CK_TOKEN_INFO *token_info);
|
||||
char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info);
|
||||
char* pkcs11_token_model(const CK_TOKEN_INFO *token_info);
|
||||
|
||||
int pkcs11_token_login_by_pin(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, const CK_TOKEN_INFO *token_info, const char *token_label, const void *pin, size_t pin_size);
|
||||
int pkcs11_token_login(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, const char *icon_name, const char *key_name, const char *credential_name, usec_t until, AskPasswordFlags ask_password_flags, char **ret_used_pin);
|
||||
|
||||
@@ -1458,7 +1458,7 @@ void tpm2_tpms_pcr_selection_move(TPMS_PCR_SELECTION *a, TPMS_PCR_SELECTION *b)
|
||||
FOREACH_TPMS_PCR_SELECTION_IN_TPML_PCR_SELECTION(tpms, tpml) \
|
||||
FOREACH_PCR_IN_TPMS_PCR_SELECTION(pcr, tpms)
|
||||
|
||||
char *tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s) {
|
||||
char* tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s) {
|
||||
assert(s);
|
||||
|
||||
const char *algstr = strna(tpm2_hash_alg_to_string(s->hash));
|
||||
@@ -1648,7 +1648,7 @@ void tpm2_tpml_pcr_selection_sub(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION
|
||||
tpm2_tpml_pcr_selection_sub_tpms_pcr_selection(a, selection_b);
|
||||
}
|
||||
|
||||
char *tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l) {
|
||||
char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l) {
|
||||
assert(l);
|
||||
|
||||
_cleanup_free_ char *banks = NULL;
|
||||
@@ -1942,7 +1942,7 @@ int tpm2_pcr_value_from_string(const char *arg, Tpm2PCRValue *ret_pcr_value) {
|
||||
/* Return a string for the PCR value. The format is described in tpm2_pcr_value_from_string(). Note that if
|
||||
* the hash algorithm is not recognized, neither hash name nor hash digest value is included in the
|
||||
* string. This does not check for validity. */
|
||||
char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) {
|
||||
char* tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) {
|
||||
_cleanup_free_ char *index = NULL, *value = NULL;
|
||||
|
||||
if (asprintf(&index, "%u", pcr_value->index) < 0)
|
||||
@@ -1999,7 +1999,7 @@ int tpm2_pcr_values_from_string(const char *arg, Tpm2PCRValue **ret_pcr_values,
|
||||
|
||||
/* Return a string representing the array of PCR values. The format is as described in
|
||||
* tpm2_pcr_values_from_string(). This does not check for validity. */
|
||||
char *tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values) {
|
||||
char* tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
|
||||
FOREACH_ARRAY(v, pcr_values, n_pcr_values) {
|
||||
@@ -7277,7 +7277,7 @@ int tpm2_hmac_key_from_pin(Tpm2Context *c, const Tpm2Handle *session, const TPM2
|
||||
}
|
||||
#endif
|
||||
|
||||
char *tpm2_pcr_mask_to_string(uint32_t mask) {
|
||||
char* tpm2_pcr_mask_to_string(uint32_t mask) {
|
||||
_cleanup_free_ char *s = NULL;
|
||||
|
||||
FOREACH_PCR_IN_MASK(n, mask)
|
||||
|
||||
@@ -110,14 +110,14 @@ bool tpm2_pcr_value_valid(const Tpm2PCRValue *pcr_value);
|
||||
bool tpm2_pcr_values_has_any_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
bool tpm2_pcr_values_has_all_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
int tpm2_pcr_value_from_string(const char *arg, Tpm2PCRValue *ret_pcr_value);
|
||||
char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value);
|
||||
char* tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value);
|
||||
|
||||
bool tpm2_pcr_values_valid(const Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
void tpm2_sort_pcr_values(Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
int tpm2_pcr_values_from_mask(uint32_t mask, TPMI_ALG_HASH hash, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values);
|
||||
int tpm2_pcr_values_to_mask(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, TPMI_ALG_HASH hash, uint32_t *ret_mask);
|
||||
int tpm2_pcr_values_from_string(const char *arg, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values);
|
||||
char *tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
char* tpm2_pcr_values_to_string(const Tpm2PCRValue *pcr_values, size_t n_pcr_values);
|
||||
int tpm2_pcr_values_hash_count(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, size_t *ret_count);
|
||||
int tpm2_tpml_pcr_selection_from_pcr_values(const Tpm2PCRValue *pcr_values, size_t n_pcr_values, TPML_PCR_SELECTION *ret_selection, TPM2B_DIGEST **ret_values, size_t *ret_n_values);
|
||||
|
||||
@@ -169,7 +169,7 @@ void tpm2_tpms_pcr_selection_sub_mask(TPMS_PCR_SELECTION *s, uint32_t mask);
|
||||
void tpm2_tpms_pcr_selection_add(TPMS_PCR_SELECTION *a, const TPMS_PCR_SELECTION *b);
|
||||
void tpm2_tpms_pcr_selection_sub(TPMS_PCR_SELECTION *a, const TPMS_PCR_SELECTION *b);
|
||||
void tpm2_tpms_pcr_selection_move(TPMS_PCR_SELECTION *a, TPMS_PCR_SELECTION *b);
|
||||
char *tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s);
|
||||
char* tpm2_tpms_pcr_selection_to_string(const TPMS_PCR_SELECTION *s);
|
||||
size_t tpm2_tpms_pcr_selection_weight(const TPMS_PCR_SELECTION *s);
|
||||
#define tpm2_tpms_pcr_selection_is_empty(s) (tpm2_tpms_pcr_selection_weight(s) == 0)
|
||||
|
||||
@@ -182,7 +182,7 @@ void tpm2_tpml_pcr_selection_add_tpms_pcr_selection(TPML_PCR_SELECTION *l, const
|
||||
void tpm2_tpml_pcr_selection_sub_tpms_pcr_selection(TPML_PCR_SELECTION *l, const TPMS_PCR_SELECTION *s);
|
||||
void tpm2_tpml_pcr_selection_add(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION *b);
|
||||
void tpm2_tpml_pcr_selection_sub(TPML_PCR_SELECTION *a, const TPML_PCR_SELECTION *b);
|
||||
char *tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l);
|
||||
char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l);
|
||||
size_t tpm2_tpml_pcr_selection_weight(const TPML_PCR_SELECTION *l);
|
||||
#define tpm2_tpml_pcr_selection_is_empty(l) (tpm2_tpml_pcr_selection_weight(l) == 0)
|
||||
|
||||
@@ -438,7 +438,7 @@ int tpm2_sym_alg_from_string(const char *alg) _pure_;
|
||||
const char* tpm2_sym_mode_to_string(uint16_t mode) _const_;
|
||||
int tpm2_sym_mode_from_string(const char *mode) _pure_;
|
||||
|
||||
char *tpm2_pcr_mask_to_string(uint32_t mask);
|
||||
char* tpm2_pcr_mask_to_string(uint32_t mask);
|
||||
|
||||
extern const uint16_t tpm2_hash_algorithms[];
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ union sd_id128 {
|
||||
#define SD_ID128_STRING_MAX 33U
|
||||
#define SD_ID128_UUID_STRING_MAX 37U
|
||||
|
||||
char *sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX]);
|
||||
char *sd_id128_to_uuid_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_UUID_STRING_MAX]);
|
||||
char* sd_id128_to_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX]);
|
||||
char* sd_id128_to_uuid_string(sd_id128_t id, char s[_SD_ARRAY_STATIC SD_ID128_UUID_STRING_MAX]);
|
||||
int sd_id128_from_string(const char *s, sd_id128_t *ret);
|
||||
|
||||
#define SD_ID128_TO_STRING(id) sd_id128_to_string((id), (char[SD_ID128_STRING_MAX]) {})
|
||||
|
||||
@@ -45,7 +45,7 @@ XdgAutostartService* xdg_autostart_service_free(XdgAutostartService *s) {
|
||||
return mfree(s);
|
||||
}
|
||||
|
||||
char *xdg_autostart_service_translate_name(const char *name) {
|
||||
char* xdg_autostart_service_translate_name(const char *name) {
|
||||
_cleanup_free_ char *c = NULL, *escaped = NULL;
|
||||
char *res;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct XdgAutostartService {
|
||||
XdgAutostartService * xdg_autostart_service_free(XdgAutostartService *s);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(XdgAutostartService*, xdg_autostart_service_free);
|
||||
|
||||
char *xdg_autostart_service_translate_name(const char *name);
|
||||
char* xdg_autostart_service_translate_name(const char *name);
|
||||
int xdg_autostart_format_exec_start(const char *exec, char **ret_exec_start);
|
||||
|
||||
XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path);
|
||||
|
||||
Reference in New Issue
Block a user