From 1571781022499a9d0c32d249f89945d034d1cbff Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 11 Dec 2000 22:12:13 +0000 Subject: [PATCH] Fixed includes, defines and copyrights. --- charset/charconv.c | 5 +--- charset/debug.c | 4 +--- charset/setnames.c | 7 +++--- charset/strlen.c | 3 ++- charset/test.c | 6 ++--- charset/tocat.c | 3 ++- charset/tolower.c | 3 ++- charset/tosig.c | 3 ++- charset/toupper.c | 3 ++- charset/unaccent.c | 3 ++- charset/unicode.h | 3 +-- charset/utf8.c | 3 ++- lib/alloc.c | 7 +++--- lib/alloc_str.c | 7 +++--- lib/charmap.h | 2 +- lib/chartype.h | 2 +- lib/config.h | 4 ---- lib/ctmatch.c | 4 +--- lib/db-emul.c | 8 +++---- lib/db-rebuild.c | 4 ++-- lib/db-test.c | 2 +- lib/db.c | 14 ++++++------ lib/db.h | 2 +- lib/db_internal.h | 2 +- lib/fastbuf.c | 6 ++--- lib/fb-file.c | 8 +++---- lib/fb-mem.c | 6 ++--- lib/lfs.h | 5 +++- lib/lib.h | 57 ++++++++++++---------------------------------- lib/lists.c | 4 ++-- lib/lists.h | 2 +- lib/log.c | 6 ++--- lib/log.h | 2 +- lib/log2.c | 4 +--- lib/md5.c | 4 +++- lib/md5.h | 6 +---- lib/md5hex.c | 9 +++----- lib/mmap.c | 6 ++--- lib/pagecache.c | 10 ++++---- lib/pagecache.h | 2 +- lib/patimatch.c | 5 +--- lib/patmatch.c | 5 +--- lib/patmatch.h | 2 +- lib/pool.c | 7 +++--- lib/pools.h | 2 +- lib/prime.c | 9 ++++---- lib/random.c | 7 +++--- lib/realloc.c | 7 +++--- lib/regex.c | 6 ++--- lib/str_ctype.c | 2 +- lib/str_upper.c | 2 +- lib/temp.c | 6 ++--- lib/timer.c | 6 ++--- lib/url.c | 10 ++++---- lib/url.h | 2 +- lib/wildmatch.c | 6 ++--- lib/wordsplit.c | 4 +--- 57 files changed, 139 insertions(+), 190 deletions(-) diff --git a/charset/charconv.c b/charset/charconv.c index 7ef6c894..7cae7492 100644 --- a/charset/charconv.c +++ b/charset/charconv.c @@ -7,13 +7,10 @@ * of the GNU General Public License. */ +#include "lib/lib.h" #include "charset/charconv.h" #include "charset/chartable.h" -#ifndef NULL -#define NULL ((void *)0) -#endif - void conv_init(struct conv_context *c) { diff --git a/charset/debug.c b/charset/debug.c index f67ea8c7..738d1d41 100644 --- a/charset/debug.c +++ b/charset/debug.c @@ -1,11 +1,9 @@ /* * The UniCode Library -- Debugging Support Functions * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include - #include "lib/lib.h" #include "charset/unicode.h" diff --git a/charset/setnames.c b/charset/setnames.c index 67e0de75..e9665971 100644 --- a/charset/setnames.c +++ b/charset/setnames.c @@ -7,11 +7,10 @@ * of the GNU General Public License. */ -#include -#include - #include "lib/lib.h" -#include "charconv.h" +#include "charset/charconv.h" + +#include char *cs_names[] = { "US-ASCII", diff --git a/charset/strlen.c b/charset/strlen.c index b1f282b1..1aad35cc 100644 --- a/charset/strlen.c +++ b/charset/strlen.c @@ -1,9 +1,10 @@ /* * The UniCode Library -- String Length * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" uns diff --git a/charset/test.c b/charset/test.c index b5fcb58b..8b8e8d87 100644 --- a/charset/test.c +++ b/charset/test.c @@ -1,10 +1,10 @@ +#include "lib/lib.h" +#include "charset/unicode.h" + #include #include #include -#include "lib/lib.h" -#include "charset/unicode.h" - int main(void) { byte buf[256]; diff --git a/charset/tocat.c b/charset/tocat.c index c12c6226..d9e6915c 100644 --- a/charset/tocat.c +++ b/charset/tocat.c @@ -1,8 +1,9 @@ /* * The UniCode Library -- Category Table * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" #include "charset/U-cat.h" diff --git a/charset/tolower.c b/charset/tolower.c index 84271e5f..88389f8a 100644 --- a/charset/tolower.c +++ b/charset/tolower.c @@ -1,8 +1,9 @@ /* * The UniCode Library -- Lowercase Table * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" #include "charset/U-lower.h" diff --git a/charset/tosig.c b/charset/tosig.c index 0395eb97..3cece27d 100644 --- a/charset/tosig.c +++ b/charset/tosig.c @@ -1,8 +1,9 @@ /* * The UniCode Library -- Signaturing Table * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" #include "charset/U-sig.h" diff --git a/charset/toupper.c b/charset/toupper.c index 43210349..ffb113f6 100644 --- a/charset/toupper.c +++ b/charset/toupper.c @@ -1,8 +1,9 @@ /* * The UniCode Library -- Uppercase Table * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" #include "charset/U-upper.h" diff --git a/charset/unaccent.c b/charset/unaccent.c index 3ccdbe7f..c9172461 100644 --- a/charset/unaccent.c +++ b/charset/unaccent.c @@ -1,8 +1,9 @@ /* * The UniCode Library -- Unaccenting Table * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" #include "charset/U-unacc.h" diff --git a/charset/unicode.h b/charset/unicode.h index 36336c8e..61617c08 100644 --- a/charset/unicode.h +++ b/charset/unicode.h @@ -1,13 +1,12 @@ /* * The UniCode Library * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ #ifndef _UNICODE_H #define _UNICODE_H -#include "lib/config.h" #include "lib/chartype.h" extern byte *_U_cat[], *_U_sig[]; diff --git a/charset/utf8.c b/charset/utf8.c index 1258f736..5d9b3add 100644 --- a/charset/utf8.c +++ b/charset/utf8.c @@ -1,9 +1,10 @@ /* * The UniCode Library -- UTF-8 Functions * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" #include "charset/unicode.h" uns diff --git a/lib/alloc.c b/lib/alloc.c index 127e63ca..bec45d9b 100644 --- a/lib/alloc.c +++ b/lib/alloc.c @@ -1,14 +1,13 @@ /* * Sherlock Library -- Memory Allocation * - * (c) 1997 Martin Mares, + * (c) 2000 Martin Mares */ -#include -#include - #include "lib/lib.h" +#include + void * xmalloc(uns size) { diff --git a/lib/alloc_str.c b/lib/alloc_str.c index 0153887e..baf5f5ad 100644 --- a/lib/alloc_str.c +++ b/lib/alloc_str.c @@ -1,14 +1,13 @@ /* * Sherlock Library -- String Allocation * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include - #include "lib/lib.h" +#include + byte * stralloc(byte *s) { diff --git a/lib/charmap.h b/lib/charmap.h index 037fd60e..ab9eb6c7 100644 --- a/lib/charmap.h +++ b/lib/charmap.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Character Code Map (UTF-8 Version) * - * (c) 1998 Martin Mares, + * (c) 1998 Martin Mares */ /* Syntax: CHAR(code, uppercase, unaccented_version, accent_code, category) */ diff --git a/lib/chartype.h b/lib/chartype.h index 16118b9f..4111eb11 100644 --- a/lib/chartype.h +++ b/lib/chartype.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Character Types * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ #ifndef _SHERLOCK_CHARTYPE_H diff --git a/lib/config.h b/lib/config.h index 9b867f7b..68d688a8 100644 --- a/lib/config.h +++ b/lib/config.h @@ -13,13 +13,9 @@ /* Features */ -/* FIXME: Prune */ -#define SHERLOCK_CONFIG_REF_WEIGHTS /* Weighed references */ #define SHERLOCK_CONFIG_LARGE_DB /* Support for DB files >4GB */ #define SHERLOCK_CONFIG_LFS /* Large files on 32-bit systems */ #undef SHERLOCK_CONFIG_LFS_LIBC /* LFS supported directly by libc */ -#undef SHERLOCK_CONFIG_LONG_TAGS /* Section tags are 32-bit */ -#undef SHERLOCK_CONFIG_SPLIT_GATHERER /* Don't merge documents from different sections */ /* Types */ diff --git a/lib/ctmatch.c b/lib/ctmatch.c index 269ab83d..4c2687b9 100644 --- a/lib/ctmatch.c +++ b/lib/ctmatch.c @@ -1,11 +1,9 @@ /* * Sherlock Library -- Content-Type Pattern Matching * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include - #include "lib/lib.h" #include "lib/chartype.h" diff --git a/lib/db-emul.c b/lib/db-emul.c index f6cc65ca..a8d88743 100644 --- a/lib/db-emul.c +++ b/lib/db-emul.c @@ -1,16 +1,16 @@ /* * Sherlock Library -- SDBM emulator at top of GDBM * - * (c) 1999 Martin Mares + * (c) 1999 Martin Mares */ +#include "lib/lib.h" +#include "lib/db.h" + #include #include #include -#include "lib/lib.h" -#include "lib/db.h" - #include struct sdbm { diff --git a/lib/db-rebuild.c b/lib/db-rebuild.c index 3ab673fc..17493bc1 100644 --- a/lib/db-rebuild.c +++ b/lib/db-rebuild.c @@ -4,6 +4,8 @@ * (c) 2000 Martin Mares */ +#include "lib/db.c" + #include #include #include @@ -11,8 +13,6 @@ #include #include -#include "lib/db.c" - int main(int argc, char **argv) { diff --git a/lib/db-test.c b/lib/db-test.c index 99139eb3..dabbbaa7 100644 --- a/lib/db-test.c +++ b/lib/db-test.c @@ -1,7 +1,7 @@ /* * Sherlock Library -- Database Manager -- Tests and Benchmarks * - * (c) 1999 Martin Mares + * (c) 1999 Martin Mares */ #if 1 diff --git a/lib/db.c b/lib/db.c index c33ca6f5..84eaef18 100644 --- a/lib/db.c +++ b/lib/db.c @@ -1,7 +1,7 @@ /* * Sherlock Library -- Fast Database Management Routines * - * (c) 1999--2000 Martin Mares + * (c) 1999--2000 Martin Mares */ /* @@ -19,18 +19,18 @@ * and we assume it's sorted. */ -#include -#include -#include -#include -#include - #include "lib/lib.h" #include "lib/lfs.h" #include "lib/pagecache.h" #include "lib/db.h" #include "lib/db_internal.h" +#include +#include +#include +#include +#include + struct sdbm * sdbm_open(struct sdbm_options *o) { diff --git a/lib/db.h b/lib/db.h index cd24b908..6b409ef4 100644 --- a/lib/db.h +++ b/lib/db.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Fast Database Management Routines * - * (c) 1999 Martin Mares + * (c) 1999 Martin Mares */ #ifndef _SHERLOCK_DB_H diff --git a/lib/db_internal.h b/lib/db_internal.h index 7a72a83c..e54d7114 100644 --- a/lib/db_internal.h +++ b/lib/db_internal.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Fast Database Management Routines -- Internal Declarations * - * (c) 1999 Martin Mares + * (c) 1999 Martin Mares */ #define SDBM_NUM_FREE_PAGE_POOLS 32 diff --git a/lib/fastbuf.c b/lib/fastbuf.c index 42506f76..1be1b576 100644 --- a/lib/fastbuf.c +++ b/lib/fastbuf.c @@ -4,12 +4,12 @@ * (c) 1997--2000 Martin Mares */ -#include -#include - #include "lib/lib.h" #include "lib/fastbuf.h" +#include +#include + void bclose(struct fastbuf *f) { bflush(f); diff --git a/lib/fb-file.c b/lib/fb-file.c index 07b4ec5d..d89522ef 100644 --- a/lib/fb-file.c +++ b/lib/fb-file.c @@ -4,15 +4,15 @@ * (c) 1997--2000 Martin Mares */ +#include "lib/lib.h" +#include "lib/fastbuf.h" +#include "lib/lfs.h" + #include #include #include #include -#include "lib/lib.h" -#include "lib/fastbuf.h" -#include "lib/lfs.h" - static int bfd_refill(struct fastbuf *f) { diff --git a/lib/fb-mem.c b/lib/fb-mem.c index f582e2e3..e83e2ebc 100644 --- a/lib/fb-mem.c +++ b/lib/fb-mem.c @@ -4,12 +4,12 @@ * (c) 1997--2000 Martin Mares */ -#include -#include - #include "lib/lib.h" #include "lib/fastbuf.h" +#include +#include + struct memstream { unsigned blocksize; unsigned uc; diff --git a/lib/lfs.h b/lib/lfs.h index f12f5ef3..7a63597f 100644 --- a/lib/lfs.h +++ b/lib/lfs.h @@ -1,12 +1,15 @@ /* * Sherlock Library -- Large File Support * - * (c) 1999--2000 Martin Mares, + * (c) 1999--2000 Martin Mares */ #ifndef _SHERLOCK_LFS_H #define _SHERLOCK_LFS_H +#include +#include + #ifdef SHERLOCK_CONFIG_LFS #ifdef SHERLOCK_CONFIG_LFS_LIBC diff --git a/lib/lib.h b/lib/lib.h index 57e8ef82..2fb56d95 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -1,7 +1,13 @@ /* * Sherlock Library -- Miscellaneous Functions * - * (c) 1997 Martin Mares, + * (c) 1997--2000 Martin Mares + */ + +/* + * This file should be included as the very first include in all + * source files, especially before all OS includes since it sets + * up libc feature macros. */ #ifndef _SHERLOCK_LIB_H @@ -9,6 +15,14 @@ #include "lib/config.h" +/* Tell libc we're going to use all extensions available */ + +#define _GNU_SOURCE + +#ifndef NULL +#define NULL ((void *)0) +#endif + /* Ugly structure handling macros */ #define OFFSETOF(s, i) ((unsigned int)&((s *)0)->i) @@ -72,47 +86,6 @@ int match_ct_patt(byte *, byte *); int log2(u32); -/* obj.c */ - -/* FIXME: What to do with this? */ - -struct odes { /* Object description */ - struct oattr *attrs; - struct mempool *pool; -}; - -struct oattr { /* Object attribute */ - struct oattr *next, *same; - byte attr; - byte val[1]; -}; - -void obj_dump(struct odes *); -struct odes *obj_fload(FILE *, byte *); -struct odes *obj_new(void); -struct odes *obj_load(byte *); -void obj_fwrite(FILE *, struct odes *); -void obj_write(byte *, struct odes *); -void obj_free(struct odes *); -struct oattr *find_attr(struct odes *, uns); -struct oattr *find_attr_last(struct odes *, uns); -uns del_attr(struct odes *, struct oattr *); -byte *find_aval(struct odes *, uns); -struct oattr *set_attr(struct odes *, uns, byte *); -struct oattr *set_attr_num(struct odes *, uns, uns); -struct oattr *add_attr(struct odes *, struct oattr *, uns, byte *); -struct oattr *prepend_attr(struct odes *, uns, byte *); - -/* oname.c */ - -/* FIXME: Kill? */ - -#define OID_MIN 0x10000 /* Values less than this have special meaning */ - -oid_t new_oid(uns); -void mk_obj_name(byte *, oid_t, byte *); -int dump_obj_to_file(byte *, oid_t, struct odes *, int); - /* wordsplit.c */ int wordsplit(byte *, byte **, uns); diff --git a/lib/lists.c b/lib/lists.c index 9f783de9..eb9967b5 100644 --- a/lib/lists.c +++ b/lib/lists.c @@ -1,10 +1,10 @@ /* * Sherlock Library -- Linked Lists * - * (c) 1997--1999 Martin Mares + * (c) 1997--1999 Martin Mares */ -#include +#include "lib/lib.h" #define _SHERLOCK_LISTS_C #include "lib/lists.h" diff --git a/lib/lists.h b/lib/lists.h index 48b7de99..0c0ab0f6 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Linked Lists * - * (c) 1997--1999 Martin Mares + * (c) 1997--1999 Martin Mares */ #ifndef _SHERLOCK_LISTS_H diff --git a/lib/log.c b/lib/log.c index 994522dc..86f8607e 100644 --- a/lib/log.c +++ b/lib/log.c @@ -1,9 +1,11 @@ /* * Sherlock Library -- Logging * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" + #include #include #include @@ -11,8 +13,6 @@ #include #include -#include "lib/lib.h" - static byte *progname = "???"; static pid_t pid; diff --git a/lib/log.h b/lib/log.h index fdd0ace2..e33c77c7 100644 --- a/lib/log.h +++ b/lib/log.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Logging * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ #define L_DEBUG "<0>" diff --git a/lib/log2.c b/lib/log2.c index da6cf8ec..2d2764e9 100644 --- a/lib/log2.c +++ b/lib/log2.c @@ -1,11 +1,9 @@ /* * Sherlock Library -- Binary Logarithm * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include - #include "lib/lib.h" #undef log2 diff --git a/lib/md5.c b/lib/md5.c index 32d26020..8bccf004 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -15,9 +15,11 @@ * will fill a supplied 16-byte array with the digest. */ -#include /* for memcpy() */ +#include "lib/lib.h" #include "lib/md5.h" +#include /* for memcpy() */ + #ifndef HIGHFIRST #define byteReverse(buf, len) /* Nothing */ #else diff --git a/lib/md5.h b/lib/md5.h index 53a40c27..7be26a77 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -1,11 +1,7 @@ #ifndef MD5_H #define MD5_H -#ifdef __alpha -typedef unsigned int uint32; -#else -typedef unsigned long uint32; -#endif +typedef u32 uint32; struct MD5Context { uint32 buf[4]; diff --git a/lib/md5hex.c b/lib/md5hex.c index 2b8d2d88..08ce0e8a 100644 --- a/lib/md5hex.c +++ b/lib/md5hex.c @@ -1,17 +1,14 @@ /* * Sherlock Library -- MD5 Binary <-> Hex Conversions * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include -#include -#include - #include "lib/lib.h" #include "lib/chartype.h" +#include + void md5_to_hex(byte *s, byte *d) { diff --git a/lib/mmap.c b/lib/mmap.c index 46f5cd3a..62101f8d 100644 --- a/lib/mmap.c +++ b/lib/mmap.c @@ -1,17 +1,17 @@ /* * Sherlock Library -- Mapping of Files * - * (c) 1999 Martin Mares, + * (c) 1999 Martin Mares */ +#include "lib/lib.h" + #include #include #include #include #include -#include "lib/lib.h" - #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1L) #endif diff --git a/lib/pagecache.c b/lib/pagecache.c index 9420ab31..5acbca4b 100644 --- a/lib/pagecache.c +++ b/lib/pagecache.c @@ -1,19 +1,19 @@ /* * Sherlock Library -- File Page Cache * - * (c) 1999--2000 Martin Mares + * (c) 1999--2000 Martin Mares */ +#include "lib/lib.h" +#include "lib/pagecache.h" +#include "lib/lfs.h" + #include #include #include #include #include -#include "lib/lib.h" -#include "lib/pagecache.h" -#include "lib/lfs.h" - struct page_cache { list free_pages; /* LRU queue of free non-dirty pages */ list locked_pages; /* List of locked pages (starts with dirty ones) */ diff --git a/lib/pagecache.h b/lib/pagecache.h index 23ad46ac..698177f0 100644 --- a/lib/pagecache.h +++ b/lib/pagecache.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- File Page Cache * - * (c) 1999 Martin Mares + * (c) 1999 Martin Mares */ #ifndef _SHERLOCK_PAGECACHE_H diff --git a/lib/patimatch.c b/lib/patimatch.c index e799f694..40a61756 100644 --- a/lib/patimatch.c +++ b/lib/patimatch.c @@ -1,12 +1,9 @@ /* * Sherlock Library -- Shell-Like Case-Insensitive Pattern Matching (currently only '?' and '*') * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include - #include "lib/lib.h" #include "lib/chartype.h" diff --git a/lib/patmatch.c b/lib/patmatch.c index df73de57..837ae1a1 100644 --- a/lib/patmatch.c +++ b/lib/patmatch.c @@ -1,12 +1,9 @@ /* * Sherlock Library -- Shell-Like Pattern Matching (currently only '?' and '*') * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include - #include "lib/lib.h" #define Convert(x) (x) diff --git a/lib/patmatch.h b/lib/patmatch.h index 2aaef12b..b787427e 100644 --- a/lib/patmatch.h +++ b/lib/patmatch.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Generic Shell-Like Pattern Matching (currently only '?' and '*') * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ int diff --git a/lib/pool.c b/lib/pool.c index 623f0517..a7d6f5b0 100644 --- a/lib/pool.c +++ b/lib/pool.c @@ -1,15 +1,14 @@ /* * Sherlock Library -- Memory Pools (One-Time Allocation) * - * (c) 1997--1999 Martin Mares + * (c) 1997--1999 Martin Mares */ -#include -#include - #include "lib/lib.h" #include "lib/pools.h" +#include + struct memchunk { struct memchunk *next; byte data[0]; diff --git a/lib/pools.h b/lib/pools.h index 981dc3eb..95c8e17f 100644 --- a/lib/pools.h +++ b/lib/pools.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- Memory Pools * - * (c) 1997--1999 Martin Mares + * (c) 1997--1999 Martin Mares */ #ifndef POOL_ALIGN diff --git a/lib/prime.c b/lib/prime.c index 877442da..56bcc87e 100644 --- a/lib/prime.c +++ b/lib/prime.c @@ -1,12 +1,9 @@ /* * Sherlock Library -- Prime Number Tests * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include - #include "lib/lib.h" static int /* Sequential search */ @@ -61,7 +58,9 @@ nextprime(uns x) /* Returns some prime greater than X, usually the next one or } } -#ifdef PRIME_DEBUG +#ifdef TEST + +#include int main(int argc, char **argv) diff --git a/lib/random.c b/lib/random.c index 57516fd2..eb3e706a 100644 --- a/lib/random.c +++ b/lib/random.c @@ -1,14 +1,13 @@ /* * Sherlock Library -- Unbiased Range Correction for random() * - * (c) 1998 Martin Mares, + * (c) 1998 Martin Mares */ -#include -#include - #include "lib/lib.h" +#include + uns random_max(uns max) { diff --git a/lib/realloc.c b/lib/realloc.c index 3ee75aa8..6829c71f 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -1,14 +1,13 @@ /* * Sherlock Library -- Memory Re-allocation * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include -#include - #include "lib/lib.h" +#include + void * xrealloc(void *old, uns size) { diff --git a/lib/regex.c b/lib/regex.c index 2df8fd04..d321172a 100644 --- a/lib/regex.c +++ b/lib/regex.c @@ -1,16 +1,16 @@ /* * Sherlock Library -- Regular Expressions * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" + #include #include #include #include -#include "lib/lib.h" - #define INITIAL_MEM 1024 /* Initial space allocated for each pattern */ struct regex { diff --git a/lib/str_ctype.c b/lib/str_ctype.c index 45d7191d..0f715e94 100644 --- a/lib/str_ctype.c +++ b/lib/str_ctype.c @@ -1,7 +1,7 @@ /* * Sherlock Library -- Character Classes * - * (c) 1998 Martin Mares, + * (c) 1998 Martin Mares */ #include "lib/chartype.h" diff --git a/lib/str_upper.c b/lib/str_upper.c index fa99e366..627aa0b2 100644 --- a/lib/str_upper.c +++ b/lib/str_upper.c @@ -1,7 +1,7 @@ /* * Sherlock Library -- Uppercase Map * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ #include "lib/chartype.h" diff --git a/lib/temp.c b/lib/temp.c index 175977e9..600f317b 100644 --- a/lib/temp.c +++ b/lib/temp.c @@ -1,16 +1,16 @@ /* * Sherlock Library -- Temporary Files * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" + #include #include #include #include -#include "lib/lib.h" - u32 temprand(uns key) { diff --git a/lib/timer.c b/lib/timer.c index 80294518..7aacaf68 100644 --- a/lib/timer.c +++ b/lib/timer.c @@ -1,15 +1,15 @@ /* * Sherlock Library -- Execution Timing * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ +#include "lib/lib.h" + #include #include #include -#include "lib/lib.h" - static struct timeval last_tv; uns diff --git a/lib/url.c b/lib/url.c index e3f431ad..ac7fd8b7 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1,17 +1,17 @@ /* * Sherlock Library -- URL Functions (according to RFC 1738 and 1808) * - * (c) 1997--1999 Martin Mares, + * (c) 1997--1999 Martin Mares */ -#include -#include -#include - #include "lib/lib.h" #include "lib/url.h" #include "lib/chartype.h" +#include +#include +#include + /* Escaping and de-escaping */ static uns diff --git a/lib/url.h b/lib/url.h index 07363f2e..e36b46a6 100644 --- a/lib/url.h +++ b/lib/url.h @@ -1,7 +1,7 @@ /* * Sherlock Library -- URL Functions * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ #define MAX_URL_SIZE 1024 diff --git a/lib/wildmatch.c b/lib/wildmatch.c index 9bccae19..ba2592f3 100644 --- a/lib/wildmatch.c +++ b/lib/wildmatch.c @@ -6,13 +6,13 @@ * (c) 1999 Martin Mares */ -#include -#include - #include "lib/lib.h" #include "lib/pools.h" #include "lib/wildmatch.h" +#include +#include + #define MAX_STATES 32 /* Must be <= 32, state 0 is reserved, state 1 is initial */ #define MAX_CACHED 256 /* Maximum number of cached DFA states */ #define HASH_SIZE 512 /* Number of entries in DFA hash table (at least MAX_CACHED+MAX_STATES) */ diff --git a/lib/wordsplit.c b/lib/wordsplit.c index e79812d1..b07b4309 100644 --- a/lib/wordsplit.c +++ b/lib/wordsplit.c @@ -1,11 +1,9 @@ /* * Sherlock Library -- Word Splitting * - * (c) 1997 Martin Mares, + * (c) 1997 Martin Mares */ -#include - #include "lib/lib.h" #include "lib/chartype.h" -- 2.39.2