]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/journal-importer.h
f49ce734a106ac851c333b058751c8483b1aa651
1 /* SPDX-License-Identifier: LGPL-2.1+ */
11 #include "time-util.h"
13 /* Make sure not to make this smaller than the maximum coredump size.
14 * See COREDUMP_MAX in coredump.c */
15 #define ENTRY_SIZE_MAX (1024*1024*770u)
16 #define DATA_SIZE_MAX (1024*1024*768u)
17 #define LINE_CHUNK 8*1024u
19 struct iovec_wrapper
{
25 size_t iovw_size(struct iovec_wrapper
*iovw
);
27 typedef struct JournalImporter
{
33 size_t size
; /* total size of the buffer */
34 size_t offset
; /* offset to the beginning of live data in the buffer */
35 size_t scanned
; /* number of bytes since the beginning of data without a newline */
36 size_t filled
; /* total number of bytes in the buffer */
38 size_t field_len
; /* used for binary fields: the field name length */
39 size_t data_size
; /* and the size of the binary data chunk being processed */
41 struct iovec_wrapper iovw
;
48 void journal_importer_cleanup(JournalImporter
*);
49 int journal_importer_process_data(JournalImporter
*);
50 int journal_importer_push_data(JournalImporter
*, const char *data
, size_t size
);
51 void journal_importer_drop_iovw(JournalImporter
*);
52 bool journal_importer_eof(const JournalImporter
*);
54 static inline size_t journal_importer_bytes_remaining(const JournalImporter
*imp
) {