head     1.5;
branch   ;
access   ;
symbols  Version_2_1:1.5 C_Demo_1:1.3;
locks    ; strict;
comment  @ * @;


1.5
date     90.09.25.16.46.28;  author kemnitz;  state Exp;
branches ;
next     1.4;

1.4
date     89.09.21.18.53.50;  author hirohama;  state Exp;
branches ;
next     1.3;

1.3
date     89.09.05.17.25.15;  author mao;  state C_Demo_1;
branches ;
next     1.2;

1.2
date     89.02.02.15.35.15;  author dillon;  state Stab;
branches ;
next     1.1;

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


desc
@@


1.5
log
@Updating from revision 1.4 to revision 1.5
@
text
@/*
 * off.c --
 *	POSTGRES disk "offset" code.
 */

#include "tmp/c.h"

RcsId("$Header: RCS/off.c,v 1.5 90/08/14 16:05:07 cimarron Exp $");

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

bool
OffsetNumberIsValid(offsetNumber)
	OffsetNumber	offsetNumber;
{
	return ((bool)((offsetNumber != 0) &&
		(offsetNumber < BLCKSZ / sizeof (ItemIdData))));
}

bool
OffsetIdIsValid(offsetId)
	OffsetId	offsetId;
{
	return ((bool)(PointerIsValid(offsetId) && *offsetId != 0));
}

void
OffsetIdSet(offsetId, offsetNumber)
	OffsetId	offsetId;
	OffsetNumber	offsetNumber;
{
	*offsetId = offsetNumber;
}

OffsetNumber
OffsetIdGetOffsetNumber(offsetId)
	OffsetId	offsetId;
{
	return (*offsetId);
}
@


1.4
log
@"bufmgr.h" -> "machine.h"
removed bogus OffsetIndexIsValid
@
text
@d6 1
a6 1
#include "c.h"
d8 1
a8 1
RcsId("$Header: RCS/off.c,v 1.3 89/09/05 17:25:15 mao C_Demo_1 Locker: hirohama $");
d10 3
a12 4
#include "itemid.h"
#include "machine.h"	/* for BLCKSZ */

#include "off.h"
@


1.3
log
@Working version of C-only demo
@
text
@d8 2
a9 1
#include "bufmgr.h"
d11 1
a14 11
RcsId("$Header: /usr6/postgres/mao/postgres/src/storage/page/RCS/off.c,v 1.2 89/02/02 15:35:15 dillon Stab $");

/* XXX incorrect validity test */
bool
OffsetIndexIsValid(offsetIndex)
	OffsetIndex	offsetIndex;
{
	return ((bool)(offsetIndex < BLCKSZ / sizeof (ItemIdData)));
}

/* XXX incorrect validity test */
@


1.2
log
@Txfer From old tree
@
text
@d13 1
a13 1
RcsId("$Header: off.c,v 1.4 88/05/18 19:21:50 dillon Locked $");
@


1.1
log
@Initial revision
@
text
@a0 1

a1 26
 * 
 * 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.
 * 
 */



/*
d13 1
a13 1
RcsId("$Header: off.c,v 1.1 88/11/11 16:37:42 postgres Exp $");
@
