blob: 18dbfd54dbc451756199f681f0c060e65864708d [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00002/*
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00004 */
Denis Vlasenko9a7d38f2007-05-31 22:42:12 +00005
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00006#include "libbb.h"
Denys Vlasenko833d4e72010-11-03 02:38:31 +01007#include "archive.h"
Alexander Shishkin535584c2010-03-15 15:38:09 +01008#include "ar.h"
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00009
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000010void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive)
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000011{
12 char magic[7];
13
Alexander Shishkin535584c2010-03-15 15:38:09 +010014 xread(ar_archive->src_fd, magic, AR_MAGIC_LEN);
15 if (strncmp(magic, AR_MAGIC, AR_MAGIC_LEN) != 0) {
Denis Vlasenkoe1a0d482006-10-20 13:28:22 +000016 bb_error_msg_and_die("invalid ar magic");
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000017 }
Alexander Shishkin535584c2010-03-15 15:38:09 +010018 ar_archive->offset += AR_MAGIC_LEN;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000019
Denis Vlasenko0381d422008-07-10 23:06:00 +000020 while (get_header_ar(ar_archive) == EXIT_SUCCESS)
21 continue;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000022}