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


1.8
date     91.11.08.15.43.10;  author kemnitz;  state Exp;
branches ;
next     1.7;

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

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

1.5
date     90.02.08.14.40.56;  author hong;  state Version_2;
branches ;
next     1.4;

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

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

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

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


desc
@@


1.8
log
@fixed prototypes.
@
text
@/*
 * isop.h --
 *	POSTGRES index strategy manipulation operator definitions.
 *
 * Identification:
 *	$Header: ../src/lib/H/access/RCS/isop.h,v 1.7 91/04/28 09:15:49 cimarron Exp Locker: kemnitz $
 */

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

#include "tmp/c.h"
#include "access/istrat.h"

typedef struct StrategyTransformMapData {
	StrategyNumber	strategy[1];	/* VARIABLE LENGTH ARRAY */
} StrategyTransformMapData;	/* VARIABLE LENGTH STRUCTURE */

typedef StrategyTransformMapData	*StrategyTransformMap;

typedef struct StrategyOperatorData {
	StrategyNumber	strategy;
	bits16		flags;		/* scan qualification flags h/skey.h */
} StrategyOperatorData;

typedef StrategyOperatorData	*StrategyOperator;

typedef struct StrategyTermData {	/* conjunctive term */
	uint16			degree;
	StrategyOperatorData	operatorData[1];	/* VARIABLE LENGTH */
} StrategyTermData;	/* VARIABLE LENGTH STRUCTURE */

typedef StrategyTermData	*StrategyTerm;

typedef struct StrategyExpressionData {	/* disjunctive normal form */
	StrategyTerm	term[1];	/* VARIABLE LENGTH ARRAY */
} StrategyExpressionData;	/* VARIABLE LENGTH STRUCTURE */

typedef StrategyExpressionData	*StrategyExpression;

typedef struct StrategyEvaluationData {
	StrategyNumber		maxStrategy;
	StrategyTransformMap	negateTransform;
	StrategyTransformMap	commuteTransform;
	StrategyTransformMap	negateCommuteTransform;
	StrategyExpression	expression[12];	/* XXX VARIABLE LENGTH */
} StrategyEvaluationData;	/* VARIABLE LENGTH STRUCTURE */

typedef StrategyEvaluationData	*StrategyEvaluation;

/*
 * StrategyTransformMapIsValid --
 *	Returns true iff strategy transformation map is valid.
 */
#define	StrategyTransformMapIsValid(transform) PointerIsValid(transform)

/*
 * StrategyOperatorIsValid --
 *	Returns true iff strategy operator is valid.
 */
extern
bool
StrategyOperatorMapIsValid ARGS((
	StrategyOperator	operator,
	StrategyNumber		maxStrategy
));

/*
 * StrategyTermIsValid --
 *	Returns true iff strategy term is valid.
 */
extern
bool
StrategyTermIsValid ARGS((
	StrategyTerm	term,
	StrategyNumber	maxStrategy
));

/*
 * StrategyExpressionIsValid --
 *	Returns true iff strategy expression is valid.
 */
extern
bool
StrategyExpressionIsValid ARGS((
	StrategyExpression	expression,
	StrategyNumber		maxStrategy
));

/*
 * StrategyEvaluationIsValid --
 *	Returns true iff strategy evaluation information is valid.
 */
extern
bool
StrategyEvaluationIsValid ARGS((
	StrategyEvaluation	evaluation
));

/*
 * RelationGetStrategy --
 *	Returns the strategy for an index relation and registered procedure.
 *	Returns InvalidStrategyNumber if registered procedure is unknown.
 *
 * Note:
 *	Assumes relation is valid index relation.
 *	Assumes attribute number is in valid range.
 *	Assumes maximum strategy is valid.
 *	Assumes strategy transformation maps are valid.
 *	Assumes registered procedure is valid.
 */
extern
StrategyNumber
RelationGetStrategy ARGS((
	Relation		relation,
	AttributeNumber		attributeNumber,
	StrategyEvaluation	evaluation,
	RegProcedure		procedure
));

/*
 * RelationInvokeStrategy --
 *	Returns the result of evaluating a strategy for an index relation.
 *
 * Note:
 *	Assumes relation is a valid index relation.
 *	Assumes strategy evalution information is valid.
 *	Assumes attribute number is in valid range.
 *	Assumes strategy is valid.
 */
extern
bool		/* XXX someday, this may return Datum */
RelationInvokeStrategy ARGS((
	Relation		relation,
	StrategyEvaluation	evaluation,
	AttributeNumber		attributeNumber,
	StrategyNumber		strategy,
	Datum			left,
	Datum			right
));

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


1.7
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@d6 1
a6 1
 *	$Header: RCS/isop.h,v 1.6 90/08/17 08:50:54 cimarron Exp Locker: cimarron $
d65 1
a65 1
	Strategy		maxStrategy
d76 1
a76 1
	Strategy	maxStrategy
d86 2
a87 2
	StrategyExpression	expression
	Strategy		maxStrategy
d117 1
a117 4
	StrategyNumber		maxStrategy,
	StrategyTransformMap	negateTransform,
	StrategyTransformMap	commuteTransform,
	StrategyTransformMap	negateCommuteTransform,
@


1.6
log
@added pathnames to #include statements
@
text
@d6 1
a6 1
 *	$Header: RCS/isop.h,v 1.5 90/02/08 14:40:56 hong Version_2 Locker: cimarron $
d55 1
a55 5
extern
bool
StrategyTransformMapIsValid ARGS((
	StrategyTransformMap	transform
));
@


1.5
log
@fix for hermes to reduce levels of #include nesting.
@
text
@d6 1
a6 1
 *	$Header: RCS/isop.h,v 1.4 89/09/05 17:07:06 mao C_Demo_1 $
d12 2
a13 7
#ifndef C_H
#include "c.h"
#endif

#ifndef ISTRAT_H
#include "istrat.h"
#endif
@


1.4
log
@Working version of C-only demo
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/isop.h,v 1.3 89/04/12 19:54:33 dillon Exp $
d16 1
d18 1
@


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


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