| 786 | } |
| 787 | |
| 788 | static int Buffer_len(lua_State *L) |
| 789 | { |
| 790 | DM_LUA_STACK_CHECK(L, 1); |
| 791 | dmBuffer::HBuffer hbuffer = dmScript::CheckBufferUnpack(L, 1); |
| 792 | uint32_t count = 0; |
| 793 | dmBuffer::Result r = dmBuffer::GetCount(hbuffer, &count); |
| 794 | if (r != dmBuffer::RESULT_OK) { |
| 795 | return DM_LUA_ERROR("%s.%s could not get buffer length", SCRIPT_LIB_NAME, SCRIPT_TYPE_NAME_BUFFER); |
| 796 | } |
| 797 | |
| 798 | lua_pushnumber(L, count); |
| 799 | return 1; |
| 800 | } |
| 801 | |
| 802 | static const luaL_reg Buffer_methods[] = |
| 803 | { |
nothing calls this directly
no test coverage detected