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


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

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

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

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

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

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

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

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


desc
@@


1.8
log
@added pathnames to #include statements
@
text
@/*
 * xid.h --
 *	POSTGRES transaction identifier definitions.
 */

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

/*
 * Identification:
 */
#define XID_H	"$Header: RCS/xid.h,v 1.7 90/03/31 19:00:14 cimarron Version_2 Locker: cimarron $"

#include "tmp/c.h"

/* ----------------------------------------------------------------
 *	TransactionId definition
 * ----------------------------------------------------------------
 */

typedef struct TransactionIdData {
	uint8	data[5];
} TransactionIdData;

#define TransactionIdDataSize	5

typedef TransactionIdData	*TransactionId;

#define InvalidTransactionId	NULL
#define NullTransactionIdValue	0.0

typedef double			TransactionIdValueData;
typedef TransactionIdValueData	*TransactionIdValue;

typedef uint8	CommandId;

#define FirstCommandId	0

#define TransactionMultiplierPerByte	(1 << BitsPerByte)
#define TransactionsPerSecondAdjustment	TransactionMultiplierPerByte	

extern TransactionId	NullTransactionId;
extern TransactionId	AmiTransactionId;
extern TransactionId	FirstTransactionId;

/* ----------------------------------------------------------------
 * TransactionIdIsValid --
 *	True iff transaction identifier is valid.
 * ----------------------------------------------------------------
 */
extern
bool
TransactionIdIsValid ARGS((
	TransactionId	transactionId
));

/* ----------------------------------------------------------------
 * GetNewTransactionId --
 *	Returns a new transaction identifier.
 * ----------------------------------------------------------------
 */
extern
void
GetNewTransactionId ARGS((
	TransactionId   xid
));

/* ----------------------------------------------------------------
 * StringFormTransactionId --
 *	Returns transaction identifier associated with a string.
 * ----------------------------------------------------------------
 */
extern
TransactionId
StringFormTransactionId ARGS((
	String	representation
));

/* ----------------------------------------------------------------
 * TransactionIdValueFormString --
 *	Returns string representation for a transaction identifier.
 * ----------------------------------------------------------------
 */
extern
String
TransactionIdFormString ARGS((
	TransactionId	transactionId
));

/* ----------------------------------------------------------------
 * TransactionIdStore --
 *	Stores the transaction identifier in external form.
 *
 * Note:
 *	Assumes transaction identifier is valid.
 *	Assumes destination pointer is valid.
 * ----------------------------------------------------------------
 */
extern
void
TransactionIdStore ARGS((
	TransactionId	transactionId,
	Pointer		destination
));

/* ----------------------------------------------------------------
 * PointerStoreInvalidTransactionId --
 *	Stores an invalid transaction identifier (in external form).
 *
 * Note:
 *	Assumes destination pointer is valid.
 * ----------------------------------------------------------------
 */
extern
void
PointerStoreInvalidTransactionId ARGS((
	Pointer		destination
));

/* ----------------------------------------------------------------
 * TransactionIdEquals --
 *	True iff transaction identifiers are equal.
 *
 * Note:
 *	Assumes transaction identifiers are valid.
 * ----------------------------------------------------------------
 */
extern
bool
TransactionIdEquals ARGS((
	TransactionId	id1,
	TransactionId	id2
));

/* ----------------------------------------------------------------
 * TransactionIdIsLessThan --
 *	True iff first transaction identifier is less than the second.
 *
 * Note:
 *	Assumes transaction identifiers are valid.
 * ----------------------------------------------------------------
 */
extern
bool
TransactionIdIsLessThan ARGS((
	TransactionId	id1,
	TransactionId	id2
));
/* ----------------------------------------------------------------
 * TransactionIdValueIsValid --
 *	True iff transaction identifier value is valid.
 * ----------------------------------------------------------------
 */
extern
bool
TransactionIdValueIsValid ARGS((
	TransactionIdValue	value
));

/* ----------------------------------------------------------------
 * StringGetTransactionIdValue --
 *	Returns transaction identifier value associated with a string.
 * ----------------------------------------------------------------
 */
extern
void
StringSetTransactionIdValue ARGS((
	String			representation,
	TransactionIdValue	value
));

/* ----------------------------------------------------------------
 * TransactionIdValueFormString --
 *	Returns string representation for a transaction identifier value.
 * ----------------------------------------------------------------
 */
extern
String
TransactionIdValueFormString ARGS((
	TransactionIdValue	value
));

/* ----------------------------------------------------------------
 * TransactionIdValueSetTransactionId --
 *	Sets transaction identifier to a transaction identifier value.
 * ----------------------------------------------------------------
 */
extern
void
TransactionIdValueSetTransactionId ARGS((
	TransactionIdValue	idValue,
	TransactionId		id
));

/* ----------------------------------------------------------------
 * TransactionIdSetTransactionIdValue --
 *	Sets transaction identifier value for a transaction identifier.
 * ----------------------------------------------------------------
 */
extern
void
TransactionIdSetTransactionIdValue ARGS((
	TransactionId		id,
	TransactionIdValue	idValue
));

/* ----------------------------------------------------------------
 * TransactionIdIncrement --
 *	Increments transaction identifier.
 * ----------------------------------------------------------------
 */
extern
void
TransactionIdIncrement ARGS((
	TransactionId	transactionId
));


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


1.7
log
@*** empty log message ***
@
text
@d12 1
a12 1
#define XID_H	"$Header: RCS/xid.h,v 1.6 89/09/25 11:24:21 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 XID_H	"$Header: RCS/xid.h,v 1.5 89/09/21 19:15:17 hirohama Exp $"
d31 6
a38 2
#define InvalidTransactionId	NULL

d41 3
a44 1

d46 1
d65 1
a65 1
TransactionId
d67 1
a67 1
	void
d151 69
@


1.5
log
@added ...SYMBOLS declarations
miscellaneous cleanup
@
text
@d12 1
a12 1
#define XID_H	"$Header: RCS/xid.h,v 1.4 89/09/05 17:13:44 mao C_Demo_1 Locker: hirohama $"
a143 9

#define XID_SYMBOLS \
	ExternDecl(NullTransactionId, "_NullTransactionId"), \
	SymbolDecl(TransactionIdIsValid, "_TransactionIdIsValid"), \
	SymbolDecl(StringFormTransactionId, "_StringFormTransactionId"), \
	SymbolDecl(TransactionIdStore, "_TransactionIdStore"), \
	SymbolDecl(PointerStoreInvalidTransactionId, "_PointerStoreInvalidTransactionId"), \
	SymbolDecl(TransactionIdEquals, "_TransactionIdEquals"), \
	SymbolDecl(TransactionIdIsLessThan, "_TransactionIdIsLessThan")
@


1.4
log
@Working version of C-only demo
@
text
@d1 1
a1 1
/* ----------------------------------------------------------------
a3 4
 *
 * Identification:
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/xid.h,v 1.3 89/04/12 19:57:10 dillon Exp $
 * ----------------------------------------------------------------
d6 1
a6 1
#ifndef	XIdIncluded	/* Include this file only once. */
d9 5
d144 9
@


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


1.2
log
@copyright removal
@
text
@d6 1
a6 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/xid.h,v 1.1 89/01/17 05:55:08 cimarron Exp $
d13 1
d15 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: xid.h,v 1.1 88/11/11 16:37:34 postgres Exp $
@
