add vclear
This commit is contained in:
parent
30f7f4475f
commit
277bc31225
2 changed files with 25 additions and 0 deletions
23
src/varray.c
23
src/varray.c
|
|
@ -64,3 +64,26 @@ int vput(var v, int idx, void* data)
|
|||
|
||||
return method(obj, idx, data);
|
||||
}
|
||||
|
||||
void vclear(var v)
|
||||
{
|
||||
meta_obj_t* obj = NULL;
|
||||
vclear_fn_t method = NULL;
|
||||
|
||||
obj = RTTI_DATA_TO_OBJ(v);
|
||||
if (RTTI_OBJ_INVALID(obj)) {
|
||||
errno = EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
RTTI_GET_METHOD(method, obj, varray, vclear);
|
||||
if (method == NULL) {
|
||||
errno = EINVAL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
method(obj);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue