00001 /* 00002 * Lua-RTT bindings 00003 * 00004 * (C) Copyright 2010 Markus Klotzbuecher 00005 * markus.klotzbuecher@mech.kuleuven.be 00006 * Department of Mechanical Engineering, 00007 * Katholieke Universiteit Leuven, Belgium. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public 00011 * License as published by the Free Software Foundation; 00012 * version 2 of the License. 00013 * 00014 * As a special exception, you may use this file as part of a free 00015 * software library without restriction. Specifically, if other files 00016 * instantiate templates or use macros or inline functions from this 00017 * file, or you compile this file and link it with other files to 00018 * produce an executable, this file does not by itself cause the 00019 * resulting executable to be covered by the GNU General Public 00020 * License. This exception does not however invalidate any other 00021 * reasons why the executable file might be covered by the GNU General 00022 * Public License. 00023 * 00024 * This library is distributed in the hope that it will be useful, 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00027 * Lesser General Public License for more details. 00028 * 00029 * You should have received a copy of the GNU General Public 00030 * License along with this library; if not, write to the Free Software 00031 * Foundation, Inc., 59 Temple Place, 00032 * Suite 330, Boston, MA 02111-1307 USA 00033 */ 00034 00035 #include <rtt/TaskContext.hpp> 00036 #include <rtt/Port.hpp> 00037 #include <rtt/types/Types.hpp> 00038 #include <rtt/base/DataSourceBase.hpp> 00039 #include <rtt/types/Operators.hpp> 00040 #include <rtt/Logger.hpp> 00041 #include <rtt/plugin/PluginLoader.hpp> 00042 #include <rtt/os/TimeService.hpp> 00043 #include <rtt/os/fosi.h> 00044 #include <rtt/internal/GlobalService.hpp> 00045 #include <rtt/types/GlobalsRepository.hpp> 00046 00047 extern "C" { 00048 #include <lua.h> 00049 #include <lauxlib.h> 00050 #include <lualib.h> 00051 #include <string.h> 00052 00053 #include <stdint.h> 00054 00055 int luaopen_rtt(lua_State *L); 00056 int set_context_tc(RTT::TaskContext*, lua_State*); 00057 00058 /* call a function/0 named by string, the last two boolean arguments 00059 * are wether to fail if no such function exists and wether to fail if 00060 * no boolean result is returned. 00061 */ 00062 bool call_func(lua_State*, const char*, RTT::TaskContext*, int, int); 00063 } 00064 00065