Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
blob: 7cb5f8d185ecdfe31817a89d90d65c56832ccc09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*-------------------------------------------------------------------------
 *
 * lselect.h--
 *    definitions for the replacement selection algorithm.
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
 * $Id: lselect.h,v 1.3 1996/11/04 11:51:19 scrappy Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef	LSELECT_H
#define	LSELECT_H

#include <stdio.h>
#include <access/htup.h>

struct	leftist {
    short	lt_dist; 	/* distance to leaf/empty node */
    short	lt_devnum; 	/* device number of tuple */
    HeapTuple	lt_tuple;
    struct	leftist	*lt_left;
    struct	leftist	*lt_right;
};

extern	struct	leftist	*Tuples;

extern struct leftist *lmerge(struct leftist *pt, struct leftist *qt);
extern HeapTuple gettuple(struct leftist **treep, short *devnum);
extern int puttuple(struct leftist **treep, HeapTuple newtuple, int devnum);
extern void dumptuples(FILE *file);
extern int tuplecmp(HeapTuple ltup, HeapTuple rtup);

#ifdef EBUG
extern void checktree(struct leftist *tree);
extern int checktreer(struct leftist *tree, int level);
#endif /* EBUG */

#endif 	/* LSELECT_H */