1*01826a49SYabin Cui /* 2*01826a49SYabin Cui * Copyright (c) Meta Platforms, Inc. and affiliates. 3*01826a49SYabin Cui * All rights reserved. 4*01826a49SYabin Cui * 5*01826a49SYabin Cui * This source code is licensed under both the BSD-style license (found in the 6*01826a49SYabin Cui * LICENSE file in the root directory of this source tree) and the GPLv2 (found 7*01826a49SYabin Cui * in the COPYING file in the root directory of this source tree). 8*01826a49SYabin Cui * You may select, at your option, one of the above-listed licenses. 9*01826a49SYabin Cui */ 10*01826a49SYabin Cui 11*01826a49SYabin Cui /* lorem ipsum generator */ 12*01826a49SYabin Cui 13*01826a49SYabin Cui #include <stddef.h> /* size_t */ 14*01826a49SYabin Cui 15*01826a49SYabin Cui /* 16*01826a49SYabin Cui * LOREM_genBuffer(): 17*01826a49SYabin Cui * Generate @size bytes of compressible data using lorem ipsum generator 18*01826a49SYabin Cui * into provided @buffer. 19*01826a49SYabin Cui */ 20*01826a49SYabin Cui void LOREM_genBuffer(void* buffer, size_t size, unsigned seed); 21*01826a49SYabin Cui 22*01826a49SYabin Cui /* 23*01826a49SYabin Cui * LOREM_genBlock(): 24*01826a49SYabin Cui * Similar to LOREM_genBuffer, with additional controls : 25*01826a49SYabin Cui * - @first : generate the first sentence 26*01826a49SYabin Cui * - @fill : fill the entire @buffer, 27*01826a49SYabin Cui * if ==0: generate one paragraph at most. 28*01826a49SYabin Cui * @return : nb of bytes generated into @buffer. 29*01826a49SYabin Cui */ 30*01826a49SYabin Cui size_t LOREM_genBlock(void* buffer, size_t size, 31*01826a49SYabin Cui unsigned seed, 32*01826a49SYabin Cui int first, int fill); 33