busybox/archival/libarchive/init_handle.c
<<
>>
Prefs
   1/* vi: set sw=4 ts=4: */
   2/*
   3 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
   4 */
   5#include "libbb.h"
   6#include "bb_archive.h"
   7
   8archive_handle_t* FAST_FUNC init_handle(void)
   9{
  10        archive_handle_t *archive_handle;
  11
  12        /* Initialize default values */
  13        archive_handle = xzalloc(sizeof(archive_handle_t));
  14        archive_handle->file_header = xzalloc(sizeof(file_header_t));
  15        archive_handle->action_header = header_skip;
  16        archive_handle->action_data = data_skip;
  17        archive_handle->filter = filter_accept_all;
  18        archive_handle->seek = seek_by_jump;
  19#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
  23
  24        return archive_handle;
  25}
  26