Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename the plugins from the command line, and document it
[simgrid.git] / src / bindings / lua / lua_host.cpp
index c83873f..8f7cb86 100644 (file)
@@ -1,17 +1,13 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* SimGrid Lua bindings                                                     */
 
-#include "lua_private.h"
-#include <simgrid/host.h>
-#include <simgrid/s4u/host.hpp>
-extern "C" {
+#include "lua_private.hpp"
+#include "simgrid/s4u/Host.hpp"
 #include <lauxlib.h>
-}
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua_host, "Lua Host module");
 
@@ -36,7 +32,7 @@ sg_host_t sglua_check_host(lua_State * L, int index)
   if (pi == nullptr)
     XBT_ERROR("luaL_checkudata() returned nullptr");
   sg_host_t ht = *pi;
-  if (!ht)
+  if (not ht)
     luaL_error(L, "null Host");
   return ht;
 }
@@ -79,7 +75,7 @@ static int l_host_get_by_name(lua_State * L)
 static int l_host_get_name(lua_State * L)
 {
   sg_host_t ht = sglua_check_host(L, 1);
-  lua_pushstring(L, ht->cname());
+  lua_pushstring(L, ht->get_cname());
   return 1;
 }