summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2000-12-12 21:02:34 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2000-12-12 21:02:34 +0000
commit7852f76ee05551c05a4f833f9a55bec15f44f85d (patch)
tree55da3253c21abc70b968e6a2ed7cb10a041dd6bb
parentd3c2d12831c70b135b630319a072588d298449da (diff)
downloaddrakx-7852f76ee05551c05a4f833f9a55bec15f44f85d.tar
drakx-7852f76ee05551c05a4f833f9a55bec15f44f85d.tar.gz
drakx-7852f76ee05551c05a4f833f9a55bec15f44f85d.tar.bz2
drakx-7852f76ee05551c05a4f833f9a55bec15f44f85d.tar.xz
drakx-7852f76ee05551c05a4f833f9a55bec15f44f85d.zip
add "list-contents" feature to mar-extract-only
-rw-r--r--mdk-stage1/mar/mar-extract-only.c18
-rw-r--r--mdk-stage1/mar/mar-extract-only.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/mdk-stage1/mar/mar-extract-only.c b/mdk-stage1/mar/mar-extract-only.c
index b1079880e..fc9e9e55f 100644
--- a/mdk-stage1/mar/mar-extract-only.c
+++ b/mdk-stage1/mar/mar-extract-only.c
@@ -52,6 +52,24 @@ gzerr(gzFile f) /* decrease code size */
#endif /* _STANDALONE_ */
+char **
+mar_list_contents(struct mar_stream *s)
+{
+ struct mar_element * elem = s->first_element;
+ char * tmp_contents[500];
+ char ** answ;
+ int i = 0;
+ while (elem)
+ {
+ tmp_contents[i++] = strdup(elem->filename);
+ elem = elem->next_element;
+ }
+ tmp_contents[i++] = NULL;
+ answ = (char **) malloc(sizeof(char *) * i);
+ memcpy(answ, tmp_contents, sizeof(char *) * i);
+ return answ;
+}
+
int
mar_calc_integrity(struct mar_stream *s)
{
diff --git a/mdk-stage1/mar/mar-extract-only.h b/mdk-stage1/mar/mar-extract-only.h
index e8a88e96e..8a68cc13d 100644
--- a/mdk-stage1/mar/mar-extract-only.h
+++ b/mdk-stage1/mar/mar-extract-only.h
@@ -31,5 +31,6 @@
int mar_open_file(char *filename, struct mar_stream *s);
int mar_extract_file(struct mar_stream *s, char *filename, char *dest_dir);
int mar_calc_integrity(struct mar_stream *s);
+char ** mar_list_contents(struct mar_stream *s);
#endif