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