-#if 0
-static void abort_gzip(int ATTRIBUTE_UNUSED ignored)
-{
- exit(1);
-}
-
-int gzip_main(int argc, char **argv);
-int gzip_main(int argc, char **argv)
-{
-
- if (optind == argc) {
- G1.time_stamp = 0;
- zip(STDIN_FILENO, STDOUT_FILENO);
- return 0; //## G1.exit_code;
- }
-
- for (i = optind; i < argc; i++) {
- char *path = NULL;
-
- clear_bufs();
- if (LONE_DASH(argv[i])) {
- G1.time_stamp = 0;
- inFileNum = STDIN_FILENO;
- outFileNum = STDOUT_FILENO;
- } else {
- inFileNum = xopen(argv[i], O_RDONLY);
- if (fstat(inFileNum, &statBuf) < 0)
- bb_perror_msg_and_die("%s", argv[i]);
- G1.time_stamp = statBuf.st_ctime;
-
- if (!(opt & OPT_tostdout)) {
- path = xasprintf("%s.gz", argv[i]);
-
- /* Open output file */
-#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && defined(O_NOFOLLOW)
- outFileNum = open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW);
-#else
- outFileNum = open(path, O_RDWR | O_CREAT | O_EXCL);
-#endif
- if (outFileNum < 0) {
- bb_perror_msg("%s", path);
- free(path);
- continue;
- }
-
- /* Set permissions on the file */
- fchmod(outFileNum, statBuf.st_mode);
- } else
- outFileNum = STDOUT_FILENO;
- }
-
- if (path == NULL && isatty(outFileNum) && !(opt & OPT_force)) {
- bb_error_msg("compressed data not written "
- "to a terminal. Use -f to force compression.");
- free(path);
- continue;
- }
-
- zip(inFileNum, outFileNum);
-
- if (path != NULL) {
- char *delFileName;
-
- close(inFileNum);
- close(outFileNum);
-
- /* Delete the original file */
- // Pity we don't propagate zip failures to this place...
- //if (zip_is_ok)
- delFileName = argv[i];
- //else
- // delFileName = path;
- if (unlink(delFileName) < 0)
- bb_perror_msg("%s", delFileName);
- }
-
- free(path);
- }
-
- return 0; //##G1.exit_code;
-}
-#endif
-
-int bbunpack(char **argv,
- char* (*make_new_name)(char *filename),
- USE_DESKTOP(long long) int (*unpacker)(void)
-);
-