Chris@4: Chris@4: /* spew out a thoroughly gigantic file designed so that bzip2 Chris@4: can compress it reasonably rapidly. This is to help test Chris@4: support for large files (> 2GB) in a reasonable amount of time. Chris@4: I suggest you use the undocumented --exponential option to Chris@4: bzip2 when compressing the resulting file; this saves a bit of Chris@4: time. Note: *don't* bother with --exponential when compressing Chris@4: Real Files; it'll just waste a lot of CPU time :-) Chris@4: (but is otherwise harmless). Chris@4: */ Chris@4: Chris@4: /* ------------------------------------------------------------------ Chris@4: This file is part of bzip2/libbzip2, a program and library for Chris@4: lossless, block-sorting data compression. Chris@4: Chris@4: bzip2/libbzip2 version 1.0.6 of 6 September 2010 Chris@4: Copyright (C) 1996-2010 Julian Seward Chris@4: Chris@4: Please read the WARNING, DISCLAIMER and PATENTS sections in the Chris@4: README file. Chris@4: Chris@4: This program is released under the terms of the license contained Chris@4: in the file LICENSE. Chris@4: ------------------------------------------------------------------ */ Chris@4: Chris@4: Chris@4: #define _FILE_OFFSET_BITS 64 Chris@4: Chris@4: #include Chris@4: #include Chris@4: Chris@4: /* The number of megabytes of junk to spew out (roughly) */ Chris@4: #define MEGABYTES 5000 Chris@4: Chris@4: #define N_BUF 1000000 Chris@4: char buf[N_BUF]; Chris@4: Chris@4: int main ( int argc, char** argv ) Chris@4: { Chris@4: int ii, kk, p; Chris@4: srandom(1); Chris@4: setbuffer ( stdout, buf, N_BUF ); Chris@4: for (kk = 0; kk < MEGABYTES * 515; kk+=3) { Chris@4: p = 25+random()%50; Chris@4: for (ii = 0; ii < p; ii++) Chris@4: printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ); Chris@4: for (ii = 0; ii < p-1; ii++) Chris@4: printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" ); Chris@4: for (ii = 0; ii < p+1; ii++) Chris@4: printf ( "ccccccccccccccccccccccccccccccccccccc" ); Chris@4: } Chris@4: fflush(stdout); Chris@4: return 0; Chris@4: }