aboutsummaryrefslogtreecommitdiff
path: root/libbb/seek_ared_file.c
blob: 67c789d6ddd3a69751a734f66df5dd54a3afe830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>
#include "libbb.h"

extern int seek_ared_file(FILE *in_file, ar_headers_t *headers, const char *tar_gz_file)
{
	/* find the headers for the specified .tar.gz file */
	while (headers->next != NULL) {
		if (strcmp(headers->name, tar_gz_file) == 0) {
			fseek(in_file, headers->offset, SEEK_SET);
			return(EXIT_SUCCESS);
		}
		headers = headers->next;
	}

	return(EXIT_FAILURE);
}