summaryrefslogtreecommitdiff
path: root/src/librandom/autosurf.c
blob: 04a47c2d002cb88edd8ac947ed20c0de60122e5a (plain)
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 ;
  }
  surf(&ctx, s, n) ;
}