Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
38
thirdparty/portable-snippets/random/random.h
vendored
Normal file
38
thirdparty/portable-snippets/random/random.h
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#if !defined(PSNIP_RANDOM__H)
|
||||
#define PSNIP_RANDOM__H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(psnip_uint8_t)
|
||||
# include "../exact-int/exact-int.h"
|
||||
#endif
|
||||
|
||||
#if defined(HEDLEY_ARRAY_PARAM)
|
||||
# define PSNIP_RANDOM_ARRAY_PARAM(expr) HEDLEY_ARRAY_PARAM(expr)
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) && !defined(__PGI)
|
||||
# define PSNIP_RANDOM_ARRAY_PARAM(expr) (expr)
|
||||
#else
|
||||
# define PSNIP_RANDOM_ARRAY_PARAM(expr)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum PSnipRandomSource {
|
||||
PSNIP_RANDOM_SOURCE_SECURE,
|
||||
PSNIP_RANDOM_SOURCE_REPRODUCIBLE,
|
||||
PSNIP_RANDOM_SOURCE_FAST,
|
||||
};
|
||||
|
||||
int psnip_random_bytes (enum PSnipRandomSource source,
|
||||
size_t length,
|
||||
psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]);
|
||||
psnip_uint32_t psnip_random_get_seed (void);
|
||||
void psnip_random_set_seed (psnip_uint32_t seed);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(PSNIP_RANDOM__H) */
|
||||
Loading…
Add table
Add a link
Reference in a new issue