示例#1
0
			BgzfDeflateZStreamBase(int const rlevel = Z_DEFAULT_COMPRESSION)
			{
				#if defined(LIBMAUS_HAVE_IGZIP)
				if ( rlevel == libmaus::lz::IGzipDeflate::getCompressionLevel() )
				{
					if ( ! libmaus::util::I386CacheLineSize::hasSSE42() )
					{
						::libmaus::exception::LibMausException se;
						se.getStream() << "BgzfDeflateZStreamBase(): igzip requested, but machine does not support SSE4.2" << std::endl;
						se.finish();
						throw se;
					}
				}
				#endif

				deflateinit(rlevel);
			}
示例#2
0
文件: gzip.c 项目: aahud/harvey
void
main(int argc, char *argv[])
{
	int i, ok, stdout;

	level = 6;
	stdout = 0;
	ARGBEGIN{
	case 'D':
		debug++;
		break;
	case 'v':
		verbose++;
		break;
	case 'c':
		stdout = 1;
		break;
	case '1': case '2': case '3': case '4':
	case '5': case '6': case '7': case '8': case '9':
		level = ARGC() - '0';
		break;
	default:
		usage();
		break;
	}ARGEND

	crctab = mkcrctab(GZCRCPOLY);
	ok = deflateinit();
	if(ok != FlateOk)
		sysfatal("deflateinit failed: %s", flateerr(ok));

	if(argc == 0){
		Binit(&bout, 1, OWRITE);
		ok = gzip(nil, time(0), 0, &bout);
		Bterm(&bout);
	}else{
		ok = 1;
		for(i = 0; i < argc; i++)
			ok &= gzipf(argv[i], stdout);
	}
	exits(ok ? nil: "errors");
}
示例#3
0
			void deflatereinit(int const rlevel = Z_DEFAULT_COMPRESSION)
			{
				deflatedestroy();
				deflateinit(rlevel);
			}
示例#4
0
void
main(int argc, char *argv[])
{
	char *s, *ss;
	char *outfile = nil;
	char *label = nil;
	char *file;

	ARGBEGIN {
	case 'u':
		uflag=1;
		break;
	case 'o':
		outfile = ARGF();
		break;
	case 'l':
		label = ARGF();
		if(label == nil)
			usage();
		break;
	case 'b':
		s = ARGF();
		if(s) {
			blocksize = strtoul(s, &ss, 0);
			if(s == ss)
				usage();
			if(*ss == 'k')
				blocksize *= 1024;
		}
		if(blocksize < MinBlockSize)
			sysfatal("blocksize too small: must be at least %d", MinBlockSize);
		if(blocksize > MaxBlockSize)
			sysfatal("blocksize too large: must be no greater than %d", MaxBlockSize);
		break;
	} ARGEND

	if(outfile == nil) {
		out = emallocz(sizeof(Biobuf));
		Binit(out, 1, OWRITE);
	} else {
		out = Bopen(outfile, OWRITE|OTRUNC);
		if(out == nil)
			sysfatal("could not create file: %s: %r", outfile);
	}

	deflateinit();

	file = argv[0];
	if(file == nil)
		file = ".";

	if(label == nil) {
		if(strrchr(file, '/'))
			label = strrchr(file, '/') + 1;
		else
			label = file;
	}

	paqfs(file, label);

	Bterm(out);

	exits(0);
}