#string #constant #null-terminated #dynamic #exporting #macro #foo

nightly export_cstr

Provides a macro for exporting constant, null-terminated, C strings from dynamic libraries

4 releases

Uses old Rust 2015

0.0.4 Feb 7, 2015
0.0.3 Feb 6, 2015
0.0.2 Feb 5, 2015
0.0.1 Feb 5, 2015

#5 in #null-terminated

MIT license

6KB
100 lines

Example usage

Cargo.toml:

[lib]
name = "foo"
crate-type = ["dylib"]

[dependencies]
export_cstr = "*"

lib.rs:

#![feature(plugin)]
#[plugin] #[macro_use] extern crate export_cstr;

// implicit #[allow(dead_code, non_upper_case_globals)]
export_cstr!(foo, "this becomes an exported symbol 'foo' which points to a constant, null-terminated, C string");

// ...

No runtime deps