OpENer - Open Source EtherNet/IP(TM) I/O Target Stack
2.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
random.c
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright (c) 2017, Rockwell Automation, Inc.
3
* All rights reserved.
4
*
5
******************************************************************************/
6
7
#include "
random.h
"
8
9
#include <stdlib.h>
10
11
Random
*
RandomNew
(
SetSeed
set_seed,
12
GetNextUInt32
get_next_uint32) {
13
Random
*random = malloc(
sizeof
(
Random
) );
14
*random =
15
(
Random
) { .
set_seed
= set_seed, .get_next_uint32 = get_next_uint32 };
16
return
random;
17
}
18
19
void
RandomDelete
(
Random
**random) {
20
free(*random);
21
*random = NULL;
22
}
Random
Definition:
random.h:15
Random::set_seed
SetSeed set_seed
Definition:
random.h:17
GetNextUInt32
uint32_t(* GetNextUInt32)(void)
Definition:
random.h:13
RandomNew
Random * RandomNew(SetSeed set_seed, GetNextUInt32 get_next_uint32)
Definition:
random.c:11
RandomDelete
void RandomDelete(Random **random)
Definition:
random.c:19
random.h
SetSeed
void(* SetSeed)(uint32_t seed)
Definition:
random.h:12
src
utils
random.c
Generated on Fri May 15 2020 21:07:15 for OpENer - Open Source EtherNet/IP(TM) I/O Target Stack by
1.8.6