asimov_sys/
bindgen.rs

1/* automatically generated by rust-bindgen 0.70.1 */
2
3#[doc = " A handle encapsulating SDK state."]
4pub type AsiInstance = u64;
5#[doc = " An SDK version number as a packed integer."]
6pub type AsiVersion = u64;
7#[repr(i32)]
8#[doc = " The set of possible flow execution states."]
9#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive, ToPrimitive)]
10pub enum AsiFlowExecutionState {
11    ASI_FLOW_EXECUTION_STATE_UNKNOWN = 0,
12    ASI_FLOW_EXECUTION_STATE_STARTED = 1,
13    ASI_FLOW_EXECUTION_STATE_COMPLETED = 2,
14    ASI_FLOW_EXECUTION_STATE_FAILED = 3,
15}
16#[repr(i32)]
17#[doc = " The set of possible port directions."]
18#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive, ToPrimitive)]
19pub enum AsiPortDirection {
20    ASI_PORT_DIRECTION_INPUT = 1,
21    ASI_PORT_DIRECTION_OUTPUT = 2,
22}
23#[repr(i32)]
24#[doc = " The set of possible port states."]
25#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive, ToPrimitive)]
26pub enum AsiPortState {
27    ASI_PORT_STATE_OPEN = 1,
28    ASI_PORT_STATE_CONNECTED = 2,
29    ASI_PORT_STATE_CLOSED = 3,
30}
31#[repr(i32)]
32#[doc = " Result codes returned by SDK functions."]
33#[must_use]
34#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive, ToPrimitive)]
35pub enum AsiResult {
36    ASI_SUCCESS = 0,
37    ASI_TIMEOUT_EXPIRED = 1,
38    ASI_ERROR_NOT_IMPLEMENTED = -1,
39    ASI_ERROR_PRECONDITION_VIOLATED = -2,
40    ASI_ERROR_HOST_MEMORY_EXHAUSTED = -3,
41    ASI_ERROR_DEVICE_MEMORY_EXHAUSTED = -4,
42    ASI_ERROR_SIZE_INSUFFICIENT = -5,
43}
44#[repr(i32)]
45#[doc = " The set of possible SDK structure types."]
46#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, FromPrimitive, ToPrimitive)]
47pub enum AsiStructureType {
48    ASI_TYPE_UNKNOWN = 0,
49}
50#[doc = " The common header for all SDK structures."]
51#[repr(C)]
52#[derive(Debug, Copy, Clone)]
53pub struct AsiStructureHeader {
54    pub type_: AsiStructureType,
55    pub next: *mut AsiStructureHeader,
56}
57impl Default for AsiStructureHeader {
58    fn default() -> Self {
59        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
60        unsafe {
61            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
62            s.assume_init()
63        }
64    }
65}
66#[doc = " A block definition."]
67#[repr(C)]
68#[derive(Debug, Copy, Clone)]
69pub struct AsiBlockDefinition {
70    pub header: AsiStructureHeader,
71    pub name: [::core::ffi::c_char; 64usize],
72    pub input_port_count: u32,
73    pub output_port_count: u32,
74    pub parameter_count: u32,
75}
76impl Default for AsiBlockDefinition {
77    fn default() -> Self {
78        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
79        unsafe {
80            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
81            s.assume_init()
82        }
83    }
84}
85#[repr(C)]
86#[derive(Debug, Copy, Clone)]
87pub struct AsiBlockExecuteInfo {
88    pub header: AsiStructureHeader,
89    pub name: [::core::ffi::c_char; 64usize],
90    pub params: [::core::ffi::c_char; 2048usize],
91}
92impl Default for AsiBlockExecuteInfo {
93    fn default() -> Self {
94        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
95        unsafe {
96            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
97            s.assume_init()
98        }
99    }
100}
101#[doc = " A block execution."]
102#[repr(C)]
103#[derive(Debug, Copy, Clone)]
104pub struct AsiBlockExecution {
105    pub header: AsiStructureHeader,
106    pub timestamp: u64,
107    pub pid: u64,
108    pub state: AsiFlowExecutionState,
109    pub name: [::core::ffi::c_char; 64usize],
110}
111impl Default for AsiBlockExecution {
112    fn default() -> Self {
113        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
114        unsafe {
115            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
116            s.assume_init()
117        }
118    }
119}
120#[doc = " A block parameter."]
121#[repr(C)]
122#[derive(Debug, Copy, Clone)]
123pub struct AsiBlockParameter {
124    pub header: AsiStructureHeader,
125    pub name: [::core::ffi::c_char; 64usize],
126    pub type_: [::core::ffi::c_char; 64usize],
127    pub default_value: [::core::ffi::c_char; 64usize],
128}
129impl Default for AsiBlockParameter {
130    fn default() -> Self {
131        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
132        unsafe {
133            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
134            s.assume_init()
135        }
136    }
137}
138#[doc = " A block port."]
139#[repr(C)]
140#[derive(Debug, Copy, Clone)]
141pub struct AsiBlockPort {
142    pub header: AsiStructureHeader,
143    pub direction: AsiPortDirection,
144    pub name: [::core::ffi::c_char; 64usize],
145    pub type_: [::core::ffi::c_char; 64usize],
146}
147impl Default for AsiBlockPort {
148    fn default() -> Self {
149        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
150        unsafe {
151            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
152            s.assume_init()
153        }
154    }
155}
156#[doc = " A block usage (in a system or flow)."]
157#[repr(C)]
158#[derive(Debug, Copy, Clone)]
159pub struct AsiBlockUsage {
160    pub header: AsiStructureHeader,
161    pub name: [::core::ffi::c_char; 64usize],
162    pub type_: [::core::ffi::c_char; 64usize],
163}
164impl Default for AsiBlockUsage {
165    fn default() -> Self {
166        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
167        unsafe {
168            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
169            s.assume_init()
170        }
171    }
172}
173#[doc = " A flow connection."]
174#[repr(C)]
175#[derive(Debug, Copy, Clone)]
176pub struct AsiFlowConnection {
177    pub header: AsiStructureHeader,
178    pub source_block: [::core::ffi::c_char; 64usize],
179    pub source_port: [::core::ffi::c_char; 64usize],
180    pub target_block: [::core::ffi::c_char; 64usize],
181    pub target_port: [::core::ffi::c_char; 64usize],
182}
183impl Default for AsiFlowConnection {
184    fn default() -> Self {
185        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
186        unsafe {
187            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
188            s.assume_init()
189        }
190    }
191}
192#[doc = " Defines the flow being created."]
193#[repr(C)]
194#[derive(Debug, Copy, Clone)]
195pub struct AsiFlowCreateInfo {
196    pub header: AsiStructureHeader,
197    pub name: [::core::ffi::c_char; 64usize],
198}
199impl Default for AsiFlowCreateInfo {
200    fn default() -> Self {
201        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
202        unsafe {
203            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
204            s.assume_init()
205        }
206    }
207}
208#[doc = " A flow definition."]
209#[repr(C)]
210#[derive(Debug, Copy, Clone)]
211pub struct AsiFlowDefinition {
212    pub header: AsiStructureHeader,
213    pub name: [::core::ffi::c_char; 64usize],
214    pub block_count: u32,
215}
216impl Default for AsiFlowDefinition {
217    fn default() -> Self {
218        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
219        unsafe {
220            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
221            s.assume_init()
222        }
223    }
224}
225#[repr(C)]
226#[derive(Debug, Copy, Clone)]
227pub struct AsiFlowExecuteInfo {
228    pub header: AsiStructureHeader,
229    pub name: [::core::ffi::c_char; 64usize],
230    pub params: [::core::ffi::c_char; 2048usize],
231}
232impl Default for AsiFlowExecuteInfo {
233    fn default() -> Self {
234        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
235        unsafe {
236            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
237            s.assume_init()
238        }
239    }
240}
241#[doc = " A flow execution."]
242#[repr(C)]
243#[derive(Debug, Copy, Clone)]
244pub struct AsiFlowExecution {
245    pub header: AsiStructureHeader,
246    pub timestamp: u64,
247    pub pid: u64,
248    pub state: AsiFlowExecutionState,
249    pub name: [::core::ffi::c_char; 64usize],
250}
251impl Default for AsiFlowExecution {
252    fn default() -> Self {
253        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
254        unsafe {
255            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
256            s.assume_init()
257        }
258    }
259}
260#[repr(C)]
261#[derive(Debug, Copy, Clone)]
262pub struct AsiFlowUpdateInfo {
263    pub header: AsiStructureHeader,
264    pub name: [::core::ffi::c_char; 64usize],
265    pub new_name: [::core::ffi::c_char; 64usize],
266}
267impl Default for AsiFlowUpdateInfo {
268    fn default() -> Self {
269        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
270        unsafe {
271            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
272            s.assume_init()
273        }
274    }
275}
276#[repr(C)]
277#[derive(Debug, Copy, Clone)]
278pub struct AsiModelDownloadInfo {
279    pub header: AsiStructureHeader,
280    pub name: [::core::ffi::c_char; 64usize],
281}
282impl Default for AsiModelDownloadInfo {
283    fn default() -> Self {
284        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
285        unsafe {
286            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
287            s.assume_init()
288        }
289    }
290}
291#[doc = " A model manifest."]
292#[repr(C)]
293#[derive(Debug, Copy, Clone)]
294pub struct AsiModelManifest {
295    pub header: AsiStructureHeader,
296    pub name: [::core::ffi::c_char; 64usize],
297    pub size: u64,
298}
299impl Default for AsiModelManifest {
300    fn default() -> Self {
301        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
302        unsafe {
303            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
304            s.assume_init()
305        }
306    }
307}
308#[doc = " A model tensor."]
309#[repr(C)]
310#[derive(Debug, Copy, Clone)]
311pub struct AsiModelTensor {
312    pub header: AsiStructureHeader,
313    pub name: [::core::ffi::c_char; 64usize],
314}
315impl Default for AsiModelTensor {
316    fn default() -> Self {
317        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
318        unsafe {
319            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
320            s.assume_init()
321        }
322    }
323}
324#[repr(C)]
325#[derive(Debug, Copy, Clone)]
326pub struct AsiModuleEnableInfo {
327    pub header: AsiStructureHeader,
328    pub name: [::core::ffi::c_char; 64usize],
329    pub enabled: bool,
330}
331impl Default for AsiModuleEnableInfo {
332    fn default() -> Self {
333        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
334        unsafe {
335            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
336            s.assume_init()
337        }
338    }
339}
340#[doc = " A module registration."]
341#[repr(C)]
342#[derive(Debug, Copy, Clone)]
343pub struct AsiModuleRegistration {
344    pub header: AsiStructureHeader,
345    pub name: [::core::ffi::c_char; 64usize],
346    pub block_count: u32,
347}
348impl Default for AsiModuleRegistration {
349    fn default() -> Self {
350        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
351        unsafe {
352            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
353            s.assume_init()
354        }
355    }
356}
357extern "C" {
358    #[must_use]
359    #[doc = " Clones an existing flow definition."]
360    pub fn asiCloneFlow(instance: AsiInstance, request: *const AsiFlowUpdateInfo) -> AsiResult;
361}
362extern "C" {
363    #[must_use]
364    #[doc = " Creates a new flow definition."]
365    pub fn asiCreateFlow(
366        instance: AsiInstance,
367        createInfo: *const AsiFlowCreateInfo,
368        flow: *mut AsiFlowDefinition,
369    ) -> AsiResult;
370}
371extern "C" {
372    #[must_use]
373    #[doc = " Creates a new SDK instance."]
374    pub fn asiCreateInstance(
375        reserved: *const ::core::ffi::c_void,
376        instance: *mut AsiInstance,
377    ) -> AsiResult;
378}
379extern "C" {
380    #[must_use]
381    #[doc = " Destroys an SDK instance."]
382    pub fn asiDestroyInstance(instance: AsiInstance) -> AsiResult;
383}
384extern "C" {
385    #[must_use]
386    pub fn asiDownloadModel(
387        instance: AsiInstance,
388        request: *const AsiModelDownloadInfo,
389    ) -> AsiResult;
390}
391extern "C" {
392    #[must_use]
393    pub fn asiEnableModule(instance: AsiInstance, request: *const AsiModuleEnableInfo)
394        -> AsiResult;
395}
396extern "C" {
397    #[must_use]
398    #[doc = " Enumerates block parameters."]
399    pub fn asiEnumerateBlockParameters(
400        instance: AsiInstance,
401        block: *const AsiBlockDefinition,
402        buffer_capacity: u32,
403        actual_count: *mut u32,
404        buffer: *mut AsiBlockParameter,
405    ) -> AsiResult;
406}
407extern "C" {
408    #[must_use]
409    #[doc = " Enumerates block ports."]
410    pub fn asiEnumerateBlockPorts(
411        instance: AsiInstance,
412        block: *const AsiBlockDefinition,
413        buffer_capacity: u32,
414        actual_count: *mut u32,
415        buffer: *mut AsiBlockPort,
416    ) -> AsiResult;
417}
418extern "C" {
419    #[must_use]
420    #[doc = " Enumerates block definitions."]
421    pub fn asiEnumerateBlocks(
422        instance: AsiInstance,
423        buffer_capacity: u32,
424        actual_count: *mut u32,
425        buffer: *mut AsiBlockDefinition,
426    ) -> AsiResult;
427}
428extern "C" {
429    #[must_use]
430    #[doc = " Enumerates flow blocks."]
431    pub fn asiEnumerateFlowBlocks(
432        instance: AsiInstance,
433        flow: *const AsiFlowDefinition,
434        buffer_capacity: u32,
435        actual_count: *mut u32,
436        buffer: *mut AsiBlockUsage,
437    ) -> AsiResult;
438}
439extern "C" {
440    #[must_use]
441    #[doc = " Enumerates flow connections."]
442    pub fn asiEnumerateFlowConnections(
443        instance: AsiInstance,
444        flow: *const AsiFlowDefinition,
445        buffer_capacity: u32,
446        actual_count: *mut u32,
447        buffer: *mut AsiFlowConnection,
448    ) -> AsiResult;
449}
450extern "C" {
451    #[must_use]
452    #[doc = " Enumerates flow executions."]
453    pub fn asiEnumerateFlowExecutions(
454        instance: AsiInstance,
455        flow: *const AsiFlowDefinition,
456        buffer_capacity: u32,
457        actual_count: *mut u32,
458        buffer: *mut AsiFlowExecution,
459    ) -> AsiResult;
460}
461extern "C" {
462    #[must_use]
463    #[doc = " Enumerates flow definitions."]
464    pub fn asiEnumerateFlows(
465        instance: AsiInstance,
466        buffer_capacity: u32,
467        actual_count: *mut u32,
468        buffer: *mut AsiFlowDefinition,
469    ) -> AsiResult;
470}
471extern "C" {
472    #[must_use]
473    #[doc = " Enumerates model tensors."]
474    pub fn asiEnumerateModelTensors(
475        instance: AsiInstance,
476        buffer_capacity: u32,
477        actual_count: *mut u32,
478        buffer: *mut AsiModelTensor,
479    ) -> AsiResult;
480}
481extern "C" {
482    #[must_use]
483    #[doc = " Enumerates models."]
484    pub fn asiEnumerateModels(
485        instance: AsiInstance,
486        buffer_capacity: u32,
487        actual_count: *mut u32,
488        buffer: *mut AsiModelManifest,
489    ) -> AsiResult;
490}
491extern "C" {
492    #[must_use]
493    #[doc = " Enumerates module registrations."]
494    pub fn asiEnumerateModules(
495        instance: AsiInstance,
496        buffer_capacity: u32,
497        actual_count: *mut u32,
498        buffer: *mut AsiModuleRegistration,
499    ) -> AsiResult;
500}
501extern "C" {
502    #[must_use]
503    pub fn asiExecuteBlock(
504        instance: AsiInstance,
505        request: *const AsiBlockExecuteInfo,
506        execution: *mut AsiBlockExecution,
507    ) -> AsiResult;
508}
509extern "C" {
510    #[must_use]
511    pub fn asiExecuteFlow(
512        instance: AsiInstance,
513        request: *const AsiFlowExecuteInfo,
514        execution: *mut AsiFlowExecution,
515    ) -> AsiResult;
516}
517extern "C" {
518    #[doc = " Returns the SDK build's licensee string, if any."]
519    pub fn asiGetLicenseeString() -> *const ::core::ffi::c_char;
520}
521extern "C" {
522    #[doc = " Returns the SDK's current version as a packed integer."]
523    pub fn asiGetVersion() -> AsiVersion;
524}
525extern "C" {
526    #[doc = " Returns the SDK's current version as a string."]
527    pub fn asiGetVersionString() -> *const ::core::ffi::c_char;
528}
529extern "C" {
530    #[must_use]
531    #[doc = " Initializes the SDK's global state."]
532    pub fn asiInitLibrary(
533        reserved: *const ::core::ffi::c_void,
534        print_callback: *mut ::core::ffi::c_void,
535    ) -> AsiResult;
536}
537extern "C" {
538    #[must_use]
539    pub fn asiPollFlowExecution(
540        instance: AsiInstance,
541        execution: *const AsiFlowExecution,
542        state: *mut AsiFlowExecutionState,
543    ) -> AsiResult;
544}
545extern "C" {
546    #[must_use]
547    #[doc = " Removes an existing flow definition."]
548    pub fn asiRemoveFlow(instance: AsiInstance, flow: *const AsiFlowDefinition) -> AsiResult;
549}
550extern "C" {
551    #[must_use]
552    pub fn asiStartFlowExecution(
553        instance: AsiInstance,
554        request: *const AsiFlowExecuteInfo,
555        execution: *mut AsiFlowExecution,
556    ) -> AsiResult;
557}
558extern "C" {
559    #[must_use]
560    pub fn asiStopFlowExecution(
561        instance: AsiInstance,
562        execution: *const AsiFlowExecution,
563    ) -> AsiResult;
564}
565extern "C" {
566    #[must_use]
567    #[doc = " Mutates an existing flow definition."]
568    pub fn asiUpdateFlow(instance: AsiInstance, request: *const AsiFlowUpdateInfo) -> AsiResult;
569}