Loading...
db/recno/rec_seq.c Libc-262.3.2 Libc-320
--- Libc/Libc-262.3.2/db/recno/rec_seq.c
+++ Libc/Libc-320/db/recno/rec_seq.c
@@ -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) 1991, 1993
+/*-
+ * Copyright (c) 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 
-
+#include <sys/cdefs.h>
 #include <sys/types.h>
 
 #include <errno.h>
@@ -103,8 +103,8 @@
 			goto einval;
 		break;
 	case R_NEXT:
-		if (ISSET(t, B_SEQINIT)) {
-			nrec = t->bt_rcursor + 1;
+		if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
+			nrec = t->bt_cursor.rcursor + 1;
 			break;
 		}
 		/* FALLTHROUGH */
@@ -112,14 +112,14 @@
 		nrec = 1;
 		break;
 	case R_PREV:
-		if (ISSET(t, B_SEQINIT)) {
-			if ((nrec = t->bt_rcursor - 1) == 0)
+		if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
+			if ((nrec = t->bt_cursor.rcursor - 1) == 0)
 				return (RET_SPECIAL);
 			break;
 		}
 		/* FALLTHROUGH */
 	case R_LAST:
-		if (!ISSET(t, R_EOF | R_INMEM) &&
+		if (!F_ISSET(t, R_EOF | R_INMEM) &&
 		    t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
 			return (RET_ERROR);
 		nrec = t->bt_nrecs;
@@ -130,7 +130,7 @@
 	}
 	
 	if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) {
-		if (!ISSET(t, R_EOF | R_INMEM) &&
+		if (!F_ISSET(t, R_EOF | R_INMEM) &&
 		    (status = t->bt_irec(t, nrec)) != RET_SUCCESS)
 			return (status);
 		if (t->bt_nrecs == 0 || nrec > t->bt_nrecs)
@@ -140,11 +140,11 @@
 	if ((e = __rec_search(t, nrec - 1, SEARCH)) == NULL)
 		return (RET_ERROR);
 
-	SET(t, B_SEQINIT);
-	t->bt_rcursor = nrec;
+	F_SET(&t->bt_cursor, CURS_INIT);
+	t->bt_cursor.rcursor = nrec;
 
 	status = __rec_ret(t, e, nrec, key, data);
-	if (ISSET(t, B_DB_LOCK))
+	if (F_ISSET(t, B_DB_LOCK))
 		mpool_put(t->bt_mp, e->page, 0);
 	else
 		t->bt_pinned = e->page;