From: Sven Eden Date: Mon, 20 Feb 2017 16:13:50 +0000 (+0100) Subject: Cleaned up more unneeded types and functions. X-Git-Tag: v226.4~1^2~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=6ff57d0bf5de38bfc4df718cc596d4a3a333f290 Cleaned up more unneeded types and functions. - src/shared/install.h - removed - src/basic/unit-name.[hc] - cleaned - src/core/cgroup.[hc] - cleaned - src/libelogind/libelogind.sym - cleaned - src/libelogind/sd-daemon/sd-daemon.c - cleaned - src/shared/acl-util.[hc] - cleaned - src/shared/bus-util.[hc] - cleaned - src/shared/output-mode.h - cleaned - src/shared/path-lookup.h - cleaned - src/systemd/sd-daemon.h - cleaned --- diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c index 7931b8f48..6c74661c5 100644 --- a/src/basic/unit-name.c +++ b/src/basic/unit-name.c @@ -118,6 +118,8 @@ bool unit_suffix_is_valid(const char *s) { return true; } +/// UNNEEDED by elogind +#if 0 int unit_name_to_prefix(const char *n, char **ret) { const char *p; char *s; @@ -142,8 +144,6 @@ int unit_name_to_prefix(const char *n, char **ret) { return 0; } -/// UNNEEDED by elogind -#if 0 int unit_name_to_instance(const char *n, char **instance) { const char *p, *d; char *i; @@ -598,6 +598,8 @@ int unit_name_from_dbus_path(const char *path, char **name) { return 0; } +/// UNNEEDED by elogind +#if 0 const char* unit_dbus_interface_from_type(UnitType t) { static const char *const table[_UNIT_TYPE_MAX] = { @@ -624,8 +626,6 @@ const char* unit_dbus_interface_from_type(UnitType t) { return table[t]; } -/// UNNEEDED by elogind -#if 0 const char *unit_dbus_interface_from_name(const char *name) { UnitType t; @@ -635,7 +635,6 @@ const char *unit_dbus_interface_from_name(const char *name) { return unit_dbus_interface_from_type(t); } -#endif // 0 static char *do_escape_mangle(const char *f, UnitNameMangle allow_globs, char *t) { const char *valid_chars; @@ -722,8 +721,6 @@ int unit_name_mangle_with_suffix(const char *name, UnitNameMangle allow_globs, c return 1; } -/// UNNEEDED by elogind -#if 0 int slice_build_parent_slice(const char *slice, char **ret) { char *s, *dash; int r; @@ -846,6 +843,8 @@ static const char* const unit_type_table[_UNIT_TYPE_MAX] = { DEFINE_STRING_TABLE_LOOKUP(unit_type, UnitType); +/// UNNEEDED by elogind +#if 0 static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = { [UNIT_STUB] = "stub", [UNIT_LOADED] = "loaded", @@ -887,3 +886,4 @@ static const char* const unit_dependency_table[_UNIT_DEPENDENCY_MAX] = { }; DEFINE_STRING_TABLE_LOOKUP(unit_dependency, UnitDependency); +#endif // 0 diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h index 7b3924de8..8ed77ae8e 100644 --- a/src/basic/unit-name.h +++ b/src/basic/unit-name.h @@ -28,8 +28,8 @@ #define UNIT_NAME_MAX 256 typedef enum UnitType UnitType; -typedef enum UnitLoadState UnitLoadState; -typedef enum UnitDependency UnitDependency; +// UNNEEDED typedef enum UnitLoadState UnitLoadState; +// UNNNEEDED typedef enum UnitDependency UnitDependency; enum UnitType { UNIT_SERVICE = 0, @@ -49,6 +49,8 @@ enum UnitType { _UNIT_TYPE_INVALID = -1 }; +/// UNNEEDED by elogind +#if 0 enum UnitLoadState { UNIT_STUB = 0, UNIT_LOADED, @@ -108,6 +110,7 @@ enum UnitDependency { _UNIT_DEPENDENCY_MAX, _UNIT_DEPENDENCY_INVALID = -1 }; +#endif // 0 typedef enum UnitNameFlags { UNIT_NAME_PLAIN = 1, /* Allow foo.service */ @@ -126,7 +129,7 @@ static inline int unit_prefix_and_instance_is_valid(const char *p) { return unit_instance_is_valid(p); } -int unit_name_to_prefix(const char *n, char **prefix); +// UNNEEDED int unit_name_to_prefix(const char *n, char **prefix); // UNNEEDED int unit_name_to_instance(const char *n, char **instance); // UNNEEDED int unit_name_to_prefix_and_instance(const char *n, char **ret); @@ -152,9 +155,11 @@ int unit_name_from_path(const char *path, const char *suffix, char **ret); 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); +// UNNEEDED const char* unit_dbus_interface_from_type(UnitType t); // UNNEEDED const char *unit_dbus_interface_from_name(const char *name); +/// UNNEEDED by elogind +#if 0 typedef enum UnitNameMangle { UNIT_NAME_NOGLOB, UNIT_NAME_GLOB, @@ -165,6 +170,7 @@ int unit_name_mangle_with_suffix(const char *name, UnitNameMangle allow_globs, c static inline int unit_name_mangle(const char *name, UnitNameMangle allow_globs, char **ret) { return unit_name_mangle_with_suffix(name, allow_globs, ".service", ret); } +#endif // 0 // UNNEEDED int slice_build_parent_slice(const char *slice, char **ret); int slice_build_subslice(const char *slice, const char*name, char **subslice); @@ -173,8 +179,8 @@ bool slice_name_is_valid(const char *name); const char *unit_type_to_string(UnitType i) _const_; UnitType unit_type_from_string(const char *s) _pure_; -const char *unit_load_state_to_string(UnitLoadState i) _const_; -UnitLoadState unit_load_state_from_string(const char *s) _pure_; +// UNNEEDED const char *unit_load_state_to_string(UnitLoadState i) _const_; +// UNNEEDED UnitLoadState unit_load_state_from_string(const char *s) _pure_; -const char *unit_dependency_to_string(UnitDependency i) _const_; -UnitDependency unit_dependency_from_string(const char *s) _pure_; +// UNNEEDED const char *unit_dependency_to_string(UnitDependency i) _const_; +// UNNEEDED UnitDependency unit_dependency_from_string(const char *s) _pure_; diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 139178ec0..1733521cd 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -30,6 +30,8 @@ #define CGROUP_CPU_QUOTA_PERIOD_USEC ((usec_t) 100 * USEC_PER_MSEC) +// UNNEEDED by elogind +#if 0 void cgroup_context_init(CGroupContext *c) { assert(c); @@ -85,8 +87,6 @@ void cgroup_context_done(CGroupContext *c) { cgroup_context_free_device_allow(c, c->device_allow); } -/// UNNEEDED by elogind -#if 0 void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix) { CGroupBlockIODeviceBandwidth *b; CGroupBlockIODeviceWeight *w; @@ -469,7 +469,6 @@ void cgroup_context_apply(CGroupContext *c, CGroupMask mask, const char *path, M } } } -#endif // 0 CGroupMask cgroup_context_get_mask(CGroupContext *c) { CGroupMask mask = 0; @@ -500,8 +499,6 @@ CGroupMask cgroup_context_get_mask(CGroupContext *c) { return mask; } -/// UNNEEDED by elogind -#if 0 CGroupMask unit_get_own_mask(Unit *u) { CGroupContext *c; @@ -1563,7 +1560,6 @@ bool unit_cgroup_delegate(Unit *u) { return c->delegate; } -#endif // 0 static const char* const cgroup_device_policy_table[_CGROUP_DEVICE_POLICY_MAX] = { [CGROUP_AUTO] = "auto", @@ -1572,3 +1568,4 @@ static const char* const cgroup_device_policy_table[_CGROUP_DEVICE_POLICY_MAX] = }; DEFINE_STRING_TABLE_LOOKUP(cgroup_device_policy, CGroupDevicePolicy); +#endif // 0 diff --git a/src/core/cgroup.h b/src/core/cgroup.h index 767eea2fb..be882a0b6 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -23,15 +23,17 @@ #include -#include "list.h" -#include "time-util.h" +// #include "list.h" +// #include "time-util.h" #include "logind.h" -typedef struct CGroupContext CGroupContext; -typedef struct CGroupDeviceAllow CGroupDeviceAllow; -typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight; -typedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth; +// UNNEEDED typedef struct CGroupContext CGroupContext; +// UNNEEDED Stypedef struct CGroupDeviceAllow CGroupDeviceAllow; +// UNNEEDED typedef struct CGroupBlockIODeviceWeight CGroupBlockIODeviceWeight; +// UNNEEDED typedef struct CGroupBlockIODeviceBandwidth CGroupBlockIODeviceBandwidth; +/// UNNEEDED by elogind +#if 0 typedef enum CGroupDevicePolicy { /* When devices listed, will allow those, plus built-in ones, @@ -90,20 +92,21 @@ struct CGroupContext { bool delegate; }; +#endif // 0 // #include "unit.h" -#include "cgroup-util.h" +// #include "cgroup-util.h" -void cgroup_context_init(CGroupContext *c); -void cgroup_context_done(CGroupContext *c); +// UNNNEEDE void cgroup_context_init(CGroupContext *c); +// UNNEEDED void cgroup_context_done(CGroupContext *c); // UNNEEDED void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix); // UNNEEDED void cgroup_context_apply(CGroupContext *c, CGroupMask mask, const char *path, ManagerState state); -CGroupMask cgroup_context_get_mask(CGroupContext *c); +// UNNEEDED CGroupMask cgroup_context_get_mask(CGroupContext *c); -void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a); -void cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBlockIODeviceWeight *w); -void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupBlockIODeviceBandwidth *b); +// UNNEEDED void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a); +// UNNEEDED void cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBlockIODeviceWeight *w); +// UNNEEDED void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupBlockIODeviceBandwidth *b); // UNNEEDED CGroupMask unit_get_own_mask(Unit *u); // UNNEEDED CGroupMask unit_get_siblings_mask(Unit *u); @@ -146,5 +149,5 @@ void manager_shutdown_cgroup(Manager *m, bool delete); // UNNEEDED int unit_notify_cgroup_empty(Unit *u); // UNNEEDED int manager_notify_cgroup_empty(Manager *m, const char *group); -const char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_; -CGroupDevicePolicy cgroup_device_policy_from_string(const char *s) _pure_; +// UNNEEDED const char* cgroup_device_policy_to_string(CGroupDevicePolicy i) _const_; +// UNNEEDED CGroupDevicePolicy cgroup_device_policy_from_string(const char *s) _pure_; diff --git a/src/libelogind/sd-daemon/sd-daemon.c b/src/libelogind/sd-daemon/sd-daemon.c index d4e0da61d..af3dab7e4 100644 --- a/src/libelogind/sd-daemon/sd-daemon.c +++ b/src/libelogind/sd-daemon/sd-daemon.c @@ -38,6 +38,8 @@ #include "socket-util.h" #include "sd-daemon.h" +/// UNNEEDED by elogind +#if 0 _public_ int sd_listen_fds(int unset_environment) { const char *e; unsigned n; @@ -151,6 +153,7 @@ _public_ int sd_is_special(int fd, const char *path) { return 1; } +#endif // 0 static int sd_is_socket_internal(int fd, int type, int listening) { struct stat st_fd; @@ -221,6 +224,8 @@ _public_ int sd_is_socket(int fd, int family, int type, int listening) { return 1; } +/// UNNEEDED by elogind +#if 0 _public_ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { union sockaddr_union sockaddr = {}; socklen_t l = sizeof(sockaddr); @@ -307,8 +312,6 @@ _public_ int sd_is_socket_unix(int fd, int type, int listening, const char *path return 1; } -/// UNNEEDED by elogind -#if 0 _public_ int sd_is_mq(int fd, const char *path) { struct mq_attr attr; @@ -463,6 +466,8 @@ _public_ int sd_notify(int unset_environment, const char *state) { return sd_pid_notify_with_fds(0, unset_environment, state, NULL, 0); } +/// UNNEEDED by elogind +#if 0 _public_ int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) { _cleanup_free_ char *p = NULL; int r; @@ -511,6 +516,7 @@ _public_ int sd_booted(void) { return !!S_ISDIR(st.st_mode); } +#endif // 0 _public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) { const char *s, *p = ""; /* p is set to dummy value to do unsetting */ diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym index b4e52dd37..1c3b51a4b 100644 --- a/src/libsystemd/libsystemd.sym +++ b/src/libsystemd/libsystemd.sym @@ -64,16 +64,16 @@ global: sd_journal_open_container; /* sd-daemon */ - sd_booted; - sd_is_fifo; + /* sd_booted; */ + /* sd_is_fifo; */ /* sd_is_mq; */ sd_is_socket; - sd_is_socket_inet; - sd_is_socket_unix; - sd_is_special; - sd_listen_fds; + /* sd_is_socket_inet; */ + /* sd_is_socket_unix; */ + /* sd_is_special; */ + /* sd_listen_fds; */ sd_notify; - sd_notifyf; + /* sd_notifyf; */ sd_watchdog_enabled; /* sd-id128 */ @@ -145,7 +145,7 @@ global: LIBSYSTEMD_214 { global: sd_pid_notify; - sd_pid_notifyf; + /* sd_pid_notifyf; */ } LIBSYSTEMD_213; LIBSYSTEMD_216 { diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c index ad0e481b9..44076d04c 100644 --- a/src/shared/acl-util.c +++ b/src/shared/acl-util.c @@ -65,6 +65,8 @@ int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) { return 0; } +/// UNNEEDED by elogind +#if 0 int calc_acl_mask_if_needed(acl_t *acl_p) { acl_entry_t i; int r; @@ -95,8 +97,6 @@ int calc_acl_mask_if_needed(acl_t *acl_p) { return 0; } -/// UNNEEDED by elogind -#if 0 int add_base_acls_if_needed(acl_t *acl_p, const char *path) { acl_entry_t i; int r; diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h index 03358b46a..90178141e 100644 --- a/src/shared/acl-util.h +++ b/src/shared/acl-util.h @@ -30,7 +30,7 @@ #include "macro.h" int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry); -int calc_acl_mask_if_needed(acl_t *acl_p); +// UNNEEDED int calc_acl_mask_if_needed(acl_t *acl_p); // UNNEEDED int add_base_acls_if_needed(acl_t *acl_p, const char *path); // UNNEEDED int acl_search_groups(const char* path, char ***ret_groups); // UNNEEDED int parse_acl(const char *text, acl_t *acl_access, acl_t *acl_default, bool want_mask); diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 0eb7034c9..b72bb8278 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -19,27 +19,29 @@ along with systemd; If not, see . ***/ -#include +// #include -#include "sd-daemon.h" -#include "sd-event.h" -#include "util.h" +// #include "sd-daemon.h" +// #include "sd-event.h" +// #include "util.h" #include "strv.h" -#include "macro.h" -#include "def.h" -#include "path-util.h" -#include "missing.h" -#include "set.h" -#include "signal-util.h" +// #include "macro.h" +// #include "def.h" +// #include "path-util.h" +// #include "missing.h" +// #include "set.h" +// #include "signal-util.h" #include "unit-name.h" -#include "sd-bus.h" -#include "bus-error.h" -#include "bus-label.h" +// #include "sd-bus.h" +// #include "bus-error.h" +// #include "bus-label.h" #include "bus-message.h" #include "bus-util.h" #include "bus-internal.h" +/// UNNEEDED by elogind +#if 0 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { sd_event *e = userdata; @@ -93,8 +95,6 @@ int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name) { return 0; } -/// UNNEEDED by elogind -#if 0 int bus_event_loop_with_idle( sd_event *e, sd_bus *bus, @@ -551,6 +551,8 @@ void bus_verify_polkit_async_registry_free(Hashmap *registry) { #endif } +/// UNNEEDED by elogind +#if 0 int bus_check_peercred(sd_bus *c) { struct ucred ucred; socklen_t l; @@ -629,8 +631,6 @@ int bus_open_system_systemd(sd_bus **_bus) { return 0; } -/// UNNEEDED by elogind -#if 0 int bus_open_user_systemd(sd_bus **_bus) { _cleanup_bus_unref_ sd_bus *bus = NULL; _cleanup_free_ char *ee = NULL; @@ -1356,12 +1356,12 @@ int bus_log_parse_error(int r) { return log_error_errno(r, "Failed to parse bus message: %m"); } +/// UNNEEDED by elogind +#if 0 int bus_log_create_error(int r) { return log_error_errno(r, "Failed to create bus message: %m"); } -/// UNNEEDED by elogind -#if 0 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) { assert(message); assert(u); @@ -1680,7 +1680,6 @@ static int match_job_removed(sd_bus_message *m, void *userdata, sd_bus_error *er return 0; } -#endif // 0 void bus_wait_for_jobs_free(BusWaitForJobs *d) { if (!d) @@ -1699,8 +1698,6 @@ void bus_wait_for_jobs_free(BusWaitForJobs *d) { free(d); } -/// UNNEEDED by elogind -#if 0 int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) { _cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *d = NULL; int r; @@ -1750,7 +1747,6 @@ int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret) { return 0; } -#endif // 0 static int bus_process_wait(sd_bus *bus) { int r; @@ -1930,8 +1926,6 @@ int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path) { return set_put_strdup(d->jobs, path); } -/// UNNEEDED by elogind -#if 0 int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes) { const char *type, *path, *source; int r; @@ -1961,7 +1955,6 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un return 0; } -#endif // 0 /** * bus_path_encode_unique() - encode unique object path @@ -2089,6 +2082,7 @@ int bus_path_decode_unique(const char *path, const char *prefix, char **ret_send *ret_external = external; return 1; } +#endif // 0 bool is_kdbus_wanted(void) { _cleanup_free_ char *value = NULL; diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h index a310087d8..0cd3a2316 100644 --- a/src/shared/bus-util.h +++ b/src/shared/bus-util.h @@ -21,11 +21,15 @@ along with systemd; If not, see . ***/ -#include "sd-event.h" +#include +#include +#include + +// #include "sd-event.h" #include "sd-bus.h" #include "hashmap.h" -#include "install.h" -#include "time-util.h" +// #include "install.h" +// #include "time-util.h" typedef enum BusTransport { BUS_TRANSPORT_LOCAL, @@ -50,7 +54,7 @@ int bus_message_map_all_properties(sd_bus_message *m, const struct bus_propertie // UNNEEDED int bus_message_map_properties_changed(sd_bus_message *m, const struct bus_properties_map *map, void *userdata); int bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map, void *userdata); -int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name); +// UNNEEDED int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name); typedef bool (*check_idle_t)(void *userdata); @@ -58,14 +62,14 @@ typedef bool (*check_idle_t)(void *userdata); int bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error); -int bus_check_peercred(sd_bus *c); +// UNNEEDED int bus_check_peercred(sd_bus *c); int bus_test_polkit(sd_bus_message *call, int capability, const char *action, const char **details, uid_t good_user, bool *_challenge, sd_bus_error *e); int bus_verify_polkit_async(sd_bus_message *call, int capability, const char *action, const char **details, bool interactive, uid_t good_user, Hashmap **registry, sd_bus_error *error); void bus_verify_polkit_async_registry_free(Hashmap *registry); -int bus_open_system_systemd(sd_bus **_bus); +// UNNEEDED int bus_open_system_systemd(sd_bus **_bus); // UNNEEDED int bus_open_user_systemd(sd_bus **_bus); int bus_open_transport(BusTransport transport, const char *host, bool user, sd_bus **bus); @@ -117,8 +121,10 @@ assert_cc(sizeof(mode_t) == sizeof(uint32_t)); #define bus_property_get_mode ((sd_bus_property_get_t) NULL) int bus_log_parse_error(int r); -int bus_log_create_error(int r); +// UNNEEDED int bus_log_create_error(int r); +/// UNNEEDED by elogind +#if 0 typedef struct UnitInfo { const char *machine; const char *id; @@ -132,6 +138,7 @@ typedef struct UnitInfo { const char *job_type; const char *job_path; } UnitInfo; +#endif // 0 // UNNEEDED int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u); @@ -183,20 +190,20 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(sd_bus_track*, sd_bus_track_unref); // UNNEEDED int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment); -typedef struct BusWaitForJobs BusWaitForJobs; +// UNNEEDED typedef struct BusWaitForJobs BusWaitForJobs; // UNNEEDED int bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret); -void bus_wait_for_jobs_free(BusWaitForJobs *d); -int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path); -int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet); +// UNNEEDED void bus_wait_for_jobs_free(BusWaitForJobs *d); +// UNNEEDED int bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path); +// UNNEEDED int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet); // UNNEEDED int bus_wait_for_jobs_one(BusWaitForJobs *d, const char *path, bool quiet); -DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free); +// UNNEEDED DEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free); // UNNEEDED int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes); -int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, const char *external_id, char **ret_path); -int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external); +// UNNEEDED int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, const char *external_id, char **ret_path); +// UNNEEDED int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external); bool is_kdbus_wanted(void); bool is_kdbus_available(void); diff --git a/src/shared/install.h b/src/shared/install.h deleted file mode 100644 index a9d77dd91..000000000 --- a/src/shared/install.h +++ /dev/null @@ -1,135 +0,0 @@ -/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ - -#pragma once - -/*** - This file is part of systemd. - - Copyright 2011 Lennart Poettering - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see . -***/ - -typedef enum UnitFileScope UnitFileScope; -typedef enum UnitFileState UnitFileState; -typedef enum UnitFilePresetMode UnitFilePresetMode; -typedef enum UnitFileChangeType UnitFileChangeType; -typedef struct UnitFileChange UnitFileChange; -typedef struct UnitFileList UnitFileList; -typedef struct UnitFileInstallInfo UnitFileInstallInfo; - -#include "hashmap.h" -#include "unit-name.h" -#include "path-lookup.h" - -enum UnitFileScope { - UNIT_FILE_SYSTEM, - UNIT_FILE_GLOBAL, - UNIT_FILE_USER, - _UNIT_FILE_SCOPE_MAX, - _UNIT_FILE_SCOPE_INVALID = -1 -}; - -enum UnitFileState { - UNIT_FILE_ENABLED, - UNIT_FILE_ENABLED_RUNTIME, - UNIT_FILE_LINKED, - UNIT_FILE_LINKED_RUNTIME, - UNIT_FILE_MASKED, - UNIT_FILE_MASKED_RUNTIME, - UNIT_FILE_STATIC, - UNIT_FILE_DISABLED, - UNIT_FILE_INDIRECT, - UNIT_FILE_INVALID, - _UNIT_FILE_STATE_MAX, - _UNIT_FILE_STATE_INVALID = -1 -}; - -enum UnitFilePresetMode { - UNIT_FILE_PRESET_FULL, - UNIT_FILE_PRESET_ENABLE_ONLY, - UNIT_FILE_PRESET_DISABLE_ONLY, - _UNIT_FILE_PRESET_MAX, - _UNIT_FILE_PRESET_INVALID = -1 -}; - -enum UnitFileChangeType { - UNIT_FILE_SYMLINK, - UNIT_FILE_UNLINK, - _UNIT_FILE_CHANGE_TYPE_MAX, - _UNIT_FILE_CHANGE_TYPE_INVALID = -1 -}; - -struct UnitFileChange { - UnitFileChangeType type; - char *path; - char *source; -}; - -struct UnitFileList { - char *path; - UnitFileState state; -}; - -struct UnitFileInstallInfo { - char *name; - char *path; - char *user; - - char **aliases; - char **wanted_by; - char **required_by; - char **also; - - char *default_instance; -}; - -int unit_file_enable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_disable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFileChange **changes, unsigned *n_changes); -int unit_file_reenable(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_link(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_preset(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFilePresetMode mode, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_preset_all(UnitFileScope scope, bool runtime, const char *root_dir, UnitFilePresetMode mode, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_mask(UnitFileScope scope, bool runtime, const char *root_dir, char **files, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_unmask(UnitFileScope scope, bool runtime, const char *root_dir, char **files, UnitFileChange **changes, unsigned *n_changes); -int unit_file_set_default(UnitFileScope scope, const char *root_dir, const char *file, bool force, UnitFileChange **changes, unsigned *n_changes); -int unit_file_get_default(UnitFileScope scope, const char *root_dir, char **name); -int unit_file_add_dependency(UnitFileScope scope, bool runtime, const char *root_dir, char **files, char *target, UnitDependency dep, bool force, UnitFileChange **changes, unsigned *n_changes); - -UnitFileState unit_file_lookup_state( - UnitFileScope scope, - const char *root_dir, - const LookupPaths *paths, - const char *name); -UnitFileState unit_file_get_state( - UnitFileScope scope, - const char *root_dir, - const char *filename); - -int unit_file_get_list(UnitFileScope scope, const char *root_dir, Hashmap *h); - -void unit_file_list_free(Hashmap *h); -int unit_file_changes_add(UnitFileChange **changes, unsigned *n_changes, UnitFileChangeType type, const char *path, const char *source); -void unit_file_changes_free(UnitFileChange *changes, unsigned n_changes); - -int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char *name); - -const char *unit_file_state_to_string(UnitFileState s) _const_; -UnitFileState unit_file_state_from_string(const char *s) _pure_; - -const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; -UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; - -const char *unit_file_preset_mode_to_string(UnitFilePresetMode m) _const_; -UnitFilePresetMode unit_file_preset_mode_from_string(const char *s) _pure_; diff --git a/src/shared/output-mode.h b/src/shared/output-mode.h index 81d7f05d9..6a61d3120 100644 --- a/src/shared/output-mode.h +++ b/src/shared/output-mode.h @@ -21,6 +21,8 @@ along with systemd; If not, see . ***/ +/// UNNEEDED by elogind +#if 0 typedef enum OutputMode { OUTPUT_SHORT, OUTPUT_SHORT_ISO, @@ -35,6 +37,7 @@ typedef enum OutputMode { _OUTPUT_MODE_MAX, _OUTPUT_MODE_INVALID = -1 } OutputMode; +#endif // 0 typedef enum OutputFlags { OUTPUT_SHOW_ALL = 1 << 0, diff --git a/src/shared/path-lookup.h b/src/shared/path-lookup.h index f4f9895bb..9bccaf640 100644 --- a/src/shared/path-lookup.h +++ b/src/shared/path-lookup.h @@ -34,6 +34,8 @@ typedef enum ManagerRunningAs { _MANAGER_RUNNING_AS_INVALID = -1 } ManagerRunningAs; +/// UNNEEDED by elogind +#if 0 int user_config_home(char **config_home); int user_runtime_dir(char **runtime_dir); @@ -55,3 +57,4 @@ int lookup_paths_init_from_scope(LookupPaths *paths, void lookup_paths_free(LookupPaths *p); #define _cleanup_lookup_paths_free_ _cleanup_(lookup_paths_free) +#endif // 0 diff --git a/src/systemd/sd-daemon.h b/src/systemd/sd-daemon.h index 1f093f3ca..67cc66fcb 100644 --- a/src/systemd/sd-daemon.h +++ b/src/systemd/sd-daemon.h @@ -74,7 +74,7 @@ _SD_BEGIN_DECLARATIONS; See sd_listen_fds(3) for more information. */ -int sd_listen_fds(int unset_environment); +// UNNEEDED int sd_listen_fds(int unset_environment); /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -86,7 +86,7 @@ int sd_listen_fds(int unset_environment); See sd_is_fifo(3) for more information. */ -int sd_is_fifo(int fd, const char *path); +// UNNEEDED int sd_is_fifo(int fd, const char *path); /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -98,7 +98,7 @@ int sd_is_fifo(int fd, const char *path); See sd_is_special(3) for more information. */ -int sd_is_special(int fd, const char *path); +// UNNEEDED int sd_is_special(int fd, const char *path); /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -128,7 +128,7 @@ int sd_is_socket(int fd, int family, int type, int listening); See sd_is_socket_inet(3) for more information. */ -int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); +// UNNEEDED int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -144,7 +144,7 @@ int sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port See sd_is_socket_unix(3) for more information. */ -int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); +// UNNEEDED int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); /* Helper call for identifying a passed file descriptor. Returns 1 if @@ -154,7 +154,7 @@ int sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t See sd_is_mq(3) for more information. */ -/// UNNEEDED int sd_is_mq(int fd, const char *path); +// UNNEEDED int sd_is_mq(int fd, const char *path); /* Informs systemd about changed daemon state. This takes a number of @@ -234,7 +234,7 @@ int sd_notify(int unset_environment, const char *state); See sd_notifyf(3) for more information. */ -int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_(2,3); +// UNNEEDED int sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_(2,3); /* Similar to sd_notify(), but send the message on behalf of another @@ -246,7 +246,7 @@ int sd_pid_notify(pid_t pid, int unset_environment, const char *state); Similar to sd_notifyf(), but send the message on behalf of another process, if the appropriate permissions are available. */ -int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) _sd_printf_(3,4); +// UNNEEDED int sd_pid_notifyf(pid_t pid, int unset_environment, const char *format, ...) _sd_printf_(3,4); /* Similar to sd_pid_notify(), but also passes the specified fd array @@ -266,7 +266,7 @@ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char *state, See sd_booted(3) for more information. */ -int sd_booted(void); +// UNNEEDED int sd_booted(void); /* Returns > 0 if the service manager expects watchdog keep-alive