-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* SimGrid Lua bindings */
-#include "lua_private.h"
-#include "lua_utils.h"
+#include "lua_private.hpp"
+#include "lua_utils.hpp"
#include "src/surf/xml/platf.hpp"
-
+#include <lauxlib.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(lua, "Lua Bindings");
-extern "C" {
-#include <lauxlib.h>
-
-int luaopen_simgrid(lua_State *L);
-}
+extern "C" int luaopen_simgrid(lua_State* L);
/* ********************************************************************************* */
/* simgrid API */
/* ********************************************************************************* */
/**
- * \brief Prints a log string with debug level.
- * \param L a Lua state
- * \return number of values returned to Lua
+ * @brief Prints a log string with debug level.
+ * @param L a Lua state
+ * @return number of values returned to Lua
*
* - Argument 1 (string): the text to print
*/
}
/**
- * \brief Prints a log string with info level.
- * \param L a Lua state
- * \return number of values returned to Lua
+ * @brief Prints a log string with info level.
+ * @param L a Lua state
+ * @return number of values returned to Lua
*
* - Argument 1 (string): the text to print
*/
* @brief Dumps a lua table with XBT_DEBUG
*
* This function can be called from within lua via "simgrid.dump(table)". It will
- * then dump the table via XBT_DEBUG
+ * then dump the table via XBT_DEBUG
*/
static int dump(lua_State* L) {
int argc = lua_gettop(L);
if (lua_istable(L, i)) {
lua_pushnil(L); /* table nil */
- //lua_next pops the topmost element from the stack and
+ //lua_next pops the topmost element from the stack and
//gets the next pair from the table at the specified index
while (lua_next(L, i)) { /* table key val */
// we need to copy here, as a cast from "Number" to "String"
{"info", info},
{"critical", critical},
{"error", error},
- {NULL, NULL}
+ {nullptr, nullptr}
};
/* ********************************************************************************* */
/* ********************************************************************************* */
/**
- * \brief Makes the core functions available to the Lua world.
- * \param L a Lua world
+ * @brief Makes the core functions available to the Lua world.
+ * @param L a Lua world
*/
static void sglua_register_core_functions(lua_State *L)
{
}
/**
- * \brief Opens the simgrid Lua module.
+ * @brief Opens the simgrid Lua module.
*
* This function is called automatically by the Lua interpreter when some
* Lua code requires the "simgrid" module.
*
- * \param L the Lua state
+ * @param L the Lua state
*/
int luaopen_simgrid(lua_State *L)
{