diff options
author | pixel <pixel> | 2004-11-27 21:44:44 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-11-27 21:44:44 +0000 |
commit | d38e80ee04afe582e70150d3884e56c05f3fd7a8 (patch) | |
tree | f2627c50fa22aea89447e8406ac418eb68650d3d /Xenogears/archive.cpp | |
parent | 50f0dd331f8168fb5b2cd60c70178fad627b7fb6 (diff) |
Large dos2unix commit...
Diffstat (limited to 'Xenogears/archive.cpp')
-rw-r--r-- | Xenogears/archive.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/Xenogears/archive.cpp b/Xenogears/archive.cpp index 286fa43..6701c2c 100644 --- a/Xenogears/archive.cpp +++ b/Xenogears/archive.cpp @@ -1,37 +1,37 @@ -#include <stdio.h>
-#include <values.h>
-#include <stdlib.h>
-#include "fileutils.h"
-
-void dearchive(FILE * f) {
- long nb;
- long * address;
- char fname[100];
- int i;
- FILE * f_out;
-
- fread(&nb, 4, 1, f);
- nb++;
- fprintf(stderr, "Reading index... (%li elements)\n", nb);
-
- address = (long *) malloc(nb * sizeof(long) + 1);
-
- for (i = 0; i < nb; i++) {
- fread(address + i, 4, 1, f);
- }
- address[nb] = MAXINT;
-
- for (i = 0; i < nb; i++) {
- fprintf(stderr, "Dumping file %i\n", i);
- sprintf(fname, "part-%i.lz", i);
- f_out = fopen(fname, "wb");
- copy(fileno(f), fileno(f_out), address[i + 1] - address[i]);
- fclose(f_out);
- }
-
- free(address);
-}
-
-int main(void) {
- dearchive(stdin);
-}
+#include <stdio.h> +#include <values.h> +#include <stdlib.h> +#include "fileutils.h" + +void dearchive(FILE * f) { + long nb; + long * address; + char fname[100]; + int i; + FILE * f_out; + + fread(&nb, 4, 1, f); + nb++; + fprintf(stderr, "Reading index... (%li elements)\n", nb); + + address = (long *) malloc(nb * sizeof(long) + 1); + + for (i = 0; i < nb; i++) { + fread(address + i, 4, 1, f); + } + address[nb] = MAXINT; + + for (i = 0; i < nb; i++) { + fprintf(stderr, "Dumping file %i\n", i); + sprintf(fname, "part-%i.lz", i); + f_out = fopen(fname, "wb"); + copy(fileno(f), fileno(f_out), address[i + 1] - address[i]); + fclose(f_out); + } + + free(address); +} + +int main(void) { + dearchive(stdin); +} |