store decompressed size in include file
authorkramm <kramm>
Mon, 9 Jun 2008 10:24:20 +0000 (10:24 +0000)
committerkramm <kramm>
Mon, 9 Jun 2008 10:24:20 +0000 (10:24 +0000)
installer/mkarchive.c

index 7b9eb16..bec26cb 100644 (file)
@@ -261,6 +261,20 @@ int main (int argn, char*argv[])
     int t;
     char buf[320];
 
+    int fullsize = 0;
+    for(t=1;t<argn;t++)
+    {
+       if(argv[t][0]!='-')
+       {
+           FILE*fi=fopen(argv[t],"rb");
+           fseek(fi,0,SEEK_END);
+           long l=ftell(fi);
+           fclose(fi);
+           fullsize += l;
+       }
+    }
+
+
 #ifdef ZLIB
     writer_t*include_writer = writer_init_includewriter("crnfiles.c");
     writer_t*zwriter = writer_init_zwriter(include_writer);
@@ -373,6 +387,10 @@ int main (int argn, char*argv[])
     }
 #endif
 
+    fi = fopen("crnfiles.c", "ab+");
+    fprintf(fi, "\nint crn_decompressed_size=%d;\n", fullsize);
+    fclose(fi);
+
     return 0;
 }