Update type-byte-buffer.md

This commit is contained in:
vegorov-rbx 2023-10-18 06:04:01 -07:00 committed by GitHub
parent c45e1d0181
commit 740aa8d730
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,6 +143,12 @@ If there is no buffer at the location, `NULL` is returned and `len` is not modif
Pushes new buffer of size `l` onto the stack.
`lua_isbuffer(L, n)`
C macro helper to check if value at the specified location is a buffer.
Simiar to `lua_istable`/`lua_isvector`/`lua_isthread` it's a simple wrapper over `lua_type` call and doesn't require internal coercions/internal field access like `lua_isnumber`/`lua_iscfunction`.
`void* luaL_checkbuffer(lua_State* L, int narg, size_t* len);`
Similar to `lua_tobuffer`, but throws a tag error if there is no buffer at specified location.