Home
last modified time | relevance | path

Searched refs:lutok (Results 1 – 25 of 58) sorted by relevance

123

/freebsd/contrib/kyua/utils/fs/
H A Dlua_module_test.cpp46 lutok::state state; in ATF_TEST_CASE_BODY()
49 lutok::do_string(state, "return fs.basename", 0, 1, 0); in ATF_TEST_CASE_BODY()
51 lutok::do_string(state, "return fs.dirname", 0, 1, 0); in ATF_TEST_CASE_BODY()
53 lutok::do_string(state, "return fs.join", 0, 1, 0); in ATF_TEST_CASE_BODY()
62 lutok::state state; in ATF_TEST_CASE_BODY()
65 lutok::do_string(state, "return fs.basename('/my/test//file_foobar')", in ATF_TEST_CASE_BODY()
75 lutok::state state; in ATF_TEST_CASE_BODY()
78 ATF_REQUIRE_THROW_RE(lutok::error, "Need a string", in ATF_TEST_CASE_BODY()
79 lutok::do_string(state, "return fs.basename({})", in ATF_TEST_CASE_BODY()
81 ATF_REQUIRE_THROW_RE(lutok::error, "Invalid path", in ATF_TEST_CASE_BODY()
[all …]
H A Dlua_module.cpp65 qualify_path(lutok::state& state, const fs::path& path) in qualify_path()
67 lutok::stack_cleaner cleaner(state); in qualify_path()
92 to_path(lutok::state& state, const int index) in to_path()
109 lua_fs_basename(lutok::state& state) in lua_fs_basename()
111 lutok::stack_cleaner cleaner(state); in lua_fs_basename()
129 lua_fs_dirname(lutok::state& state) in lua_fs_dirname()
131 lutok::stack_cleaner cleaner(state); in lua_fs_dirname()
149 lua_fs_exists(lutok::state& state) in lua_fs_exists()
151 lutok::stack_cleaner cleaner(state); in lua_fs_exists()
173 files_iterator(lutok::state& state) in files_iterator()
[all …]
/freebsd/contrib/lutok/
H A Dstate.cpp139 call_cxx_function_from_c(lutok::cxx_function function, in call_cxx_function_from_c()
145 lutok::state state = lutok::state_c_gate::connect(raw_state); in call_cxx_function_from_c()
176 lutok::state state = lutok::state_c_gate::connect(raw_state); in cxx_closure_trampoline()
186 lutok::cxx_function* function = state.to_userdata< lutok::cxx_function >( in cxx_closure_trampoline()
205 lutok::state state = lutok::state_c_gate::connect(raw_state); in cxx_function_trampoline()
206 lutok::cxx_function* function = state.to_userdata< lutok::cxx_function >( in cxx_function_trampoline()
215 const int lutok::registry_index = LUA_REGISTRYINDEX;
219 struct lutok::state::impl {
242 lutok::state::state(void) in state()
246 throw lutok::error("lua open failed"); in state()
[all …]
H A Doperations_test.cpp53 hook_add(lutok::state& state) in hook_add()
70 hook_multiply(lutok::state& state) in hook_multiply()
83 lutok::state state; in ATF_TEST_CASE_BODY()
84 std::map< std::string, lutok::cxx_function > members; in ATF_TEST_CASE_BODY()
85 lutok::create_module(state, "my_math", members); in ATF_TEST_CASE_BODY()
88 lutok::do_string(state, "return next(my_math) == nil", 0, 1, 0); in ATF_TEST_CASE_BODY()
97 lutok::state state; in ATF_TEST_CASE_BODY()
98 std::map< std::string, lutok::cxx_function > members; in ATF_TEST_CASE_BODY()
100 lutok::create_module(state, "my_math", members); in ATF_TEST_CASE_BODY()
102 lutok::do_string(state, "return my_math.add(10, 20)", 0, 1, 0); in ATF_TEST_CASE_BODY()
[all …]
H A Ddebug.cpp40 struct lutok::debug::impl {
47 lutok::debug::debug(void) : in debug()
54 lutok::debug::~debug(void) in ~debug()
67 lutok::debug::get_info(state& s, const std::string& what_) in get_info()
72 throw lutok::api_error::from_stack(s, "lua_getinfo"); in get_info()
81 lutok::debug::get_stack(state& s, const int level) in get_stack()
93 lutok::debug::event(void) const in event()
103 lutok::debug::name(void) const in name()
114 lutok::debug::name_what(void) const in name_what()
125 lutok::debug::what(void) const in what()
[all …]
H A Dexceptions.cpp41 lutok::error::error(const std::string& message) : in error()
48 lutok::error::~error(void) throw() in ~error()
57 lutok::api_error::api_error(const std::string& api_function_, in api_error()
66 lutok::api_error::~api_error(void) throw() in ~api_error()
80 lutok::api_error
81 lutok::api_error::from_stack(state& state_, const std::string& api_function_) in from_stack()
83 lua_State* raw_state = lutok::state_c_gate(state_).c_state(); in from_stack()
88 return lutok::api_error(api_function_, message); in from_stack()
96 lutok::api_error::api_function(void) const in api_function()
105 lutok::file_not_found_error::file_not_found_error( in file_not_found_error()
[all …]
H A Dstate_test.cpp69 is_available(lutok::state& state, const char* symbol) in is_available()
88 check_modules(lutok::state& state, const std::string& expected) in check_modules()
111 lutok::state state = lutok::state_c_gate::connect(raw_state); in c_get_upvalues()
129 cxx_multiply_closure(lutok::state& state) in cxx_multiply_closure()
154 cxx_divide(lutok::state& state) in cxx_divide()
179 raise_long_error(lutok::state& state) in raise_long_error()
192 lutok::state state; in ATF_TEST_CASE_BODY()
202 lutok::state state; in ATF_TEST_CASE_BODY()
213 lutok::state state; in ATF_TEST_CASE_BODY()
223 lutok::state state; in ATF_TEST_CASE_BODY()
[all …]
H A DMakefile.am47 EXTRA_DIST += include/lutok/README
48 EXTRA_DIST += include/lutok/c_gate.hpp
49 EXTRA_DIST += include/lutok/debug.hpp
50 EXTRA_DIST += include/lutok/exceptions.hpp
51 EXTRA_DIST += include/lutok/operations.hpp
52 EXTRA_DIST += include/lutok/stack_cleaner.hpp
53 EXTRA_DIST += include/lutok/state.hpp
54 EXTRA_DIST += include/lutok/state.ipp
75 pkgconfig_DATA = lutok.pc
76 CLEANFILES = lutok.pc
[all …]
H A Dstack_cleaner_test.cpp37 lutok::state state; in ATF_TEST_CASE_BODY()
39 lutok::stack_cleaner cleaner(state); in ATF_TEST_CASE_BODY()
49 lutok::state state; in ATF_TEST_CASE_BODY()
51 lutok::stack_cleaner cleaner(state); in ATF_TEST_CASE_BODY()
64 lutok::state state; in ATF_TEST_CASE_BODY()
66 lutok::stack_cleaner cleaner1(state); in ATF_TEST_CASE_BODY()
71 lutok::stack_cleaner cleaner2(state); in ATF_TEST_CASE_BODY()
87 lutok::state state; in ATF_TEST_CASE_BODY()
89 lutok::stack_cleaner cleaner(state); in ATF_TEST_CASE_BODY()
H A Doperations.cpp45 lutok::create_module(state& s, const std::string& name, in create_module()
76 lutok::do_file(state& s, const std::string& file, const int nargs, in do_file()
88 } catch (const lutok::api_error& e) { in do_file()
89 throw lutok::error("Failed to load Lua file '" + file + "': " + in do_file()
116 lutok::do_string(state& s, const std::string& str, const int nargs, in do_string()
128 } catch (const lutok::api_error& e) { in do_string()
129 throw lutok::error("Failed to process Lua string '" + str + "': " + in do_string()
149 lutok::eval(state& s, const std::string& expression, const int nresults) in eval()
H A Dc_gate.cpp37 lutok::state_c_gate::state_c_gate(state& state_) : in state_c_gate()
48 lutok::state_c_gate::~state_c_gate(void) in ~state_c_gate()
62 lutok::state
63 lutok::state_c_gate::connect(lua_State* raw_state) in connect()
73 lutok::state_c_gate::c_state(void) in c_state()
H A Dexceptions_test.cpp41 const lutok::error e("Some text"); in ATF_TEST_CASE_BODY()
49 const lutok::api_error e("some_function", "Some text"); in ATF_TEST_CASE_BODY()
58 lutok::state state; in ATF_TEST_CASE_BODY()
61 const lutok::api_error e = lutok::api_error::from_stack(state, in ATF_TEST_CASE_BODY()
74 const lutok::file_not_found_error e("missing-file"); in ATF_TEST_CASE_BODY()
H A Dtest_utils.hpp66 } catch (const lutok::api_error& api_error) { \
80 raw(lutok::state& state) in raw()
82 return lutok::state_c_gate(state).c_state(); in raw()
94 lutok::state& _state;
110 stack_balance_checker(lutok::state& state_, in stack_balance_checker()
H A Ddebug_test.cpp41 lutok::state state; in ATF_TEST_CASE_BODY()
44 lutok::debug debug; in ATF_TEST_CASE_BODY()
53 lutok::state state; in ATF_TEST_CASE_BODY()
55 lutok::debug debug; in ATF_TEST_CASE_BODY()
H A Dstack_cleaner.cpp37 struct lutok::stack_cleaner::impl {
62 lutok::stack_cleaner::stack_cleaner(state& state_) : in stack_cleaner()
72 lutok::stack_cleaner::~stack_cleaner(void) in ~stack_cleaner()
88 lutok::stack_cleaner::forget(void) in forget()
H A Dc_gate_test.cpp45 lutok::state state = lutok::state_c_gate::connect(raw_state); in ATF_TEST_CASE_BODY()
59 lutok::state state; in ATF_TEST_CASE_BODY()
62 lutok::state_c_gate gate(state); in ATF_TEST_CASE_BODY()
/freebsd/contrib/kyua/utils/config/
H A Dlua_module_test.cpp79 push_lua(lutok::state& state) const in push_lua()
89 set_lua(lutok::state& state, const int value_index) in set_lua()
131 lutok::state state; in ATF_TEST_CASE_BODY()
133 lutok::do_string(state, in ATF_TEST_CASE_BODY()
154 lutok::state state; in ATF_TEST_CASE_BODY()
157 lutok::error, in ATF_TEST_CASE_BODY()
159 lutok::do_string(state, in ATF_TEST_CASE_BODY()
179 lutok::state state; in ATF_TEST_CASE_BODY()
181 lutok::do_string(state, "first = 100; second = first * 2", 0, 0, 0); in ATF_TEST_CASE_BODY()
196 lutok::state state; in ATF_TEST_CASE_BODY()
[all …]
H A Dnodes.hpp105 virtual void push_lua(lutok::state&) const = 0;
106 virtual void set_lua(lutok::state&, const int) = 0;
166 void push_lua(lutok::state&) const;
167 void set_lua(lutok::state&, const int);
176 void push_lua(lutok::state&) const;
177 void set_lua(lutok::state&, const int);
192 void push_lua(lutok::state&) const;
193 void set_lua(lutok::state&, const int);
238 void push_lua(lutok::state&) const;
241 void set_lua(lutok::state&, const int);
H A Dlua_module.cpp54 get_global_tree(lutok::state& state) in get_global_tree()
56 lutok::stack_cleaner cleaner(state); in get_global_tree()
58 state.push_value(lutok::registry_index); in get_global_tree()
83 get_tree_key(lutok::state& state, const int table_index, const int field_index) in get_tree_key()
102 static int redirect_newindex(lutok::state&);
103 static int redirect_index(lutok::state&);
113 new_table_for_key(lutok::state& state, const std::string& tree_key) in new_table_for_key()
153 redirect_newindex(lutok::state& state) in redirect_newindex()
194 redirect_index(lutok::state& state) in redirect_index()
260 config::redirect(lutok::state& state, tree& out_tree) in redirect()
[all …]
H A Dparser.cpp61 lutok::state _state;
79 friend void lua_syntax(lutok::state&);
107 lua_syntax(lutok::state& state) in lua_syntax()
146 lutok::stack_cleaner cleaner(_pimpl->_state); in parser()
174 lutok::do_file(_pimpl->_state, file.str(), 0, 0, 0); in parse()
175 } catch (const lutok::error& e) { in parse()
/freebsd/contrib/lutok/examples/
H A Dbindings.cpp79 lua_factorial(lutok::state& state) in lua_factorial()
107 lutok::state state; in main()
115 std::map< std::string, lutok::cxx_function > module; in main()
117 lutok::create_module(state, "native", module); in main()
127 lutok::do_string(state, script.str(), 0, 0, 0); in main()
129 } catch (const lutok::error& e) { in main()
H A DMakefile35 LUTOK_CPPFLAGS = $$(pkg-config --cflags-only-I lutok)
36 LUTOK_CXXFLAGS = $$(pkg-config --cflags-only-other lutok)
37 LUTOK_LDFLAGS = $$(pkg-config --libs-only-L lutok) \
38 $$(pkg-config --libs-only-other lutok)
39 LUTOK_LIBS = $$(pkg-config --libs-only-l lutok)
H A Dinterpreter.cpp46 run_statement(lutok::state& state, const std::string& line) in run_statement()
53 lutok::do_string(state, line, 0, 0, 0); in run_statement()
54 } catch (const lutok::error& error) { in run_statement()
67 lutok::state state; in main()
H A Draii.cpp63 print_table_field(lutok::state& state, const std::string& field) in print_table_field()
74 lutok::stack_cleaner cleaner(state); in print_table_field()
113 lutok::state state; in main()
116 lutok::do_string(state, "example = {foo='hello', bar=123, baz='bye'}", in main()
/freebsd/contrib/kyua/engine/
H A Dkyuafile.cpp84 static int lua_current_kyuafile(lutok::state&);
85 static int lua_generic_test_program(lutok::state&);
86 static int lua_include(lutok::state&);
87 static int lua_syntax(lutok::state&);
88 static int lua_test_suite(lutok::state&);
116 lutok::state _state;
190 lutok::stack_cleaner cleaner(_state); in parser()
241 get_from_state(lutok::state& state) in get_from_state()
243 lutok::stack_cleaner cleaner(state); in get_from_state()
383 lutok::do_file(_state, load_path.str(), 0, 0, 0); in parse()
[all …]

123