blob: 4c64dac585415c7309540637db2870402b252ffe [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath237ae422002-11-03 14:05:15 +00002/*
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Glenn L McGrath237ae422002-11-03 14:05:15 +00004 */
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00005#include "libbb.h"
Denys Vlasenkod184a722011-09-22 12:45:14 +02006#include "bb_archive.h"
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00007
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +00008archive_handle_t* FAST_FUNC init_handle(void)
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00009{
10 archive_handle_t *archive_handle;
11
Denis Vlasenkocba9ef52006-10-10 21:00:47 +000012 /* Initialize default values */
Rob Landley8bb50782006-05-26 23:44:51 +000013 archive_handle = xzalloc(sizeof(archive_handle_t));
Denis Vlasenko3eb91c22006-11-21 00:55:46 +000014 archive_handle->file_header = xzalloc(sizeof(file_header_t));
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000015 archive_handle->action_header = header_skip;
16 archive_handle->action_data = data_skip;
17 archive_handle->filter = filter_accept_all;
Glenn L McGrath237ae422002-11-03 14:05:15 +000018 archive_handle->seek = seek_by_jump;
Denys Vlasenko85100a72016-10-12 20:56:46 +020019#if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM
20 archive_handle->cpio__owner.uid = (uid_t)-1L;
21 archive_handle->cpio__owner.gid = (gid_t)-1L;
22#endif
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000023
Denis Vlasenkocba9ef52006-10-10 21:00:47 +000024 return archive_handle;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000025}