extern crate ffi_utils;
#[macro_use]
extern crate unwrap;
extern crate routing;
extern crate rust_sodium;
use routing::XOR_NAME_LEN;
use rust_sodium::crypto::{box_, secretbox, sign};
use std::collections::HashMap;
use std::collections::HashSet;
static HEADER_NAME: &'static str = "safe_core";
static HEADER_DIRECTORY: &'static str = "../auto-gen/c-include/";
static ROOT_FILE: &'static str = "src/lib.rs";
fn main() {
let mut ignore_modules = HashSet::new();
ignore_modules.insert(String::from("ffi::arrays"));
let mut custom_code = HashMap::new();
custom_code.insert(
String::from("ffi::arrays"),
format!(
"typedef unsigned char AsymPublicKey[{}];\n\
typedef unsigned char AsymSecretKey[{}];\n\
typedef unsigned char AsymNonce[{}];\n\
typedef unsigned char SymSecretKey[{}];\n\
typedef unsigned char SymNonce[{}];\n\
typedef unsigned char SignPublicKey[{}];\n\
typedef unsigned char SignSecretKey[{}];\n\
typedef unsigned char XorNameArray[{}];",
box_::PUBLICKEYBYTES,
box_::SECRETKEYBYTES,
box_::NONCEBYTES,
secretbox::KEYBYTES,
secretbox::NONCEBYTES,
sign::PUBLICKEYBYTES,
sign::SECRETKEYBYTES,
XOR_NAME_LEN
),
);
unwrap!(ffi_utils::header_gen::gen_headers_custom_code(
HEADER_NAME,
HEADER_DIRECTORY,
ROOT_FILE,
&custom_code,
&ignore_modules,
));
}