Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
b36e217d6e5c7fe839afda8951fdb6d752d88e20
[simgrid.git] / src / bindings / lua / lua_utils.h
1 /* Copyright (c) 2010. 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 #include <lua.h>
10
11 /**
12  * @brief A chunk of memory.
13  *
14  * TODO replace this by a dynar
15  */
16 typedef struct s_buffer {
17   char* data;
18   size_t size;
19   size_t capacity;
20 } s_buffer_t, *buffer_t;
21
22 const char* sglua_tostring(lua_State* L, int index);
23 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);
24 void sglua_stack_dump(const char *msg, lua_State* L);
25 const char* sglua_get_spaces(int length);
26 int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata);