** Register the random functions and initialize their state. */
| 640 | ** Register the random functions and initialize their state. |
| 641 | */ |
| 642 | static void setrandfunc (lua_State *L) { |
| 643 | RanState *state = (RanState *)lua_newuserdatauv(L, sizeof(RanState), 0); |
| 644 | randseed(L, state); /* initialize with a "random" seed */ |
| 645 | lua_pop(L, 2); /* remove pushed seeds */ |
| 646 | luaL_setfuncs(L, randfuncs, 1); |
| 647 | } |
| 648 | |
| 649 | /* }================================================================== */ |
| 650 |
no test coverage detected