Blame libarchive/archive_read_support_filter_all.c

Packit 08bd4c
/*-
Packit 08bd4c
 * Copyright (c) 2003-2011 Tim Kientzle
Packit 08bd4c
 * All rights reserved.
Packit 08bd4c
 *
Packit 08bd4c
 * Redistribution and use in source and binary forms, with or without
Packit 08bd4c
 * modification, are permitted provided that the following conditions
Packit 08bd4c
 * are met:
Packit 08bd4c
 * 1. Redistributions of source code must retain the above copyright
Packit 08bd4c
 *    notice, this list of conditions and the following disclaimer.
Packit 08bd4c
 * 2. Redistributions in binary form must reproduce the above copyright
Packit 08bd4c
 *    notice, this list of conditions and the following disclaimer in the
Packit 08bd4c
 *    documentation and/or other materials provided with the distribution.
Packit 08bd4c
 *
Packit 08bd4c
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
Packit 08bd4c
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
Packit 08bd4c
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Packit 08bd4c
 * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
Packit 08bd4c
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
Packit 08bd4c
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit 08bd4c
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit 08bd4c
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 08bd4c
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
Packit 08bd4c
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 08bd4c
 */
Packit 08bd4c
Packit 08bd4c
#include "archive_platform.h"
Packit 08bd4c
__FBSDID("$FreeBSD$");
Packit 08bd4c
Packit 08bd4c
#include "archive.h"
Packit 08bd4c
#include "archive_private.h"
Packit 08bd4c
Packit 08bd4c
#if ARCHIVE_VERSION_NUMBER < 4000000
Packit 08bd4c
/* Deprecated; remove in libarchive 4.0 */
Packit 08bd4c
int
Packit 08bd4c
archive_read_support_compression_all(struct archive *a)
Packit 08bd4c
{
Packit 08bd4c
	return archive_read_support_filter_all(a);
Packit 08bd4c
}
Packit 08bd4c
#endif
Packit 08bd4c
Packit 08bd4c
int
Packit 08bd4c
archive_read_support_filter_all(struct archive *a)
Packit 08bd4c
{
Packit 08bd4c
	archive_check_magic(a, ARCHIVE_READ_MAGIC,
Packit 08bd4c
	    ARCHIVE_STATE_NEW, "archive_read_support_filter_all");
Packit 08bd4c
Packit 08bd4c
	/* Bzip falls back to "bunzip2" command-line */
Packit 08bd4c
	archive_read_support_filter_bzip2(a);
Packit 08bd4c
	/* The decompress code doesn't use an outside library. */
Packit 08bd4c
	archive_read_support_filter_compress(a);
Packit 08bd4c
	/* Gzip decompress falls back to "gzip -d" command-line. */
Packit 08bd4c
	archive_read_support_filter_gzip(a);
Packit 08bd4c
	/* Lzip falls back to "unlzip" command-line program. */
Packit 08bd4c
	archive_read_support_filter_lzip(a);
Packit 08bd4c
	/* The LZMA file format has a very weak signature, so it
Packit 08bd4c
	 * may not be feasible to keep this here, but we'll try.
Packit 08bd4c
	 * This will come back out if there are problems. */
Packit 08bd4c
	/* Lzma falls back to "unlzma" command-line program. */
Packit 08bd4c
	archive_read_support_filter_lzma(a);
Packit 08bd4c
	/* Xz falls back to "unxz" command-line program. */
Packit 08bd4c
	archive_read_support_filter_xz(a);
Packit 08bd4c
	/* The decode code doesn't use an outside library. */
Packit 08bd4c
	archive_read_support_filter_uu(a);
Packit 08bd4c
	/* The decode code doesn't use an outside library. */
Packit 08bd4c
	archive_read_support_filter_rpm(a);
Packit 08bd4c
	/* The decode code always uses "lrzip -q -d" command-line. */
Packit 08bd4c
	archive_read_support_filter_lrzip(a);
Packit 08bd4c
	/* Lzop decompress falls back to "lzop -d" command-line. */
Packit 08bd4c
	archive_read_support_filter_lzop(a);
Packit 08bd4c
	/* The decode code always uses "grzip -d" command-line. */
Packit 08bd4c
	archive_read_support_filter_grzip(a);
Packit 08bd4c
	/* Lz4 falls back to "lz4 -d" command-line program. */
Packit 08bd4c
	archive_read_support_filter_lz4(a);
Packit 08bd4c
Packit 08bd4c
	/* Note: We always return ARCHIVE_OK here, even if some of the
Packit 08bd4c
	 * above return ARCHIVE_WARN.  The intent here is to enable
Packit 08bd4c
	 * "as much as possible."  Clients who need specific
Packit 08bd4c
	 * compression should enable those individually so they can
Packit 08bd4c
	 * verify the level of support. */
Packit 08bd4c
	/* Clear any warning messages set by the above functions. */
Packit 08bd4c
	archive_clear_error(a);
Packit 08bd4c
	return (ARCHIVE_OK);
Packit 08bd4c
}