annotate src/bzip2-1.0.6/spewG.c @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents 8a15ff55d9af
children
rev   line source
cannam@89 1
cannam@89 2 /* spew out a thoroughly gigantic file designed so that bzip2
cannam@89 3 can compress it reasonably rapidly. This is to help test
cannam@89 4 support for large files (> 2GB) in a reasonable amount of time.
cannam@89 5 I suggest you use the undocumented --exponential option to
cannam@89 6 bzip2 when compressing the resulting file; this saves a bit of
cannam@89 7 time. Note: *don't* bother with --exponential when compressing
cannam@89 8 Real Files; it'll just waste a lot of CPU time :-)
cannam@89 9 (but is otherwise harmless).
cannam@89 10 */
cannam@89 11
cannam@89 12 /* ------------------------------------------------------------------
cannam@89 13 This file is part of bzip2/libbzip2, a program and library for
cannam@89 14 lossless, block-sorting data compression.
cannam@89 15
cannam@89 16 bzip2/libbzip2 version 1.0.6 of 6 September 2010
cannam@89 17 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
cannam@89 18
cannam@89 19 Please read the WARNING, DISCLAIMER and PATENTS sections in the
cannam@89 20 README file.
cannam@89 21
cannam@89 22 This program is released under the terms of the license contained
cannam@89 23 in the file LICENSE.
cannam@89 24 ------------------------------------------------------------------ */
cannam@89 25
cannam@89 26
cannam@89 27 #define _FILE_OFFSET_BITS 64
cannam@89 28
cannam@89 29 #include <stdio.h>
cannam@89 30 #include <stdlib.h>
cannam@89 31
cannam@89 32 /* The number of megabytes of junk to spew out (roughly) */
cannam@89 33 #define MEGABYTES 5000
cannam@89 34
cannam@89 35 #define N_BUF 1000000
cannam@89 36 char buf[N_BUF];
cannam@89 37
cannam@89 38 int main ( int argc, char** argv )
cannam@89 39 {
cannam@89 40 int ii, kk, p;
cannam@89 41 srandom(1);
cannam@89 42 setbuffer ( stdout, buf, N_BUF );
cannam@89 43 for (kk = 0; kk < MEGABYTES * 515; kk+=3) {
cannam@89 44 p = 25+random()%50;
cannam@89 45 for (ii = 0; ii < p; ii++)
cannam@89 46 printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" );
cannam@89 47 for (ii = 0; ii < p-1; ii++)
cannam@89 48 printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" );
cannam@89 49 for (ii = 0; ii < p+1; ii++)
cannam@89 50 printf ( "ccccccccccccccccccccccccccccccccccccc" );
cannam@89 51 }
cannam@89 52 fflush(stdout);
cannam@89 53 return 0;
cannam@89 54 }