chiark / gitweb /
systemctl: shortcut log output for non-service, non-socket, non-mount, non-swap units
[elogind.git] / src / journal / journal-internal.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foojournalinternalhfoo
4 #define foojournalinternalhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2011 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <sys/types.h>
26 #include <inttypes.h>
27 #include <stdbool.h>
28
29 #include "list.h"
30 #include "sd-id128.h"
31
32 typedef struct Match Match;
33
34 struct Match {
35         char *data;
36         size_t size;
37         uint64_t le_hash;
38
39         LIST_FIELDS(Match, matches);
40 };
41
42 typedef enum location_type {
43         LOCATION_HEAD,
44         LOCATION_TAIL,
45         LOCATION_DISCRETE
46 } location_type_t;
47
48 typedef struct Location {
49         location_type_t type;
50
51         uint64_t seqnum;
52         sd_id128_t seqnum_id;
53         bool seqnum_set;
54
55         uint64_t realtime;
56         bool realtime_set;
57
58         uint64_t monotonic;
59         sd_id128_t boot_id;
60         bool monotonic_set;
61
62         uint64_t xor_hash;
63         bool xor_hash_set;
64 } Location;
65
66 struct sd_journal {
67         int flags;
68
69         Hashmap *files;
70
71         Location current_location;
72         JournalFile *current_file;
73         uint64_t current_field;
74
75         int inotify_fd;
76         Hashmap *inotify_wd_dirs;
77         Hashmap *inotify_wd_roots;
78
79         LIST_HEAD(Match, matches);
80         unsigned n_matches;
81 };
82
83 #endif