Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove useless parameters in header generation
[simgrid.git] / src / bindings / lua / lua_private.h
1 /* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 /* SimGrid Lua bindings                                                     */
7
8 #ifndef LUA_PRIVATE_H
9 #define LUA_PRIVATE_H
10
11 #include "simgrid/msg.h"
12 #include "simgrid_lua.h"
13
14 extern "C" {
15
16 void sglua_register_host_functions(lua_State* L);
17 msg_host_t sglua_check_host(lua_State* L, int index);
18
19 void sglua_register_platf_functions(lua_State* L);
20
21 const char* sglua_get_msg_error(msg_error_t err);
22
23 }
24
25 #define lua_ensure(...) \
26   _XBT_IF_ONE_ARG(_lua_ensure_ARG1, _lua_ensure_ARGN, __VA_ARGS__)(__VA_ARGS__)
27 #define _lua_ensure_ARG1(cond) \
28   _lua_ensure_ARGN(cond, "Assertion %s failed", #cond)
29 #define _lua_ensure_ARGN(cond, ...) \
30   do { if (!(cond)) { luaL_error(L, __VA_ARGS__); return -1;} } while (0)
31
32 #endif