aviutl2_sys/
module2.rs

1//! スクリプトモジュール ヘッダーファイル for AviUtl ExEdit2
2//! By KENくん
3
4#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
5
6use std::ffi::c_void;
7use std::os::raw::{c_char, c_double, c_int};
8
9/// スクリプトモジュール引数構造体
10#[repr(C)]
11#[derive(Debug, Clone, Copy)]
12pub struct SCRIPT_MODULE_PARAM {
13    /// 引数の数を取得する
14    ///
15    /// # Returns
16    ///
17    /// 引数の数
18    pub get_param_num: unsafe extern "C" fn() -> c_int,
19
20    /// 引数を整数で取得する
21    ///
22    /// # Arguments
23    ///
24    /// * `index` - 引数の位置(0〜)
25    ///
26    /// # Returns
27    ///
28    /// 引数の値 (取得出来ない場合は0)
29    pub get_param_int: unsafe extern "C" fn(index: c_int) -> c_int,
30
31    /// 引数を浮動小数点で取得する
32    ///
33    /// # Arguments
34    ///
35    /// * `index` - 引数の位置(0〜)
36    ///
37    /// # Returns
38    ///
39    /// 引数の値 (取得出来ない場合は0)
40    pub get_param_double: unsafe extern "C" fn(index: c_int) -> c_double,
41
42    /// 引数を文字列(UTF-8)で取得する
43    ///
44    /// # Arguments
45    ///
46    /// * `index` - 引数の位置(0〜)
47    ///
48    /// # Returns
49    ///
50    /// 引数の値 (取得出来ない場合はnullptr)
51    pub get_param_string: unsafe extern "C" fn(index: c_int) -> *const c_char,
52
53    /// 引数をデータのポインタで取得する
54    ///
55    /// # Arguments
56    ///
57    /// * `index` - 引数の位置(0〜)
58    ///
59    /// # Returns
60    ///
61    /// 引数の値 (取得出来ない場合はnullptr)
62    pub get_param_data: unsafe extern "C" fn(index: c_int) -> *mut c_void,
63
64    /// 引数の連想配列要素を整数で取得する
65    ///
66    /// # Arguments
67    ///
68    /// * `index` - 引数の位置(0〜)
69    /// * `key` - キー名(UTF-8)
70    ///
71    /// # Returns
72    ///
73    /// 引数の値 (取得出来ない場合は0)
74    pub get_param_table_int: unsafe extern "C" fn(index: c_int, key: *const c_char) -> c_int,
75
76    /// 引数の連想配列要素を浮動小数点で取得する
77    ///
78    /// # Arguments
79    ///
80    /// * `index` - 引数の位置(0〜)
81    /// * `key` - キー名(UTF-8)
82    ///
83    /// # Returns
84    ///
85    /// 引数の値 (取得出来ない場合は0)
86    pub get_param_table_double: unsafe extern "C" fn(index: c_int, key: *const c_char) -> c_double,
87
88    /// 引数の連想配列要素を文字列(UTF-8)で取得する
89    ///
90    /// # Arguments
91    ///
92    /// * `index` - 引数の位置(0〜)
93    /// * `key` - キー名(UTF-8)
94    ///
95    /// # Returns
96    ///
97    /// 引数の値 (取得出来ない場合はnullptr)
98    pub get_param_table_string:
99        unsafe extern "C" fn(index: c_int, key: *const c_char) -> *const c_char,
100
101    /// 引数の配列要素の数を取得する
102    ///
103    /// # Arguments
104    ///
105    /// * `index` - 引数の位置(0〜)
106    ///
107    /// # Returns
108    ///
109    /// 配列要素の数
110    pub get_param_array_num: unsafe extern "C" fn(index: c_int) -> c_int,
111
112    /// 引数の配列要素を整数で取得する
113    ///
114    /// # Arguments
115    ///
116    /// * `index` - 引数の位置(0〜)
117    /// * `key` - 配列のインデックス(0〜)
118    ///
119    /// # Returns
120    ///
121    /// 引数の値 (取得出来ない場合は0)
122    pub get_param_array_int: unsafe extern "C" fn(index: c_int, key: c_int) -> c_int,
123
124    /// 引数の配列要素を浮動小数点で取得する
125    ///
126    /// # Arguments
127    ///
128    /// * `index` - 引数の位置(0〜)
129    /// * `key` - 配列のインデックス(0〜)
130    ///
131    /// # Returns
132    ///
133    /// 引数の値 (取得出来ない場合は0)
134    pub get_param_array_double: unsafe extern "C" fn(index: c_int, key: c_int) -> c_double,
135
136    /// 引数の配列要素を文字列(UTF-8)で取得する
137    ///
138    /// # Arguments
139    ///
140    /// * `index` - 引数の位置(0〜)
141    /// * `key` - 配列のインデックス(0〜)
142    ///
143    /// # Returns
144    ///
145    /// 引数の値 (取得出来ない場合はnullptr)
146    pub get_param_array_string: unsafe extern "C" fn(index: c_int, key: c_int) -> *const c_char,
147
148    /// 整数の戻り値を追加する
149    ///
150    /// # Arguments
151    ///
152    /// * `value` - 戻り値
153    pub push_result_int: unsafe extern "C" fn(value: c_int),
154
155    /// 浮動小数点の戻り値を追加する
156    ///
157    /// # Arguments
158    ///
159    /// * `value` - 戻り値
160    pub push_result_double: unsafe extern "C" fn(value: c_double),
161
162    /// 文字列(UTF-8)の戻り値を追加する
163    ///
164    /// # Arguments
165    ///
166    /// * `value` - 戻り値
167    pub push_result_string: unsafe extern "C" fn(value: *const c_char),
168
169    /// データのポインタの戻り値を追加する
170    ///
171    /// # Arguments
172    ///
173    /// * `value` - 戻り値
174    pub push_result_data: unsafe extern "C" fn(value: *const c_void),
175
176    /// 整数連想配列の戻り値を追加する
177    ///
178    /// # Arguments
179    ///
180    /// * `key` - キー名(UTF-8)の配列
181    /// * `value` - 戻り値の配列
182    /// * `num` - 配列の要素数
183    pub push_result_table_int:
184        unsafe extern "C" fn(key: *const *const c_char, value: *const c_int, num: c_int),
185
186    /// 浮動小数点連想配列の戻り値を追加する
187    ///
188    /// # Arguments
189    ///
190    /// * `key` - キー名(UTF-8)の配列
191    /// * `value` - 戻り値の配列
192    /// * `num` - 配列の要素数
193    pub push_result_table_double:
194        unsafe extern "C" fn(key: *const *const c_char, value: *const c_double, num: c_int),
195
196    /// 文字列(UTF-8)連想配列の戻り値を追加する
197    ///
198    /// # Arguments
199    ///
200    /// * `key` - キー名(UTF-8)の配列
201    /// * `value` - 戻り値の配列
202    /// * `num` - 配列の要素数
203    pub push_result_table_string:
204        unsafe extern "C" fn(key: *const *const c_char, value: *const *const c_char, num: c_int),
205
206    /// 整数配列の戻り値を追加する
207    ///
208    /// # Arguments
209    ///
210    /// * `value` - 戻り値の配列
211    /// * `num` - 配列の要素数
212    pub push_result_array_int: unsafe extern "C" fn(value: *const c_int, num: c_int),
213
214    /// 浮動小数点配列の戻り値を追加する
215    ///
216    /// # Arguments
217    ///
218    /// * `value` - 戻り値の配列
219    /// * `num` - 配列の要素数
220    pub push_result_array_double: unsafe extern "C" fn(value: *const c_double, num: c_int),
221
222    /// 文字列(UTF-8)配列の戻り値を追加する
223    ///
224    /// # Arguments
225    ///
226    /// * `value` - 戻り値の配列
227    /// * `num` - 配列の要素数
228    pub push_result_array_string: unsafe extern "C" fn(value: *const *const c_char, num: c_int),
229
230    /// エラーメッセージを設定する
231    /// 呼び出された関数をエラー終了する場合に設定します
232    ///
233    /// # Arguments
234    ///
235    /// * `message` - エラーメッセージ(UTF-8)
236    pub set_error: unsafe extern "C" fn(message: *const c_char),
237
238    /// 引数をブール値で取得する
239    ///
240    /// # Arguments
241    ///
242    /// * `index` - 引数の位置(0〜)
243    ///
244    /// # Returns
245    ///
246    /// 引数の値 (取得出来ない場合はfalse)
247    pub get_param_boolean: unsafe extern "C" fn(index: c_int) -> bool,
248
249    /// ブール値の戻り値を追加する
250    ///
251    /// # Arguments
252    ///
253    /// * `value` - 戻り値
254    pub push_result_boolean: unsafe extern "C" fn(value: bool),
255}
256
257/// スクリプトモジュール関数定義構造体
258#[repr(C)]
259#[derive(Debug, Clone, Copy)]
260pub struct SCRIPT_MODULE_FUNCTION {
261    /// 関数名
262    pub name: *const u16,
263    /// 関数へのポインタ
264    pub func: unsafe extern "C" fn(smp: *mut SCRIPT_MODULE_PARAM),
265}
266
267/// スクリプトモジュール構造体
268#[repr(C)]
269#[derive(Debug, Clone, Copy)]
270pub struct SCRIPT_MODULE_TABLE {
271    /// スクリプトモジュールの情報
272    pub information: *const u16,
273    /// 登録する関数の一覧 (SCRIPT_MODULE_FUNCTIONを列挙して関数名がnullの要素で終端したリストへのポインタ)
274    pub functions: *const SCRIPT_MODULE_FUNCTION,
275}