compress.h revision 5d6f46b6bf7804af8c1ba780f72a37dc37193428
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2011 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <unistd.h>
#include "journal-def.h"
const char* object_compressed_to_string(int compression);
int object_compressed_from_string(const char *compression);
int r;
#ifdef HAVE_LZ4
if (r == 0)
return OBJECT_COMPRESSED_LZ4;
#else
if (r == 0)
return OBJECT_COMPRESSED_XZ;
#endif
return r;
}
int decompress_blob(int compression,
int decompress_startswith(int compression,
#ifdef HAVE_LZ4
# define compress_stream compress_stream_lz4
# define COMPRESSED_EXT ".lz4"
#else
# define compress_stream compress_stream_xz
# define COMPRESSED_EXT ".xz"
#endif