#if !defined(MR4TH_PRNG_DECLARATIONS)
#define MR4TH_PRNG_DECLARATIONS 1

////////////////////////////////
// PRNG Types

#include "pcg/pcg_basic.h"

typedef struct PRNG{
  pcg32_random_t gen[2];
} PRNG;

typedef struct PRNG_Seed{
  union{
    U8 v[32];
    U64 u64[4];
  };
} PRNG_Seed;

////////////////////////////////
// PRNG Functions

MR4TH_SYMBOL PRNG prng_from_seed(PRNG_Seed *seed);
MR4TH_SYMBOL U32  prng_u32(PRNG *prng);
MR4TH_SYMBOL U64  prng_u64(PRNG *prng);
MR4TH_SYMBOL U32  prng_u32_bounded(PRNG *prng, U32 bound);

MR4TH_SYMBOL F32  prng_f32_unit(PRNG *prng);
MR4TH_SYMBOL F32  prng_f32_biunit(PRNG *prng);
MR4TH_SYMBOL F32  prng_f32_range(PRNG *prng, F32 min, F32 max);

MR4TH_SYMBOL B32  prng_b32_pcoin(PRNG *prng, F32 p);


#endif /* MR4TH_PRNG_DECLARATIONS */
