summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-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 0000000..67c789d
--- /dev/null
+++ b/libbb/seek_ared_file.c
@@ -0,0 +1,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);
+} \ No newline at end of file