chiark / gitweb /
bus: use new property retrieval calls everywhere
[elogind.git] / src / journal / journal-file.h
index 0eab5017d76b60fee5affa4528b7d3fd0a6541ee..5cc2c2d28d3ab53f4eb882b39af7558e964dd330 100644 (file)
@@ -42,10 +42,14 @@ typedef struct JournalMetrics {
         uint64_t keep_free;
 } JournalMetrics;
 
+typedef enum direction {
+        DIRECTION_UP,
+        DIRECTION_DOWN
+} direction_t;
+
 typedef struct JournalFile {
         int fd;
-        char *path;
-        struct stat last_stat;
+
         mode_t mode;
 
         int flags;
@@ -56,6 +60,11 @@ typedef struct JournalFile {
 
         bool tail_entry_monotonic_valid;
 
+        direction_t last_direction;
+
+        char *path;
+        struct stat last_stat;
+
         Header *header;
         HashItem *data_hash_table;
         HashItem *field_hash_table;
@@ -90,11 +99,6 @@ typedef struct JournalFile {
 #endif
 } JournalFile;
 
-typedef enum direction {
-        DIRECTION_UP,
-        DIRECTION_DOWN
-} direction_t;
-
 int journal_file_open(
                 const char *fname,
                 int flags,
@@ -150,9 +154,9 @@ static inline bool VALID_EPOCH(uint64_t u) {
 
 int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret);
 
-uint64_t journal_file_entry_n_items(Object *o);
-uint64_t journal_file_entry_array_n_items(Object *o);
-uint64_t journal_file_hash_table_n_items(Object *o);
+uint64_t journal_file_entry_n_items(Object *o) _pure_;
+uint64_t journal_file_entry_array_n_items(Object *o) _pure_;
+uint64_t journal_file_hash_table_n_items(Object *o) _pure_;
 
 int journal_file_append_object(JournalFile *f, int type, uint64_t size, Object **ret, uint64_t *offset);
 int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const struct iovec iovec[], unsigned n_iovec, uint64_t *seqno, Object **ret, uint64_t *offset);