Skip to content

Commit 7df4124

Browse files
committed
first commit
0 parents  commit 7df4124

File tree

7 files changed

+104
-0
lines changed

7 files changed

+104
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
**/*.rs.bk
3+
Cargo.lock

.travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dist: bionic
2+
language: rust
3+
rust:
4+
- stable
5+
6+
sudo: required
7+
install:
8+
- sudo apt-get install git
9+
- git clone https://github.com/thalium/icebox --depth 1
10+
- cd icebox/src/FDP && gcc -shared -fPIC FDP.c -o libFDP.so && sudo cp include/* /usr/local/include && sudo cp libFDP.so /usr/local/lib
11+
script:
12+
- cargo build
13+
- cargo test

Cargo.toml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "fdp-sys"
3+
version = "0.1.0"
4+
authors = ["Mathieu Tarral <[email protected]>"]
5+
edition = "2018"
6+
links = "FDP"
7+
repository = "https://github.com/Wenzel/fdp-sys"
8+
readme = "README.md"
9+
keywords = ["Winbagility", "FDP", "VirtualBox", "VMI"]
10+
description = "Rust unsafe bindings for FDP (Fast Debugging Protocol)"
11+
license = "GPL-3.0-only"
12+
13+
[dependencies]
14+
15+
[build-dependencies]
16+
bindgen = "0.49.2"

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# fdp-sys
2+
3+
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
4+
5+
> Rust unsafe bindings for FDP library
6+
7+
## Table of Contents
8+
9+
- [Overview](#overview)
10+
- [Requirements](#requirements)
11+
- [Maintainers](#maintainers)
12+
- [Contributing](#contributing)
13+
- [License](#license)
14+
15+
## Overview
16+
17+
This crate will compile **unsafe** bindings for Winbagility's FDP `libFDP.so`.
18+
19+
## Requirements
20+
21+
- `cargo`
22+
- `rustc`
23+
24+
## Maintainers
25+
26+
[@Wenzel](https://github.com/Wenzel)
27+
28+
## Contributing
29+
30+
PRs accepted.
31+
32+
Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
33+
34+
## License
35+
36+
[GNU General Public License v3.0](https://github.com/Wenzel/kvmi-sys/blob/master/LICENSE)

build.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extern crate bindgen;
2+
3+
use std::env;
4+
use std::path::PathBuf;
5+
6+
fn main() {
7+
8+
// what library to link with
9+
println!("cargo:rustc-link-lib=FDP");
10+
11+
// The bindgen::Builder is the main entry point
12+
// to bindgen, and lets you build up options for
13+
// the resulting bindings.
14+
let bindings = bindgen::Builder::default()
15+
// The input header we would like to generate
16+
// bindings for.
17+
.header("src/wrapper.h")
18+
// Finish the builder and generate the bindings.
19+
.generate()
20+
// Unwrap the Result and panic on failure.
21+
.expect("Unable to generate bindings");
22+
23+
// Write the bindings to the $OUT_DIR/bindings.rs file.
24+
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
25+
bindings
26+
.write_to_file(out_path.join("bindings.rs"))
27+
.expect("Couldn't write bindings!");
28+
}

src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![allow(non_upper_case_globals)]
2+
#![allow(non_camel_case_types)]
3+
#![allow(non_snake_case)]
4+
5+
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

src/wrapper.h

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <inttypes.h>
2+
#include <stdbool.h>
3+
#include <FDP.h>

0 commit comments

Comments
 (0)