Next: slua_tbl_el_si, Previous: slua_tbl_el, Up: Manipulating Tables
get a string element from a table
#include <luasup/luasup.h>int slua_tbl_el_s( lua_Object table, const char *index, char **value );
lua_Object table
- the table containing the data
const char *index
- the index of the element
char **value
- the output value of the element
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.
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.
Diab Jerius