Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge tag 'v3_9_90' into hypervisor
[simgrid.git] / src / bindings / lua / lua_utils.h
1 /* Copyright (c) 2010-2011. 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 #include <lua.h>
13
14 /**
15  * @brief A chunk of memory.
16  *
17  * This structure is used as the userdata parameter of lua_Writer.
18  */
19 typedef struct s_sglua_buffer {
20   char* data;
21   size_t size;
22   size_t capacity;
23 } s_sglua_buffer_t, *sglua_buffer_t;
24
25 const char* sglua_tostring(lua_State* L, int index);
26 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
27 void sglua_stack_dump(const char *msg, lua_State* L);
28 void* sglua_checkudata_debug(lua_State* L, int ud, const char* tname);
29 const char* sglua_get_spaces(int length);
30 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);
31
32 #endif  /* LUA_UTILS_H */