1 /* Copyright (c) 2010, 2012-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /* SimGrid Lua bindings */
12 #include "simgrid/msg.h"
13 #include "simgrid_lua.h"
17 void sglua_register_host_functions(lua_State* L);
18 msg_host_t sglua_check_host(lua_State* L, int index);
20 void sglua_register_platf_functions(lua_State* L);
22 const char* sglua_get_msg_error(msg_error_t err);
26 #define lua_ensure(...) \
27 _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
28 #define _lua_ensure_ARG1(cond) \
29 _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
30 #define _lua_ensure_ARGN(cond, ...) \
31 do { if (!(cond)) { luaL_error(L, __VA_ARGS__); return -1;} } while (0)
34 #endif /* LUA_PRIVATE_H */