xref: /aosp_15_r20/external/lz4/programs/lorem.h (revision 27162e4e17433d5aa7cb38e7b6a433a09405fc7f)
1 /*
2     lorem.h - lorem ipsum generator
3     Copyright (C) Yann Collet 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 /*
30  * LOREM_genBuffer():
31  * Generate @size bytes of compressible data using lorem ipsum generator
32  * into provided @buffer.
33  */
34 void LOREM_genBuffer(void* buffer, size_t size, unsigned seed);
35 
36 /*
37  * LOREM_genBlock():
38  * Similar to LOREM_genBuffer, with additional controls :
39  * - @first : generate the first sentence
40  * - @fill : fill the entire @buffer,
41  *           if ==0: generate one paragraph at most.
42  * @return : nb of bytes generated into @buffer.
43  */
44 size_t LOREM_genBlock(void* buffer, size_t size,
45                       unsigned seed,
46                       int first, int fill);
47