** Register the random functions and initialize their state. */
| 657 | ** Register the random functions and initialize their state. |
| 658 | */ |
| 659 | static void setrandfunc (lua_State *L) { |
| 660 | RanState *state = (RanState *)lua_newuserdatauv(L, sizeof(RanState), 0); |
| 661 | randseed(L, state); /* initialize with a "random" seed */ |
| 662 | lua_pop(L, 2); /* remove pushed seeds */ |
| 663 | luaL_setfuncs(L, randfuncs, 1); |
| 664 | } |
| 665 | |
| 666 | /* }================================================================== */ |
| 667 |
no test coverage detected