Function kdb_c_api::S_to_str[][src]

pub fn S_to_str<'a>(cstring: S) -> &'a str
Expand description

Convert S to &str. This function is intended to convert symbol type (null-terminated char-array) to str.

Extern

use kdb_c_api::*;
 
#[no_mangle]
pub extern "C" fn print_symbol(symbol: K) -> K{
  unsafe{
    if (*symbol).qtype == -qtype::SYMBOL{
      println!("symbol: `{}", S_to_str((*symbol).value.symbol));
    }
    // return null
    KNULL
  }
}
q)print_symbol:`libc_api_examples 2: (`print_symbol; 1)
q)a:`kx
q)print_symbol a
symbol: `kx