1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! # Foreignc
//! Foreignc is a framework for auto generating a safe ffi abi for rust methods.
//! The main advantage if foreignc is that allows for easy deplayment and maintenance of safe ffi abi.
//! The crate is made up of two parts.
//! - Macros for auto generating ffi abis and cleanup methods
//! - Functions for auto generate the recieving end of the ffi abi
//! - Currently only python is supported
//! # Templating
//! Using the feature 'template' it is possible to auto generate the recieving side of the ffi.
//! This will also add two new functions get_package_dir and get_parsed_dir. Both functions return a representation of the current ffi api
//!
//!
//! # Default types
//! ## Primititve types
//! The following primitive types are supported:
//! - bool
//! - ()
//! - i8, i16, i32, i64
//! - u8, u16, u32, u64
//! - f32, f64
//! - &str (will be converted to a CString)
//!
//! ## Other types
//! The following other types are soppurted:
//! - Result (will be converted to a CResult)
//! - Option (will be converted to a COption)
//! - String (will be converted to a CString)
//!
//! # Custom Structs
//! Custom types can be implemented either by using the IntoFFi, FromFFi trait or the Boxed, Json macro.
//!
//! # Safety
//! As a rule of thumb, all allocated memory needs too be unallocated by the creator.
//! This is also the basis for generate_free_methods that creates frunctions for freeing memory allocated by structures made by foreignc
//! The following functions are made
//! - free_string(ptr: *mut CString)
//! - free_coption(ptr: *mut COption)
//! - free_cresult(ptr: *mut CResult)
//!
//! Boxed structs will auto generate a free method using the following convention free_{to_snake_case(struct name)}
//!
//! For more information see the [![git repository]](https://github.com/mart368b/foreignc)
extern crate libc;
pub use *;
pub use *;
pub use ;
pub use c_void;
pub use free as free_libc;
pub use CString;
pub use *;
use get_dir_path;
use RustContext;
/// Get the parsed abis from the current crate
/// Get the parsed abis from the provided crate