Lines Matching defs:Unit

26 typedef struct Unit Unit;
68 Unit* unit;
72 struct Unit {
77 Unit *merged_into;
134 LIST_FIELDS(Unit, units_by_type);
137 LIST_FIELDS(Unit, has_requires_mounts_for);
140 LIST_FIELDS(Unit, load_queue);
143 LIST_FIELDS(Unit, dbus_queue);
146 LIST_FIELDS(Unit, cleanup_queue);
149 LIST_FIELDS(Unit, gc_queue);
152 LIST_FIELDS(Unit, cgroup_queue);
155 LIST_FIELDS(Unit, cgroup_netclass);
297 void (*init)(Unit *u);
301 void (*done)(Unit *u);
306 int (*load)(Unit *u);
310 int (*coldplug)(Unit *u);
312 void (*dump)(Unit *u, FILE *f, const char *prefix);
314 int (*start)(Unit *u);
315 int (*stop)(Unit *u);
316 int (*reload)(Unit *u);
318 int (*kill)(Unit *u, KillWho w, int signo, sd_bus_error *error);
320 bool (*can_reload)(Unit *u);
324 int (*serialize)(Unit *u, FILE *f, FDSet *fds);
327 int (*deserialize_item)(Unit *u, const char *key, const char *data, FDSet *fds);
330 void (*distribute_fds)(Unit *u, FDSet *fds);
334 UnitActiveState (*active_state)(Unit *u);
340 const char* (*sub_state_to_string)(Unit *u);
345 bool (*check_gc)(Unit *u);
349 void (*release_resources)(Unit *u);
352 void (*sigchld_event)(Unit *u, pid_t pid, int code, int status);
355 void (*reset_failed)(Unit *u);
359 void (*notify_cgroup_empty)(Unit *u);
362 void (*notify_message)(Unit *u, pid_t pid, char **tags, FDSet *fds);
364 /* Called whenever a name this Unit registered for comes or
366 void (*bus_name_owner_change)(Unit *u, const char *name, const char *old_owner, const char *new_owner);
369 int (*bus_set_property)(Unit *u, const char *name, sd_bus_message *message, UnitSetPropertiesMode mode, sd_bus_error *error);
372 int (*bus_commit_properties)(Unit *u);
375 Unit *(*following)(Unit *u);
378 int (*following_set)(Unit *u, Set **s);
382 void (*trigger_notify)(Unit *u, Unit *trigger);
385 void (*time_change)(Unit *u);
388 int (*get_timeout)(Unit *u, usec_t *timeout);
426 static inline MixedCase* UPPERCASE(Unit *u) { \
440 #define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS]))
455 Unit *unit_new(Manager *m, size_t size);
456 void unit_free(Unit *u);
458 int unit_add_name(Unit *u, const char *name);
460 int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_reference);
461 int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference);
463 int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference);
464 int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference);
466 int unit_add_exec_dependencies(Unit *u, ExecContext *c);
468 int unit_choose_id(Unit *u, const char *name);
469 int unit_set_description(Unit *u, const char *description);
471 bool unit_check_gc(Unit *u);
473 void unit_add_to_load_queue(Unit *u);
474 void unit_add_to_dbus_queue(Unit *u);
475 void unit_add_to_cleanup_queue(Unit *u);
476 void unit_add_to_gc_queue(Unit *u);
478 int unit_merge(Unit *u, Unit *other);
479 int unit_merge_by_name(Unit *u, const char *other);
481 Unit *unit_follow_merge(Unit *u) _pure_;
483 int unit_load_fragment_and_dropin(Unit *u);
484 int unit_load_fragment_and_dropin_optional(Unit *u);
485 int unit_load(Unit *unit);
487 int unit_set_slice(Unit *u, Unit *slice);
488 int unit_set_default_slice(Unit *u);
490 const char *unit_description(Unit *u) _pure_;
492 bool unit_has_name(Unit *u, const char *name);
494 UnitActiveState unit_active_state(Unit *u);
496 const char* unit_sub_state_to_string(Unit *u);
498 void unit_dump(Unit *u, FILE *f, const char *prefix);
500 bool unit_can_reload(Unit *u) _pure_;
501 bool unit_can_start(Unit *u) _pure_;
502 bool unit_can_isolate(Unit *u) _pure_;
504 int unit_start(Unit *u);
505 int unit_stop(Unit *u);
506 int unit_reload(Unit *u);
508 int unit_kill(Unit *u, KillWho w, int signo, sd_bus_error *error);
509 int unit_kill_common(Unit *u, KillWho who, int signo, pid_t main_pid, pid_t control_pid, sd_bus_error *error);
511 void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_success);
513 int unit_watch_pid(Unit *u, pid_t pid);
514 void unit_unwatch_pid(Unit *u, pid_t pid);
515 void unit_unwatch_all_pids(Unit *u);
517 void unit_tidy_watch_pids(Unit *u, pid_t except1, pid_t except2);
519 int unit_install_bus_match(Unit *u, sd_bus *bus, const char *name);
520 int unit_watch_bus_name(Unit *u, const char *name);
521 void unit_unwatch_bus_name(Unit *u, const char *name);
523 bool unit_job_is_applicable(Unit *u, JobType j);
527 char *unit_dbus_path(Unit *u);
529 int unit_load_related_unit(Unit *u, const char *type, Unit **_found);
531 bool unit_can_serialize(Unit *u) _pure_;
533 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs);
534 int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
536 int unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value);
537 int unit_serialize_item_escaped(Unit *u, FILE *f, const char *key, const char *value);
538 int unit_serialize_item_fd(Unit *u, FILE *f, FDSet *fds, const char *key, int fd);
539 void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const char *value, ...) _printf_(4,5);
541 int unit_add_node_link(Unit *u, const char *what, bool wants, UnitDependency d);
543 int unit_coldplug(Unit *u);
545 void unit_status_printf(Unit *u, const char *status, const char *unit_status_msg_format) _printf_(3, 0);
546 void unit_status_emit_starting_stopping_reloading(Unit *u, JobType t);
548 bool unit_need_daemon_reload(Unit *u);
550 void unit_reset_failed(Unit *u);
552 Unit *unit_following(Unit *u);
553 int unit_following_set(Unit *u, Set **s);
555 const char *unit_slice_name(Unit *u);
557 bool unit_stop_pending(Unit *u) _pure_;
558 bool unit_inactive_or_pending(Unit *u) _pure_;
559 bool unit_active_or_pending(Unit *u);
561 int unit_add_default_target_dependency(Unit *u, Unit *target);
563 void unit_start_on_failure(Unit *u);
564 void unit_trigger_notify(Unit *u);
566 UnitFileState unit_get_unit_file_state(Unit *u);
567 int unit_get_unit_file_preset(Unit *u);
569 Unit* unit_ref_set(UnitRef *ref, Unit *u);
575 int unit_patch_contexts(Unit *u);
577 ExecContext *unit_get_exec_context(Unit *u) _pure_;
578 KillContext *unit_get_kill_context(Unit *u) _pure_;
579 CGroupContext *unit_get_cgroup_context(Unit *u) _pure_;
581 ExecRuntime *unit_get_exec_runtime(Unit *u) _pure_;
583 int unit_setup_exec_runtime(Unit *u);
585 int unit_write_drop_in(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data);
586 int unit_write_drop_in_format(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *format, ...) _printf_(4,5);
588 int unit_write_drop_in_private(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *data);
589 int unit_write_drop_in_private_format(Unit *u, UnitSetPropertiesMode mode, const char *name, const char *format, ...) _printf_(4,5);
591 int unit_kill_context(Unit *u, KillContext *c, KillOperation k, pid_t main_pid, pid_t control_pid, bool main_pid_alien);
593 int unit_make_transient(Unit *u);
595 int unit_require_mounts_for(Unit *u, const char *path);
599 bool unit_is_pristine(Unit *u);
601 static inline bool unit_supported(Unit *u) {
605 void unit_warn_if_dir_nonempty(Unit *u, const char* where);
606 int unit_fail_if_symlink(Unit *u, const char* where);
612 Unit *_u = (unit); \