Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move parts of the kernel to the right subdir
[simgrid.git] / src / bindings / lua / lua_utils.h
1 /* Copyright (c) 2010-2011, 2013-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 /* SimGrid Lua helper functions                                             */
8
9 #ifndef LUA_UTILS_H
10 #define LUA_UTILS_H
11
12 extern "C" {
13
14 #include <lua.h>
15
16 /**
17  * @brief A chunk of memory.
18  *
19  * This structure is used as the userdata parameter of lua_Writer.
20  */
21 typedef struct s_sglua_buffer {
22   char* data;
23   size_t size;
24   size_t capacity;
25 } s_sglua_buffer_t, *sglua_buffer_t;
26
27 const char* sglua_tostring(lua_State* L, int index);
28 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
29 void sglua_stack_dump(lua_State* L, const char *msg);
30 static int sglua_dump_table(lua_State* L);
31 void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
32 const char* sglua_get_spaces(int length);
33 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
34
35 }
36
37 #endif  /* LUA_UTILS_H */