Added the possibility to obtain buffers (copied from buffers)

This commit is contained in:
Pierre Pronchery 2013-01-08 02:43:27 +01:00
parent fd788fc9df
commit 67b23de717

View File

@ -338,6 +338,7 @@ int variable_get_as(Variable * variable, VariableType type, void * result)
uint16_t u16;
int32_t i32;
uint32_t u32;
Buffer ** b;
switch(type)
{
@ -504,6 +505,13 @@ int variable_get_as(Variable * variable, VariableType type, void * result)
}
break;
case VT_BUFFER:
if(variable->type == VT_BUFFER)
{
b = result;
*b = buffer_new_copy(variable->u.buffer);
return 0;
}
break;
case VT_STRING:
/* FIXME implement */
break;