home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * UNCOMP.C
- *
- * uncompress a file pointer into a file destination.
- */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "config.h"
-
- Prototype int uncompress_to_file(FILE *, char *);
- Prototype int uncompress_to_fp(FILE *, FILE *);
-
- int
- uncompress_to_file (FILE *fi, char *outName)
- {
- FILE *fo;
- int r = -1;
-
- if (initcomp(fi, NULL, 0, 1, 1) >= 0) {
- if (fo = fopen(outName, "w")) {
- r = decompress(fi, fo, 0);
- fclose(fo);
- }
- }
- deletecomp();
- return r;
- }
-
- int
- uncompress_to_fp (FILE *fi, FILE *fo)
- {
- int r = -1;
-
- if (initcomp(fi, NULL, 0, 1, 1) >= 0) {
- r = decompress(fi, fo, 0);
- }
- deletecomp();
- return r;
- }
-