|
|
@ -29,7 +29,8 @@ enum rng_next_flag {
|
|
|
|
RNG_TYQ_UNSIGNED = 1 << 0,
|
|
|
|
RNG_TYQ_UNSIGNED = 1 << 0,
|
|
|
|
|
|
|
|
|
|
|
|
RNG_TYQ_CHAOS = 1 << 1,
|
|
|
|
RNG_TYQ_CHAOS = 1 << 1,
|
|
|
|
}; // 2 bits
|
|
|
|
RNG_TYQ_ARRAY = 1 << 2,
|
|
|
|
|
|
|
|
}; // 3 bits
|
|
|
|
|
|
|
|
|
|
|
|
typedef int rng_bool_t;
|
|
|
|
typedef int rng_bool_t;
|
|
|
|
|
|
|
|
|
|
|
@ -60,9 +61,15 @@ struct rng_next_opt {
|
|
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
enum rng_next_type type : 4;
|
|
|
|
enum rng_next_type type : 4;
|
|
|
|
enum rng_next_flag mod : 2;
|
|
|
|
enum rng_next_flag mod : 3;
|
|
|
|
uint8_t _unused : 2;
|
|
|
|
uint8_t _unused0 : 1;
|
|
|
|
} ty; // 8 bits
|
|
|
|
//first byte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint32_t _padding : 24;
|
|
|
|
|
|
|
|
} ty; // 32 bits :/
|
|
|
|
|
|
|
|
union {
|
|
|
|
|
|
|
|
uint32_t array_size; //TODO: Implement next for arrays
|
|
|
|
|
|
|
|
} ex; // 32 bits. fills hole
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef __typeof( ((struct rng_next_opt*)NULL)->ty ) rng_next_tyq; // Qualified type
|
|
|
|
typedef __typeof( ((struct rng_next_opt*)NULL)->ty ) rng_next_tyq; // Qualified type
|
|
|
@ -74,6 +81,9 @@ typedef struct rng_dyn_ctor* rng_dyn_ctor_ref;
|
|
|
|
// -- // --
|
|
|
|
// -- // --
|
|
|
|
#ifndef _RNGXX_IMPL_ONLY_TYPES
|
|
|
|
#ifndef _RNGXX_IMPL_ONLY_TYPES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_Static_assert(sizeof(rng_next_tyq) == sizeof(uint32_t));
|
|
|
|
|
|
|
|
_Static_assert(sizeof( ((struct rng_next_opt*)NULL)->ex ) == sizeof(uint32_t));
|
|
|
|
|
|
|
|
|
|
|
|
// -- C API functions -- (C++ NO compat)
|
|
|
|
// -- C API functions -- (C++ NO compat)
|
|
|
|
|
|
|
|
|
|
|
|
int rng_raw(rng_t* engine, void* restrict output, struct rng_next_opt opt);
|
|
|
|
int rng_raw(rng_t* engine, void* restrict output, struct rng_next_opt opt);
|
|
|
|