Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename s_buffer_t to s_sglua_buffer_t
authorChristophe Thiéry <christopho128@gmail.com>
Thu, 29 Sep 2011 12:16:58 +0000 (14:16 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Thu, 29 Sep 2011 12:16:58 +0000 (14:16 +0200)
src/bindings/lua/lua_utils.c
src/bindings/lua/lua_utils.h

index 55721bc..50b37ee 100644 (file)
@@ -140,7 +140,6 @@ void sglua_stack_dump(const char* msg, lua_State* L)
  *
  * This function is a valid lua_Writer that writes into a memory buffer passed
  * as userdata.
- * TODO: use a dynar as userdata
  *
  * @param L a lua state
  * @param source some data
@@ -150,7 +149,7 @@ void sglua_stack_dump(const char* msg, lua_State* L)
 int sglua_memory_writer(lua_State* L, const void* source, size_t size,
     void* userdata) {
 
-  buffer_t buffer = (buffer_t) userdata;
+  sglua_buffer_t buffer = (sglua_buffer_t) userdata;
   while (buffer->capacity < buffer->size + size) {
     buffer->capacity *= 2;
     buffer->data = xbt_realloc(buffer->data, buffer->capacity);
index b36e217..49f8e4d 100644 (file)
 /**
  * @brief A chunk of memory.
  *
- * TODO replace this by a dynar
+ * This structure is used as the userdata parameter of lua_Writer.
  */
-typedef struct s_buffer {
+typedef struct s_sglua_buffer {
   char* data;
   size_t size;
   size_t capacity;
-} s_buffer_t, *buffer_t;
+} s_sglua_buffer_t, *sglua_buffer_t;
 
 const char* sglua_tostring(lua_State* L, int index);
 const char* sglua_keyvalue_tostring(lua_State* L, int key_index, int value_index);