*
*
* IDENTIFICATION
- * $Id: nbtsort.c,v 1.9 1997/02/12 05:04:20 scrappy Exp $
+ * $Id: nbtsort.c,v 1.10 1997/02/14 22:47:19 momjian Exp $
*
* NOTES
*
BTSpool *btspool = (BTSpool *) spool;
BTTapeBlock *itape;
Size itemsz;
- int i;
itape = btspool->bts_itape[btspool->bts_tape];
itemsz = BTITEMSZ(btitem);
*/
_bt_isortcmpinit(index);
qsort((void *) parray, itape->bttb_ntup, sizeof(BTSortKey),
- _bt_isortcmp);
+ (int (*)(const void *,const void *))_bt_isortcmp);
}
/*
}
}
-typedef struct BTPageState {
- Buffer btps_buf;
- Page btps_page;
- BTItem btps_lastbti;
- OffsetNumber btps_lastoff;
- OffsetNumber btps_firstoff;
- int btps_level;
- bool btps_doupper;
- struct BTPageState *btps_next;
-} BTPageState;
-
/*
* allocate and initialize a new BTPageState. the returned structure
* is suitable for immediate use by _bt_buildadd.
BTPageState *state = (BTPageState *) pstate;
Buffer nbuf;
Page npage;
- char *pos;
BTItem last_bti;
OffsetNumber first_off;
OffsetNumber last_off;
int nruns;
Size btisz;
bool doleaf = false;
- BTPageState *s;
- BTPageOpaque *opaque;
/*
* initialize state needed for the merge into the btree leaf pages.
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nbtree.h,v 1.6 1997/02/12 05:04:28 scrappy Exp $
+ * $Id: nbtree.h,v 1.7 1997/02/14 22:47:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
typedef BTStackData *BTStack;
+typedef struct BTPageState {
+ Buffer btps_buf;
+ Page btps_page;
+ BTItem btps_lastbti;
+ OffsetNumber btps_lastoff;
+ OffsetNumber btps_firstoff;
+ int btps_level;
+ bool btps_doupper;
+ struct BTPageState *btps_next;
+} BTPageState;
+
/*
* We need to be able to tell the difference between read and write
* requests for pages, in order to do locking correctly.
*/
extern void _bt_regscan(IndexScanDesc scan);
extern void _bt_dropscan(IndexScanDesc scan);
-extern void _bt_adjscans(Relation rel, ItemPointer tid, int op);
+extern void _bt_adjscans(Relation rel, ItemPointer tid);
+extern void _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
+extern bool _bt_scantouched(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno);
/*
* prototypes for functions in nbtsearch.c
* prototypes for functions in nbtsort.c
*/
extern void *_bt_spoolinit(Relation index, int ntapes);
+extern void *_bt_pagestate(Relation index, int flags, int level, bool doupper);
+extern BTItem _bt_minitem(Page opage, BlockNumber oblkno, int atend);
+extern BTItem _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags);
+extern void _bt_uppershutdown(Relation index, BTPageState *state);
extern void _bt_spooldestroy(void *spool);
extern void _bt_spool(Relation index, BTItem btitem, void *spool);
extern void _bt_upperbuild(Relation index);