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