]> thyrsus.com Git - comparator.git/commitdiff
Ready to pass stuff in core.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 18:34:12 +0000 (18:34 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 2 Sep 2003 18:34:12 +0000 (18:34 +0000)
shred.h
shredtree.c

diff --git a/shred.h b/shred.h
index 189f07bf3bce383fa66ec1a916cc18366c8eeef8..0eba471bb1ae81de370ecb8dffcb9ec216d144c7 100644 (file)
--- a/shred.h
+++ b/shred.h
@@ -41,6 +41,7 @@ extern struct hash_t *chunk_buffer;
 
 /* functions */
 extern void generate_shredfile(const char *, FILE *);
+extern struct sorthash_t *generate_shredlist(const int, const char *argv[]);
 extern void shredreport(int argc, char *argv[]);
 
 /* shred.h ends here */
index 69b07efc545aed12fb62b1c31b7be7cea8955f2e..f0123d529e631f934cd03e2f3493ed993e49ca38 100644 (file)
@@ -259,17 +259,23 @@ void generate_shredfile(const char *tree, FILE *ofp)
     }
 }
 
-struct sorthash_t *generate_shredlist(const char *tree)
+struct sorthash_t *generate_shredlist(const int argc, const char *argv[])
 /* generate an in-core list of sorthash structures */
 {
-    char       **place, **list;
+    int        i;
 
     sort_buffer = (struct sorthash_t*)calloc(sizeof(struct sorthash_t),1);
     sort_count = 0;
 
-    list = sorted_file_list(tree);
-    for (place = list; place < list + file_count; place++)
-       shredfile(*place, corehook);
+    for (i = 0; i < argc; i++)
+    {
+       char    **place, **list;
+
+       list = sorted_file_list(argv[i]);
+       for (place = list; place < list + file_count; place++)
+           shredfile(*place, corehook);
+       free(list);
+    }
 
     /* caller is responsible for freeing this */
     return(sort_buffer);