Skip to content
/ rbread Public

Header-only, gzread-like reader for gzip, bz2, and xz.

Notifications You must be signed in to change notification settings

ocxtal/rbread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rbread.h

Header-only, gzread-like reader for gzip, bz2, and xz.

Example

#include "rbread.h"

/* simple zcat / bzcat */
int dump_file(char const *filename, FILE *out)
{
	rbread_t *rb = rbopen(filename);		/* always in read mode; "rb" for plain text */
	if(rb == NULL) { return(1); }
	while(rbeof(rb) == 0) {
		size_t read = rbread(rb, buf, buf_size);
		fwrite(buf, 1, read, out);
	}
	rbclose(rb);
	fflush(out);
	return(0);
}

License

MIT

Copyright (2018), Hajime Suzuki

About

Header-only, gzread-like reader for gzip, bz2, and xz.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published