summaryrefslogtreecommitdiffstats
path: root/src/shared/journal-importer.h
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2019-06-25 15:54:44 +0200
committerFranck Bui <fbui@suse.com>2019-06-27 19:14:23 +0200
commit11e6d9714ebcae00cb42a0d0910881b2b6570742 (patch)
tree7e43ebff3da4ba947bf2ffec9ebf65797be0295f /src/shared/journal-importer.h
parentcoredump: drop 2 useless assertions (diff)
downloadsystemd-11e6d9714ebcae00cb42a0d0910881b2b6570742.tar.xz
systemd-11e6d9714ebcae00cb42a0d0910881b2b6570742.zip
journal-import: extract helpers for handling arrays of iovec and make them available for others
Diffstat (limited to 'src/shared/journal-importer.h')
-rw-r--r--src/shared/journal-importer.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/shared/journal-importer.h b/src/shared/journal-importer.h
index 7914c0cf5f..b2e3c817f5 100644
--- a/src/shared/journal-importer.h
+++ b/src/shared/journal-importer.h
@@ -6,8 +6,8 @@
#include <stdbool.h>
#include <sys/uio.h>
+#include "io-util.h"
#include "sd-id128.h"
-
#include "time-util.h"
/* Make sure not to make this smaller than the maximum coredump size.
@@ -24,14 +24,6 @@
/* The maximum number of fields in an entry */
#define ENTRY_FIELD_COUNT_MAX 1024
-struct iovec_wrapper {
- struct iovec *iovec;
- size_t size_bytes;
- size_t count;
-};
-
-size_t iovw_size(struct iovec_wrapper *iovw);
-
typedef struct JournalImporter {
int fd;
bool passive_fd;
@@ -53,6 +45,9 @@ typedef struct JournalImporter {
sd_id128_t boot_id;
} JournalImporter;
+#define JOURNAL_IMPORTER_INIT(_fd) { .fd = (_fd), .iovw = {} }
+#define JOURNAL_IMPORTER_MAKE(_fd) (JournalImporter) JOURNAL_IMPORTER_INIT(_fd)
+
void journal_importer_cleanup(JournalImporter *);
int journal_importer_process_data(JournalImporter *);
int journal_importer_push_data(JournalImporter *, const char *data, size_t size);