/* -*- mode: C; c-basic-offset: 4 -*- */ #ident "Copyright (c) 2007 Tokutek Inc. All rights reserved." #include static int is_prime (int n) { int i; if (n==2) return 1; if (n%2==0) return 0; for (i=3; i*i<=n; i+=2) { if (n%i==0) return 0; } return 1; } #define N_PRIMES 30 static unsigned int primes[N_PRIMES]={0}; int toku_get_prime (unsigned int idx) { if (primes[0]==0) { int i; for (i=0; i