LCOV - code coverage report
Current view: top level - login - logind-user.h (source / functions) Hit Total Coverage
Test: systemd_full.info Lines: 0 1 0.0 %
Date: 2019-08-23 13:36:53 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 2 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: LGPL-2.1+ */
       2                 :            : #pragma once
       3                 :            : 
       4                 :            : typedef struct User User;
       5                 :            : 
       6                 :            : #include "conf-parser.h"
       7                 :            : #include "list.h"
       8                 :            : #include "logind.h"
       9                 :            : 
      10                 :            : typedef enum UserState {
      11                 :            :         USER_OFFLINE,    /* Not logged in at all */
      12                 :            :         USER_OPENING,    /* Is logging in */
      13                 :            :         USER_LINGERING,  /* Lingering has been enabled by the admin for this user */
      14                 :            :         USER_ONLINE,     /* User logged in */
      15                 :            :         USER_ACTIVE,     /* User logged in and has a session in the fg */
      16                 :            :         USER_CLOSING,    /* User logged out, but processes still remain and lingering is not enabled */
      17                 :            :         _USER_STATE_MAX,
      18                 :            :         _USER_STATE_INVALID = -1
      19                 :            : } UserState;
      20                 :            : 
      21                 :            : struct User {
      22                 :            :         Manager *manager;
      23                 :            :         uid_t uid;
      24                 :            :         gid_t gid;
      25                 :            :         char *name;
      26                 :            :         char *home;
      27                 :            :         char *state_file;
      28                 :            :         char *runtime_path;
      29                 :            : 
      30                 :            :         char *slice;                     /* user-UID.slice */
      31                 :            :         char *service;                   /* user@UID.service */
      32                 :            :         char *runtime_dir_service;       /* user-runtime-dir@UID.service */
      33                 :            : 
      34                 :            :         char *service_job;
      35                 :            : 
      36                 :            :         Session *display;
      37                 :            : 
      38                 :            :         dual_timestamp timestamp;      /* When this User object was 'started' the first time */
      39                 :            :         usec_t last_session_timestamp; /* When the number of sessions of this user went from 1 to 0 the last time */
      40                 :            : 
      41                 :            :         /* Set up when the last session of the user logs out */
      42                 :            :         sd_event_source *timer_event_source;
      43                 :            : 
      44                 :            :         bool in_gc_queue:1;
      45                 :            : 
      46                 :            :         bool started:1;       /* Whenever the user being started, has been started or is being stopped again. */
      47                 :            :         bool stopping:1;      /* Whenever the user is being stopped or has been stopped. */
      48                 :            : 
      49                 :            :         LIST_HEAD(Session, sessions);
      50                 :            :         LIST_FIELDS(User, gc_queue);
      51                 :            : };
      52                 :            : 
      53                 :            : int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name, const char *home);
      54                 :            : User *user_free(User *u);
      55                 :            : 
      56         [ #  # ]:          0 : DEFINE_TRIVIAL_CLEANUP_FUNC(User *, user_free);
      57                 :            : 
      58                 :            : bool user_may_gc(User *u, bool drop_not_started);
      59                 :            : void user_add_to_gc_queue(User *u);
      60                 :            : int user_start(User *u);
      61                 :            : int user_stop(User *u, bool force);
      62                 :            : int user_finalize(User *u);
      63                 :            : UserState user_get_state(User *u);
      64                 :            : int user_get_idle_hint(User *u, dual_timestamp *t);
      65                 :            : int user_save(User *u);
      66                 :            : int user_load(User *u);
      67                 :            : int user_kill(User *u, int signo);
      68                 :            : int user_check_linger_file(User *u);
      69                 :            : void user_elect_display(User *u);
      70                 :            : void user_update_last_session_timer(User *u);
      71                 :            : 
      72                 :            : const char* user_state_to_string(UserState s) _const_;
      73                 :            : UserState user_state_from_string(const char *s) _pure_;
      74                 :            : 
      75                 :            : CONFIG_PARSER_PROTOTYPE(config_parse_compat_user_tasks_max);

Generated by: LCOV version 1.14