hashfunc.h hashtable.h \
heap.h binheap.h binheap-node.h \
redblack.h \
- binsearch.h \
+ binsearch.h prime.h \
bitops.h \
conf.h getopt.h ipaccess.h \
profile.h \
#include "ucw/hashfunc.h"
#endif
+#include "ucw/prime.h"
+
#include <string.h>
/* Initial setup of parameters */
void *xmalloc_zero(uns) LIKE_MALLOC;
char *xstrdup(const char *) LIKE_MALLOC;
-/* prime.c */
-
-int isprime(uns x);
-uns nextprime(uns x);
-
-/* primetable.c */
-
-uns next_table_prime(uns x);
-uns prev_table_prime(uns x);
-
/* timer.c */
timestamp_t get_timestamp(void);
*/
#include "ucw/lib.h"
+#include "ucw/prime.h"
static int /* Sequential search */
__isprime(uns x) /* We know x != 2 && x != 3 */
--- /dev/null
+/*
+ * The UCW Library -- Prime numbers
+ *
+ * (c) 2008 Michal Vaner <vorner@ucw.cz>
+ *
+ * Code taken from ucw/lib.h by:
+ *
+ * (c) 1997--2008 Martin Mares <mj@ucw.cz>
+ * (c) 2005 Tomas Valla <tom@ucw.cz>
+ * (c) 2006 Robert Spalek <robert@ucw.cz>
+ * (c) 2007 Pavel Charvat <pchar@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
+ */
+
+#ifndef _UCW_PRIME_H
+#define _UCW_PRIME_H
+
+#include "ucw/lib.h"
+
+/* prime.c */
+
+int isprime(uns x);
+uns nextprime(uns x);
+
+/* primetable.c */
+
+uns next_table_prime(uns x);
+uns prev_table_prime(uns x);
+
+#endif // _UCW_PRIME_H
*/
#include "ucw/lib.h"
+#include "ucw/prime.h"
#include "ucw/binsearch.h"
/* A table of odd primes, each is about 1.2 times the previous one */
#include "ucw/hashfunc.h"
#include "ucw/md5.h"
#include "ucw/string.h"
+#include "ucw/prime.h"
#include <stdlib.h>
#include <stdio.h>
#include "ucw/url.h"
#include "ucw/chartype.h"
#include "ucw/conf.h"
+#include "ucw/prime.h"
#include <string.h>
#include <stdlib.h>