aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-04-11 16:31:20 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-04-11 16:31:20 +0000
commitb3f23d4c6a34b190d3fe0b73ed3c25e4af611749 (patch)
tree9966ebb52afc74d1cf85c4b7f5c670545b137007
parent988be100e246cd4b78c60082ce74a77894a903b7 (diff)
downloadbusybox-w32-b3f23d4c6a34b190d3fe0b73ed3c25e4af611749.tar.gz
busybox-w32-b3f23d4c6a34b190d3fe0b73ed3c25e4af611749.tar.bz2
busybox-w32-b3f23d4c6a34b190d3fe0b73ed3c25e4af611749.zip
Seek to start of an entry inside an ar file
-rw-r--r--libbb/seek_ared_file.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libbb/seek_ared_file.c b/libbb/seek_ared_file.c
new file mode 100644
index 000000000..67c789d6d
--- /dev/null
+++ b/libbb/seek_ared_file.c
@@ -0,0 +1,17 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include "libbb.h"
4
5extern int seek_ared_file(FILE *in_file, ar_headers_t *headers, const char *tar_gz_file)
6{
7 /* find the headers for the specified .tar.gz file */
8 while (headers->next != NULL) {
9 if (strcmp(headers->name, tar_gz_file) == 0) {
10 fseek(in_file, headers->offset, SEEK_SET);
11 return(EXIT_SUCCESS);
12 }
13 headers = headers->next;
14 }
15
16 return(EXIT_FAILURE);
17} \ No newline at end of file