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


1.6
date     91.04.28.09.15.47;  author cimarron;  state Exp;
branches ;
next     1.5;

1.5
date     90.08.17.08.50.52;  author cimarron;  state Exp;
branches ;
next     1.4;

1.4
date     89.09.05.17.06.49;  author mao;  state Version_2;
branches ;
next     1.3;

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

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

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


desc
@@


1.6
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@/*
 * imark.h --
 *	POSTGRES buffer manager item marking definitions.
 *
 * Explaination:
 *	There are three types of disk items which need to be
 *	manipulated.  The first type is disk item pointers.
 *	The second type is pointers to items on a disk block
 *	(buffer frame).  The third is pointers to copies of
 *	disk resident data (before or after transformations).
 *
 *	The first type of disk item is represented by the
 *	disk item pointer and an "unknown" buffer.
 *
 *	The second type of disk item is represented by the
 *	pointer and its associated pinned buffer.
 *
 *	The third type of disk item is represented by the
 *	pointer	and an "invalid" buffer.  This type of item
 *	is especially easy to manage because such an item
 *	remains valid even after a relation restructuring.
 *
 * XXX
 *	None of this is implemented, so I replaced the dummy functions
 *	with macros.  -cim 4/27/91
 *
 * Identification:
 *	$Header: RCS/imark.h,v 1.5 90/08/17 08:50:52 cimarron Exp Locker: cimarron $
 */

#ifndef	IMarkIncluded	/* Include this file only once. */
#define IMarkIncluded	1

#include "tmp/c.h"
#include "storage/buf.h"
#include "storage/itemptr.h"

typedef Pointer	ItemMark;

#define InvalidItemMark	NULL

/*
 * ItemMarkIsValid --
 *	True iff the item mark is valid.
 */
#define ItemMarkIsValid(mark) PointerIsValid(mark)

/*
 * ItemMarkIsForItemPointer --
 *	True iff the item mark is associated with a disk item pointer.
 *
 * Note:
 *	Does nothing at present. XXX
 */
#define ItemMarkIsForItemPointer(mark) \
    ((bool) AssertMacro(ItemMarkIsValid(mark)))

/*
 * ItemMarkIsForBufferPointer --
 *	True iff the item mark is associated with a buffer memory pointer.
 *
 * Note:
 *	Does nothing at present. XXX
 */
#define ItemMarkIsForBufferPointer(mark) \
    ((bool) AssertMacro(ItemMarkIsValid(mark)))

/*
 * ItemMarkIsForCopiedPointer --
 *	True iff the item mark is associated with a non-buffer memory pointer.
 *
 * Note:
 *	Does nothing at present. XXX
 */
#define ItemMarkIsForCopiedPointer(mark) \
    ((bool) AssertMacro(ItemMarkIsValid(mark)))

/*
 * ItemMarkGetItemPointer --
 *	Returns the item pointer associated with a disk item pointer item mark.
 *
 * Note:
 *	Assumes the item mark is for a disk item pointer.
 *	Presently just returns it's argument.  XXX
 */
#define ItemMarkGetItemPointer(mark) \
    ((ItemPointer) \
     AssertMacro(ItemMarkIsValid(mark)) ? \
     (ItemPointer) mark : (ItemPointer) NULL)

/*
 * ItemMarkGetBuffer --
 *	Returns the buffer associated with a buffer memory pointer item mark.
 *
 * Note:
 *	Assumes the item mark is for a buffer memory pointer.
 *	Does nothing at present.  XXX
 */
#define ItemMarkGetBuffer(mark) \
    ((Buffer) \
     AssertMacro(ItemMarkIsValid(mark)) ? (Buffer) 1 : (Buffer) 0)

/*
 * ItemMarkGetBufferPointer --
 *	Returns the pointer associated with a buffer memory pointer item mark.
 *
 * Note:
 *	Assumes the item mark is for a buffer memory pointer.
 *	Does nothing at present.  XXX
 */
#define ItemMarkGetBufferPointer(mark) \
    ((ItemPointer) \
     AssertMacro(ItemMarkIsValid(mark)) ? \
     (ItemPointer) mark : (ItemPointer) NULL)

/*
 * ItemMarkGetCopiedPointer --
 *	Returns the pointer associated with a non-buffer pointer item mark.
 *
 * Note:
 *	Assumes the item mark is for a non-buffer memory pointer.
 *	Does nothing at present.  XXX
 */
#define ItemMarkGetCopiedPointer(mark) \
    ((ItemPointer) \
     AssertMacro(ItemMarkIsValid(mark)) ? \
     (ItemPointer) mark : (ItemPointer) NULL)

/*
 * ItemMarkFree --
 *	Frees a item mark.
 *	Does nothing at present.  XXX
 */
#define ItemMarkFree(mark) \
    Assert(ItemMarkIsValid(mark))

/*
 * ItemPointerGetItemMark --
 *	Returns the item mark associated with a disk item pointer.
 *
 * Note:
 *	Assumes the disk item pointer is valid.
 *	Does nothing at present.  XXX
 */
#define ItemPointerGetItemMark(pointer) \
    ((ItemMark) \
     AssertMacro(ItemPointerIsValid(pointer)) ? \
     (ItemMark) pointer : (ItemMark) NULL)

/*
 * BufferGetItemMark --
 *	Returns the item mark associated with a buffer memory pointer.
 *
 * Note:
 *	Assumes the buffer is valid.
 *	Assumes the pointer is valid.
 *	Does nothing at present.  XXX
 */
#define BufferGetItemMark(buffer, pointer) \
    ((ItemMark) \
     (AssertMacro(BufferIsValid(buffer) && \
		  PointerIsValid(pointer)) ? \
      (ItemMark) pointer : (ItemMark) NULL))

/*
 * PointerGetItemMark --
 *	Returns the item mark associated with a non-buffer memory pointer.
 *
 * Note:
 *	Assumes the pointer is valid.
 *	Does nothing at present.  XXX
 */
#define PointerGetItemMark(pointer) \
    ((ItemMark) \
     (AssertMacro(PointerIsValid(pointer)) ? \
      (ItemMark) pointer : (ItemMark) NULL))

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


1.5
log
@added pathnames to #include statements
@
text
@d23 4
d28 1
a28 1
 *	$Header: RCS/imark.h,v 1.4 89/09/05 17:06:49 mao Version_2 Locker: cimarron $
d46 1
a46 5
extern
bool
ItemMarkIsValid ARGS ((
	ItemMark	mark
));
d53 1
a53 1
 *	Assumes the item mark is valid.
d55 2
a56 5
extern
bool
ItemMarkIsForItemPointer ARGS ((
	ItemMark	mark
));
d63 1
a63 1
 *	Assumes the item mark is valid.
d65 2
a66 5
extern
bool
ItemMarkIsForBufferPointer ARGS ((
	ItemMark	mark
));
d73 1
a73 1
 *	Assumes the item mark is valid.
d75 2
a76 5
extern
bool
ItemMarkIsForCopiedPointer ARGS ((
	ItemMark	mark
));
d84 1
d86 4
a89 5
extern
ItemPointer
ItemMarkGetItemPointer ARGS((
	ItemMark	mark
));
d97 1
d99 3
a101 5
extern
Buffer
ItemMarkGetBuffer ARGS((
	ItemMark	mark
));
d109 1
d111 4
a114 5
extern
Pointer
ItemMarkGetPointer ARGS((
	ItemMark	mark
));
d122 1
d124 4
a127 5
extern
Pointer
ItemMarkGetCopiedPointer ARGS((
	ItemMark	mark
));
d132 1
d134 2
a135 5
extern
void
ItemMarkFree ARGS((
	ItemMark	mark
));
d143 1
d145 4
a148 5
extern
ItemMark
ItemPointerGetItemMark ARGS((
	ItemPointer	pointer
));
d157 1
d159 5
a163 6
extern
ItemMark
BufferGetItemMark ARGS((
	Buffer	buffer,
	Pointer	pointer
));
d171 1
d173 4
a176 5
extern
ItemMark
PointerGetItemMark ARGS((
	Pointer	pointer
));
@


1.4
log
@Working version of C-only demo
@
text
@d24 1
a24 1
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/imark.h,v 1.3 89/04/12 19:54:24 dillon Exp $
d30 3
a32 6
#ifndef C_H
#include "c.h"
#endif

#include "buf.h"
#include "itemptr.h"
@


1.3
log
@c.h
@
text
@d24 1
a24 1
 *	$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/imark.h,v 1.2 89/03/22 17:33:05 muir Stab $
@


1.2
log
@copyright removal
@
text
@d24 1
a24 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/imark.h,v 1.1 89/01/17 05:54:11 cimarron Exp $
d30 1
d32 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.
; * 
; */



d24 1
a24 1
 *	$Header: imark.h,v 1.1 88/11/11 16:37:07 postgres Exp $
@
