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