1use crate::MtrNode;
2use libc::{FILE, c_int, c_uint, c_void};
3
4pub const MTR_DEFAULT: c_uint = 0;
6pub const MTR_TERMINAL: c_uint = 1;
8pub const MTR_SOFT: c_uint = 2;
10pub const MTR_FIXED: c_uint = 4;
12pub const MTR_NEWNODE: c_uint = 8;
14
15unsafe extern "C" {
16 pub fn Mtr_AllocNode() -> *mut MtrNode;
17 pub fn Mtr_DeallocNode(node: *mut MtrNode) -> c_void;
18 pub fn Mtr_InitTree() -> *mut MtrNode;
19 pub fn Mtr_FreeTree(node: *mut MtrNode) -> c_void;
20 pub fn Mtr_CopyTree(node: *const MtrNode, expansion: c_int) -> *mut MtrNode;
21 pub fn Mtr_MakeFirstChild(parent: *mut MtrNode, child: *mut MtrNode) -> c_void;
22 pub fn Mtr_MakeLastChild(parent: *mut MtrNode, child: *mut MtrNode) -> c_void;
23 pub fn Mtr_CreateFirstChild(parent: *mut MtrNode) -> *mut MtrNode;
24 pub fn Mtr_CreateLastChild(parent: *mut MtrNode) -> *mut MtrNode;
25 pub fn Mtr_MakeNextSibling(first: *mut MtrNode, second: *mut MtrNode) -> c_void;
26 pub fn Mtr_PrintTree(node: *const MtrNode) -> c_void;
27 pub fn Mtr_InitGroupTree(lower: c_int, size: c_int) -> *mut MtrNode;
28 pub fn Mtr_MakeGroup(
29 root: *mut MtrNode,
30 low: c_uint,
31 high: c_uint,
32 flags: c_uint,
33 ) -> *mut MtrNode;
34 pub fn Mtr_DissolveGroup(group: *mut MtrNode) -> *mut MtrNode;
35 pub fn Mtr_FindGroup(root: *mut MtrNode, low: c_uint, high: c_uint) -> *mut MtrNode;
36 pub fn Mtr_SwapGroups(first: *mut MtrNode, second: *mut MtrNode) -> c_int;
37 pub fn Mtr_ReorderGroups(treenode: *mut MtrNode, permutation: *mut c_int) -> c_void;
38 pub fn Mtr_PrintGroups(root: *const MtrNode, silent: c_int) -> c_void;
39 pub fn Mtr_PrintGroupedOrder(
40 root: *const MtrNode,
41 invperm: *const c_int,
42 fp: *mut FILE,
43 ) -> c_int;
44 pub fn Mtr_ReadGroups(fp: *mut FILE, nleaves: c_int) -> *mut MtrNode;
45}