init_handle.c 730 B

1234567891011121314151617181920212223242526
  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. archive_handle_t* FAST_FUNC init_handle(void)
  8. {
  9. archive_handle_t *archive_handle;
  10. /* Initialize default values */
  11. archive_handle = xzalloc(sizeof(archive_handle_t));
  12. archive_handle->file_header = xzalloc(sizeof(file_header_t));
  13. archive_handle->action_header = header_skip;
  14. archive_handle->action_data = data_skip;
  15. archive_handle->filter = filter_accept_all;
  16. archive_handle->seek = seek_by_jump;
  17. #if ENABLE_CPIO || ENABLE_RPM2CPIO || ENABLE_RPM
  18. archive_handle->cpio__owner.uid = (uid_t)-1L;
  19. archive_handle->cpio__owner.gid = (gid_t)-1L;
  20. #endif
  21. return archive_handle;
  22. }