lorem.h 1.0 KB

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