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


1.10
date     91.05.01.02.49.54;  author cimarron;  state Exp;
branches ;
next     1.9;

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

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

1.7
date     89.10.05.16.58.41;  author cimarron;  state Version_2;
branches ;
next     1.6;

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

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

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

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

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

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


desc
@@


1.10
log
@round II of converting simple functions to macros + code cleaning in general
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	attnum.h
 *
 *   DESCRIPTION
 *	POSTGRES attribute number definitions.
 *
 *   IDENTIFICATION
 *	$Header$
 * ----------------------------------------------------------------
 */
#ifndef	AttNumIncluded		/* Include this file only once */
#define AttNumIncluded	1

#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.9 91/04/28 09:16:05 cimarron Exp Locker: cimarron $"

#include "tmp/c.h"

typedef int16		AttributeNumber;
typedef AttributeNumber	*AttributeNumberPtr;
typedef uint16		AttributeOffset;

#define InvalidAttributeNumber	0

/* ----------------
 *	support macros
 * ----------------
 */
/*
 * AttributeNumberIsValid --
 *	True iff the attribute number is valid.
 */
#define AttributeNumberIsValid(attributeNumber) \
    ((bool) ((attributeNumber) != InvalidAttributeNumber))

/*
 * AttributeNumberIsForUserDefinedAttribute --
 *	True iff the attribute number corresponds to an user defined attribute.
 */
#define AttributeNumberIsForUserDefinedAttribute(attributeNumber) \
    ((bool) ((attributeNumber) > 0))

/*
 * AttributeNumberIsInBounds --
 *	True iff attribute number is within given bounds.
 *
 * Note:
 *	Assumes AttributeNumber is an signed type.
 *	Assumes the bounded interval to be (minumum,maximum].
 *	An invalid attribute number is within given bounds.
 */
#define AttributeNumberIsInBounds(attNum, minAttNum, maxAttNum) \
     ((bool) OffsetIsInBounds(attNum, minAttNum, maxAttNum))

/*
 * AttributeNumberGetAttributeOffset --
 *	Returns the attribute offset for an attribute number.
 *
 * Note:
 *	Assumes the attribute number is for an user defined attribute.
 */
#define AttributeNumberGetAttributeOffset(attNum) \
     (AssertMacro(AttributeNumberIsForUserDefinedAttribute(attNum)) ? \
      ((AttributeOffset) (attNum - 1)) : (AttributeOffset) 0)

/*
 * AttributeOffsetGetAttributeNumber --
 *	Returns the attribute number for an attribute offset.
 */
#define AttributeOffsetGetAttributeNumber(attributeOffset) \
     ((AttributeNumber) (1 + attributeOffset))

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


1.9
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@d1 5
a5 2
/*
 * attnum.h --
d7 4
a11 1

d15 1
a15 4
/*
 * Identification:
 */
#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.8 90/08/17 08:51:26 cimarron Exp Locker: cimarron $"
d19 1
a19 2
typedef int16	AttributeNumber;

d21 1
d25 4
a28 2
typedef uint16	AttributeOffset;

d40 2
a41 5
extern
bool
AttributeNumberIsForUserDefinedAttribute ARGS((
	AttributeNumber	attributeNumber
));
d52 2
a53 7
extern
bool
AttributeNumberIsInBounds ARGS((
	AttributeNumber	attributeNumber,
	AttributeNumber	minimumAttributeNumber,
	AttributeNumber	maximumAttributeNumber
));
d62 3
a64 5
extern
AttributeOffset
AttributeNumberGetAttributeOffset ARGS((
	AttributeNumber	attributeNumber
));
d70 2
a71 5
extern
AttributeNumber
AttributeOffsetGetAttributeNumber ARGS((
	AttributeOffset	attributeOffset
));
@


1.8
log
@added pathnames to #include statements
@
text
@d12 1
a12 1
#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.7 89/10/05 16:58:41 cimarron Version_2 Locker: cimarron $"
d28 2
a29 5
extern
bool
AttributeNumberIsValid ARGS((
	AttributeNumber	attributeNumber
));
@


1.7
log
@added code to support mirroring of heap updates to index relations
@
text
@d12 1
a12 1
#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.6 89/09/25 11:27:31 cimarron Exp $"
d14 1
a14 3
#ifndef C_H
#include "c.h"
#endif
@


1.6
log
@moved dynamic symbol stuff to syms.h
@
text
@d12 1
a12 1
#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.5 89/09/21 19:12:04 hirohama Exp $"
d19 2
@


1.5
log
@added ...SYMBOLS declarations
miscellaneous cleanup
@
text
@d12 1
a12 1
#define ATTNUM_H	"$Header: RCS/attnum.h,v 1.4 89/09/05 17:03:36 mao C_Demo_1 Locker: hirohama $"
a82 7

#define ATTNUM_SYMBOLS \
	SymbolDecl(AttributeNumberIsValid, "_AttributeNumberIsValid"), \
	SymbolDecl(AttributeNumberIsForUserDefinedAttribute, "_AttributeNumberIsForUserDefinedAttribute"), \
	SymbolDecl(AttributeNumberIsInBounds, "_AttributeNumberIsInBounds"), \
	SymbolDecl(AttributeNumberGetAttributeOffset, "_AttributeNumberGetAttributeOffset"), \
	SymbolDecl(AttributeOffsetGetAttributeNumber, "_AttributeOffsetGetAttributeNumber")
@


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


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


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