random.h 774 B

1234567891011121314151617181920212223242526
  1. /*******************************************************************************
  2. * Copyright (c) 2017, Rockwell Automation, Inc.
  3. * All rights reserved.
  4. *
  5. ******************************************************************************/
  6. #ifndef OPENER_RANDOM_H_
  7. #define OPENER_RANDOM_H_
  8. #include <stdint.h>
  9. typedef void (*SetSeed)(uint32_t seed);
  10. typedef uint32_t (*GetNextUInt32)(void);
  11. typedef struct {
  12. uint32_t current_seed_value; /**< Holds the current seed/random value */
  13. SetSeed set_seed; /**< Function pointer to SetSeed function */
  14. GetNextUInt32 get_next_uint32; /**< Function pointer to GetNextUInt32 function */
  15. } Random;
  16. Random *RandomNew(SetSeed,
  17. GetNextUInt32);
  18. void RandomDelete(Random **random);
  19. #endif /* OPENER_RANDOM_H_ */