1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-31 21:18:09 +03:00

various: move const ptr indicator to return value

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-05-17 08:54:00 +02:00
parent cd2fb04960
commit bfd5a0687f
141 changed files with 272 additions and 272 deletions

View File

@ -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,

View File

@ -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" :

View File

@ -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) {

View File

@ -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_;

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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_;

View File

@ -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;

View File

@ -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;

View File

@ -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";

View File

@ -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) \

View File

@ -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"

View File

@ -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);

View File

@ -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

View File

@ -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) : " ";
}

View File

@ -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)

View File

@ -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;

View File

@ -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:

View File

@ -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);

View File

@ -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. */

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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_;

View File

@ -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_;

View File

@ -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;

View File

@ -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);

View File

@ -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]; \

View File

@ -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) \

View File

@ -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";
}

View File

@ -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) : "";
}

View File

@ -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);

View File

@ -284,24 +284,24 @@ 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_;

View File

@ -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);

View File

@ -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. */

View File

@ -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);

View File

@ -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;
}

View File

@ -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. */

View File

@ -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_;

View File

@ -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)

View File

@ -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);

View File

@ -43,10 +43,10 @@ typedef enum 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_whom_to_string(KillWhom k) _const_;
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) {

View File

@ -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);

View File

@ -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);

View File

@ -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);
@ -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_;

View File

@ -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);

View File

@ -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/";
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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(

View File

@ -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);

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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 */

View File

@ -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)

View File

@ -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);

View File

@ -446,7 +446,7 @@ bool manager_is_inhibited(
return inhibited;
}
const char *inhibit_what_to_string(InhibitWhat w) {
const char* inhibit_what_to_string(InhibitWhat w) {
static thread_local char buffer[STRLEN(
"shutdown:"
"sleep:"

View File

@ -72,8 +72,8 @@ static inline bool inhibit_what_is_valid(InhibitWhat w) {
return w > 0 && w < _INHIBIT_WHAT_MAX;
}
const char *inhibit_what_to_string(InhibitWhat k);
const char* inhibit_what_to_string(InhibitWhat k);
int inhibit_what_from_string(const char *s);
const char *inhibit_mode_to_string(InhibitMode k);
const char* inhibit_mode_to_string(InhibitMode k);
InhibitMode inhibit_mode_from_string(const char *s);

View File

@ -204,7 +204,7 @@ SessionType session_type_from_string(const char *s) _pure_;
const char* session_class_to_string(SessionClass t) _const_;
SessionClass session_class_from_string(const char *s) _pure_;
const char *kill_whom_to_string(KillWhom k) _const_;
const char* kill_whom_to_string(KillWhom k) _const_;
KillWhom kill_whom_from_string(const char *s) _pure_;
const char* tty_validity_to_string(TTYValidity t) _const_;

View File

@ -95,7 +95,7 @@ MachineClass machine_class_from_string(const char *s) _pure_;
const char* machine_state_to_string(MachineState t) _const_;
MachineState machine_state_from_string(const char *s) _pure_;
const char *kill_whom_to_string(KillWhom k) _const_;
const char* kill_whom_to_string(KillWhom k) _const_;
KillWhom kill_whom_from_string(const char *s) _pure_;
int machine_openpt(Machine *m, int flags, char **ret_slave);

View File

@ -28,7 +28,7 @@ struct BareUDP {
DEFINE_NETDEV_CAST(BAREUDP, BareUDP);
extern const NetDevVTable bare_udp_vtable;
const char *bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
const char* bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype);

View File

@ -34,7 +34,7 @@ typedef struct FouTunnel {
DEFINE_NETDEV_CAST(FOU, FouTunnel);
extern const NetDevVTable foutnl_vtable;
const char *fou_encap_type_to_string(FooOverUDPEncapType d) _const_;
const char* fou_encap_type_to_string(FooOverUDPEncapType d) _const_;
FooOverUDPEncapType fou_encap_type_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type);

View File

@ -44,7 +44,7 @@ struct Geneve {
DEFINE_NETDEV_CAST(GENEVE, Geneve);
extern const NetDevVTable geneve_vtable;
const char *geneve_df_to_string(GeneveDF d) _const_;
const char* geneve_df_to_string(GeneveDF d) _const_;
GeneveDF geneve_df_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni);

View File

@ -16,7 +16,7 @@ typedef enum NetDevLocalAddressType {
_NETDEV_LOCAL_ADDRESS_TYPE_INVALID = -EINVAL,
} NetDevLocalAddressType;
const char *netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_;
const char* netdev_local_address_type_to_string(NetDevLocalAddressType t) _const_;
NetDevLocalAddressType netdev_local_address_type_from_string(const char *s) _pure_;
int link_get_local_address(

View File

@ -212,7 +212,7 @@ int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name,
int link_request_stacked_netdev(Link *link, NetDev *netdev);
const char *netdev_kind_to_string(NetDevKind d) _const_;
const char* netdev_kind_to_string(NetDevKind d) _const_;
NetDevKind netdev_kind_from_string(const char *d) _pure_;
static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) {

View File

@ -123,7 +123,7 @@ extern const NetDevVTable ip6gretap_vtable;
extern const NetDevVTable ip6tnl_vtable;
extern const NetDevVTable erspan_vtable;
const char *ip6tnl_mode_to_string(Ip6TnlMode d) _const_;
const char* ip6tnl_mode_to_string(Ip6TnlMode d) _const_;
Ip6TnlMode ip6tnl_mode_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_ip6tnl_mode);

View File

@ -66,7 +66,7 @@ struct VxLan {
DEFINE_NETDEV_CAST(VXLAN, VxLan);
extern const NetDevVTable vxlan_vtable;
const char *df_to_string(VxLanDF d) _const_;
const char* df_to_string(VxLanDF d) _const_;
VxLanDF df_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address);

View File

@ -79,7 +79,7 @@ static inline bool in6_prefix_is_filtered(const struct in6_addr *prefix, uint8_t
int link_get_captive_portal(Link *link, const char **ret);
const char *dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_;
const char* dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_;
DHCPOptionDataType dhcp_option_data_type_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp);

View File

@ -260,7 +260,7 @@ int manager_udev_process_link(Manager *m, sd_device *device, sd_device_action_t
int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);
int link_flags_to_string_alloc(uint32_t flags, char **ret);
const char *kernel_operstate_to_string(int t) _const_;
const char* kernel_operstate_to_string(int t) _const_;
void link_required_operstate_for_online(Link *link, LinkOperationalStateRange *ret);
AddressFamily link_required_family_for_online(Link *link);

View File

@ -39,7 +39,7 @@ int manager_address_is_reachable(
Address **ret);
int route_type_from_string(const char *s) _pure_;
const char *route_type_to_string(int t) _const_;
const char* route_type_to_string(int t) _const_;
int route_scope_from_string(const char *s);
int route_scope_to_string_alloc(int t, char **ret);

View File

@ -53,7 +53,7 @@ typedef struct RoutingPolicyRule {
int32_t suppress_ifgroup;
} RoutingPolicyRule;
const char *fr_act_type_full_to_string(int t) _const_;
const char* fr_act_type_full_to_string(int t) _const_;
RoutingPolicyRule *routing_policy_rule_free(RoutingPolicyRule *rule);

View File

@ -55,7 +55,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_link_local_address_family);
CONFIG_PARSER_PROTOTYPE(config_parse_ip_masquerade);
CONFIG_PARSER_PROTOTYPE(config_parse_mud_url);
const char *network_config_source_to_string(NetworkConfigSource s) _const_;
const char* network_config_source_to_string(NetworkConfigSource s) _const_;
int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
@ -131,23 +131,23 @@ int network_config_state_to_string_alloc(NetworkConfigState s, char **ret);
0); \
}
const char *address_family_to_string(AddressFamily b) _const_;
const char* address_family_to_string(AddressFamily b) _const_;
AddressFamily address_family_from_string(const char *s) _pure_;
AddressFamily link_local_address_family_from_string(const char *s) _pure_;
const char *routing_policy_rule_address_family_to_string(AddressFamily b) _const_;
const char* routing_policy_rule_address_family_to_string(AddressFamily b) _const_;
AddressFamily routing_policy_rule_address_family_from_string(const char *s) _pure_;
const char *nexthop_address_family_to_string(AddressFamily b) _const_;
const char* nexthop_address_family_to_string(AddressFamily b) _const_;
AddressFamily nexthop_address_family_from_string(const char *s) _pure_;
const char *duplicate_address_detection_address_family_to_string(AddressFamily b) _const_;
const char* duplicate_address_detection_address_family_to_string(AddressFamily b) _const_;
AddressFamily duplicate_address_detection_address_family_from_string(const char *s) _pure_;
AddressFamily dhcp_deprecated_address_family_from_string(const char *s) _pure_;
const char *dhcp_lease_server_type_to_string(sd_dhcp_lease_server_type_t t) _const_;
const char* dhcp_lease_server_type_to_string(sd_dhcp_lease_server_type_t t) _const_;
sd_dhcp_lease_server_type_t dhcp_lease_server_type_from_string(const char *s) _pure_;
int log_link_message_full_errno(Link *link, sd_netlink_message *m, int level, int err, const char *msg);

View File

@ -273,13 +273,13 @@ CONFIG_PARSER_PROTOTYPE(config_parse_userns_chown);
CONFIG_PARSER_PROTOTYPE(config_parse_userns_ownership);
CONFIG_PARSER_PROTOTYPE(config_parse_bind_user);
const char *resolv_conf_mode_to_string(ResolvConfMode a) _const_;
const char* resolv_conf_mode_to_string(ResolvConfMode a) _const_;
ResolvConfMode resolv_conf_mode_from_string(const char *s) _pure_;
const char *timezone_mode_to_string(TimezoneMode a) _const_;
const char* timezone_mode_to_string(TimezoneMode a) _const_;
TimezoneMode timezone_mode_from_string(const char *s) _pure_;
const char *user_namespace_ownership_to_string(UserNamespaceOwnership a) _const_;
const char* user_namespace_ownership_to_string(UserNamespaceOwnership a) _const_;
UserNamespaceOwnership user_namespace_ownership_from_string(const char *s) _pure_;
int parse_link_journal(const char *s, LinkJournal *ret_mode, bool *ret_try);

View File

@ -80,8 +80,8 @@ int portable_get_profiles(char ***ret);
void portable_changes_free(PortableChange *changes, size_t n_changes);
const char *portable_change_type_to_string(int t) _const_;
const char* portable_change_type_to_string(int t) _const_;
int portable_change_type_from_string(const char *t) _pure_;
const char *portable_state_to_string(PortableState t) _const_;
const char* portable_state_to_string(PortableState t) _const_;
PortableState portable_state_from_string(const char *t) _pure_;

View File

@ -220,7 +220,7 @@ int dns_type_to_af(uint16_t t) {
}
}
const char *dns_class_to_string(uint16_t class) {
const char* dns_class_to_string(uint16_t class) {
switch (class) {

View File

@ -143,20 +143,20 @@ bool dns_class_is_pseudo(uint16_t class);
bool dns_class_is_valid_rr(uint16_t class);
/* TYPE?? follows http://tools.ietf.org/html/rfc3597#section-5 */
const char *dns_type_to_string(int type);
const char* dns_type_to_string(int type);
int dns_type_from_string(const char *s);
const char *dns_class_to_string(uint16_t class);
const char* dns_class_to_string(uint16_t class);
int dns_class_from_string(const char *name);
/* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
const char *tlsa_cert_usage_to_string(uint8_t cert_usage);
const char* tlsa_cert_usage_to_string(uint8_t cert_usage);
/* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.3 */
const char *tlsa_selector_to_string(uint8_t selector);
const char* tlsa_selector_to_string(uint8_t selector);
/* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.4 */
const char *tlsa_matching_type_to_string(uint8_t selector);
const char* tlsa_matching_type_to_string(uint8_t selector);
/* https://tools.ietf.org/html/rfc6844#section-5.1 */
#define CAA_FLAG_CRITICAL (1u << 7)

View File

@ -2905,7 +2905,7 @@ static const char* const dns_rcode_table[_DNS_RCODE_MAX_DEFINED] = {
};
DEFINE_STRING_TABLE_LOOKUP(dns_rcode, int);
const char *format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) {
const char* format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) {
const char *p = dns_rcode_to_string(i);
if (p)
return p;
@ -2947,7 +2947,7 @@ static const char* const dns_ede_rcode_table[_DNS_EDE_RCODE_MAX_DEFINED] = {
};
DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dns_ede_rcode, int);
const char *format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) {
const char* format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]) {
const char *p = dns_ede_rcode_to_string(i);
if (p)
return p;
@ -2968,7 +2968,7 @@ static const char* const dns_svc_param_key_table[_DNS_SVC_PARAM_KEY_MAX_DEFINED]
};
DEFINE_STRING_TABLE_LOOKUP_TO_STRING(dns_svc_param_key, int);
const char *format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]) {
const char* format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]) {
const char *p = dns_svc_param_key_to_string(i);
if (p)
return p;

View File

@ -351,11 +351,11 @@ enum {
const char* dns_rcode_to_string(int i) _const_;
int dns_rcode_from_string(const char *s) _pure_;
const char *format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]);
const char* format_dns_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]);
#define FORMAT_DNS_RCODE(i) format_dns_rcode(i, (char [DECIMAL_STR_MAX(int)]) {})
const char* dns_ede_rcode_to_string(int i) _const_;
const char *format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]);
const char* format_dns_ede_rcode(int i, char buf[static DECIMAL_STR_MAX(int)]);
#define FORMAT_DNS_EDE_RCODE(i) format_dns_ede_rcode(i, (char [DECIMAL_STR_MAX(int)]) {})
const char* dns_protocol_to_string(DnsProtocol p) _const_;
@ -377,7 +377,7 @@ enum {
};
const char* dns_svc_param_key_to_string(int i) _const_;
const char *format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]);
const char* format_dns_svc_param_key(uint16_t i, char buf[static DECIMAL_STR_MAX(uint16_t)+3]);
#define FORMAT_DNS_SVC_PARAM_KEY(i) format_dns_svc_param_key(i, (char [DECIMAL_STR_MAX(uint16_t)+3]) {})
#define LLMNR_MULTICAST_IPV4_ADDRESS ((struct in_addr) { .s_addr = htobe32(224U << 24 | 252U) })

View File

@ -1282,7 +1282,7 @@ DnsQuestion* dns_query_question_for_protocol(DnsQuery *q, DnsProtocol protocol)
}
}
const char *dns_query_string(DnsQuery *q) {
const char* dns_query_string(DnsQuery *q) {
const char *name;
int r;

View File

@ -149,7 +149,7 @@ void dns_query_complete(DnsQuery *q, DnsTransactionState state);
DnsQuestion* dns_query_question_for_protocol(DnsQuery *q, DnsProtocol protocol);
const char *dns_query_string(DnsQuery *q);
const char* dns_query_string(DnsQuery *q);
DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuery*, dns_query_free);

View File

@ -309,7 +309,7 @@ int dns_question_cname_redirect(DnsQuestion *q, const DnsResourceRecord *cname,
return 1;
}
const char *dns_question_first_name(DnsQuestion *q) {
const char* dns_question_first_name(DnsQuestion *q) {
if (!q)
return NULL;

View File

@ -45,7 +45,7 @@ int dns_question_cname_redirect(DnsQuestion *q, const DnsResourceRecord *cname,
void dns_question_dump(DnsQuestion *q, FILE *f);
const char *dns_question_first_name(DnsQuestion *q);
const char* dns_question_first_name(DnsQuestion *q);
static inline DnsResourceKey *dns_question_first_key(DnsQuestion *q) {
return (q && q->n_keys > 0) ? q->items[0].key : NULL;

View File

@ -972,7 +972,7 @@ static char *format_svc_params(DnsSvcParam *first) {
return strv_join(params, " ");
}
const char *dns_resource_record_to_string(DnsResourceRecord *rr) {
const char* dns_resource_record_to_string(DnsResourceRecord *rr) {
_cleanup_free_ char *s = NULL, *t = NULL;
char k[DNS_RESOURCE_KEY_STRING_MAX];
int r;

View File

@ -674,7 +674,7 @@ uint16_t dns_server_port(const DnsServer *s) {
return 53;
}
const char *dns_server_string(DnsServer *server) {
const char* dns_server_string(DnsServer *server) {
assert(server);
if (!server->server_string)
@ -683,7 +683,7 @@ const char *dns_server_string(DnsServer *server) {
return server->server_string;
}
const char *dns_server_string_full(DnsServer *server) {
const char* dns_server_string_full(DnsServer *server) {
assert(server);
if (!server->server_string_full)

View File

@ -140,8 +140,8 @@ DnsServerFeatureLevel dns_server_possible_feature_level(DnsServer *s);
int dns_server_adjust_opt(DnsServer *server, DnsPacket *packet, DnsServerFeatureLevel level);
const char *dns_server_string(DnsServer *server);
const char *dns_server_string_full(DnsServer *server);
const char* dns_server_string(DnsServer *server);
const char* dns_server_string_full(DnsServer *server);
int dns_server_ifindex(const DnsServer *s);
uint16_t dns_server_port(const DnsServer *s);

View File

@ -81,26 +81,26 @@ typedef enum BondPrimaryReselect {
_NETDEV_BOND_PRIMARY_RESELECT_INVALID = -EINVAL,
} BondPrimaryReselect;
const char *bond_mode_to_string(BondMode d) _const_;
const char* bond_mode_to_string(BondMode d) _const_;
BondMode bond_mode_from_string(const char *d) _pure_;
const char *bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_;
const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_;
BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *d) _pure_;
const char *bond_lacp_rate_to_string(BondLacpRate d) _const_;
const char* bond_lacp_rate_to_string(BondLacpRate d) _const_;
BondLacpRate bond_lacp_rate_from_string(const char *d) _pure_;
const char *bond_fail_over_mac_to_string(BondFailOverMac d) _const_;
const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_;
BondFailOverMac bond_fail_over_mac_from_string(const char *d) _pure_;
const char *bond_ad_select_to_string(BondAdSelect d) _const_;
const char* bond_ad_select_to_string(BondAdSelect d) _const_;
BondAdSelect bond_ad_select_from_string(const char *d) _pure_;
const char *bond_arp_validate_to_string(BondArpValidate d) _const_;
const char* bond_arp_validate_to_string(BondArpValidate d) _const_;
BondArpValidate bond_arp_validate_from_string(const char *d) _pure_;
const char *bond_arp_all_targets_to_string(BondArpAllTargets d) _const_;
const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_;
BondArpAllTargets bond_arp_all_targets_from_string(const char *d) _pure_;
const char *bond_primary_reselect_to_string(BondPrimaryReselect d) _const_;
const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_;
BondPrimaryReselect bond_primary_reselect_from_string(const char *d) _pure_;

View File

@ -60,6 +60,6 @@ int bpf_map_update_element(int fd, const void *key, void *value);
int bpf_map_lookup_element(int fd, const void *key, void *value);
int bpf_cgroup_attach_type_from_string(const char *str) _pure_;
const char *bpf_cgroup_attach_type_to_string(int attach_type) _const_;
const char* bpf_cgroup_attach_type_to_string(int attach_type) _const_;
DEFINE_TRIVIAL_CLEANUP_FUNC(BPFProgram*, bpf_program_free);

View File

@ -16,5 +16,5 @@ typedef enum BridgeState {
_NETDEV_BRIDGE_STATE_INVALID = -EINVAL,
} BridgeState;
const char *bridge_state_to_string(BridgeState d) _const_;
const char* bridge_state_to_string(BridgeState d) _const_;
BridgeState bridge_state_from_string(const char *d) _pure_;

View File

@ -77,7 +77,7 @@ DLSYM_PROTOTYPE(crypt_volume_key_keyring) = NULL;
/* Do this only on new enough compilers that actually support the "symver" attribute. Given this is a debug
* feature, let's simply not bother on older compilers */
#if BUILD_MODE_DEVELOPER && defined(__has_attribute) && __has_attribute(symver)
const char *my_crypt_token_external_path(void); /* prototype for our own implementation */
const char* my_crypt_token_external_path(void); /* prototype for our own implementation */
/* We use the "symver" attribute to mark this implementation as the default implementation, and drop the
* SD_SHARED namespace we by default attach to our symbols via a version script. */

View File

@ -113,7 +113,7 @@ int dlopen_cryptsetup(void);
int cryptsetup_get_keyslot_from_token(sd_json_variant *v);
static inline const char *mangle_none(const char *s) {
static inline const char* mangle_none(const char *s) {
/* A helper that turns cryptsetup/integritysetup/veritysetup "options" strings into NULL if they are effectively empty */
return isempty(s) || STR_IN_SET(s, "-", "none") ? NULL : s;
}

View File

@ -119,7 +119,7 @@ static inline bool IMAGE_IS_HOST(const struct Image *i) {
int image_to_json(const struct Image *i, sd_json_variant **ret);
const char *image_root_to_string(ImageClass c) _const_;
const char* image_root_to_string(ImageClass c) _const_;
extern const struct hash_ops image_hash_ops;

View File

@ -235,7 +235,7 @@ int probe_sector_size_prefer_ioctl(int fd, uint32_t *ret);
int partition_pick_mount_options(PartitionDesignator d, const char *fstype, bool rw, bool discard, char **ret_options, unsigned long *ret_ms_flags);
static inline const char *dissected_partition_fstype(const DissectedPartition *m) {
static inline const char* dissected_partition_fstype(const DissectedPartition *m) {
assert(m);
return m->decrypted_node ? m->decrypted_fstype : m->fstype;

View File

@ -181,17 +181,17 @@ int ethtool_set_channels(int *ethtool_fd, const char *ifname, const netdev_chann
int ethtool_set_flow_control(int *fd, const char *ifname, int rx, int tx, int autoneg);
int ethtool_set_nic_coalesce_settings(int *ethtool_fd, const char *ifname, const netdev_coalesce_param *coalesce);
const char *duplex_to_string(Duplex d) _const_;
const char* duplex_to_string(Duplex d) _const_;
Duplex duplex_from_string(const char *d) _pure_;
int wol_options_to_string_alloc(uint32_t opts, char **ret);
const char *port_to_string(NetDevPort port) _const_;
const char* port_to_string(NetDevPort port) _const_;
NetDevPort port_from_string(const char *port) _pure_;
const char *mdi_to_string(int mdi) _const_;
const char* mdi_to_string(int mdi) _const_;
const char *ethtool_link_mode_bit_to_string(enum ethtool_link_mode_bit_indices val) _const_;
const char* ethtool_link_mode_bit_to_string(enum ethtool_link_mode_bit_indices val) _const_;
enum ethtool_link_mode_bit_indices ethtool_link_mode_bit_from_string(const char *str) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_duplex);

View File

@ -24,7 +24,7 @@ struct FirewallContext {
sd_netlink *nfnl;
};
const char *firewall_backend_to_string(FirewallBackend b) _const_;
const char* firewall_backend_to_string(FirewallBackend b) _const_;
int fw_nftables_init(FirewallContext *ctx);
int fw_nftables_init_full(FirewallContext *ctx, bool init_tables);

View File

@ -60,10 +60,10 @@ typedef struct NFTSetContext {
void nft_set_context_clear(NFTSetContext *s);
int nft_set_context_dup(const NFTSetContext *src, NFTSetContext *dst);
const char *nfproto_to_string(int i) _const_;
const char* nfproto_to_string(int i) _const_;
int nfproto_from_string(const char *s) _pure_;
const char *nft_set_source_to_string(int i) _const_;
const char* nft_set_source_to_string(int i) _const_;
int nft_set_source_from_string(const char *s) _pure_;
int nft_set_element_modify_iprange(

View File

@ -13,5 +13,5 @@ typedef enum GeneveDF {
_NETDEV_GENEVE_DF_INVALID = -EINVAL,
} GeneveDF;
const char *geneve_df_to_string(GeneveDF d) _const_;
const char* geneve_df_to_string(GeneveDF d) _const_;
GeneveDF geneve_df_from_string(const char *d) _pure_;

Some files were not shown because too many files have changed in this diff Show More