Skip to content

regenerate with recent bindgen #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -52,6 +52,17 @@ By default, `/usr/lib`, `/usr/local/lib64`, and `/usr/local/lib` are added to th

A semicolon separated list of additional directories to add to the linker search path may be specified through the `CASSANDRA_SYS_LIB_PATH` environment variable.

## Autogeneration

The file `cassandra.rs` is autogenerated as follows:


```
$ bindgen --no-layout-tests --blacklist-type=max_align_t --output=src/cassandra.rs cassandra.h
```

The autogenerated code is formatted with `rustfmt`.


## History

18 changes: 1 addition & 17 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
//#![feature(plugin)]
//#![plugin(bindgen_plugin)]



//#[allow(dead_code, uppercase_variables, non_camel_case_types)]
//#[plugin(bindgen_plugin)]
//mod mysql_bindings {
// bindgen!("/usr/include/mysql/mysql.h", match="mysql.h", link="mysql");
//}

//use std::env;
//use std::fs;
//use std::path::Path;
//use std::process::Command;

fn main() {
if let Some(datastax_dir) = option_env!("CASSANDRA_SYS_LIB_PATH") {
for p in datastax_dir.split(";") {
println!("cargo:rustc-link-search={}", p);
}
}

println!("cargo:rustc-flags=-l dylib=cassandra");
println!("cargo:rustc-flags=-l dylib=crypto");
println!("cargo:rustc-flags=-l dylib=ssl");
println!("cargo:rustc-flags=-l dylib=stdc++");
@@ -31,5 +16,4 @@ fn main() {
println!("cargo:rustc-link-search={}", "/usr/local/lib");
println!("cargo:rustc-link-search={}", "/usr/lib64/");
println!("cargo:rustc-link-search={}", "/usr/lib/");
// println!("cargo:rustc-link-lib=static=cassandra_static");
}
10,117 changes: 8,193 additions & 1,924 deletions src/cassandra.rs

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions src/ffi_util.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::slice;
use std::str;
use cassandra::cass_bool_t;
use cassandra::CassValueType_;

use std::str::Utf8Error;

@@ -10,19 +9,6 @@ pub unsafe fn raw2utf8(data: *const i8, length: usize) -> Result<String, Utf8Err
Ok(try!(str::from_utf8(slice)).to_owned())
}

impl PartialEq for cass_bool_t {
fn eq(&self, other: &cass_bool_t) -> bool {
let s: bool = self.clone().into();
s == other.clone().into()
}
}

impl PartialEq for CassValueType_ {
fn eq(&self, other: &CassValueType_) -> bool {
self == other
}
}

impl Into<bool> for cass_bool_t {
fn into(self) -> bool {
match self {