X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isam%2Fphysical.c;h=48b04c5c49e92a9e2e28c2c2e69a7d14adbf17f2;hb=bad06dda453543b8dd716ee54e9b7cb2b015b6e5;hp=f10f23b9813070b582a31ec57dae2dbe60cc5d87;hpb=e127268c91736bf5a116cbc24653da4b845ca046;p=idzebra-moved-to-github.git diff --git a/isam/physical.c b/isam/physical.c index f10f23b..48b04c5 100644 --- a/isam/physical.c +++ b/isam/physical.c @@ -1,50 +1,26 @@ -/* - * Copyright (C) 1994, Index Data I/S - * All rights reserved. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: physical.c,v $ - * Revision 1.13 1996-10-29 13:56:57 adam - * Include of zebrautl.h instead of alexutil.h. - * - * Revision 1.12 1996/03/20 16:17:11 quinn - * Bug hunting - * - * Revision 1.11 1996/03/20 13:29:17 quinn - * Bug-fix - * - * Revision 1.10 1996/03/19 19:22:44 quinn - * Fixed update-bug - * - * Revision 1.9 1996/02/06 10:19:57 quinn - * Attempt at fixing bug. Not all blocks were read before they were unlinked - * prior to a remap operation. - * - * Revision 1.8 1996/01/29 09:47:11 quinn - * Fixed mean little bug in the read-table code. - * - * Revision 1.7 1995/12/06 14:48:27 quinn - * Fixed some strange bugs. - * - * Revision 1.6 1995/09/04 12:33:47 adam - * Various cleanup. YAZ util used instead. - * - * Revision 1.5 1994/09/28 11:29:33 quinn - * Added cmp parameter. - * - * Revision 1.4 1994/09/27 20:03:53 quinn - * Seems relatively bug-free. - * - * Revision 1.3 1994/09/26 17:11:31 quinn - * Trivial - * - * Revision 1.2 1994/09/26 17:06:36 quinn - * Back again... - * - * Revision 1.1 1994/09/26 16:07:57 quinn - * Most of the functionality in place. - * - */ +/* $Id: physical.c,v 1.18 2002-08-02 19:26:56 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 + Index Data Aps + +This file is part of the Zebra server. + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Zebra; see the file LICENSE.zebra. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +*/ + + /* * This module handles the representation of tables in the bfiles. @@ -52,8 +28,9 @@ #include #include +#include -#include +#include #include static int is_freestore_alloc(ISAM is, int type) @@ -261,7 +238,7 @@ void is_p_unmap(is_mtable *tab) static is_mbuf *mbuf_takehead(is_mbuf **mb, int *num, int keysize) { - is_mbuf *p = 0, **pp = &p, *new; + is_mbuf *p = 0, **pp = &p, *inew; int toget = *num; if (!toget) @@ -276,13 +253,13 @@ static is_mbuf *mbuf_takehead(is_mbuf **mb, int *num, int keysize) } if (toget > 0 && *mb) { - new = xmalloc_mbuf(IS_MBUF_TYPE_SMALL); - new->next = (*mb)->next; - (*mb)->next = new; - new->data = (*mb)->data; + inew = xmalloc_mbuf(IS_MBUF_TYPE_SMALL); + inew->next = (*mb)->next; + (*mb)->next = inew; + inew->data = (*mb)->data; (*mb)->refcount++; - new->offset = (*mb)->offset + toget * keysize; - new->num = (*mb)->num - toget; + inew->offset = (*mb)->offset + toget * keysize; + inew->num = (*mb)->num - toget; (*mb)->num = toget; *pp = *mb; *mb = (*mb)->next; @@ -300,7 +277,7 @@ static is_mbuf *mbuf_takehead(is_mbuf **mb, int *num, int keysize) */ void is_p_align(is_mtable *tab) { - is_mblock *mblock, *new, *last = 0, *next; + is_mblock *mblock, *inew, *last = 0, *next; is_mbuf *mbufs, *mbp; int blocks, recsblock; @@ -363,11 +340,11 @@ void is_p_align(is_mtable *tab) { if (mbufs) { - new = xmalloc_mblock(); - new->diskpos = -1; - new->state = IS_MBSTATE_DIRTY; - new->next = mblock->next; - mblock->next = new; + inew = xmalloc_mblock(); + inew->diskpos = -1; + inew->state = IS_MBSTATE_DIRTY; + inew->next = mblock->next; + mblock->next = inew; } mblock->data = mbp; mblock->num_records = recsblock;