head     1.10;
branch   ;
access   ;
symbols  Version_2_1:1.7 Version_2:1.6 C_Demo_1:1.4;
locks    ; strict;
comment  @ * @;


1.10
date     91.05.07.13.58.13;  author kemnitz;  state Exp;
branches ;
next     1.9;

1.9
date     91.05.01.02.50.23;  author cimarron;  state Exp;
branches ;
next     1.8;

1.8
date     91.04.28.09.15.22;  author cimarron;  state Exp;
branches ;
next     1.7;

1.7
date     90.08.17.08.53.24;  author cimarron;  state Exp;
branches ;
next     1.6;

1.6
date     89.09.25.11.25.48;  author cimarron;  state Version_2;
branches ;
next     1.5;

1.5
date     89.09.21.19.12.39;  author hirohama;  state Exp;
branches ;
next     1.4;

1.4
date     89.09.05.17.07.16;  author mao;  state C_Demo_1;
branches ;
next     1.3;

1.3
date     89.04.12.19.54.39;  author dillon;  state Exp;
branches ;
next     1.2;

1.2
date     89.03.22.17.33.21;  author muir;  state Stab;
branches ;
next     1.1;

1.1
date     89.01.17.05.54.19;  author cimarron;  state Exp;
branches ;
next     ;


desc
@@


1.10
log
@got rid of superfluous includes.
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	itemid.h
 *
 *   DESCRIPTION
 *	Standard POSTGRES buffer page item identifier definitions.
 *
 *   IDENTIFICATION
 *	$Header: RCS/itemid.h,v 1.9 91/05/01 02:50:23 cimarron Exp Locker: kemnitz $
 * ----------------------------------------------------------------
 */

#ifndef	ItemIdIncluded		/* Include this file only once */
#define ItemIdIncluded	1

#define ITEMID_H	"$Header: RCS/itemid.h,v 1.9 91/05/01 02:50:23 cimarron Exp Locker: kemnitz $"

typedef uint16	ItemOffset;
typedef uint16	ItemLength;

typedef bits16	ItemIdFlags;

typedef struct ItemIdData {		/* line pointers */
	unsigned	lp_off:13,	/* offset to find tup */
					/* can be reduced by 2 if necc. */
			lp_flags:6,	/* flags on tuple */
			lp_len:13;	/* length of tuple */
} ItemIdData;

typedef struct ItemIdData	*ItemId;

#ifndef	LP_USED
#define LP_USED		0x01	/* this line pointer is being used */
#define LP_IVALID	0x02	/* this tuple is known to be insert valid */
#define LP_DOCNT	0x04	/* this tuple continues on another page */
#define LP_CTUP		0x08	/* this is a continuation tuple */
#define LP_LOCK		0x10	/* this is a lock */
#define LP_ISINDEX	0x20	/* this is an internal index tuple */
#endif

/* ----------------
 *	support macros
 * ----------------
 */
/* 
 *	ItemIdGetLength
 */
#define ItemIdGetLength(itemId) \
   ((itemId)->lp_len)

/* 
 *	ItemIdGetOffset
 */
#define ItemIdGetOffset(itemId) \
   ((itemId)->lp_off)

/* 
 *	ItemIdGetFlags
 */
#define ItemIdGetFlags(itemId) \
   ((itemId)->lp_flags)

/*
 * ItemIdIsValid --
 *	True iff disk item identifier is valid.
 */
#define	ItemIdIsValid(itemId)	PointerIsValid(itemId)

/*
 * ItemIdIsUsed --
 *	True iff disk item identifier is in use.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
#define ItemIdIsUsed(itemId) \
    (AssertMacro(ItemIdIsValid(itemId)) ? \
     (bool) (((itemId)->lp_flags & LP_USED) != 0) : false)

/*
 * ItemIdIsContinuation --
 *	True iff disk item identifier is a continuation.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
#define ItemIdIsContinuation(itemId) \
    (AssertMacro(ItemIdIsValid(itemId)) ? \
     ((bool) (((itemId)->lp_flags & LP_CTUP) != 0)) : false)

/*
 * ItemIdIsContinuing --
 *	True iff disk item identifier continues.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
#define ItemIdIsContinuing(itemId) \
    (AssertMacro(ItemIdIsValid(itemId)) ? \
     ((bool) (((itemId)->lp_flags & LP_DOCNT) != 0)) : false)

/*
 * ItemIdIsLock --
 *	True iff disk item identifier is a lock.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
#define ItemIdIsLock(itemId) \
    (AssertMacro(ItemIdIsValid(itemId)) ? \
     ((bool) (((itemId)->lp_flags & LP_LOCK) != 0)) : false)

/*
 * ItemIdIsInternal --
 *	True iff disk item identifier is an internal index tuple.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
#define ItemIdIsInternal(itemId) \
    (AssertMacro(ItemIdIsValid(itemId)) ? \
     ((bool) (((itemId)->lp_flags & LP_ISINDEX) != 0)) : false)


#endif	/* !defined(ItemIdIncluded) */
@


1.9
log
@round II of converting simple functions to macros + code cleaning in general
@
text
@d9 1
a9 1
 *	$Header$
d16 1
a16 3
#define ITEMID_H	"$Header: RCS/itemid.h,v 1.8 91/04/28 09:15:22 cimarron Exp Locker: cimarron $"

#include "tmp/c.h"
@


1.8
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@d1 5
a5 2
/*
 * itemid.h --
d7 4
d16 1
a16 4
/*
 * Identification:
 */
#define ITEMID_H	"$Header: RCS/itemid.h,v 1.7 90/08/17 08:53:24 cimarron Exp Locker: cimarron $"
d43 5
a47 1
/* 
a49 1

a55 1

a61 1

a70 5
/* ----------------------------------------------------------------
 *	entern declarations
 * ----------------------------------------------------------------
 */

d78 3
a80 5
extern
bool
ItemIdIsUsed ARGS((
	ItemId	itemId;
));
a81 1
#if 0
d83 2
a84 2
 * ItemIdIsInsertValid --
 *	True iff disk item identifier is inserted validly.
d89 3
a91 6
extern
bool
ItemIdIsInsertValid ARGS((
	ItemId	itemId;
));
#endif
d100 3
a102 5
extern
bool
ItemIdIsContinuing ARGS((
	ItemId	itemId;
));
a104 13
 * ItemIdIsContinuation --
 *	True iff disk item identifier is a continuation.
 *
 * Note:
 *	Assumes disk item identifier is valid.
 */
extern
bool
ItemIdIsContinuation ARGS((
	ItemId	itemId;
));

/*
d111 3
a113 5
extern
bool
ItemIdIsLock ARGS((
	ItemId	itemId;
));
d122 4
a125 5
extern
bool
ItemIdIsInternal ARGS((
	ItemId	itemId;
));
@


1.7
log
@added pathnames to #include statements
@
text
@d12 1
a12 1
#define ITEMID_H	"$Header: RCS/itemid.h,v 1.6 89/09/25 11:25:48 cimarron Version_2 Locker: cimarron $"
d39 1
a39 1
/* ----------------------------------------------------------------
a40 1
 * ----------------------------------------------------------------
d46 1
a46 1
/* ----------------------------------------------------------------
a47 1
 * ----------------------------------------------------------------
d53 2
a54 3
/* ----------------------------------------------------------------
 *	ItemIdGetLength
 * ----------------------------------------------------------------
d60 6
a71 10
 * ItemIdIsValid --
 *	True iff disk item identifier is valid.
 */
extern
bool
ItemIdIsValid ARGS((
	ItemId	itemId;
));

/*
d84 1
d97 1
@


1.6
log
@moved dynamic symbol stuff to syms.h
@
text
@d12 1
a12 1
#define ITEMID_H	"$Header: RCS/itemid.h,v 1.5 89/09/21 19:12:39 hirohama Exp $"
d14 1
a14 3
#ifndef C_H
#include "c.h"
#endif
@


1.5
log
@added ...SYMBOLS declarations
miscellaneous cleanup
@
text
@d12 1
a12 1
#define ITEMID_H	"$Header: RCS/itemid.h,v 1.4 89/09/05 17:07:16 mao C_Demo_1 Locker: hirohama $"
a156 8

#define ITEMID_SYMBOLS \
	SymbolDecl(ItemIdIsValid, "_ItemIdIsValid"), \
	SymbolDecl(ItemIdIsUsed, "_ItemIdIsUsed"), \
	SymbolDecl(ItemIdIsContinuing, "_ItemIdIsContinuing"), \
	SymbolDecl(ItemIdIsContinuation, "_ItemIdIsContinuation"), \
	SymbolDecl(ItemIdIsLock, "_ItemIdIsLock"), \
	SymbolDecl(ItemIdIsInternal, "_ItemIdIsInternal")
@


1.4
log
@Working version of C-only demo
@
text
@a3 3
 *
 * Identification:
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/itemid.h,v 1.3 89/04/12 19:54:39 dillon Exp $
d6 1
a6 1
#ifndef	ItemIdIncluded	/* Include this file only once. */
d9 5
d157 8
@


1.3
log
@c.h
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/itemid.h,v 1.2 89/03/22 17:33:21 muir Stab $
@


1.2
log
@copyright removal
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/itemid.h,v 1.1 89/01/17 05:54:19 cimarron Exp $
d12 1
d14 1
@


1.1
log
@Initial revision
@
text
@a0 27

; /*
; * 
; * POSTGRES Data Base Management System
; * 
; * Copyright (c) 1988 Regents of the University of California
; * 
; * Permission to use, copy, modify, and distribute this software and its
; * documentation for educational, research, and non-profit purposes and
; * without fee is hereby granted, provided that the above copyright
; * notice appear in all copies and that both that copyright notice and
; * this permission notice appear in supporting documentation, and that
; * the name of the University of California not be used in advertising
; * or publicity pertaining to distribution of the software without
; * specific, written prior permission.  Permission to incorporate this
; * software into commercial products can be obtained from the Campus
; * Software Office, 295 Evans Hall, University of California, Berkeley,
; * Ca., 94720 provided only that the the requestor give the University
; * of California a free licence to any derived software for educational
; * and research purposes.  The University of California makes no
; * representations about the suitability of this software for any
; * purpose.  It is provided "as is" without express or implied warranty.
; * 
; */



d6 1
a6 1
 *	$Header: itemid.h,v 1.1 88/11/11 16:37:10 postgres Exp $
@
