1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#[derive(Debug)]
#[repr(C)]
pub struct Node {
pub next_count: u32,
next_size: u32,
pub(crate) next: *mut u32,
pub prev_count: u32,
prev_size: u32,
pub(crate) prev: *mut u32,
}
#[repr(C)]
pub struct IndexList {
pub(crate) index: u32,
next: *mut IndexList,
}
#[derive(Debug)]
#[repr(C)]
pub struct Net {
pub transition_count: u32,
transitions_size: u32,
pub(crate) transitions: *mut Node,
pub(crate) reusable_transitions: *mut IndexList,
pub place_count: u32,
places_size: u32,
pub(crate) places: *mut Node,
pub(crate) initial_token_counts: *mut u32,
pub(crate) reusable_places: *mut IndexList,
dirt: *mut IndexList,
reverse_dirt: *mut IndexList,
}
#[repr(C)]
struct FireChanges {
count: u32,
added_count: u32,
removed_count: u32,
active: *mut IndexList,
added: *mut IndexList,
removed: *mut IndexList,
}
#[repr(C)]
pub struct State {
places_size: u32,
pub(crate) token_counts: *mut u32,
transitions_size: u32,
pub(crate) call_counts: *mut u32,
fire: FireChanges,
unfire: FireChanges,
}