Merge pull request #32868 from keszybz/more-whomification
Fix confusion between killer and prey
This commit is contained in:
@@ -113,7 +113,7 @@ node /org/freedesktop/login1 {
|
||||
LockSessions();
|
||||
UnlockSessions();
|
||||
KillSession(in s session_id,
|
||||
in s who,
|
||||
in s whom,
|
||||
in i signal_number);
|
||||
KillUser(in u uid,
|
||||
in i signal_number);
|
||||
@@ -1140,7 +1140,7 @@ node /org/freedesktop/login1/session/1 {
|
||||
Unlock();
|
||||
SetIdleHint(in b idle);
|
||||
SetLockedHint(in b locked);
|
||||
Kill(in s who,
|
||||
Kill(in s whom,
|
||||
in i signal_number);
|
||||
TakeControl(in b force);
|
||||
ReleaseControl();
|
||||
|
||||
@@ -465,7 +465,7 @@ node /org/freedesktop/machine1/machine/rawhide {
|
||||
interface org.freedesktop.machine1.Machine {
|
||||
methods:
|
||||
Terminate();
|
||||
Kill(in s who,
|
||||
Kill(in s whom,
|
||||
in i signal);
|
||||
GetAddresses(out a(iay) addresses);
|
||||
GetSSHInfo(out s ssh_address,
|
||||
|
||||
+1
-1
@@ -723,7 +723,7 @@ gperf = find_program('gperf')
|
||||
|
||||
gperf_test_format = '''
|
||||
#include <string.h>
|
||||
const char * in_word_set(const char *, @0@);
|
||||
const char* in_word_set(const char *, @0@);
|
||||
@1@
|
||||
'''
|
||||
gperf_snippet = run_command(sh, '-c', 'echo foo,bar | "$1" -L ANSI-C', '_', gperf,
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ static const struct af_name* lookup_af(register const char *str, register GPERF_
|
||||
#include "af-from-name.h"
|
||||
#include "af-to-name.h"
|
||||
|
||||
const char *af_to_name(int id) {
|
||||
const char* af_to_name(int id) {
|
||||
|
||||
if (id <= 0)
|
||||
return NULL;
|
||||
@@ -39,7 +39,7 @@ int af_max(void) {
|
||||
return ELEMENTSOF(af_names);
|
||||
}
|
||||
|
||||
const char *af_to_ipv4_ipv6(int id) {
|
||||
const char* af_to_ipv4_ipv6(int id) {
|
||||
/* Pretty often we want to map the address family to the typically used protocol name for IPv4 +
|
||||
* IPv6. Let's add special helpers for that. */
|
||||
return id == AF_INET ? "ipv4" :
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "string-util.h"
|
||||
|
||||
const char *af_to_name(int id);
|
||||
const char* af_to_name(int id);
|
||||
int af_from_name(const char *name);
|
||||
|
||||
static inline const char* af_to_name_short(int id) {
|
||||
|
||||
@@ -242,5 +242,5 @@ Architecture uname_architecture(void);
|
||||
# error "Please register your architecture here!"
|
||||
#endif
|
||||
|
||||
const char *architecture_to_string(Architecture a) _const_;
|
||||
const char* architecture_to_string(Architecture a) _const_;
|
||||
Architecture architecture_from_string(const char *s) _pure_;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <stddef.h>
|
||||
|
||||
const char *arphrd_to_name(int id);
|
||||
const char* arphrd_to_name(int id);
|
||||
int arphrd_from_name(const char *name);
|
||||
|
||||
size_t arphrd_to_hw_addr_len(uint16_t arphrd);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ static const struct capability_name* lookup_capability(register const char *str,
|
||||
#include "cap-from-name.h"
|
||||
#include "cap-to-name.h"
|
||||
|
||||
const char *capability_to_name(int id) {
|
||||
const char* capability_to_name(int id) {
|
||||
if (id < 0)
|
||||
return NULL;
|
||||
if (id >= capability_list_length())
|
||||
@@ -27,7 +27,7 @@ const char *capability_to_name(int id) {
|
||||
return capability_names[id];
|
||||
}
|
||||
|
||||
const char *capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]) {
|
||||
const char* capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]) {
|
||||
const char *p;
|
||||
|
||||
if (id < 0)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* "0x", two bytes for the hex value, and one trailing NUL byte. */
|
||||
#define CAPABILITY_TO_STRING_MAX (2 + 2 + 1)
|
||||
|
||||
const char *capability_to_name(int id);
|
||||
const char *capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]);
|
||||
const char* capability_to_name(int id);
|
||||
const char* capability_to_string(int id, char buf[static CAPABILITY_TO_STRING_MAX]);
|
||||
#define CAPABILITY_TO_STRING(id) capability_to_string(id, (char[CAPABILITY_TO_STRING_MAX]) {})
|
||||
|
||||
int capability_from_name(const char *name);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -21,5 +21,5 @@ typedef enum ConfidentialVirtualization {
|
||||
|
||||
ConfidentialVirtualization detect_confidential_virtualization(void);
|
||||
|
||||
const char *confidential_virtualization_to_string(ConfidentialVirtualization v) _const_;
|
||||
const char* confidential_virtualization_to_string(ConfidentialVirtualization v) _const_;
|
||||
ConfidentialVirtualization confidential_virtualization_from_string(const char *s) _pure_;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -12,7 +12,7 @@ static const struct errno_name* lookup_errno(register const char *str,
|
||||
#include "errno-from-name.h"
|
||||
#include "errno-to-name.h"
|
||||
|
||||
const char *errno_to_name(int id) {
|
||||
const char* errno_to_name(int id) {
|
||||
|
||||
if (id < 0)
|
||||
id = -id;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#define ERRNO_MAX 4095
|
||||
|
||||
const char *errno_to_name(int id);
|
||||
const char* errno_to_name(int id);
|
||||
int errno_from_name(const char *name);
|
||||
static inline bool errno_is_valid(int n) {
|
||||
return n > 0 && n <= ERRNO_MAX;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1091,7 +1091,7 @@ int fds_are_same_mount(int fd1, int fd2) {
|
||||
return statx_mount_same(&st1.nsx, &st2.nsx);
|
||||
}
|
||||
|
||||
const char *accmode_to_string(int flags) {
|
||||
const char* accmode_to_string(int flags) {
|
||||
switch (flags & O_ACCMODE) {
|
||||
case O_RDONLY:
|
||||
return "ro";
|
||||
@@ -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);
|
||||
|
||||
+3
-3
@@ -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) \
|
||||
@@ -163,7 +163,7 @@ char *format_proc_pid_fd_path(char buf[static PROC_PID_FD_PATH_MAX], pid_t pid,
|
||||
|
||||
int proc_fd_enoent_errno(void);
|
||||
|
||||
const char *accmode_to_string(int flags);
|
||||
const char* accmode_to_string(int flags);
|
||||
|
||||
/* Like ASSERT_PTR, but for fds */
|
||||
#define ASSERT_FD(fd) \
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "filesystems-gperf.h"
|
||||
#include "stat-util.h"
|
||||
|
||||
const char *fs_type_to_string(statfs_f_type_t magic) {
|
||||
const char* fs_type_to_string(statfs_f_type_t magic) {
|
||||
|
||||
switch (magic) {
|
||||
#include "filesystem-switch-case.h"
|
||||
|
||||
@@ -34,7 +34,7 @@ extern const FilesystemSet filesystem_sets[];
|
||||
|
||||
const FilesystemSet *filesystem_set_find(const char *name);
|
||||
|
||||
const char *fs_type_to_string(statfs_f_type_t magic);
|
||||
const char* fs_type_to_string(statfs_f_type_t magic);
|
||||
int fs_type_from_string(const char *name, const statfs_f_type_t **ret);
|
||||
bool fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool emoji_enabled(void) {
|
||||
return cached_emoji_enabled;
|
||||
}
|
||||
|
||||
const char *special_glyph_full(SpecialGlyph code, bool force_utf) {
|
||||
const char* special_glyph_full(SpecialGlyph 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
|
||||
|
||||
@@ -61,16 +61,16 @@ typedef enum SpecialGlyph {
|
||||
|
||||
bool emoji_enabled(void);
|
||||
|
||||
const char *special_glyph_full(SpecialGlyph code, bool force_utf) _const_;
|
||||
const char* special_glyph_full(SpecialGlyph code, bool force_utf) _const_;
|
||||
|
||||
static inline const char *special_glyph(SpecialGlyph code) {
|
||||
static inline const char* special_glyph(SpecialGlyph code) {
|
||||
return special_glyph_full(code, false);
|
||||
}
|
||||
|
||||
static inline const char *special_glyph_check_mark(bool b) {
|
||||
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 *special_glyph_check_mark_space(bool b) {
|
||||
static inline const char* special_glyph_check_mark_space(bool b) {
|
||||
return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : " ";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -1741,7 +1741,7 @@ void log_setup(void) {
|
||||
log_show_color(true);
|
||||
}
|
||||
|
||||
const char *_log_set_prefix(const char *prefix, bool force) {
|
||||
const char* _log_set_prefix(const char *prefix, bool force) {
|
||||
const char *old = log_prefix;
|
||||
|
||||
if (prefix || force)
|
||||
|
||||
+3
-3
@@ -49,7 +49,7 @@ static inline void clear_log_syntax_callback(dummy_t *dummy) {
|
||||
set_log_syntax_callback(/* cb= */ NULL, /* userdata= */ NULL);
|
||||
}
|
||||
|
||||
const char *log_target_to_string(LogTarget target) _const_;
|
||||
const char* log_target_to_string(LogTarget target) _const_;
|
||||
LogTarget log_target_from_string(const char *s) _pure_;
|
||||
void log_set_target(LogTarget target);
|
||||
void log_set_target_and_open(LogTarget target);
|
||||
@@ -432,8 +432,8 @@ typedef struct LogRateLimit {
|
||||
#define log_ratelimit_error_errno(error, ...) log_ratelimit_full_errno(LOG_ERR, error, __VA_ARGS__)
|
||||
#define log_ratelimit_emergency_errno(error, ...) log_ratelimit_full_errno(log_emergency_level(), error, __VA_ARGS__)
|
||||
|
||||
const char *_log_set_prefix(const char *prefix, bool force);
|
||||
static inline const char *_log_unset_prefixp(const char **p) {
|
||||
const char* _log_set_prefix(const char *prefix, bool force);
|
||||
static inline const char* _log_unset_prefixp(const char **p) {
|
||||
assert(p);
|
||||
_log_set_prefix(*p, true);
|
||||
return NULL;
|
||||
|
||||
@@ -647,7 +647,7 @@ int mount_nofollow(
|
||||
return mount_fd(source, fd, filesystemtype, mountflags, data);
|
||||
}
|
||||
|
||||
const char *mount_propagation_flag_to_string(unsigned long flags) {
|
||||
const char* mount_propagation_flag_to_string(unsigned long flags) {
|
||||
|
||||
switch (flags & (MS_SHARED|MS_SLAVE|MS_PRIVATE)) {
|
||||
case 0:
|
||||
|
||||
@@ -70,7 +70,7 @@ int mount_nofollow(
|
||||
unsigned long mountflags,
|
||||
const void *data);
|
||||
|
||||
const char *mount_propagation_flag_to_string(unsigned long flags);
|
||||
const char* mount_propagation_flag_to_string(unsigned long flags);
|
||||
int mount_propagation_flag_from_string(const char *name, unsigned long *ret);
|
||||
bool mount_propagation_flag_is_valid(unsigned long flag);
|
||||
|
||||
|
||||
+1
-1
@@ -476,7 +476,7 @@ int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eo
|
||||
return DIV_ROUND_UP(now(CLOCK_REALTIME), USEC_PER_SEC) > (usec_t) eol;
|
||||
}
|
||||
|
||||
const char *os_release_pretty_name(const char *pretty_name, const char *name) {
|
||||
const char* os_release_pretty_name(const char *pretty_name, const char *name) {
|
||||
/* Distills a "pretty" name to show from os-release data. First argument is supposed to be the
|
||||
* PRETTY_NAME= field, the second one the NAME= field. This function is trivial, of course, and
|
||||
* exists mostly to ensure we use the same logic wherever possible. */
|
||||
|
||||
+1
-1
@@ -57,4 +57,4 @@ int load_os_release_pairs_with_prefix(const char *root, const char *prefix, char
|
||||
|
||||
int os_release_support_ended(const char *support_end, bool quiet, usec_t *ret_eol);
|
||||
|
||||
const char *os_release_pretty_name(const char *pretty_name, const char *name);
|
||||
const char* os_release_pretty_name(const char *pretty_name, const char *name);
|
||||
|
||||
@@ -203,7 +203,7 @@ bool dot_or_dot_dot(const char *path);
|
||||
|
||||
bool path_implies_directory(const char *path);
|
||||
|
||||
static inline const char *skip_dev_prefix(const char *p) {
|
||||
static inline const char* skip_dev_prefix(const char *p) {
|
||||
const char *e;
|
||||
|
||||
/* Drop any /dev prefix if there is any */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -113,12 +113,12 @@ bool oom_score_adjust_is_valid(int oa);
|
||||
#define OPINIONATED_PERSONALITY_MASK 0xFFUL
|
||||
|
||||
unsigned long personality_from_string(const char *p);
|
||||
const char *personality_to_string(unsigned long);
|
||||
const char* personality_to_string(unsigned long);
|
||||
|
||||
int safe_personality(unsigned long p);
|
||||
int opinionated_personality(unsigned long *ret);
|
||||
|
||||
const char *sigchld_code_to_string(int i) _const_;
|
||||
const char* sigchld_code_to_string(int i) _const_;
|
||||
int sigchld_code_from_string(const char *s) _pure_;
|
||||
|
||||
int sched_policy_to_string_alloc(int i, char **s);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "macro.h"
|
||||
#include "missing_resource.h"
|
||||
|
||||
const char *rlimit_to_string(int i) _const_;
|
||||
const char* rlimit_to_string(int i) _const_;
|
||||
int rlimit_from_string(const char *s) _pure_;
|
||||
int rlimit_from_string_harder(const char *s) _pure_;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef enum RuntimeScope {
|
||||
_RUNTIME_SCOPE_INVALID = -EINVAL,
|
||||
} RuntimeScope;
|
||||
|
||||
const char *runtime_scope_to_string(RuntimeScope scope) _const_;
|
||||
const char* runtime_scope_to_string(RuntimeScope scope) _const_;
|
||||
RuntimeScope runtime_scope_from_string(const char *s) _const_;
|
||||
|
||||
const char *runtime_scope_cmdline_option_to_string(RuntimeScope scope) _const_;
|
||||
const char* runtime_scope_cmdline_option_to_string(RuntimeScope scope) _const_;
|
||||
|
||||
@@ -151,7 +151,7 @@ static const char *const static_signal_table[] = {
|
||||
|
||||
DEFINE_PRIVATE_STRING_TABLE_LOOKUP(static_signal, int);
|
||||
|
||||
const char *signal_to_string(int signo) {
|
||||
const char* signal_to_string(int signo) {
|
||||
static thread_local char buf[STRLEN("RTMIN+") + DECIMAL_STR_MAX(int)];
|
||||
const char *name;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ int sigset_add_many_internal(sigset_t *ss, ...);
|
||||
int sigprocmask_many_internal(int how, sigset_t *old, ...);
|
||||
#define sigprocmask_many(...) sigprocmask_many_internal(__VA_ARGS__, -1)
|
||||
|
||||
const char *signal_to_string(int i) _const_;
|
||||
const char* signal_to_string(int i) _const_;
|
||||
int signal_from_string(const char *s) _pure_;
|
||||
|
||||
void nop_signal_handler(int sig);
|
||||
|
||||
@@ -15,7 +15,7 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
|
||||
|
||||
/* For basic lookup tables with strictly enumerated entries */
|
||||
#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
|
||||
scope const char *name##_to_string(type i) { \
|
||||
scope const char* name##_to_string(type i) { \
|
||||
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
|
||||
return NULL; \
|
||||
return name##_table[i]; \
|
||||
|
||||
+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)
|
||||
|
||||
+29
-29
@@ -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 */
|
||||
@@ -49,7 +49,7 @@ static inline const char* strnull(const char *s) {
|
||||
return s ?: "(null)";
|
||||
}
|
||||
|
||||
static inline const char *strna(const char *s) {
|
||||
static inline const char* strna(const char *s) {
|
||||
return s ?: "n/a";
|
||||
}
|
||||
|
||||
@@ -81,11 +81,11 @@ static inline const char* enabled_disabled(bool b) {
|
||||
(typeof(p)) (isempty(_p) ? NULL : _p); \
|
||||
})
|
||||
|
||||
static inline const char *empty_to_na(const char *p) {
|
||||
static inline const char* empty_to_na(const char *p) {
|
||||
return isempty(p) ? "n/a" : p;
|
||||
}
|
||||
|
||||
static inline const char *empty_to_dash(const char *str) {
|
||||
static inline const char* empty_to_dash(const char *str) {
|
||||
return isempty(str) ? "-" : str;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ static inline bool empty_or_dash(const char *str) {
|
||||
(str[0] == '-' && str[1] == 0);
|
||||
}
|
||||
|
||||
static inline const char *empty_or_dash_to_null(const char *p) {
|
||||
static inline const char* empty_or_dash_to_null(const char *p) {
|
||||
return empty_or_dash(p) ? NULL : p;
|
||||
}
|
||||
#define empty_or_dash_to_null(p) \
|
||||
@@ -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);
|
||||
|
||||
@@ -790,7 +790,7 @@ bool tty_is_vc_resolve(const char *tty) {
|
||||
return tty_is_vc(tty);
|
||||
}
|
||||
|
||||
const char *default_term_for_tty(const char *tty) {
|
||||
const char* default_term_for_tty(const char *tty) {
|
||||
return tty && tty_is_vc_resolve(tty) ? "linux" : "vt220";
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ bool tty_is_vc(const char *tty);
|
||||
bool tty_is_vc_resolve(const char *tty);
|
||||
bool tty_is_console(const char *tty) _pure_;
|
||||
int vtnr_from_tty(const char *tty);
|
||||
const char *default_term_for_tty(const char *tty);
|
||||
const char* default_term_for_tty(const char *tty);
|
||||
|
||||
int make_console_stdio(void);
|
||||
|
||||
@@ -198,15 +198,15 @@ static inline bool colors_enabled(void) {
|
||||
} \
|
||||
}
|
||||
|
||||
static inline const char *ansi_underline(void) {
|
||||
static inline const char* ansi_underline(void) {
|
||||
return underline_enabled() ? ANSI_UNDERLINE : "";
|
||||
}
|
||||
|
||||
static inline const char *ansi_add_underline(void) {
|
||||
static inline const char* ansi_add_underline(void) {
|
||||
return underline_enabled() ? ANSI_ADD_UNDERLINE : "";
|
||||
}
|
||||
|
||||
static inline const char *ansi_add_underline_grey(void) {
|
||||
static inline const char* ansi_add_underline_grey(void) {
|
||||
return underline_enabled() ?
|
||||
(colors_enabled() ? ANSI_ADD_UNDERLINE_GREY : ANSI_ADD_UNDERLINE) : "";
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -58,7 +58,7 @@ const char* unit_dbus_interface_from_type(UnitType t) {
|
||||
return table[t];
|
||||
}
|
||||
|
||||
const char *unit_dbus_interface_from_name(const char *name) {
|
||||
const char* unit_dbus_interface_from_name(const char *name) {
|
||||
UnitType t;
|
||||
|
||||
t = unit_name_to_type(name);
|
||||
|
||||
@@ -280,28 +280,28 @@ 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);
|
||||
const char *unit_dbus_interface_from_name(const char *name);
|
||||
const char* unit_dbus_interface_from_name(const char *name);
|
||||
|
||||
const char *unit_type_to_string(UnitType i) _const_;
|
||||
const char* unit_type_to_string(UnitType i) _const_;
|
||||
UnitType unit_type_from_string(const char *s) _pure_;
|
||||
|
||||
const char* unit_type_to_capitalized_string(UnitType t);
|
||||
|
||||
const char *unit_load_state_to_string(UnitLoadState i) _const_;
|
||||
const char* unit_load_state_to_string(UnitLoadState i) _const_;
|
||||
UnitLoadState unit_load_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *unit_active_state_to_string(UnitActiveState i) _const_;
|
||||
const char* unit_active_state_to_string(UnitActiveState i) _const_;
|
||||
UnitActiveState unit_active_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *freezer_state_to_string(FreezerState i) _const_;
|
||||
const char* freezer_state_to_string(FreezerState i) _const_;
|
||||
FreezerState freezer_state_from_string(const char *s) _pure_;
|
||||
FreezerState freezer_state_finish(FreezerState i) _const_;
|
||||
|
||||
const char *unit_marker_to_string(UnitMarker m) _const_;
|
||||
const char* unit_marker_to_string(UnitMarker m) _const_;
|
||||
UnitMarker unit_marker_from_string(const char *s) _pure_;
|
||||
|
||||
const char* automount_state_to_string(AutomountState i) _const_;
|
||||
@@ -334,10 +334,10 @@ SwapState swap_state_from_string(const char *s) _pure_;
|
||||
const char* target_state_to_string(TargetState i) _const_;
|
||||
TargetState target_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *timer_state_to_string(TimerState i) _const_;
|
||||
const char* timer_state_to_string(TimerState i) _const_;
|
||||
TimerState timer_state_from_string(const char *s) _pure_;
|
||||
|
||||
const char *unit_dependency_to_string(UnitDependency i) _const_;
|
||||
const char* unit_dependency_to_string(UnitDependency i) _const_;
|
||||
UnitDependency unit_dependency_from_string(const char *s) _pure_;
|
||||
|
||||
const char* notify_access_to_string(NotifyAccess i) _const_;
|
||||
|
||||
@@ -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!) */
|
||||
|
||||
+1
-1
@@ -65,6 +65,6 @@ Virtualization detect_virtualization(void);
|
||||
int running_in_userns(void);
|
||||
int running_in_chroot(void);
|
||||
|
||||
const char *virtualization_to_string(Virtualization v) _const_;
|
||||
const char* virtualization_to_string(Virtualization v) _const_;
|
||||
Virtualization virtualization_from_string(const char *s) _pure_;
|
||||
bool has_cpu_with_flag(const char *flag);
|
||||
|
||||
@@ -27,7 +27,7 @@ int sync_everything(void) {
|
||||
return r;
|
||||
}
|
||||
|
||||
const char *get_efi_arch(void) {
|
||||
const char* get_efi_arch(void) {
|
||||
/* Detect EFI firmware architecture of the running system. On mixed mode systems, it could be 32-bit
|
||||
* while the kernel is running in 64-bit. */
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
int sync_everything(void);
|
||||
|
||||
const char *get_efi_arch(void);
|
||||
const char* get_efi_arch(void);
|
||||
|
||||
int get_file_version(int fd, char **ret);
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ extern bool arg_dry_run;
|
||||
extern ImagePolicy *arg_image_policy;
|
||||
extern bool arg_varlink;
|
||||
|
||||
static inline const char *arg_dollar_boot_path(void) {
|
||||
static inline const char* arg_dollar_boot_path(void) {
|
||||
/* $BOOT shall be the XBOOTLDR partition if it exists, and otherwise the ESP */
|
||||
return arg_xbootldr_path ?: arg_esp_path;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+2
-2
@@ -780,7 +780,7 @@ static char *format_cgroup_memory_limit_comparison(Unit *u, const char *property
|
||||
return buf;
|
||||
}
|
||||
|
||||
const char *cgroup_device_permissions_to_string(CGroupDevicePermissions p) {
|
||||
const char* cgroup_device_permissions_to_string(CGroupDevicePermissions p) {
|
||||
static const char *table[_CGROUP_DEVICE_PERMISSIONS_MAX] = {
|
||||
/* Lets simply define a table with every possible combination. As long as those are just 8 we
|
||||
* can get away with it. If this ever grows to more we need to revisit this logic though. */
|
||||
@@ -2615,7 +2615,7 @@ void unit_invalidate_cgroup_members_masks(Unit *u) {
|
||||
unit_invalidate_cgroup_members_masks(slice);
|
||||
}
|
||||
|
||||
const char *unit_get_realized_cgroup_path(Unit *u, CGroupMask mask) {
|
||||
const char* unit_get_realized_cgroup_path(Unit *u, CGroupMask mask) {
|
||||
|
||||
/* Returns the realized cgroup path of the specified unit where all specified controllers are available. */
|
||||
|
||||
|
||||
+2
-2
@@ -437,7 +437,7 @@ void unit_invalidate_cgroup_members_masks(Unit *u);
|
||||
|
||||
void unit_add_family_to_cgroup_realize_queue(Unit *u);
|
||||
|
||||
const char *unit_get_realized_cgroup_path(Unit *u, CGroupMask mask);
|
||||
const char* unit_get_realized_cgroup_path(Unit *u, CGroupMask mask);
|
||||
int unit_default_cgroup_path(const Unit *u, char **ret);
|
||||
int unit_set_cgroup_path(Unit *u, const char *path);
|
||||
int unit_pick_cgroup_path(Unit *u);
|
||||
@@ -537,7 +537,7 @@ int cgroup_runtime_deserialize_one(Unit *u, const char *key, const char *value,
|
||||
const char* cgroup_pressure_watch_to_string(CGroupPressureWatch a) _const_;
|
||||
CGroupPressureWatch cgroup_pressure_watch_from_string(const char *s) _pure_;
|
||||
|
||||
const char *cgroup_device_permissions_to_string(CGroupDevicePermissions p) _const_;
|
||||
const char* cgroup_device_permissions_to_string(CGroupDevicePermissions p) _const_;
|
||||
CGroupDevicePermissions cgroup_device_permissions_from_string(const char *s) _pure_;
|
||||
|
||||
const char* cgroup_ip_accounting_metric_to_string(CGroupIPAccountingMetric m) _const_;
|
||||
|
||||
@@ -504,9 +504,9 @@ int bus_unit_method_enqueue_job(sd_bus_message *message, void *userdata, sd_bus_
|
||||
int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *error) {
|
||||
Unit *u = ASSERT_PTR(userdata);
|
||||
int32_t value = 0;
|
||||
const char *swho;
|
||||
const char *swhom;
|
||||
int32_t signo;
|
||||
KillWho who;
|
||||
KillWhom whom;
|
||||
int r, code;
|
||||
|
||||
assert(message);
|
||||
@@ -515,7 +515,7 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = sd_bus_message_read(message, "si", &swho, &signo);
|
||||
r = sd_bus_message_read(message, "si", &swhom, &signo);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -528,12 +528,12 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *
|
||||
} else
|
||||
code = SI_USER;
|
||||
|
||||
if (isempty(swho))
|
||||
who = KILL_ALL;
|
||||
if (isempty(swhom))
|
||||
whom = KILL_ALL;
|
||||
else {
|
||||
who = kill_who_from_string(swho);
|
||||
if (who < 0)
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid who argument: %s", swho);
|
||||
whom = kill_whom_from_string(swhom);
|
||||
if (whom < 0)
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid whom argument: %s", swhom);
|
||||
}
|
||||
|
||||
if (!SIGNAL_VALID(signo))
|
||||
@@ -554,7 +554,7 @@ int bus_unit_method_kill(sd_bus_message *message, void *userdata, sd_bus_error *
|
||||
if (r == 0)
|
||||
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
|
||||
|
||||
r = unit_kill(u, who, signo, code, value, error);
|
||||
r = unit_kill(u, whom, signo, code, value, error);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ static bool is_terminal_output(ExecOutput o) {
|
||||
EXEC_OUTPUT_JOURNAL_AND_CONSOLE);
|
||||
}
|
||||
|
||||
const char *exec_context_tty_path(const ExecContext *context) {
|
||||
const char* exec_context_tty_path(const ExecContext *context) {
|
||||
assert(context);
|
||||
|
||||
if (context->stdio_as_fds)
|
||||
|
||||
+1
-1
@@ -525,7 +525,7 @@ void exec_context_revert_tty(ExecContext *c);
|
||||
int exec_context_get_clean_directories(ExecContext *c, char **prefix, ExecCleanMask mask, char ***ret);
|
||||
int exec_context_get_clean_mask(ExecContext *c, ExecCleanMask *ret);
|
||||
|
||||
const char *exec_context_tty_path(const ExecContext *context);
|
||||
const char* exec_context_tty_path(const ExecContext *context);
|
||||
int exec_context_apply_tty_size(const ExecContext *context, int tty_fd, const char *tty_path);
|
||||
void exec_context_tty_reset(const ExecContext *context, const ExecParameters *p);
|
||||
|
||||
|
||||
+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);
|
||||
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ static const char* const kill_mode_table[_KILL_MODE_MAX] = {
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(kill_mode, KillMode);
|
||||
|
||||
static const char* const kill_who_table[_KILL_WHO_MAX] = {
|
||||
static const char* const kill_whom_table[_KILL_WHOM_MAX] = {
|
||||
[KILL_MAIN] = "main",
|
||||
[KILL_CONTROL] = "control",
|
||||
[KILL_ALL] = "all",
|
||||
@@ -53,4 +53,4 @@ static const char* const kill_who_table[_KILL_WHO_MAX] = {
|
||||
[KILL_ALL_FAIL] = "all-fail",
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(kill_who, KillWho);
|
||||
DEFINE_STRING_TABLE_LOOKUP(kill_whom, KillWhom);
|
||||
|
||||
+8
-8
@@ -28,26 +28,26 @@ struct KillContext {
|
||||
bool send_sighup;
|
||||
};
|
||||
|
||||
typedef enum KillWho {
|
||||
/* Kill who is a property of an operation */
|
||||
typedef enum KillWhom {
|
||||
/* Kill whom is a property of an operation */
|
||||
KILL_MAIN,
|
||||
KILL_CONTROL,
|
||||
KILL_ALL,
|
||||
KILL_MAIN_FAIL,
|
||||
KILL_CONTROL_FAIL,
|
||||
KILL_ALL_FAIL,
|
||||
_KILL_WHO_MAX,
|
||||
_KILL_WHO_INVALID = -EINVAL,
|
||||
} KillWho;
|
||||
_KILL_WHOM_MAX,
|
||||
_KILL_WHOM_INVALID = -EINVAL,
|
||||
} KillWhom;
|
||||
|
||||
void kill_context_init(KillContext *c);
|
||||
void kill_context_dump(KillContext *c, FILE *f, const char *prefix);
|
||||
|
||||
const char *kill_mode_to_string(KillMode k) _const_;
|
||||
const char* kill_mode_to_string(KillMode k) _const_;
|
||||
KillMode kill_mode_from_string(const char *s) _pure_;
|
||||
|
||||
const char *kill_who_to_string(KillWho k) _const_;
|
||||
KillWho kill_who_from_string(const char *s) _pure_;
|
||||
const char* kill_whom_to_string(KillWhom k) _const_;
|
||||
KillWhom kill_whom_from_string(const char *s) _pure_;
|
||||
|
||||
static inline int restart_kill_signal(const KillContext *c) {
|
||||
if (c->restart_kill_signal != 0)
|
||||
|
||||
+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;
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ void timer_free_values(Timer *t);
|
||||
extern const UnitVTable timer_vtable;
|
||||
extern const ActivationDetailsVTable activation_details_timer_vtable;
|
||||
|
||||
const char *timer_base_to_string(TimerBase i) _const_;
|
||||
const char* timer_base_to_string(TimerBase i) _const_;
|
||||
TimerBase timer_base_from_string(const char *s) _pure_;
|
||||
|
||||
char* timer_base_to_usec_string(TimerBase i);
|
||||
|
||||
+12
-12
@@ -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))
|
||||
@@ -3491,7 +3491,7 @@ int unit_set_default_slice(Unit *u) {
|
||||
return unit_set_slice(u, slice);
|
||||
}
|
||||
|
||||
const char *unit_slice_name(Unit *u) {
|
||||
const char* unit_slice_name(Unit *u) {
|
||||
Unit *slice;
|
||||
assert(u);
|
||||
|
||||
@@ -4011,7 +4011,7 @@ static int unit_kill_one(
|
||||
|
||||
int unit_kill(
|
||||
Unit *u,
|
||||
KillWho who,
|
||||
KillWhom whom,
|
||||
int signo,
|
||||
int code,
|
||||
int value,
|
||||
@@ -4026,8 +4026,8 @@ int unit_kill(
|
||||
* stop a service ourselves. */
|
||||
|
||||
assert(u);
|
||||
assert(who >= 0);
|
||||
assert(who < _KILL_WHO_MAX);
|
||||
assert(whom >= 0);
|
||||
assert(whom < _KILL_WHOM_MAX);
|
||||
assert(SIGNAL_VALID(signo));
|
||||
assert(IN_SET(code, SI_USER, SI_QUEUE));
|
||||
|
||||
@@ -4037,27 +4037,27 @@ int unit_kill(
|
||||
if (!UNIT_HAS_CGROUP_CONTEXT(u) && !main_pid && !control_pid)
|
||||
return sd_bus_error_setf(ret_error, SD_BUS_ERROR_NOT_SUPPORTED, "Unit type does not support process killing.");
|
||||
|
||||
if (IN_SET(who, KILL_MAIN, KILL_MAIN_FAIL)) {
|
||||
if (IN_SET(whom, KILL_MAIN, KILL_MAIN_FAIL)) {
|
||||
if (!main_pid)
|
||||
return sd_bus_error_setf(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no main processes", unit_type_to_string(u->type));
|
||||
if (!pidref_is_set(main_pid))
|
||||
return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No main process to kill");
|
||||
}
|
||||
|
||||
if (IN_SET(who, KILL_CONTROL, KILL_CONTROL_FAIL)) {
|
||||
if (IN_SET(whom, KILL_CONTROL, KILL_CONTROL_FAIL)) {
|
||||
if (!control_pid)
|
||||
return sd_bus_error_setf(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "%s units have no control processes", unit_type_to_string(u->type));
|
||||
if (!pidref_is_set(control_pid))
|
||||
return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No control process to kill");
|
||||
}
|
||||
|
||||
if (IN_SET(who, KILL_CONTROL, KILL_CONTROL_FAIL, KILL_ALL, KILL_ALL_FAIL)) {
|
||||
if (IN_SET(whom, KILL_CONTROL, KILL_CONTROL_FAIL, KILL_ALL, KILL_ALL_FAIL)) {
|
||||
r = unit_kill_one(u, control_pid, "control", signo, code, value, ret_error);
|
||||
RET_GATHER(ret, r);
|
||||
killed = killed || r > 0;
|
||||
}
|
||||
|
||||
if (IN_SET(who, KILL_MAIN, KILL_MAIN_FAIL, KILL_ALL, KILL_ALL_FAIL)) {
|
||||
if (IN_SET(whom, KILL_MAIN, KILL_MAIN_FAIL, KILL_ALL, KILL_ALL_FAIL)) {
|
||||
r = unit_kill_one(u, main_pid, "main", signo, code, value, ret >= 0 ? ret_error : NULL);
|
||||
RET_GATHER(ret, r);
|
||||
killed = killed || r > 0;
|
||||
@@ -4066,7 +4066,7 @@ int unit_kill(
|
||||
/* Note: if we shall enqueue rather than kill we won't do this via the cgroup mechanism, since it
|
||||
* doesn't really make much sense (and given that enqueued values are a relatively expensive
|
||||
* resource, and we shouldn't allow us to be subjects for such allocation sprees) */
|
||||
if (IN_SET(who, KILL_ALL, KILL_ALL_FAIL) && code == SI_USER) {
|
||||
if (IN_SET(whom, KILL_ALL, KILL_ALL_FAIL) && code == SI_USER) {
|
||||
CGroupRuntime *crt = unit_get_cgroup_runtime(u);
|
||||
|
||||
if (crt && crt->cgroup_path) {
|
||||
@@ -4098,7 +4098,7 @@ int unit_kill(
|
||||
}
|
||||
|
||||
/* If the "fail" versions of the operation are requested, then complain if the set of processes we killed is empty */
|
||||
if (ret >= 0 && !killed && IN_SET(who, KILL_ALL_FAIL, KILL_CONTROL_FAIL, KILL_MAIN_FAIL))
|
||||
if (ret >= 0 && !killed && IN_SET(whom, KILL_ALL_FAIL, KILL_CONTROL_FAIL, KILL_MAIN_FAIL))
|
||||
return sd_bus_error_set_const(ret_error, BUS_ERROR_NO_SUCH_PROCESS, "No matching processes to kill");
|
||||
|
||||
return ret;
|
||||
|
||||
+6
-6
@@ -843,8 +843,8 @@ int unit_load(Unit *unit);
|
||||
int unit_set_slice(Unit *u, Unit *slice);
|
||||
int unit_set_default_slice(Unit *u);
|
||||
|
||||
const char *unit_description(Unit *u) _pure_;
|
||||
const char *unit_status_string(Unit *u, char **combined);
|
||||
const char* unit_description(Unit *u) _pure_;
|
||||
const char* unit_status_string(Unit *u, char **combined);
|
||||
|
||||
bool unit_has_name(const Unit *u, const char *name);
|
||||
|
||||
@@ -862,7 +862,7 @@ int unit_start(Unit *u, ActivationDetails *details);
|
||||
int unit_stop(Unit *u);
|
||||
int unit_reload(Unit *u);
|
||||
|
||||
int unit_kill(Unit *u, KillWho w, int signo, int code, int value, sd_bus_error *ret_error);
|
||||
int unit_kill(Unit *u, KillWhom w, int signo, int code, int value, sd_bus_error *ret_error);
|
||||
|
||||
void unit_notify_cgroup_oom(Unit *u, bool managed_oom);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -906,7 +906,7 @@ void unit_reset_failed(Unit *u);
|
||||
Unit *unit_following(Unit *u);
|
||||
int unit_following_set(Unit *u, Set **s);
|
||||
|
||||
const char *unit_slice_name(Unit *u);
|
||||
const char* unit_slice_name(Unit *u);
|
||||
|
||||
bool unit_stop_pending(Unit *u) _pure_;
|
||||
bool unit_inactive_or_pending(Unit *u) _pure_;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/* for more information see libcryptsetup.h crypt-tokens section */
|
||||
|
||||
const char *cryptsetup_token_version(void);
|
||||
const char* cryptsetup_token_version(void);
|
||||
|
||||
int cryptsetup_token_open(struct crypt_device *cd, int token,
|
||||
char **password, size_t *password_len, void *usrptr);
|
||||
|
||||
@@ -137,10 +137,10 @@ int bus_message_append_secret(sd_bus_message *m, UserRecord *secret) {
|
||||
return sd_bus_message_append(m, "s", formatted);
|
||||
}
|
||||
|
||||
const char *home_record_dir(void) {
|
||||
const char* home_record_dir(void) {
|
||||
return secure_getenv("SYSTEMD_HOME_RECORD_DIR") ?: "/var/lib/systemd/home/";
|
||||
}
|
||||
|
||||
const char *home_system_blob_dir(void) {
|
||||
const char* home_system_blob_dir(void) {
|
||||
return secure_getenv("SYSTEMD_HOME_SYSTEM_BLOB_DIR") ?: "/var/cache/systemd/home/";
|
||||
}
|
||||
|
||||
@@ -44,5 +44,5 @@ int bus_message_append_secret(sd_bus_message *m, UserRecord *secret);
|
||||
* operations permit a *very* long timeout */
|
||||
#define HOME_SLOW_BUS_CALL_TIMEOUT_USEC (2*USEC_PER_MINUTE)
|
||||
|
||||
const char *home_record_dir(void);
|
||||
const char *home_system_blob_dir(void);
|
||||
const char* home_record_dir(void);
|
||||
const char* home_system_blob_dir(void);
|
||||
|
||||
@@ -231,5 +231,5 @@ bool home_shall_rebalance(Home *h);
|
||||
|
||||
bool home_is_busy(Home *h);
|
||||
|
||||
const char *home_state_to_string(HomeState state);
|
||||
const char* home_state_to_string(HomeState state);
|
||||
HomeState home_state_from_string(const char *s);
|
||||
|
||||
@@ -219,12 +219,12 @@ CONFIG_PARSER_PROTOTYPE(config_parse_line_max);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_compress);
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_forward_to_socket);
|
||||
|
||||
const char *storage_to_string(Storage s) _const_;
|
||||
const char* storage_to_string(Storage s) _const_;
|
||||
Storage storage_from_string(const char *s) _pure_;
|
||||
|
||||
CONFIG_PARSER_PROTOTYPE(config_parse_split_mode);
|
||||
|
||||
const char *split_mode_to_string(SplitMode s) _const_;
|
||||
const char* split_mode_to_string(SplitMode s) _const_;
|
||||
SplitMode split_mode_from_string(const char *s) _pure_;
|
||||
|
||||
int server_new(Server **ret);
|
||||
|
||||
@@ -22,7 +22,7 @@ typedef enum DHCPState {
|
||||
_DHCP_STATE_INVALID = -EINVAL,
|
||||
} DHCPState;
|
||||
|
||||
const char *dhcp_state_to_string(DHCPState s) _const_;
|
||||
const char* dhcp_state_to_string(DHCPState s) _const_;
|
||||
|
||||
typedef struct sd_dhcp_client sd_dhcp_client;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ static inline bool duid_data_size_is_valid(size_t size) {
|
||||
return size >= MIN_DUID_DATA_LEN && size <= MAX_DUID_DATA_LEN;
|
||||
}
|
||||
|
||||
const char *duid_type_to_string(DUIDType t) _const_;
|
||||
const char* duid_type_to_string(DUIDType t) _const_;
|
||||
int dhcp_duid_to_string_internal(uint16_t type, const void *data, size_t data_size, char **ret);
|
||||
|
||||
int dhcp_identifier_set_iaid(
|
||||
|
||||
@@ -152,9 +152,9 @@ typedef enum DHCP6FQDNFlag {
|
||||
DHCP6_FQDN_FLAG_N = 1 << 2,
|
||||
} DHCP6FQDNFlag;
|
||||
|
||||
const char *dhcp6_state_to_string(DHCP6State s) _const_;
|
||||
const char *dhcp6_message_type_to_string(DHCP6MessageType s) _const_;
|
||||
const char* dhcp6_state_to_string(DHCP6State s) _const_;
|
||||
const char* dhcp6_message_type_to_string(DHCP6MessageType s) _const_;
|
||||
DHCP6MessageType dhcp6_message_type_from_string(const char *s) _pure_;
|
||||
const char *dhcp6_message_status_to_string(DHCP6Status s) _const_;
|
||||
const char* dhcp6_message_status_to_string(DHCP6Status s) _const_;
|
||||
DHCP6Status dhcp6_message_status_from_string(const char *s) _pure_;
|
||||
int dhcp6_message_status_to_errno(DHCP6Status s);
|
||||
|
||||
@@ -273,7 +273,7 @@ int bus_message_type_from_string(const char *s, uint8_t *u) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *bus_message_type_to_string(uint8_t u) {
|
||||
const char* bus_message_type_to_string(uint8_t u) {
|
||||
if (u == SD_BUS_MESSAGE_SIGNAL)
|
||||
return "signal";
|
||||
else if (u == SD_BUS_MESSAGE_METHOD_CALL)
|
||||
@@ -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_;
|
||||
@@ -369,7 +369,7 @@ bool namespace_simple_pattern(const char *pattern, const char *value) _pure_;
|
||||
bool path_simple_pattern(const char *pattern, const char *value) _pure_;
|
||||
|
||||
int bus_message_type_from_string(const char *s, uint8_t *u);
|
||||
const char *bus_message_type_to_string(uint8_t u) _pure_;
|
||||
const char* bus_message_type_to_string(uint8_t u) _pure_;
|
||||
|
||||
#define error_name_is_valid interface_name_is_valid
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -76,5 +76,5 @@ int device_read_uevent_file(sd_device *device);
|
||||
|
||||
int device_set_action(sd_device *device, sd_device_action_t a);
|
||||
sd_device_action_t device_action_from_string(const char *s) _pure_;
|
||||
const char *device_action_to_string(sd_device_action_t a) _const_;
|
||||
const char* device_action_to_string(sd_device_action_t a) _const_;
|
||||
void dump_device_action_table(void);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "macro.h"
|
||||
|
||||
const char *audit_type_to_string(int type);
|
||||
const char* audit_type_to_string(int type);
|
||||
int audit_type_from_string(const char *s);
|
||||
|
||||
/* This is inspired by DNS TYPEnnn formatting */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -903,7 +903,7 @@ _public_ void sd_json_variant_unref_many(sd_json_variant **array, size_t n) {
|
||||
free(array);
|
||||
}
|
||||
|
||||
_public_ const char *sd_json_variant_string(sd_json_variant *v) {
|
||||
_public_ const char* sd_json_variant_string(sd_json_variant *v) {
|
||||
if (!v)
|
||||
return NULL;
|
||||
if (v == JSON_VARIANT_MAGIC_EMPTY_STRING)
|
||||
|
||||
+13
-13
@@ -38,8 +38,8 @@ void udev_set_userdata(struct udev *udev, void *userdata);
|
||||
struct udev_list_entry;
|
||||
struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry);
|
||||
struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name);
|
||||
const char *udev_list_entry_get_name(struct udev_list_entry *list_entry);
|
||||
const char *udev_list_entry_get_value(struct udev_list_entry *list_entry);
|
||||
const char* udev_list_entry_get_name(struct udev_list_entry *list_entry);
|
||||
const char* udev_list_entry_get_value(struct udev_list_entry *list_entry);
|
||||
/**
|
||||
* udev_list_entry_foreach:
|
||||
* @list_entry: entry to store the current position
|
||||
@@ -71,26 +71,26 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device);
|
||||
struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device,
|
||||
const char *subsystem, const char *devtype);
|
||||
/* retrieve device properties */
|
||||
const char *udev_device_get_devpath(struct udev_device *udev_device);
|
||||
const char *udev_device_get_subsystem(struct udev_device *udev_device);
|
||||
const char *udev_device_get_devtype(struct udev_device *udev_device);
|
||||
const char *udev_device_get_syspath(struct udev_device *udev_device);
|
||||
const char *udev_device_get_sysname(struct udev_device *udev_device);
|
||||
const char *udev_device_get_sysnum(struct udev_device *udev_device);
|
||||
const char *udev_device_get_devnode(struct udev_device *udev_device);
|
||||
const char* udev_device_get_devpath(struct udev_device *udev_device);
|
||||
const char* udev_device_get_subsystem(struct udev_device *udev_device);
|
||||
const char* udev_device_get_devtype(struct udev_device *udev_device);
|
||||
const char* udev_device_get_syspath(struct udev_device *udev_device);
|
||||
const char* udev_device_get_sysname(struct udev_device *udev_device);
|
||||
const char* udev_device_get_sysnum(struct udev_device *udev_device);
|
||||
const char* udev_device_get_devnode(struct udev_device *udev_device);
|
||||
int udev_device_get_is_initialized(struct udev_device *udev_device);
|
||||
struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device);
|
||||
struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
|
||||
struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device);
|
||||
struct udev_list_entry *udev_device_get_current_tags_list_entry(struct udev_device *udev_device);
|
||||
struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device);
|
||||
const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
|
||||
const char *udev_device_get_driver(struct udev_device *udev_device);
|
||||
const char* udev_device_get_property_value(struct udev_device *udev_device, const char *key);
|
||||
const char* udev_device_get_driver(struct udev_device *udev_device);
|
||||
dev_t udev_device_get_devnum(struct udev_device *udev_device);
|
||||
const char *udev_device_get_action(struct udev_device *udev_device);
|
||||
const char* udev_device_get_action(struct udev_device *udev_device);
|
||||
unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device);
|
||||
unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device);
|
||||
const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr);
|
||||
const char* udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr);
|
||||
int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, const char *value);
|
||||
int udev_device_has_tag(struct udev_device *udev_device, const char *tag);
|
||||
int udev_device_has_current_tag(struct udev_device *udev_device, const char *tag);
|
||||
|
||||
@@ -3807,7 +3807,7 @@ static const sd_bus_vtable manager_vtable[] = {
|
||||
method_lock_sessions,
|
||||
SD_BUS_VTABLE_UNPRIVILEGED),
|
||||
SD_BUS_METHOD_WITH_ARGS("KillSession",
|
||||
SD_BUS_ARGS("s", session_id, "s", who, "i", signal_number),
|
||||
SD_BUS_ARGS("s", session_id, "s", whom, "i", signal_number),
|
||||
SD_BUS_NO_RESULT,
|
||||
method_kill_session,
|
||||
SD_BUS_VTABLE_UNPRIVILEGED),
|
||||
@@ -4473,7 +4473,7 @@ int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *ret
|
||||
return 1;
|
||||
}
|
||||
|
||||
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error) {
|
||||
int manager_kill_unit(Manager *manager, const char *unit, KillWhom whom, int signo, sd_bus_error *error) {
|
||||
assert(manager);
|
||||
assert(unit);
|
||||
assert(SIGNAL_VALID(signo));
|
||||
@@ -4486,7 +4486,7 @@ int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo
|
||||
NULL,
|
||||
"ssi",
|
||||
unit,
|
||||
who == KILL_LEADER ? "main" : "all",
|
||||
whom == KILL_LEADER ? "main" : "all",
|
||||
signo);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ int manager_start_scope(
|
||||
int manager_start_unit(Manager *manager, const char *unit, sd_bus_error *error, char **ret_job);
|
||||
int manager_stop_unit(Manager *manager, const char *unit, const char *job_mode, sd_bus_error *error, char **ret_job);
|
||||
int manager_abandon_scope(Manager *manager, const char *scope, sd_bus_error *error);
|
||||
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, sd_bus_error *error);
|
||||
int manager_kill_unit(Manager *manager, const char *unit, KillWhom whom, int signo, sd_bus_error *error);
|
||||
int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *error);
|
||||
int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *error);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user