home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / duucp-1.17 / AU-117b4-src.lha / src / util / uncompressbatch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-27  |  668 b   |  36 lines

  1. /*
  2.  *  UNCOMPRESSBATCH.C
  3.  *
  4.  *  UNCOMPRESSBATCH [file]
  5.  *
  6.  *  skips cunbatch line and calls uncompress, output to stdout
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include "config.h"
  12. #include "lib_protos.h"
  13. #include "OwnDevUnit.h"
  14.  
  15. struct Library *OwnDevUnitBase = NULL;
  16.  
  17. int main(int ac, char **av)
  18. {
  19.     char buf[256];
  20.     short bits;
  21.     int r;
  22.  
  23.     if (ac != 1) {
  24.     if (freopen(av[1], "r", stdin) == NULL) {
  25.         fprintf(stderr, "unable to open %s\n", av[1]);
  26.         exit(20);
  27.     }
  28.     }
  29.     fgets(buf, sizeof(buf), stdin);
  30.  
  31.     r = unix_uncompress_to_fp(stdin, stdout, &bits);
  32.     if (r < 0)
  33.     fprintf(stderr, "*** ERROR UNCOMPRESSING BATCH ***\n");
  34.     return(r);
  35. }
  36.