build out geany_load_module
This commit is contained in:
parent
5e22f823b4
commit
c48d967e3a
3
build.rs
3
build.rs
@ -40,7 +40,8 @@ fn add_pkg_config(build: &mut Build, pkg: &Library) {
|
||||
fn write_bindings(pkg: &Library) {
|
||||
let mut bindings_builder = bindgen::Builder::default()
|
||||
.header("wrapper.h")
|
||||
.clang_arg("-DGTK");
|
||||
.clang_arg("-DGTK")
|
||||
.blacklist_function("geany_load_module");
|
||||
|
||||
for p in pkg.include_paths.iter() {
|
||||
bindings_builder = bindings_builder.clang_arg(format!("-I{}", p.to_str().unwrap()));
|
||||
|
17
src/lib.rs
17
src/lib.rs
@ -1,3 +1,18 @@
|
||||
extern fn geany_load_module () {
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use std::ffi::CString;
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn geany_load_module (plugin: *mut GeanyPlugin) {
|
||||
println!("loading shenlong module");
|
||||
unsafe {
|
||||
(*(*plugin).info).name = CString::new("Project Shenlong").unwrap().into_raw();
|
||||
(*(*plugin).info).description = CString::new("Experimental Geany plugin project").unwrap().into_raw();
|
||||
(*(*plugin).info).version = CString::new("0.0.1").unwrap().into_raw();
|
||||
(*(*plugin).info).author = CString::new("Adrian Malacoda <malacoda@monarch-pass.net>").unwrap().into_raw();
|
||||
geany_plugin_register(plugin, 235, GEANY_API_VERSION as i32, GEANY_ABI_VERSION as i32);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user