Browse Source

*** empty log message ***

Mike Goslin 25 years ago
parent
commit
7bfdd75113

+ 20 - 0
panda/src/downloader/decompressor.cxx

@@ -175,3 +175,23 @@ run(void) {
 
   return DS_ok;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: Decompressor::decompress
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+bool Decompressor::
+decompress(Filename &source_file) {
+  int ret = initiate(source_file);
+  if (ret < 0) 
+    return false;
+  for (;;) {
+    ret = run();
+    if (ret == DS_success)
+      return true;
+    else if (ret < 0)
+      return false;
+  }
+  return false;
+}

+ 2 - 1
panda/src/downloader/decompressor.h

@@ -35,9 +35,10 @@ PUBLISHED:
 
   int initiate(Filename &source_file);
   int initiate(Filename &source_file, Filename &dest_file);
-
   int run(void);
 
+  bool decompress(Filename &source_file);
+
 private:
   void init(PT(Buffer) buffer);
 

+ 20 - 0
panda/src/downloader/extractor.cxx

@@ -116,3 +116,23 @@ run(void) {
   }
   return ES_ok;
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: Extractor::extract
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+bool Extractor::
+extract(Filename &source_file, const Filename &rel_path) {
+  int ret = initiate(source_file, rel_path);
+  if (ret < 0)
+    return false;
+  for (;;) {
+    ret = run();
+    if (ret == ES_success)
+      return true;
+    if (ret < 0)
+      return false;
+  }
+  return false;
+}

+ 2 - 0
panda/src/downloader/extractor.h

@@ -35,6 +35,8 @@ PUBLISHED:
   int initiate(Filename &source_file, const Filename &rel_path = "");
   int run(void);
 
+  bool extract(Filename &source_file, const Filename &rel_path = "");
+
 private:
   void init(PT(Buffer) buffer);
 

+ 0 - 1
panda/src/downloadertools/multify.cxx

@@ -78,7 +78,6 @@ main(int argc, char *argv[]) {
     mfile.extract_all(rel_path);
 #else
     Extractor extor;
-    extor.set_frequency(0);
     extor.extract(dest_file, rel_path);
 #endif
   }