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
use libc::c_void;
use std::mem;

use channel::*;
use die::*;
use heat_sink::*;
use layer::*;
use types::*;

#[derive(Clone, Copy)]
#[repr(C)]
pub struct StackElement_p(*mut c_void);

impl StackElement_p {
    #[inline]
    pub unsafe fn Layer(&self) -> *mut Layer_t {
        mem::transmute(self.0)
    }

    #[inline]
    pub unsafe fn Die(&self) -> *mut Die_t {
        mem::transmute(self.0)
    }

    #[inline]
    pub unsafe fn Channel(&self) -> *mut Channel_t {
        mem::transmute(self.0)
    }

    #[inline]
    pub unsafe fn HeatSink(&self) -> *mut HeatSink_t {
        mem::transmute(self.0)
    }
}

#[derive(Clone, Copy)]
#[repr(C)]
pub struct StackElement_t {
    pub Id: String_t,
    pub Type: StackElementType_t,
    pub Pointer: StackElement_p,
    pub NLayers: CellIndex_t,
    pub Offset: CellIndex_t,
}