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


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

1.9
date     90.02.08.14.47.59;  author hong;  state Version_2;
branches ;
next     1.8;

1.8
date     90.01.30.23.24.06;  author sp;  state Exp;
branches ;
next     1.7;

1.7
date     89.09.29.20.26.14;  author sp;  state Exp;
branches ;
next     1.6;

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

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

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

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

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

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


desc
@@


1.10
log
@added pathnames to #include statements
@
text
@/*
 * rlock.h --
 *	POSTGRES rule lock definitions.
 *
 * Identification:
 *	$Header: RCS/rlock.h,v 1.9 90/02/08 14:47:59 hong Version_2 Locker: cimarron $
 */

#ifndef RLOCK_H
#define RLOCK_H

#include "rules/prs2locks.h"

#endif
@


1.9
log
@fix for hermes to reduce levels of #include nesting.
@
text
@d6 1
a6 1
 *	$Header: RCS/rlock.h,v 1.8 90/01/30 23:24:06 sp Exp $
d12 1
a12 3
#ifndef PRS2LOCKS_H
#include "prs2locks.h"
#endif
@


1.8
log
@Not it is just a #include "prs2locks.h"
The reason it remains is that it is included by many-many
files. Probably I have to rename prs2lock.h to rlock.h ...
@
text
@d6 1
a6 1
 *	$Header: RCS/rlock.h,v 1.7 89/09/29 20:26:14 sp Exp Locker: sp $
d9 4
d14 3
@


1.7
log
@Added comments and ARGS into function declarations...
@
text
@d6 1
a6 1
 *	$Header: RCS/rlock.h,v 1.4 89/09/05 17:11:30 mao C_Demo_1 $
d9 1
a9 285
#ifndef	RLockIncluded	/* Include this file only once. */
#define RLockIncluded	1

#ifndef C_H
#include "c.h"
#endif

#include "oid.h"

/*
 * The various types of rule locks...
 */
#define RuleLockTypeWrite 0
#define RuleLockTypeRead1 1
#define RuleLockTypeRead2 2
#define RuleLockTypeRead3 3

/*
 * RuleLockIntermediate.ruletype can be one of the following...
 * (i.e. these are the various types of rules supported so far)
 */
#define RuleTypeRetrieve	0
#define RuleTypeReplace		1
#define RuleTypeAppend		2
#define RuleTypeDelete		3
#define RuleTypeRefuseRetrieve	4
#define RuleTypeRefuseReplace	5
#define RuleTypeRefuseAppend	6
#define RuleTypeRefuseDelete	7

/*
 * A Rule Lock... (this is the low level format. Users must not
 * manipulate directly the "lockData".
 *
 * WARNING : Last field is of VARIABLE LENGTH
 */
typedef struct RuleLockData {
    uint32 lockLength;
    char lockData[1];		/* VARIABLE LENGTH FIELD */
} RuleLockData;

typedef RuleLockData *RuleLock;

#define InvalidRuleLock	(RuleLock)NULL

/*
 * The "intermediate" representation of a rule lock.
 * Most routines operate on this type. So, if you have a RuleLock
 * (e.g. the result of a call to amgetattr()) then you have first
 * to translate to RuleLockIntermediate, call whatever routines you
 * want to call and then translate it back to RuleLock format.
 */

typedef struct RuleLockIntermediate {
    ObjectId ruleid;
    char priority;
    char ruletype;
    bool isearly;
    struct RuleLockIntermediateLockData *locks;
    struct RuleLockIntermediate *next_rulepack;
}RuleLockIntermediate;

typedef struct RuleLockIntermediateLockData {
    char locktype;
    unsigned long attrno;
    unsigned long planno;
    struct RuleLockIntermediateLockData *next_lock;
}RuleLockIntermediateLockData;

/*
 * RuleLockOut
 * Given a 'RuleLock' create a string containing a human readable
 * representation.
 */
extern
char *
RuleLockOut ARGS((
    RuleLock ruleLock
));

/*
 * RuleLockIn
 * Given a string whcih contains a human readable form of a lock
 * (such as the one produced by 'RuleLockOut') create and return
 * the corresponding RuleLock
 */
extern
RuleLock
RuleLockIn ARGS((char * lockString));

/*
 * RuleLockIntermediateToInternal
 * Transform a lock from the 'intermediate' rule lock form
 * to the 'internal' form
 */
extern
RuleLock
RuleLockIntermediateToInternal ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockInternalToIntermediate
 * The exact opposite of 'RuleLockIntermediateToInternal'
 */
extern
RuleLockIntermediate *
RuleLockInternalToIntermediate ARGS((
    RuleLock lockInInternalForm
));

/*
 * RuleLockIntermediateSort
 * Sort the RuleLockIntermediate linked list according to rule priority
 * order.
 */
extern
RuleLockIntermediate *
RuleLockIntermediateSort ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockIntermdiateCopy
 * Make a copy of a lock
 */
extern
RuleLockIntermediate *
RuleLockIntermediateCopy ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockIntermediateFree
 * Free (pfree) memeory occupied by this lock
 */
extern
void
RuleLockIntermediateFree ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockIntermediateUnion
 * Combine two locks into one.
 */
extern
RuleLockIntermediate *
RuleLockIntermediateUnion ARGS((
    RuleLockIntermediate * lock1,
    RuleLockIntermediate * lock2
));

/*
 * RuleLockIntermediateRemove
 * Remove specific lock info from a lock
 */
extern
RuleLockIntermediate *
RuleLockIntermediateRemove ARGS((
    RuleLockIntermediate	* lock,
    ObjectId 			ruleId,
    char			lockType,
    unsigned long		attributeNo,	/* XXX AttributeNumber ?? */
    unsigned long		planNumber,
    int				* returnStatus
));

/*
 * RuleLockIntermediatePrint
 * Print a lock in the given file descriptor (used for debugging...)
 */
extern
void
RuleLockIntermediatePrint ARGS((
    FILE			*fp,
    RuleLockIntermediate	*lock
));

/*
 * RuleLockIntermediateDump
 * Print a lock in stdout (used for debugging...)
 */
extern
void
RuleLockIntermediateDump ARGS((
    RuleLockIntermediate	*lock
));

/*
 * RuleLockIntermediateRemoveEarlyWrite
 * Remove all early write (sub)locks from a lock
 */
extern
RuleLockIntermediate *
RuleLockIntermediateRemoveEarlyWrite ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockIntermediateCopyEarlyWriteLocks
 * Create a new lock cosnsiting of copies of the early write (sub)locks
 * of the given lock.
 */
extern
RuleLockIntermediate *
RuleLockIntermediateCopyEarlyWriteLocks ARGS((
    RuleLockIntermediate * lock
));

/*
 * RuleLockIntermediateRemoveLocksOfRule
 * Remove all the locks of a given rule
 */
RuleLockIntermediate *
RuleLockIntermediateRemoveLocksOfRule ARGS((
    RuleLockIntermediate	* lock,
    ObjectId 			ruleId
));

/*
 * RuleInsertCatalog
 * Insert a dummy tuple to RuleRelation and return ist ObjectId
 * (which is nothing else than the rule Id)
 */
extern
ObjectId
RuleInsertCatalog ARGS((
));

/*
 * RuleModifyCatalog
 * Find the tuple created by 'RuleInsertCatalog' and update it with
 * the proper values.
 */
extern
void
RuleModifyCatalog ARGS((
    ObjectId		ruleId,
    Name		ruleName,
    ObjectId		ruleOwner,
    ObjectId		ruleServer,
    Name		rulePortal,
    uint16		rulePriority,
    char		ruleStatus,
    char		ruleKind,
    RegProcedure	ruleStatistics1,
    RegProcedure	ruleStatistics2
));

/*
 * RulePlansCatalogInsert
 * Insert into the RulePlans relation a tuple filled with the
 * given data
 */
extern
void
RulePlansCatalogInsert ARGS((
    ObjectId	ruleId,
    int32	rulePlanNumber,
    char	* rulePlanString
));



/*====================
 * Some other functions....
 */

/*
 * RuleLockIsValid
 *	True iff the rule lock is valid.
 */
extern
bool
RuleLockIsValid ARGS((
	RuleLock	lock
));

/*
 * XXX use a macro for now
 */
#define RuleLockIsValid(lock)	PointerIsValid(lock)

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


1.6
log
@moved dynamic symbol stuff to syms.h
@
text
@d4 3
d9 1
a9 1
#ifndef	RLockIncluded		/* Include this file only once */
a11 5
/*
 * Identification:
 */
#define RLOCK_H	"$Header: RCS/rlock.h,v 1.5 89/09/21 19:13:12 hirohama Exp $"

d16 1
a16 3
#ifndef	OID_H
# include "oid.h"
#endif
d79 3
a81 1
 * These are the routines a user needs to know.
d83 189
a271 12
char			* RuleLockOut();
RuleLock		RuleLockIn();
RuleLock		RuleLockIntermediateToInternal();
RuleLockIntermediate	* RuleLockInternalToIntermediate();
RuleLockIntermediate	* RuleLockIntermediateSort();
RuleLockIntermediate	* RuleLockIntermediateCopy();
void			RuleLockIntermediateFree();
RuleLockIntermediate	* RuleLockIntermediateUnion();
RuleLockIntermediate	* RuleLockIntermediateRemove();
void			RuleLockIntermediatePrint();
RuleLockIntermediate	* RuleLockIntermediateRemoveEarlyWrite();
RuleLockIntermediate	* RuleLockIntermediateCopyEarlyWriteLocks();
@


1.5
log
@added ...SYMBOLS declarations
miscellaneous cleanup
@
text
@d12 1
a12 1
#define RLOCK_H	"$Header: RCS/rlock.h,v 1.4 89/09/05 17:11:30 mao C_Demo_1 Locker: hirohama $"
a116 21

#define RLOCK_SYMBOLS \
	SymbolDecl(RuleLockIntermediateToInternal, "_RuleLockIntermediateToInternal"), \
	SymbolDecl(RuleLockInternalToIntermediate, "_RuleLockInternalToIntermediate"), \
	SymbolDecl(RuleLockIntermediateSort, "_RuleLockIntermediateSort"), \
	SymbolDecl(RuleLockIntermediateCopy, "_RuleLockIntermediateCopy"), \
	SymbolDecl(RuleLockIntermediateFree, "_RuleLockIntermediateFree"), \
	SymbolDecl(RuleLockIntermediateRemove, "_RuleLockIntermediateRemove"), \
	SymbolDecl(RuleLockIntermediatePrint, "_RuleLockIntermediatePrint"), \
	SymbolDecl(RuleLockIntermediateRemoveEarlyWrite, "_RuleLockIntermediateRemoveEarlyWrite"), \
	SymbolDecl(RuleLockIntermediateCopyEarlyWriteLocks, "_RuleLockIntermediateCopyEarlyWriteLocks")
/*
 * Protected symbols:
 *
 *	RuleLockIntermediateSingleLockUnion
 *	RuleLockIntermediateDump
 *	RuleLockIntermediateFindEWLock
 *	RuleLockIntermediateRelationLock
 *	RuleLockIntermediateSetDirection
 *	RuleLockIntermediateUnion
 */
@


1.4
log
@Working version of C-only demo
@
text
@a3 3
 *
 * Identification:
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/rlock.h,v 1.3 89/04/12 19:56:02 dillon Exp $
d6 1
a6 1
#ifndef	RLockIncluded	/* Include this file only once. */
d9 5
d18 3
a20 1
#include "oid.h"
d117 21
@


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


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