1 /* SPDX-License-Identifier: LGPL-2.1+ */
9 #include "sd-journal.h"
12 #include "journal-def.h"
13 #include "journal-file.h"
17 typedef struct Match Match
;
18 typedef struct Location Location
;
19 typedef struct Directory Directory
;
21 typedef enum MatchType
{
30 LIST_FIELDS(Match
, matches
);
32 /* For concrete matches */
38 LIST_HEAD(Match
, matches
);
64 unsigned last_seen_generation
;
73 OrderedHashmap
*files
;
74 IteratedCache
*files_cache
;
77 Location current_location
;
79 JournalFile
*current_file
;
80 uint64_t current_field
;
82 Match
*level0
, *level1
, *level2
;
87 unsigned current_invalidate_counter
, last_invalidate_counter
;
88 usec_t last_process_usec
;
91 /* Iterating through unique fields and their data values */
93 JournalFile
*unique_file
;
94 uint64_t unique_offset
;
96 /* Iterating through known fields */
97 JournalFile
*fields_file
;
98 uint64_t fields_offset
;
99 uint64_t fields_hash_table_index
;
101 size_t fields_buffer_allocated
;
108 bool unique_file_lost
:1; /* File we were iterating over got
109 removed, and there were no more
110 files, so sd_j_enumerate_unique
111 will return a value equal to 0. */
112 bool fields_file_lost
:1;
113 bool has_runtime_files
:1;
114 bool has_persistent_files
:1;
116 size_t data_threshold
;
118 Hashmap
*directories_by_path
;
119 Hashmap
*directories_by_wd
;
124 char *journal_make_match_string(sd_journal
*j
);
125 void journal_print_header(sd_journal
*j
);
127 #define JOURNAL_FOREACH_DATA_RETVAL(j, data, l, retval) \
128 for (sd_journal_restart_data(j); ((retval) = sd_journal_enumerate_data((j), &(data), &(l))) > 0; )