diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-10-15 01:38:44 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-10-15 01:38:44 +0200 |
commit | e892bd1797e99c8afaa6afdbe413fda78937c9c3 (patch) | |
tree | a5390bd377757bcb93d94a6bced53ab72a1b381b /src/journal/journal-file.h | |
parent | de7b95cdc3228131498021c2fdcf6647004c3920 (diff) |
journal: unify code for up and for down traversal
Diffstat (limited to 'src/journal/journal-file.h')
-rw-r--r-- | src/journal/journal-file.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index 0294555cab..795a446dc8 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -54,6 +54,11 @@ typedef struct JournalFile { uint64_t current_offset; } JournalFile; +typedef enum direction { + DIRECTION_UP, + DIRECTION_DOWN +} direction_t; + int journal_file_open(const char *fname, int flags, mode_t mode, JournalFile *template, JournalFile **ret); void journal_file_close(JournalFile *j); @@ -66,11 +71,9 @@ int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st int journal_file_move_to_entry(JournalFile *f, uint64_t seqnum, Object **ret, uint64_t *offset); -int journal_file_find_first_entry(JournalFile *f, const void *data, uint64_t size, Object **ret, uint64_t *offset); -int journal_file_find_last_entry(JournalFile *f, const void *data, uint64_t size, Object **ret, uint64_t *offset); +int journal_file_find_first_entry(JournalFile *f, const void *data, uint64_t size, direction_t direction, Object **ret, uint64_t *offset); -int journal_file_next_entry(JournalFile *f, Object *o, Object **ret, uint64_t *offset); -int journal_file_prev_entry(JournalFile *f, Object *o, Object **ret, uint64_t *offset); +int journal_file_next_entry(JournalFile *f, Object *o, direction_t direction, Object **ret, uint64_t *offset); void journal_file_dump(JournalFile *f); |