• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2     datagen.h - compressible data generator header
3     Copyright (C) Yann Collet 2012-2024
4 
5     GPL v2 License
6 
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11 
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16 
17     You should have received a copy of the GNU General Public License along
18     with this program; if not, write to the Free Software Foundation, Inc.,
19     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 
21     You can contact the author at :
22    - LZ4 source repository : https://github.com/lz4/lz4
23    - Public forum : https://groups.google.com/forum/#!forum/lz4c
24 */
25 
26 
27 #include <stddef.h>   /* size_t */
28 
29 /* RDG_genOut():
30  * Generate @size bytes of compressible data into stdout.
31  * Compressibility can be controlled using @matchProba.
32  * @LitProba is optional, and affect variability of bytes. If @litProba==0.0, default value is used.
33  * Generated data can be influenced using @seed.
34  * If @matchProba, @litProba and @seed are equal, the function always generates the same content.
35  */
36 void RDG_genOut(unsigned long long size, double matchProba, double litProba, unsigned seed);
37 
38 /*
39  * RDG_genBuffer():
40  * Same as RDG_genOut, but generates data into provided @buffer
41  */
42 void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba, unsigned seed);
43