head     1.13;
branch   ;
access   ;
symbols  Version_2_1:1.11 Version_2:1.9 C_Demo_1:1.5;
locks    ; strict;
comment  @ * @;


1.13
date     91.04.28.09.15.59;  author cimarron;  state Exp;
branches ;
next     1.12;

1.12
date     91.04.19.05.36.59;  author kemnitz;  state Exp;
branches ;
next     1.11;

1.11
date     90.08.18.00.40.01;  author cimarron;  state Exp;
branches ;
next     1.10;

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

1.9
date     90.06.07.18.20.15;  author cimarron;  state Version_2;
branches ;
next     1.8;

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

1.7
date     89.09.21.19.13.17;  author hirohama;  state Exp;
branches ;
next     1.6;

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

1.5
date     89.09.05.17.11.56;  author mao;  state C_Demo_1;
branches ;
next     1.4;

1.4
date     89.07.20.13.10.53;  author mao;  state Exp;
branches ;
next     1.3;

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

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

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


desc
@@


1.13
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@/*
 * skey.h --
 *	POSTGRES scan key definitions.
 *
 * Note:
 *	Needs more accessor/assignment routines.
 */

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

/*
 * Identification:
 */
#define SKEY_H	"$Header: RCS/skey.h,v 1.12 91/04/19 05:36:59 kemnitz Exp Locker: cimarron $"

#include "tmp/postgres.h"
#include "access/attnum.h"

typedef uint16	ScanKeySize;

typedef struct ScanKeyEntryData {
	bits16		flags;
	AttributeNumber	attributeNumber;
	RegProcedure	procedure;
	int (*func) ();
	int32 nargs;
	Datum		argument;
} ScanKeyEntryData;

#define CheckIfNull		0x1
#define UnaryProcedure		0x2
#define NegateResult		0x4
#define CommuteArguments	0x8

#define ScanUnmarked		0x01
#define ScanUncheckedPrevious	0x02
#define ScanUncheckedNext	0x04

typedef ScanKeyEntryData	*ScanKeyEntry;

typedef struct ScanKeyData {
	ScanKeyEntryData	data[1];	/* VARIABLE LENGTH ARRAY */
} ScanKeyData;

typedef ScanKeyData	*ScanKey;

/* ----------------
 *	ScanKeyPtr is used in the executor to keep track of
 *	an array of ScanKey's.  This is needed because a single
 *	scan may use several indices and each index has its own
 *	ScanKey. -cim 9/11/89
 * ----------------
 */
typedef ScanKey		*ScanKeyPtr;

/*
 * ScanKeyIsValid --
 *	True iff the scan key is valid.
 */
#define ScanKeyIsValid(scanKeySize, key) \
    ((bool) ((scanKeySize) == 0 || PointerIsValid(key)))
	     
/*
 * ScanKeyEntryIsValid --
 *	True iff the scan key entry is valid.
 */
#define	ScanKeyEntryIsValid(entry) PointerIsValid(entry)

/*
 * ScanKeyEntryIsLegal --
 *	True iff the scan key entry is legal.
 */
#define ScanKeyEntryIsLegal(entry) \
    ((bool) (AssertMacro(ScanKeyEntryIsValid(entry)) && \
	     AttributeNumberIsValid(entry->attributeNumber)))

/*
 * ScanKeyEntrySetIllegal --
 *	Marks a scan key entry as illegal.
 */
extern
void
ScanKeyEntrySetIllegal ARGS((
	ScanKeyEntry	entry
));

/*
 * ScanKeyEntryInitialize --
 *	Initializes an scan key entry.
 *
 * Note:
 *	Assumes the scan key entry is valid.
 *	Assumes the intialized scan key entry will be legal.
 */
extern
void
ScanKeyEntryInitialize ARGS((
	ScanKeyEntry	entry,
	bits16		flags,
	AttributeNumber	attributeNumber,
	RegProcedure	procedure,
	Datum		argument
));

/* ----------------------------------------------------------------
 *		    old access.h definitions
 * ----------------------------------------------------------------
 */
struct	skey {
	int16	sk_flags;	/* flags */
	int16	sk_attnum;	/* domain number */
	OID	sk_opr;		/* procedure OID */
	int 	(*func) ();
	int32 	nargs;
	DATUM	sk_data;	/* data to compare */
};

#define	SK_ISNULL	01
#define	SK_UNARY	02
#define	SK_NEGATE	04
#define	SK_COMMUTE	010

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


1.12
log
@the function coresponding to procedure is now cached in the scankey.
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.11 90/08/18 00:40:01 cimarron Exp Locker: kemnitz $"
d61 3
a63 6
extern
bool
ScanKeyIsValid ARGS((
	ScanKey	key
));

d68 1
a68 5
extern
bool
ScanKeyEntryIsValid ARGS((
	ScanKeyEntry	entry
));
d74 3
a76 5
extern
bool
ScanKeyEntryIsLegal ARGS((
	ScanKeyEntry	entry
));
d114 2
a115 2
	int (*func) ();
	int32 nargs;
@


1.11
log
@eliminated less significant .h files
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.10 90/08/17 08:51:10 cimarron Exp Locker: cimarron $"
d26 2
d123 2
@


1.10
log
@added pathnames to #include statements
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.9 90/06/07 18:20:15 cimarron Version_2 Locker: cimarron $"
a18 2
#include "tmp/datum.h"
#include "tmp/regproc.h"
@


1.9
log
@made changes to simplify header include files
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.8 89/09/25 11:24:41 cimarron Exp $"
d17 4
a20 12
#ifndef POSTGRES_H
#include "postgres.h"
#endif
#ifndef	ATTNUM_H
# include "attnum.h"
#endif
#ifndef	DATUM_H
# include "datum.h"
#endif
#ifndef	REGPROC_H
# include "regproc.h"
#endif
@


1.8
log
@moved dynamic symbol stuff to syms.h
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.7 89/09/21 19:13:17 hirohama Exp $"
d17 2
a18 2
#ifndef C_H
#include "c.h"
a19 1

d122 16
@


1.7
log
@added ...SYMBOLS declarations
miscellaneous cleanup
@
text
@d15 1
a15 1
#define SKEY_H	"$Header: RCS/skey.h,v 1.6 89/09/18 08:02:05 cimarron Exp Locker: hirohama $"
a122 7

#define SKEY_SYMBOLS \
	SymbolDecl(ScanKeyIsValid, "_ScanKeyIsValid"), \
	SymbolDecl(ScanKeyEntryIsValid, "_ScanKeyEntryIsValid"), \
	SymbolDecl(ScanKeyEntryIsLegal, "_ScanKeyEntryIsLegal"), \
	SymbolDecl(ScanKeyEntrySetIllegal, "_ScanKeyEntrySetIllegal"), \
	SymbolDecl(ScanKeyEntryInitialize, "_ScanKeyEntryInitialize")
@


1.6
log
@added code to support index scans in the executor.
@
text
@d7 6
a12 1
 *
a13 1
 *	$Header: RCS/skey.h,v 1.4 89/07/20 13:10:53 mao Exp $
d15 1
a16 3
#ifndef	SKey	/* Include this file only once. */
#define SKey	1

d21 9
a29 3
#include "attnum.h"
#include "datum.h"
#include "regproc.h"
d124 8
a131 1
#endif	/* !defined(SKey) */
@


1.5
log
@Working version of C-only demo
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/skey.h,v 1.4 89/07/20 13:10:53 mao Exp $
d48 9
@


1.4
log
@add scan marked flags (previously in access/genam/internal.h)
@
text
@d9 1
a9 1
 *	$Header: skey.h,v 1.3 89/04/12 19:56:12 mao Locked $
@


1.3
log
@c.h
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/skey.h,v 1.2 89/03/22 17:34:34 muir Stab $
d36 4
@


1.2
log
@copyright removal
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/skey.h,v 1.1 89/01/17 05:54:53 cimarron Exp $
d15 1
d17 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.
; * 
; */



d9 1
a9 1
 *	$Header: skey.h,v 1.1 88/11/11 16:37:25 postgres Exp $
@
