head	1.8;
access;
symbols
	release_4_2:1.8
	aix_ok:1.8
	Version_2_1:1.7
	Version_2:1.6
	C_Demo_1:1.4;
locks; strict;
comment	@ * @;


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

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

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

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

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

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

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

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


desc
@@


1.8
log
@round II of converting simple functions to macros + code cleaning in general
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	off.h
 *
 *   DESCRIPTION
 *	POSTGRES disk "offset" definitions.
 *
 *   IDENTIFICATION
 *	$Header$
 * ----------------------------------------------------------------
 */

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

#define OFF_H	"$Header: RCS/off.h,v 1.7 90/08/17 08:53:29 cimarron Exp Locker: cimarron $"

#include "tmp/c.h"
#include "machine.h"	/* (in port dir.) for BLCKSZ */
#include "storage/itemid.h"

typedef uint16		OffsetNumber;	/* offset number */
typedef uint16		OffsetIndex;	/* offset index */
typedef int16		OffsetIdData;	/* internal offset identifier */
typedef OffsetIdData	*OffsetId;	/* offset identifier */

#define InvalidOffsetNumber	0
#define FirstOffsetIndex	0

/* ----------------
 *	support macros
 * ----------------
 */
/*
 * OffsetNumberIsValid --
 *	True iff the offset number is valid.
 */
#define OffsetNumberIsValid(offsetNumber) \
    ((bool) \
     ((offsetNumber != 0) && (offsetNumber < BLCKSZ / sizeof(ItemIdData))))

/*
 * OffsetIdIsValid --
 *	True iff the offset identifier is valid.
 */
#define OffsetIdIsValid(offsetId) \
    ((bool) (PointerIsValid(offsetId) && (*(offsetId) != 0)))

/*
 * OffsetIdSet --
 *	Sets a offset identifier to the specified value.
 */
#define OffsetIdSet(offsetId, offsetNumber) \
    ((*offsetId) = (offsetNumber))

/*
 * OffsetIdGetOffsetNumber --
 *	Retrieve the offset number from a offset identifier.
 */
#define OffsetIdGetOffsetNumber(offsetId) \
    ((OffsetNumber) (*(offsetId)))

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


1.7
log
@added pathnames to #include statements
@
text
@d1 5
a5 2
/*
 * off.h --
d7 4
d16 1
a16 4
/*
 * Identification:
 */
#define OFF_H	"$Header: RCS/off.h,v 1.6 89/09/25 11:25:33 cimarron Version_2 Locker: cimarron $"
d19 2
d22 2
a23 3
typedef uint16	OffsetNumber;	/* offset number */
typedef uint16	OffsetIndex;	/* offset index */

d30 4
d38 3
a40 5
extern
bool
OffsetNumberIsValid ARGS((
	OffsetNumber	offsetNumber
));
d46 2
a47 5
extern
bool
OffsetIdIsValid ARGS((
	OffsetId	offsetId
));
d53 2
a54 6
extern
void
OffsetIdSet ARGS((
	OffsetId	offsetId,
	OffsetNumber	offsetNumber
));
d60 2
a61 5
extern
OffsetNumber
OffsetIdGetOffsetNumber ARGS((
	OffsetId	offsetId
));
@


1.6
log
@moved dynamic symbol stuff to syms.h
@
text
@d12 1
a12 1
#define OFF_H	"$Header: RCS/off.h,v 1.5 89/09/21 19:12:45 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 OFF_H	"$Header: RCS/off.h,v 1.4 89/09/05 17:08:57 mao C_Demo_1 Locker: hirohama $"
a66 6

#define OFF_SYMBOLS \
	SymbolDecl(OffsetNumberIsValid, "_OffsetNumberIsValid"), \
	SymbolDecl(OffsetIdIsValid, "_OffsetIdIsValid"), \
	SymbolDecl(OffsetIdSet, "_OffsetIdSet"), \
	SymbolDecl(OffsetIdGetOffsetNumber, "_OffsetIdGetOffsetNumber")
@


1.4
log
@Working version of C-only demo
@
text
@a3 3
 *
 * Identification:
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/off.h,v 1.3 89/04/12 19:55:17 dillon Exp $
d6 1
a6 1
#ifndef	OffIncluded	/* Include this file only once. */
d9 5
a27 10
 * OffsetIndexIsValid --
 *	True iff the offset index is valid.
 */
extern
bool
OffsetIndexIsValid ARGS((
	OffsetIndex	offsetIndex
));

/*
d67 6
@


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


1.2
log
@copyright removal
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/off.h,v 1.1 89/01/17 05:54:35 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: off.h,v 1.1 88/11/11 16:37:17 postgres Exp $
@
