1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use ctypes
::{c_int, c_void}
;
7 use shared
::basetsd
::INT_PTR
;
8 use shared
::minwindef
::{BOOL, DWORD, LPARAM, UINT}
;
9 use um
::winnt
::{HANDLE, HRESULT, LPCWSTR, LPWSTR, PVOID, ULONGLONG}
;
10 pub const DA_LAST
: c_int
= 0x7FFFFFFF;
11 pub const DA_ERR
: c_int
= -1;
12 FN
!{stdcall
PFNDAENUMCALLBACK(
16 FN
!{stdcall
PFNDAENUMCALLBACKCONST(
20 FN
!{stdcall
PFNDACOMPARE(
25 FN
!{stdcall
PFNDACOMPARECONST(
31 pub type HDSA
= *mut DSA
;
40 pub fn DSA_DestroyCallback(
42 pfnCB
: PFNDAENUMCALLBACK
,
45 pub fn DSA_DeleteItem(
49 pub fn DSA_DeleteAllItems(
52 pub fn DSA_EnumCallback(
54 pfnCB
: PFNDAENUMCALLBACK
,
57 pub fn DSA_InsertItem(
62 pub fn DSA_GetItemPtr(
78 pub unsafe fn DSA_GetItemCount(hdsa
: HDSA
) -> c_int
{
82 pub unsafe fn DSA_AppendItem(hdsa
: HDSA
, pitem
: *const c_void
) -> c_int
{
83 DSA_InsertItem(hdsa
, DA_LAST
, pitem
)
94 pfnCompare
: PFNDACOMPARE
,
98 pub const DSA_APPEND
: c_int
= DA_LAST
;
99 pub const DSA_ERR
: c_int
= DA_ERR
;
100 pub type PFNDSAENUMCALLBACK
= PFNDAENUMCALLBACK
;
101 pub type PFNDSAENUMCALLBACKCONST
= PFNDAENUMCALLBACKCONST
;
102 pub type PFNDSACOMPARE
= PFNDACOMPARE
;
103 pub type PFNDSACOMPARECONST
= PFNDACOMPARECONST
;
105 pub type HDPA
= *mut DPA
;
121 pub fn DPA_DestroyCallback(
123 pfnCB
: PFNDAENUMCALLBACK
,
126 pub fn DPA_DeletePtr(
130 pub fn DPA_DeleteAllPtrs(
133 pub fn DPA_EnumCallback(
135 pfnCB
: PFNDAENUMCALLBACK
,
142 pub fn DPA_InsertPtr(
156 pub fn DPA_GetPtrIndex(
162 pub unsafe fn DPA_GetPtrCount(hdpa
: HDPA
) -> c_int
{
163 *(hdpa
as *mut c_int
)
166 pub unsafe fn DPA_SetPtrCount(hdpa
: HDPA
, cItems
: c_int
) {
167 *(hdpa
as *mut c_int
) = cItems
;
170 pub unsafe fn DPA_FastDeleteLastPtr(hdpa
: HDPA
) -> c_int
{
171 *(hdpa
as *mut c_int
) -= 1;
172 *(hdpa
as *mut c_int
)
175 pub unsafe fn DPA_AppendPtr(hdpa
: HDPA
, pitem
: *mut c_void
) -> c_int
{
176 DPA_InsertPtr(hdpa
, DA_LAST
, pitem
)
184 pfnCompare
: PFNDACOMPARE
,
188 STRUCT
!{struct DPASTREAMINFO
{
193 FN
!{stdcall
PFNDPASTREAM(
194 pinfo
: *mut DPASTREAMINFO
,
195 pstream
: *mut IStream
,
196 pvInstData
: *mut c_void
,
199 pub fn DPA_LoadStream(
202 pstream
: *mut IStream
,
203 pvInstData
: *mut c_void
,
205 pub fn DPA_SaveStream(
208 pstream
: *mut IStream
,
209 pvInstData
: *mut c_void
,
212 pub const DPAM_SORTED
: DWORD
= 0x00000001;
213 pub const DPAM_NORMAL
: DWORD
= 0x00000002;
214 pub const DPAM_UNION
: DWORD
= 0x00000004;
215 pub const DPAM_INTERSECT
: DWORD
= 0x00000008;
216 FN
!{stdcall
PFNDPAMERGE(
222 FN
!{stdcall
PFNDPAMERGECONST(
224 pvDest
: *const c_void
,
225 pvSrc
: *const c_void
,
228 pub const DPAMM_MERGE
: UINT
= 1;
229 pub const DPAMM_DELETE
: UINT
= 2;
230 pub const DPAMM_INSERT
: UINT
= 3;
236 pfnCompare
: PFNDACOMPARE
,
237 pfnMerge
: PFNDPAMERGE
,
241 pub const DPAS_SORTED
: UINT
= 0x0001;
242 pub const DPAS_INSERTBEFORE
: UINT
= 0x0002;
243 pub const DPAS_INSERTAFTER
: UINT
= 0x0004;
249 pfnCompare
: PFNDACOMPARE
,
255 pub unsafe fn DPA_SortedInsertPtr(
259 pfnCompare
: PFNDACOMPARE
,
267 hdpa
, pFind
, iStart
, pfnCompare
, lParam
, DPAS_SORTED
| options
,
272 pub const DPA_APPEND
: c_int
= DA_LAST
;
273 pub const DPA_ERR
: c_int
= DA_ERR
;
274 pub type PFNDPAENUMCALLBACK
= PFNDAENUMCALLBACK
;
275 pub type PFNDPAENUMCALLBACKCONST
= PFNDAENUMCALLBACKCONST
;
276 pub type PFNDPACOMPARE
= PFNDACOMPARE
;
277 pub type PFNDPACOMPARECONST
= PFNDACOMPARECONST
;