1#![allow(non_snake_case, non_camel_case_types)]
4
5pub const CHM_UNCOMPRESSED: u32 = 0;
6pub const CHM_COMPRESSED: u32 = 1;
7pub const CHM_MAX_PATHLEN: u32 = 512;
8pub const CHM_PARAM_MAX_BLOCKS_CACHED: u32 = 0;
9pub const CHM_RESOLVE_SUCCESS: u32 = 0;
10pub const CHM_RESOLVE_FAILURE: u32 = 1;
11pub const CHM_ENUMERATE_NORMAL: u32 = 1;
12pub const CHM_ENUMERATE_META: u32 = 2;
13pub const CHM_ENUMERATE_SPECIAL: u32 = 4;
14pub const CHM_ENUMERATE_FILES: u32 = 8;
15pub const CHM_ENUMERATE_DIRS: u32 = 16;
16pub const CHM_ENUMERATE_ALL: u32 = 31;
17pub const CHM_ENUMERATOR_FAILURE: u32 = 0;
18pub const CHM_ENUMERATOR_CONTINUE: u32 = 1;
19pub const CHM_ENUMERATOR_SUCCESS: u32 = 2;
20pub type LONGUINT64 = ::std::os::raw::c_ulonglong;
21pub type LONGINT64 = ::std::os::raw::c_longlong;
22#[repr(C)]
23#[derive(Debug, Copy, Clone)]
24pub struct chmFile {
25 _unused: [u8; 0],
26}
27#[repr(C)]
28#[derive(Copy, Clone)]
29pub struct chmUnitInfo {
30 pub start: LONGUINT64,
31 pub length: LONGUINT64,
32 pub space: ::std::os::raw::c_int,
33 pub flags: ::std::os::raw::c_int,
34 pub path: [::std::os::raw::c_char; 513usize],
35}
36#[test]
37fn bindgen_test_layout_chmUnitInfo() {
38 assert_eq!(
39 ::std::mem::size_of::<chmUnitInfo>(),
40 544usize,
41 concat!("Size of: ", stringify!(chmUnitInfo))
42 );
43 assert_eq!(
44 ::std::mem::align_of::<chmUnitInfo>(),
45 8usize,
46 concat!("Alignment of ", stringify!(chmUnitInfo))
47 );
48 assert_eq!(
49 unsafe {
50 &(*(::std::ptr::null::<chmUnitInfo>())).start as *const _ as usize
51 },
52 0usize,
53 concat!(
54 "Offset of field: ",
55 stringify!(chmUnitInfo),
56 "::",
57 stringify!(start)
58 )
59 );
60 assert_eq!(
61 unsafe {
62 &(*(::std::ptr::null::<chmUnitInfo>())).length as *const _ as usize
63 },
64 8usize,
65 concat!(
66 "Offset of field: ",
67 stringify!(chmUnitInfo),
68 "::",
69 stringify!(length)
70 )
71 );
72 assert_eq!(
73 unsafe {
74 &(*(::std::ptr::null::<chmUnitInfo>())).space as *const _ as usize
75 },
76 16usize,
77 concat!(
78 "Offset of field: ",
79 stringify!(chmUnitInfo),
80 "::",
81 stringify!(space)
82 )
83 );
84 assert_eq!(
85 unsafe {
86 &(*(::std::ptr::null::<chmUnitInfo>())).flags as *const _ as usize
87 },
88 20usize,
89 concat!(
90 "Offset of field: ",
91 stringify!(chmUnitInfo),
92 "::",
93 stringify!(flags)
94 )
95 );
96 assert_eq!(
97 unsafe {
98 &(*(::std::ptr::null::<chmUnitInfo>())).path as *const _ as usize
99 },
100 24usize,
101 concat!(
102 "Offset of field: ",
103 stringify!(chmUnitInfo),
104 "::",
105 stringify!(path)
106 )
107 );
108}
109extern "C" {
110 pub fn chm_open(filename: *const ::std::os::raw::c_char) -> *mut chmFile;
111}
112extern "C" {
113 pub fn chm_close(h: *mut chmFile);
114}
115extern "C" {
116 pub fn chm_set_param(
117 h: *mut chmFile,
118 paramType: ::std::os::raw::c_int,
119 paramVal: ::std::os::raw::c_int,
120 );
121}
122extern "C" {
123 pub fn chm_resolve_object(
124 h: *mut chmFile,
125 objPath: *const ::std::os::raw::c_char,
126 ui: *mut chmUnitInfo,
127 ) -> ::std::os::raw::c_int;
128}
129extern "C" {
130 pub fn chm_retrieve_object(
131 h: *mut chmFile,
132 ui: *mut chmUnitInfo,
133 buf: *mut ::std::os::raw::c_uchar,
134 addr: LONGUINT64,
135 len: LONGINT64,
136 ) -> LONGINT64;
137}
138pub type CHM_ENUMERATOR = ::std::option::Option<
139 unsafe extern "C" fn(
140 h: *mut chmFile,
141 ui: *mut chmUnitInfo,
142 context: *mut ::std::os::raw::c_void,
143 ) -> ::std::os::raw::c_int,
144>;
145extern "C" {
146 pub fn chm_enumerate(
147 h: *mut chmFile,
148 what: ::std::os::raw::c_int,
149 e: CHM_ENUMERATOR,
150 context: *mut ::std::os::raw::c_void,
151 ) -> ::std::os::raw::c_int;
152}
153extern "C" {
154 pub fn chm_enumerate_dir(
155 h: *mut chmFile,
156 prefix: *const ::std::os::raw::c_char,
157 what: ::std::os::raw::c_int,
158 e: CHM_ENUMERATOR,
159 context: *mut ::std::os::raw::c_void,
160 ) -> ::std::os::raw::c_int;
161}