Macro dmsdk::lua::declare_functions
source · macro_rules! declare_functions {
($ident:ident, $($func:ident),*) => { ... };
}
Expand description
Creates a new constant Reg
with the name provided, to be used with register()
.
Examples
use dmsdk::*;
fn hello_world(l: lua::State) -> i32 {
lua::push_string(l, "Hello, world!");
1
}
fn the_answer(l: lua::State) -> i32 {
lua::push_integer(l, 42);
1
}
// Equivalent to `const LUA_FUNCTIONS: lua::Reg = ...`
declare_functions!(
LUA_FUNCTIONS,
hello_world,
the_answer
);