1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
4 This file is part of systemd.
6 Copyright 2014 Zbigniew Jędrzejewski-Szmek
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 #include "journal-file.h"
27 typedef struct RemoteServer RemoteServer
;
29 struct iovec_wrapper
{
35 int iovw_put(struct iovec_wrapper
*iovw
, void* data
, size_t len
);
36 void iovw_free_contents(struct iovec_wrapper
*iovw
);
37 size_t iovw_size(struct iovec_wrapper
*iovw
);
38 void iovw_rebase(struct iovec_wrapper
*iovw
, char *old
, char *new);
40 typedef struct Writer
{
42 JournalMetrics metrics
;
53 Writer
* writer_new(RemoteServer
* server
);
54 Writer
* writer_free(Writer
*w
);
56 Writer
* writer_ref(Writer
*w
);
57 Writer
* writer_unref(Writer
*w
);
59 DEFINE_TRIVIAL_CLEANUP_FUNC(Writer
*, writer_unref
);
60 #define _cleanup_writer_unref_ _cleanup_(writer_unrefp)
62 int writer_write(Writer
*s
,
63 struct iovec_wrapper
*iovw
,
68 typedef enum JournalWriteSplitMode
{
69 JOURNAL_WRITE_SPLIT_NONE
,
70 JOURNAL_WRITE_SPLIT_HOST
,
71 _JOURNAL_WRITE_SPLIT_MAX
,
72 _JOURNAL_WRITE_SPLIT_INVALID
= -1
73 } JournalWriteSplitMode
;