]> git.saurik.com Git - apple/libc.git/blobdiff - db/recno/rec_delete.c
Libc-320.tar.gz
[apple/libc.git] / db / recno / rec_delete.c
index 416aa8395ee57a4d4031618ca4faec40380947a0..38c0f9637cd3c5c922f3d9da5211fce3187af983 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -22,8 +22,8 @@
  * 
  * @APPLE_LICENSE_HEADER_END@
  */
-/*
- * Copyright (c) 1990, 1993
+/*-
+ * Copyright (c) 1990, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * SUCH DAMAGE.
  */
 
+#if defined(LIBC_SCCS) && !defined(lint)
+static char sccsid[] = "@(#)rec_delete.c       8.7 (Berkeley) 7/14/94";
+#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
 
 #include <sys/types.h>
 
@@ -68,7 +72,7 @@
 #include <db.h>
 #include "recno.h"
 
-static int rec_rdelete __P((BTREE *, recno_t));
+static int rec_rdelete(BTREE *, recno_t);
 
 /*
  * __REC_DELETE -- Delete the item(s) referenced by a key.
@@ -109,13 +113,13 @@ __rec_delete(dbp, key, flags)
                status = rec_rdelete(t, nrec);
                break;
        case R_CURSOR:
-               if (!ISSET(t, B_SEQINIT))
+               if (!F_ISSET(&t->bt_cursor, CURS_INIT))
                        goto einval;
                if (t->bt_nrecs == 0)
                        return (RET_SPECIAL);
-               status = rec_rdelete(t, t->bt_rcursor - 1);
+               status = rec_rdelete(t, t->bt_cursor.rcursor - 1);
                if (status == RET_SUCCESS)
-                       --t->bt_rcursor;
+                       --t->bt_cursor.rcursor;
                break;
        default:
 einval:                errno = EINVAL;
@@ -123,7 +127,7 @@ einval:             errno = EINVAL;
        }
 
        if (status == RET_SUCCESS)
-               SET(t, B_MODIFIED | R_MODIFIED);
+               F_SET(t, B_MODIFIED | R_MODIFIED);
        return (status);
 }
 
@@ -175,11 +179,11 @@ int
 __rec_dleaf(t, h, index)
        BTREE *t;
        PAGE *h;
-       indx_t index;
+       u_int32_t index;
 {
-       register RLEAF *rl;
-       register indx_t *ip, cnt, offset;
-       register size_t nbytes;
+       RLEAF *rl;
+       indx_t *ip, cnt, offset;
+       u_int32_t nbytes;
        char *from;
        void *to;