journal-remote-parse.h revision 09d801a82a46df518dd752e40bf13ac404daa2ce
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering This file is part of systemd.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Copyright 2014 Zbigniew Jędrzejewski-Szmek
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is distributed in the hope that it will be useful, but
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Lesser General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering STATE_LINE = 0, /* waiting to read, or reading line */
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poettering STATE_DATA_START, /* reading binary data header */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering STATE_DATA_FINISH, /* expecting newline */
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poettering size_t size; /* total size of the buffer */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering size_t offset; /* offset to the beginning of live data in the buffer */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering size_t scanned; /* number of bytes since the beginning of data without a newline */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering size_t filled; /* total number of bytes in the buffer */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering size_t field_len; /* used for binary fields: the field name length */
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering size_t data_size; /* and the size of the binary data chunk being processed */
1ee306e1248866617c96ed9f4263f375588ad838Lennart PoetteringRemoteSource* source_new(int fd, bool passive_fd, char *name, Writer *writer);
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringstatic inline size_t source_non_empty(RemoteSource *source) {
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poetteringint push_data(RemoteSource *source, const char *data, size_t size);