1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* ISC license. */ #include <skalibs/random.h> #include <skalibs/surf.h> void autosurf (char *s, size_t n) { static SURFSchedule ctx = SURFSCHEDULE_ZERO ; static int need4seed = 1 ; if (need4seed) { char tmp[160] ; random_makeseed(tmp) ; surf_init(&ctx, tmp) ; need4seed = 0 ; } return surf(&ctx, s, n) ; }