Next: , Previous: slua_tbl_el, Up: Manipulating Tables


A.2.4 slua_tbl_el_s

get a string element from a table

Synopsis

     #include <luasup/luasup.h>
     
     
     
int slua_tbl_el_s( lua_Object table, const char *index, char **value );

Parameters

lua_Object table
the table containing the data
const char *index
the index of the element
char **value
the output value of the element

Description

retrieve the value of an element in a table. The value should be representable as a string, as a pointer to a dynamically allocated string is returned. The calling routine is responsible for deallocating the string.

Returns

It returns zero if all went well, `1' if the element didn't exist, and `-1' if it was unable to allocate enough memory for the string. If the element doesn't exist, *value is unchanged.

Author

Diab Jerius