178556Sobrien 278556Sobrien/* spew out a thoroughly gigantic file designed so that bzip2 378556Sobrien can compress it reasonably rapidly. This is to help test 478556Sobrien support for large files (> 2GB) in a reasonable amount of time. 578556Sobrien I suggest you use the undocumented --exponential option to 678556Sobrien bzip2 when compressing the resulting file; this saves a bit of 778556Sobrien time. Note: *don't* bother with --exponential when compressing 878556Sobrien Real Files; it'll just waste a lot of CPU time :-) 978556Sobrien (but is otherwise harmless). 1078556Sobrien*/ 1178556Sobrien 12167974Sdelphij/* ------------------------------------------------------------------ 13167974Sdelphij This file is part of bzip2/libbzip2, a program and library for 14167974Sdelphij lossless, block-sorting data compression. 15167974Sdelphij 16351007Sdelphij bzip2/libbzip2 version 1.0.8 of 13 July 2019 17351007Sdelphij Copyright (C) 1996-2019 Julian Seward <jseward@acm.org> 18167974Sdelphij 19167974Sdelphij Please read the WARNING, DISCLAIMER and PATENTS sections in the 20167974Sdelphij README file. 21167974Sdelphij 22167974Sdelphij This program is released under the terms of the license contained 23167974Sdelphij in the file LICENSE. 24167974Sdelphij ------------------------------------------------------------------ */ 25167974Sdelphij 26167974Sdelphij 2778556Sobrien#define _FILE_OFFSET_BITS 64 2878556Sobrien 2978556Sobrien#include <stdio.h> 3078556Sobrien#include <stdlib.h> 3178556Sobrien 3278556Sobrien/* The number of megabytes of junk to spew out (roughly) */ 3378556Sobrien#define MEGABYTES 5000 3478556Sobrien 3578556Sobrien#define N_BUF 1000000 3678556Sobrienchar buf[N_BUF]; 3778556Sobrien 3878556Sobrienint main ( int argc, char** argv ) 3978556Sobrien{ 4078556Sobrien int ii, kk, p; 4178556Sobrien srandom(1); 4278556Sobrien setbuffer ( stdout, buf, N_BUF ); 4378556Sobrien for (kk = 0; kk < MEGABYTES * 515; kk+=3) { 4478556Sobrien p = 25+random()%50; 4578556Sobrien for (ii = 0; ii < p; ii++) 4678556Sobrien printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ); 4778556Sobrien for (ii = 0; ii < p-1; ii++) 4878556Sobrien printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" ); 4978556Sobrien for (ii = 0; ii < p+1; ii++) 5078556Sobrien printf ( "ccccccccccccccccccccccccccccccccccccc" ); 5178556Sobrien } 5278556Sobrien fflush(stdout); 5378556Sobrien return 0; 5478556Sobrien} 55