clap_sys/ext/draft/
resource_directory.rs

1use crate::{cstr, host::*, plugin::*};
2
3use std::ffi::{c_char, CStr};
4
5pub const CLAP_EXT_RESOURCE_DIRECTORY: &CStr = cstr!("clap.resource-directory/1");
6
7#[repr(C)]
8#[derive(Debug, Copy, Clone)]
9pub struct clap_plugin_resource_directory {
10    pub set_directory: Option<
11        unsafe extern "C" fn(plugin: *const clap_plugin, path: *const c_char, is_shared: bool),
12    >,
13    pub collect: Option<unsafe extern "C" fn(plugin: *const clap_plugin, all: bool)>,
14    pub get_files_count: Option<unsafe extern "C" fn(plugin: *const clap_plugin) -> u32>,
15    pub get_file_path: Option<
16        unsafe extern "C" fn(
17            plugin: *const clap_plugin,
18            index: u32,
19            path: *mut c_char,
20            path_size: u32,
21        ) -> i32,
22    >,
23}
24
25#[repr(C)]
26#[derive(Debug, Copy, Clone)]
27pub struct clap_host_resource_directory {
28    pub request_directory:
29        Option<unsafe extern "C" fn(host: *const clap_host, is_shared: bool) -> bool>,
30    pub release_directory: Option<unsafe extern "C" fn(host: *const clap_host, is_shared: bool)>,
31}