1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-30 07:03:40 +00:00

Added GetBuffer helper

This commit is contained in:
Bryan Roe
2019-01-11 12:22:57 -08:00
parent 70daead65e
commit 24d97b3b34
2 changed files with 12 additions and 1 deletions

View File

@@ -97,6 +97,17 @@ void *Duktape_GetHeapptrProperty(duk_context *ctx, duk_idx_t i, char* propertyNa
}
return retVal;
}
void *Duktape_GetBufferProperty(duk_context *ctx, duk_idx_t i, char* propertyName)
{
void *retVal = NULL;
if (duk_has_prop_string(ctx, i, propertyName))
{
duk_get_prop_string(ctx, i, propertyName); // [prop]
retVal = (void*)Duktape_GetBuffer(ctx, -1, NULL);
duk_pop(ctx); // ...
}
return(retVal);
}
void *Duktape_GetPointerProperty(duk_context *ctx, duk_idx_t i, char* propertyName)
{
void *retVal = NULL;