macro_rules! str_to_S {
($string: expr) => { ... };
}
Expand description
Convert &str
to S
(null-terminated character array).
Example
#[macro_use]
use kdbplus::api::*;
#[no_mangle]
pub extern "C" fn pingpong(_: K) -> K{
unsafe{native::k(0, str_to_S!("ping"), new_int(77), KNULL)}
}
q)ping:{[int] `$string[int], "_pong!!"}
q)pingpong: `libapi_examples 2: (`pingpong; 1);
q)pingpong[]
`77_pong!!
Note
This macro cannot be created as a function due to freeing resource of Rust (not sure).