X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fprime.h;h=eff04d01f1360b0354c531c4434822c75d590b65;hb=9689a6aa2bb0815ab95ea679d0d298acc4c5cd5b;hp=87d13f92ed4fe285ae3925a411bd90b0e609b83c;hpb=a4fe009d3366b0a3e119713b0ecc7fc0070efdfa;p=libucw.git diff --git a/ucw/prime.h b/ucw/prime.h index 87d13f92..eff04d01 100644 --- a/ucw/prime.h +++ b/ucw/prime.h @@ -17,7 +17,14 @@ #ifndef _UCW_PRIME_H #define _UCW_PRIME_H -#include "ucw/lib.h" +#include + +#ifdef CONFIG_UCW_CLEAN_ABI +#define isprime ucw_isprime +#define next_table_prime ucw_next_table_prime +#define nextprime ucw_nextprime +#define prev_table_prime ucw_prev_table_prime +#endif /* prime.c */ @@ -25,14 +32,14 @@ * Return a non-zero value iff @x is a prime number. * The time complexity is `O(sqrt(x))`. **/ -int isprime(uns x); +int isprime(uint x); /** * Return some prime greater than @x. The function does not checks overflows, but it should * be safe at least for @x lower than `1U << 31`. * If the Cramer's conjecture is true, it should have complexity `O(sqrt(x) * log(x)^2)`. **/ -uns nextprime(uns x); +uint nextprime(uint x); /* primetable.c */ @@ -41,12 +48,12 @@ uns nextprime(uns x); * Returns zero if there is no such prime (we guarantee the existance of at * least one prime greater than `1U << 31` in the table). **/ -uns next_table_prime(uns x); +uint next_table_prime(uint x); /** * Quickly lookup a precomputed table to return a prime number smaller than @x. * Returns zero if @x is smaller than `7`. **/ -uns prev_table_prime(uns x); +uint prev_table_prime(uint x); #endif // _UCW_PRIME_H