1#![allow(
26 dead_code,
27 non_camel_case_types,
28 non_upper_case_globals,
29 non_snake_case
30)]
31
32use std::os::raw;
33pub type ptrdiff_t = isize;
34pub type size_t = usize;
35pub type nfdchar_t = raw::c_char;
36
37#[repr(C)]
38#[derive(Copy, Clone, Debug)]
39pub struct nfdpathset_t {
40 pub buf: *mut nfdchar_t,
41 pub indices: *mut size_t,
42 pub count: size_t,
43}
44
45impl Default for nfdpathset_t {
46 fn default() -> Self {
47 unsafe { std::mem::zeroed() }
48 }
49}
50
51#[derive(Copy, Clone)]
52#[repr(u32)]
53#[derive(Debug)]
54pub enum nfdresult_t {
55 Error = 0,
56 Okay = 1,
57 Cancel = 2,
58}
59
60extern "C" {
61 pub fn NFD_OpenDialog(
62 filterList: *const nfdchar_t,
63 defaultPath: *const nfdchar_t,
64 outPath: *mut *mut nfdchar_t,
65 ) -> nfdresult_t;
66 pub fn NFD_OpenDialogMultiple(
67 filterList: *const nfdchar_t,
68 defaultPath: *const nfdchar_t,
69 outPaths: *mut nfdpathset_t,
70 ) -> nfdresult_t;
71 pub fn NFD_SaveDialog(
72 filterList: *const nfdchar_t,
73 defaultPath: *const nfdchar_t,
74 outPath: *mut *mut nfdchar_t,
75 ) -> nfdresult_t;
76 pub fn NFD_PickFolder(
77 defaultPath: *const nfdchar_t,
78 outPath: *mut *mut nfdchar_t,
79 ) -> nfdresult_t;
80 pub fn NFD_GetError() -> *const raw::c_char;
81 pub fn NFD_PathSet_GetCount(pathSet: *const nfdpathset_t) -> size_t;
82 pub fn NFD_PathSet_GetPath(pathSet: *const nfdpathset_t, index: size_t) -> *mut nfdchar_t;
83 pub fn NFD_PathSet_Free(pathSet: *mut nfdpathset_t);
84 pub fn NFD_Free(ptr: *mut std::os::raw::c_void);
85}