grub2: bring back build of aros-side grub2 tools
[AROS.git] / external / bz2 / spewG.c
blob14a364938d4c40bc7efea1d1d22eea2c3f7f49cb
2 /* spew out a thoroughly gigantic file designed so that bzip2
3 can compress it reasonably rapidly. This is to help test
4 support for large files (> 2GB) in a reasonable amount of time.
5 I suggest you use the undocumented --exponential option to
6 bzip2 when compressing the resulting file; this saves a bit of
7 time. Note: *don't* bother with --exponential when compressing
8 Real Files; it'll just waste a lot of CPU time :-)
9 (but is otherwise harmless).
12 /* ------------------------------------------------------------------
13 This file is part of bzip2/libbzip2, a program and library for
14 lossless, block-sorting data compression.
16 bzip2/libbzip2 version 1.0.6 of 6 September 2010
17 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
19 Please read the WARNING, DISCLAIMER and PATENTS sections in the
20 README file.
22 This program is released under the terms of the license contained
23 in the file LICENSE.
24 ------------------------------------------------------------------ */
27 #define _FILE_OFFSET_BITS 64
29 #include <stdio.h>
30 #include <stdlib.h>
32 /* The number of megabytes of junk to spew out (roughly) */
33 #define MEGABYTES 5000
35 #define N_BUF 1000000
36 char buf[N_BUF];
38 int main ( int argc, char** argv )
40 int ii, kk, p;
41 srandom(1);
42 setbuffer ( stdout, buf, N_BUF );
43 for (kk = 0; kk < MEGABYTES * 515; kk+=3) {
44 p = 25+random()%50;
45 for (ii = 0; ii < p; ii++)
46 printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" );
47 for (ii = 0; ii < p-1; ii++)
48 printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" );
49 for (ii = 0; ii < p+1; ii++)
50 printf ( "ccccccccccccccccccccccccccccccccccccc" );
52 fflush(stdout);
53 return 0;