diff --git a/btree/bt_close.c b/btree/bt_close.c index 27f9ab6..1b78405 100644 --- a/btree/bt_close.c +++ b/btree/bt_close.c @@ -61,8 +61,7 @@ static int bt_meta __P((BTREE *)); * RET_ERROR, RET_SUCCESS */ int -__bt_close(dbp) - DB *dbp; +__bt_close(DB *dbp) { BTREE *t; int fd; @@ -116,9 +115,7 @@ __bt_close(dbp) * RET_SUCCESS, RET_ERROR. */ int -__bt_sync(dbp, flags) - const DB *dbp; - u_int flags; +__bt_sync(const DB *dbp, u_int flags) { BTREE *t; int status; @@ -159,8 +156,7 @@ __bt_sync(dbp, flags) * RET_ERROR, RET_SUCCESS */ static int -bt_meta(t) - BTREE *t; +bt_meta(BTREE *t) { BTMETA m; void *p; diff --git a/btree/bt_conv.c b/btree/bt_conv.c index 1cb208b..a36505c 100644 --- a/btree/bt_conv.c +++ b/btree/bt_conv.c @@ -58,10 +58,7 @@ static void mswap __P((PAGE *)); * h: page to convert */ void -__bt_pgin(t, pg, pp) - void *t; - pgno_t pg; - void *pp; +__bt_pgin(void *t, pgno_t pg, void *pp) { PAGE *h; indx_t i, top; @@ -126,10 +123,7 @@ __bt_pgin(t, pg, pp) } void -__bt_pgout(t, pg, pp) - void *t; - pgno_t pg; - void *pp; +__bt_pgout(void *t, pgno_t pg, void * pp) { PAGE *h; indx_t i, top; @@ -200,8 +194,7 @@ __bt_pgout(t, pg, pp) * p: page to convert */ static void -mswap(pg) - PAGE *pg; +mswap(PAGE *pg) { char *p; diff --git a/btree/bt_debug.c b/btree/bt_debug.c index 3aefbe7..c8c303a 100644 --- a/btree/bt_debug.c +++ b/btree/bt_debug.c @@ -55,8 +55,7 @@ static char sccsid[] = "@(#)bt_debug.c 8.5 (Berkeley) 8/17/94"; * dbp: pointer to the DB */ void -__bt_dump(dbp) - DB *dbp; +__bt_dump(DB *dbp) { BTREE *t; PAGE *h; @@ -99,8 +98,7 @@ __bt_dump(dbp) * h: pointer to the PAGE */ void -__bt_dmpage(h) - PAGE *h; +__bt_dmpage(PAGE *h) { BTMETA *m; char *sep; @@ -133,9 +131,7 @@ __bt_dmpage(h) * n: page number to dump. */ void -__bt_dnpage(dbp, pgno) - DB *dbp; - pgno_t pgno; +__bt_dnpage(DB *dbp, pgno_t pgno) { BTREE *t; PAGE *h; @@ -154,8 +150,7 @@ __bt_dnpage(dbp, pgno) * h: pointer to the PAGE */ void -__bt_dpage(h) - PAGE *h; +__bt_dpage(PAGE *h) { BINTERNAL *bi; BLEAF *bl; @@ -250,8 +245,7 @@ __bt_dpage(h) * dbp: pointer to the DB */ void -__bt_stat(dbp) - DB *dbp; +__bt_stat(DB *dbp) { extern u_long bt_cache_hit, bt_cache_miss, bt_pfxsaved, bt_rootsplit; extern u_long bt_sortsplit, bt_split; diff --git a/btree/bt_delete.c b/btree/bt_delete.c index 667bff5..fcb0f78 100644 --- a/btree/bt_delete.c +++ b/btree/bt_delete.c @@ -60,10 +60,7 @@ static int __bt_stkacq __P((BTREE *, PAGE **, CURSOR *)); * Return RET_SPECIAL if the key is not found. */ int -__bt_delete(dbp, key, flags) - const DB *dbp; - const DBT *key; - u_int flags; +__bt_delete(const DB *dbp, const DBT *key, u_int flags) { BTREE *t; CURSOR *c; @@ -141,10 +138,7 @@ __bt_delete(dbp, key, flags) * 0 on success, 1 on failure */ static int -__bt_stkacq(t, hp, c) - BTREE *t; - PAGE **hp; - CURSOR *c; +__bt_stkacq(BTREE *t, PAGE **hp, CURSOR *c) { BINTERNAL *bi; EPG *e; @@ -288,9 +282,7 @@ ret: mpool_put(t->bt_mp, h, 0); * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. */ static int -__bt_bdelete(t, key) - BTREE *t; - const DBT *key; +__bt_bdelete(BTREE *t, const DBT *key) { EPG *e; PAGE *h; @@ -375,9 +367,7 @@ loop: if ((e = __bt_search(t, key, &exact)) == NULL) * mpool_put's the page */ static int -__bt_pdelete(t, h) - BTREE *t; - PAGE *h; +__bt_pdelete(BTREE *t, PAGE *h) { BINTERNAL *bi; PAGE *pg; @@ -471,11 +461,7 @@ __bt_pdelete(t, h) * RET_SUCCESS, RET_ERROR. */ int -__bt_dleaf(t, key, h, index) - BTREE *t; - const DBT *key; - PAGE *h; - u_int index; +__bt_dleaf(BTREE *t, const DBT *key, PAGE *h, u_int index) { BLEAF *bl; indx_t cnt, *ip, offset; @@ -536,11 +522,7 @@ __bt_dleaf(t, key, h, index) * RET_SUCCESS, RET_ERROR. */ static int -__bt_curdel(t, key, h, index) - BTREE *t; - const DBT *key; - PAGE *h; - u_int index; +__bt_curdel(BTREE *t, const DBT *key, PAGE *h, u_int index) { CURSOR *c; EPG e; @@ -635,9 +617,7 @@ dup2: c->pg.pgno = e.page->pgno; * h: page to be deleted */ static int -__bt_relink(t, h) - BTREE *t; - PAGE *h; +__bt_relink(BTREE *t, PAGE *h) { PAGE *pg; diff --git a/btree/bt_get.c b/btree/bt_get.c index 74824c7..2628fa8 100644 --- a/btree/bt_get.c +++ b/btree/bt_get.c @@ -60,11 +60,7 @@ static char sccsid[] = "@(#)bt_get.c 8.6 (Berkeley) 7/20/94"; * RET_ERROR, RET_SUCCESS and RET_SPECIAL if the key not found. */ int -__bt_get(dbp, key, data, flags) - const DB *dbp; - const DBT *key; - DBT *data; - u_int flags; +__bt_get(const DB *dbp, const DBT *key, DBT *data, u_int flags) { BTREE *t; EPG *e; diff --git a/btree/bt_open.c b/btree/bt_open.c index cdcb760..4a5e96e 100644 --- a/btree/bt_open.c +++ b/btree/bt_open.c @@ -87,10 +87,7 @@ static int tmp __P((void)); * */ DB * -__bt_open(fname, flags, mode, openinfo, dflags) - const char *fname; - int flags, mode, dflags; - const BTREEINFO *openinfo; +__bt_open(virt_fd_t file, const FILEVTABLE *vtable, const BTREEINFO *openinfo, int dflags) { struct stat sb; BTMETA m; @@ -350,8 +347,7 @@ err: if (t) { * RET_ERROR, RET_SUCCESS */ static int -nroot(t) - BTREE *t; +nroot(BTREE *t) { PAGE *meta, *root; pgno_t npg; @@ -422,8 +418,7 @@ byteorder() } int -__bt_fd(dbp) - const DB *dbp; +__bt_fd(const DB *dbp) { BTREE *t; diff --git a/btree/bt_overflow.c b/btree/bt_overflow.c index b1bd343..5b0129f 100644 --- a/btree/bt_overflow.c +++ b/btree/bt_overflow.c @@ -77,12 +77,7 @@ static char sccsid[] = "@(#)bt_overflow.c 8.5 (Berkeley) 7/16/94"; * RET_ERROR, RET_SUCCESS */ int -__ovfl_get(t, p, ssz, buf, bufsz) - BTREE *t; - void *p; - size_t *ssz; - void **buf; - size_t *bufsz; +__ovfl_get(BTREE *t, void *p, size_t *ssz, void **buf, size_t *bufsz) { PAGE *h; pgno_t pg; @@ -136,10 +131,7 @@ __ovfl_get(t, p, ssz, buf, bufsz) * RET_ERROR, RET_SUCCESS */ int -__ovfl_put(t, dbt, pg) - BTREE *t; - const DBT *dbt; - pgno_t *pg; +__ovfl_put(BTREE *t, const DBT *dbt, pgno_t *pg) { PAGE *h, *last; void *p; @@ -190,9 +182,7 @@ __ovfl_put(t, dbt, pg) * RET_ERROR, RET_SUCCESS */ int -__ovfl_delete(t, p) - BTREE *t; - void *p; +__ovfl_delete(BTREE *t, void *p) { PAGE *h; pgno_t pg; diff --git a/btree/bt_page.c b/btree/bt_page.c index ce9cbf1..fa230ec 100644 --- a/btree/bt_page.c +++ b/btree/bt_page.c @@ -57,9 +57,7 @@ static char sccsid[] = "@(#)bt_page.c 8.3 (Berkeley) 7/14/94"; * mpool_put's the page. */ int -__bt_free(t, h) - BTREE *t; - PAGE *h; +__bt_free(BTREE *t, PAGE *h) { /* Insert the page at the head of the free list. */ h->prevpg = P_INVALID; @@ -83,9 +81,7 @@ __bt_free(t, h) * Pointer to a page, NULL on error. */ PAGE * -__bt_new(t, npg) - BTREE *t; - pgno_t *npg; +__bt_new(BTREE *t, pgno_t *npg) { PAGE *h; diff --git a/btree/bt_put.c b/btree/bt_put.c index 4f3bd1f..fd77775 100644 --- a/btree/bt_put.c +++ b/btree/bt_put.c @@ -64,11 +64,7 @@ static EPG *bt_fast __P((BTREE *, const DBT *, const DBT *, int *)); * tree and R_NOOVERWRITE specified. */ int -__bt_put(dbp, key, data, flags) - const DB *dbp; - DBT *key; - const DBT *data; - u_int flags; +__bt_put(const DB *dbp, DBT *key, const DBT *data, u_int flags) { BTREE *t; DBT tkey, tdata; @@ -264,10 +260,7 @@ u_long bt_cache_hit, bt_cache_miss; * EPG for new record or NULL if not found. */ static EPG * -bt_fast(t, key, data, exactp) - BTREE *t; - const DBT *key, *data; - int *exactp; +bt_fast(BTREE *t, const DBT *key, const DBT *data, int *exactp) { PAGE *h; u_int32_t nbytes; diff --git a/btree/bt_search.c b/btree/bt_search.c index 485afcb..0924d6e 100644 --- a/btree/bt_search.c +++ b/btree/bt_search.c @@ -63,10 +63,7 @@ static int __bt_sprev __P((BTREE *, PAGE *, const DBT *, int *)); * the bt_cur field of the tree. A pointer to the field is returned. */ EPG * -__bt_search(t, key, exactp) - BTREE *t; - const DBT *key; - int *exactp; +__bt_search(BTREE *t, const DBT *key, int *exactp) { PAGE *h; indx_t base, index, lim; @@ -148,11 +145,7 @@ next: BT_PUSH(t, h->pgno, index); * If an exact match found. */ static int -__bt_snext(t, h, key, exactp) - BTREE *t; - PAGE *h; - const DBT *key; - int *exactp; +__bt_snext(BTREE *t, PAGE *h, const DBT *key, int *exactp) { EPG e; @@ -187,11 +180,7 @@ __bt_snext(t, h, key, exactp) * If an exact match found. */ static int -__bt_sprev(t, h, key, exactp) - BTREE *t; - PAGE *h; - const DBT *key; - int *exactp; +__bt_sprev(BTREE *t, PAGE *h, const DBT *key, int *exactp) { EPG e; diff --git a/btree/bt_seq.c b/btree/bt_seq.c index d5a700d..4d3ddf1 100644 --- a/btree/bt_seq.c +++ b/btree/bt_seq.c @@ -74,10 +74,7 @@ static int __bt_seqset __P((BTREE *, EPG *, DBT *, int)); * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ int -__bt_seq(dbp, key, data, flags) - const DB *dbp; - DBT *key, *data; - u_int flags; +__bt_seq(const DB *dbp, DBT *key, DBT *data, u_int flags) { BTREE *t; EPG e; @@ -149,11 +146,7 @@ __bt_seq(dbp, key, data, flags) * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ static int -__bt_seqset(t, ep, key, flags) - BTREE *t; - EPG *ep; - DBT *key; - int flags; +__bt_seqset(BTREE *t, EPG *ep, DBT *key, int flags) { PAGE *h; pgno_t pg; @@ -237,10 +230,7 @@ __bt_seqset(t, ep, key, flags) * RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key. */ static int -__bt_seqadv(t, ep, flags) - BTREE *t; - EPG *ep; - int flags; +__bt_seqadv(BTREE *t, EPG *ep, int flags) { CURSOR *c; PAGE *h; @@ -339,11 +329,7 @@ usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE); * or RET_SPECIAL if no such key exists. */ static int -__bt_first(t, key, erval, exactp) - BTREE *t; - const DBT *key; - EPG *erval; - int *exactp; +__bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp) { PAGE *h; EPG *ep, save; @@ -364,7 +350,7 @@ __bt_first(t, key, erval, exactp) *erval = *ep; return (RET_SUCCESS); } - + /* * Walk backwards, as long as the entry matches and there are * keys left in the tree. Save a copy of each match in case @@ -440,10 +426,7 @@ __bt_first(t, key, erval, exactp) * index: page index */ void -__bt_setcur(t, pgno, index) - BTREE *t; - pgno_t pgno; - u_int index; +__bt_setcur(BTREE *t, pgno_t pgno, u_int index) { /* Lose any already deleted key. */ if (t->bt_cursor.key.data != NULL) { diff --git a/btree/bt_split.c b/btree/bt_split.c index e743178..a50f5ea 100644 --- a/btree/bt_split.c +++ b/btree/bt_split.c @@ -79,13 +79,7 @@ u_long bt_rootsplit, bt_split, bt_sortsplit, bt_pfxsaved; * RET_ERROR, RET_SUCCESS */ int -__bt_split(t, sp, key, data, flags, ilen, argskip) - BTREE *t; - PAGE *sp; - const DBT *key, *data; - int flags; - size_t ilen; - u_int32_t argskip; +__bt_split(BTREE *t, PAGE *sp, const DBT *key, const DBT *data, int flags, size_t ilen, u_int32_t argskip) { BINTERNAL *bi = NULL; BLEAF *bl = NULL, *tbl; @@ -344,11 +338,7 @@ err2: mpool_put(t->bt_mp, l, 0); * Pointer to page in which to insert or NULL on error. */ static PAGE * -bt_page(t, h, lp, rp, skip, ilen) - BTREE *t; - PAGE *h, **lp, **rp; - indx_t *skip; - size_t ilen; +bt_page(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) { PAGE *l, *r, *tp; pgno_t npg; @@ -449,11 +439,7 @@ bt_page(t, h, lp, rp, skip, ilen) * Pointer to page in which to insert or NULL on error. */ static PAGE * -bt_root(t, h, lp, rp, skip, ilen) - BTREE *t; - PAGE *h, **lp, **rp; - indx_t *skip; - size_t ilen; +bt_root(BTREE *t, PAGE *h, PAGE **lp, PAGE **rp, indx_t *skip, size_t ilen) { PAGE *l, *r, *tp; pgno_t lnpg, rnpg; @@ -496,9 +482,7 @@ bt_root(t, h, lp, rp, skip, ilen) * RET_ERROR, RET_SUCCESS */ static int -bt_rroot(t, h, l, r) - BTREE *t; - PAGE *h, *l, *r; +bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) { char *dest; @@ -536,9 +520,7 @@ bt_rroot(t, h, l, r) * RET_ERROR, RET_SUCCESS */ static int -bt_broot(t, h, l, r) - BTREE *t; - PAGE *h, *l, *r; +bt_broot(BTREE *t, PAGE *h, PAGE *l, PAGE *r) { BINTERNAL *bi; BLEAF *bl; @@ -616,11 +598,7 @@ bt_broot(t, h, l, r) * Pointer to page in which to insert. */ static PAGE * -bt_psplit(t, h, l, r, pskip, ilen) - BTREE *t; - PAGE *h, *l, *r; - indx_t *pskip; - size_t ilen; +bt_psplit(BTREE *t, PAGE *h, PAGE *l, PAGE *r, indx_t *pskip, size_t ilen) { BINTERNAL *bi; BLEAF *bl; @@ -794,9 +772,7 @@ bt_psplit(t, h, l, r, pskip, ilen) * RET_SUCCESS, RET_ERROR. */ static int -bt_preserve(t, pg) - BTREE *t; - pgno_t pg; +bt_preserve(BTREE *t, pgno_t pg) { PAGE *h; @@ -822,8 +798,7 @@ bt_preserve(t, pg) * all the way back to bt_split/bt_rroot and it's not very clean. */ static recno_t -rec_total(h) - PAGE *h; +rec_total(PAGE *h) { recno_t recs; indx_t nxt, top; diff --git a/btree/bt_utils.c b/btree/bt_utils.c index 9c1438e..f312c3c 100644 --- a/btree/bt_utils.c +++ b/btree/bt_utils.c @@ -64,11 +64,7 @@ static char sccsid[] = "@(#)bt_utils.c 8.8 (Berkeley) 7/20/94"; * RET_SUCCESS, RET_ERROR. */ int -__bt_ret(t, e, key, rkey, data, rdata, copy) - BTREE *t; - EPG *e; - DBT *key, *rkey, *data, *rdata; - int copy; +__bt_ret(BTREE *t, EPG *e, DBT *key, DBT *rkey, DBT *data, DBT *rdata, int copy) { BLEAF *bl; void *p; @@ -150,10 +146,7 @@ __bt_ret(t, e, key, rkey, data, rdata, copy) * > 0 if k1 is > record */ int -__bt_cmp(t, k1, e) - BTREE *t; - const DBT *k1; - EPG *e; +__bt_cmp(BTREE *t, const DBT *k1, EPG *e) { BINTERNAL *bi; BLEAF *bl; @@ -213,8 +206,7 @@ __bt_cmp(t, k1, e) * > 0 if a is > b */ int -__bt_defcmp(a, b) - const DBT *a, *b; +__bt_defcmp(const DBT *a, const DBT *b) { register size_t len; register u_char *p1, *p2; @@ -243,8 +235,7 @@ __bt_defcmp(a, b) * Number of bytes needed to distinguish b from a. */ size_t -__bt_defpfx(a, b) - const DBT *a, *b; +__bt_defpfx(const DBT *a, const DBT *b) { register u_char *p1, *p2; register size_t cnt, len; diff --git a/mpool/mpool.c b/mpool/mpool.c index a61041e..2327bb2 100644 --- a/mpool/mpool.c +++ b/mpool/mpool.c @@ -59,10 +59,7 @@ static int mpool_write __P((MPOOL *, BKT *)); * Initialize a memory pool. */ MPOOL * -mpool_open(key, fd, pagesize, maxcache) - void *key; - int fd; - pgno_t pagesize, maxcache; +mpool_open(void *key, virt_fd_t fd, const FILEVTABLE * fvtable, pgno_t pagesize, pgno_t maxcache) { struct stat sb; MPOOL *mp; @@ -99,25 +96,20 @@ mpool_open(key, fd, pagesize, maxcache) * Initialize input/output filters. */ void -mpool_filter(mp, pgin, pgout, pgcookie) - MPOOL *mp; - void (*pgin) __P((void *, pgno_t, void *)); - void (*pgout) __P((void *, pgno_t, void *)); - void *pgcookie; +mpool_filter(MPOOL *mp, void (*pgin) __P((void *, pgno_t, void *)), + void (*pgout) __P((void *, pgno_t, void *)), void *pgcookie) { mp->pgin = pgin; mp->pgout = pgout; mp->pgcookie = pgcookie; } - + /* * mpool_new -- * Get a new page of memory. */ void * -mpool_new(mp, pgnoaddr) - MPOOL *mp; - pgno_t *pgnoaddr; +mpool_new(MPOOL *mp, pgno_t *pgnoaddr) { struct _hqh *head; BKT *bp; @@ -150,10 +142,7 @@ mpool_new(mp, pgnoaddr) * Get a page. */ void * -mpool_get(mp, pgno, flags) - MPOOL *mp; - pgno_t pgno; - u_int flags; /* XXX not used? */ +mpool_get(MPOOL *mp, pgno_t pgno, u_int flags) /* XXX not used? */ { struct _hqh *head; BKT *bp; @@ -235,10 +224,7 @@ mpool_get(mp, pgno, flags) * Return a page. */ int -mpool_put(mp, page, flags) - MPOOL *mp; - void *page; - u_int flags; +mpool_put(MPOOL *mp, void *page, u_int flags) { BKT *bp; @@ -263,8 +249,7 @@ mpool_put(mp, page, flags) * Close the buffer pool. */ int -mpool_close(mp) - MPOOL *mp; +mpool_close(MPOOL *mp) { BKT *bp; @@ -284,8 +269,7 @@ mpool_close(mp) * Sync the pool to disk. */ int -mpool_sync(mp) - MPOOL *mp; +mpool_sync(MPOOL *mp) { BKT *bp; @@ -305,8 +289,7 @@ mpool_sync(mp) * Get a page from the cache (or create one). */ static BKT * -mpool_bkt(mp) - MPOOL *mp; +mpool_bkt(MPOOL *mp) { struct _hqh *head; BKT *bp; @@ -363,9 +346,7 @@ new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL) * Write a page to disk. */ static int -mpool_write(mp, bp) - MPOOL *mp; - BKT *bp; +mpool_write(MPOOL *mp, BKT *bp) { off_t off; @@ -392,9 +373,7 @@ mpool_write(mp, bp) * Lookup a page in the cache. */ static BKT * -mpool_look(mp, pgno) - MPOOL *mp; - pgno_t pgno; +mpool_look(MPOOL *mp, pgno_t pgno) { struct _hqh *head; BKT *bp; @@ -419,8 +398,7 @@ mpool_look(mp, pgno) * Print out cache statistics. */ void -mpool_stat(mp) - MPOOL *mp; +mpool_stat(MPOOL *mp) { BKT *bp; int cnt;