| 290 | } |
| 291 | |
| 292 | dmhash_t CheckHashOrString(lua_State* L, int index) |
| 293 | { |
| 294 | dmhash_t* phash = ToHash(L, index); |
| 295 | if (phash != 0) |
| 296 | { |
| 297 | return *phash; |
| 298 | } |
| 299 | else if( lua_type(L, index) == LUA_TSTRING ) |
| 300 | { |
| 301 | size_t len = 0; |
| 302 | const char* s = lua_tolstring(L, index, &len); |
| 303 | return dmHashBuffer64(s, len); |
| 304 | } |
| 305 | |
| 306 | luaL_typerror(L, index, "hash or string expected"); |
| 307 | return 0; |
| 308 | } |
| 309 | |
| 310 | const char* GetStringFromHashOrString(lua_State* L, int index, char* buffer, uint32_t bufferlength) |
| 311 | { |
no test coverage detected