head	1.59;
access;
symbols
	release_4_2:1.59
	aix_ok:1.54
	Version_2_1:1.23
	old_buffer_manager:1.20
	Version_2:1.13
	C_Demo_1:1.10;
locks; strict;
comment	@ * @;


1.59
date	94.06.30.03.03.57;	author aoki;	state Exp;
branches;
next	1.58;

1.58
date	94.06.20.21.58.53;	author aoki;	state Exp;
branches;
next	1.57;

1.57
date	94.06.16.03.23.06;	author aoki;	state Exp;
branches;
next	1.56;

1.56
date	94.02.07.11.45.48;	author aoki;	state Exp;
branches;
next	1.55;

1.55
date	94.01.18.21.15.02;	author boris;	state Exp;
branches;
next	1.54;

1.54
date	93.09.27.04.48.18;	author aoki;	state Exp;
branches;
next	1.53;

1.53
date	93.09.21.20.28.16;	author aoki;	state Exp;
branches;
next	1.52;

1.52
date	93.08.15.05.42.04;	author aoki;	state Exp;
branches;
next	1.51;

1.51
date	93.08.14.21.30.04;	author aoki;	state Exp;
branches;
next	1.50;

1.50
date	93.07.10.03.13.08;	author aoki;	state Exp;
branches;
next	1.49;

1.49
date	93.07.07.01.21.06;	author aoki;	state Exp;
branches;
next	1.48;

1.48
date	93.06.16.04.19.02;	author aoki;	state Exp;
branches;
next	1.47;

1.47
date	93.06.13.22.58.21;	author aoki;	state Exp;
branches;
next	1.46;

1.46
date	93.04.14.00.14.36;	author sunita;	state Exp;
branches;
next	1.45;

1.45
date	93.03.23.02.26.31;	author aoki;	state Exp;
branches;
next	1.44;

1.44
date	93.02.22.20.27.18;	author marc;	state Exp;
branches;
next	1.43;

1.43
date	93.01.01.00.06.09;	author marc;	state Exp;
branches;
next	1.42;

1.42
date	92.12.31.02.36.12;	author marc;	state Exp;
branches;
next	1.41;

1.41
date	92.12.31.02.03.45;	author marc;	state Exp;
branches;
next	1.40;

1.40
date	92.12.30.17.17.45;	author marc;	state Exp;
branches;
next	1.39;

1.39
date	92.07.13.07.40.12;	author hong;	state Exp;
branches;
next	1.38;

1.38
date	92.06.26.17.55.11;	author mer;	state Exp;
branches;
next	1.37;

1.37
date	92.03.05.00.40.25;	author hong;	state Exp;
branches;
next	1.36;

1.36
date	91.12.10.15.59.38;	author mao;	state Exp;
branches;
next	1.35;

1.35
date	91.11.20.21.25.01;	author mer;	state Exp;
branches;
next	1.34;

1.34
date	91.11.07.22.12.13;	author mer;	state Exp;
branches;
next	1.33;

1.33
date	91.10.06.21.34.05;	author hong;	state Exp;
branches;
next	1.32;

1.32
date	91.10.01.16.40.34;	author glass;	state Exp;
branches;
next	1.31;

1.31
date	91.08.20.05.32.45;	author mao;	state Exp;
branches;
next	1.30;

1.30
date	91.08.12.19.48.22;	author mao;	state Exp;
branches;
next	1.29;

1.29
date	91.07.24.07.48.20;	author mao;	state Exp;
branches;
next	1.28;

1.28
date	91.07.22.22.21.35;	author mao;	state Exp;
branches;
next	1.27;

1.27
date	91.06.18.23.28.26;	author cimarron;	state Exp;
branches;
next	1.26;

1.26
date	91.06.13.11.19.58;	author kemnitz;	state Exp;
branches;
next	1.25;

1.25
date	91.04.28.09.15.08;	author cimarron;	state Exp;
branches;
next	1.24;

1.24
date	91.04.01.08.44.00;	author hong;	state Exp;
branches;
next	1.23;

1.23
date	91.02.24.00.59.43;	author cimarron;	state Exp;
branches;
next	1.22;

1.22
date	91.02.24.00.47.31;	author cimarron;	state Exp;
branches;
next	1.21;

1.21
date	91.01.18.21.56.28;	author hong;	state Exp;
branches;
next	1.20;

1.20
date	90.10.02.06.16.52;	author goh;	state Exp;
branches;
next	1.19;

1.19
date	90.09.25.21.46.04;	author goh;	state Exp;
branches;
next	1.18;

1.18
date	90.09.06.13.03.01;	author plai;	state Exp;
branches;
next	1.17;

1.17
date	90.09.06.12.58.40;	author plai;	state Exp;
branches;
next	1.16;

1.16
date	90.08.20.14.30.17;	author choi;	state Exp;
branches;
next	1.15;

1.15
date	90.08.17.11.31.11;	author cimarron;	state Exp;
branches;
next	1.14;

1.14
date	90.08.08.08.16.21;	author cimarron;	state Exp;
branches;
next	1.13;

1.13
date	89.09.25.11.27.24;	author cimarron;	state Version_2;
branches;
next	1.12;

1.12
date	89.09.21.19.04.47;	author hirohama;	state Exp;
branches;
next	1.11;

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

1.10
date	89.09.05.17.04.23;	author mao;	state C_Demo_1;
branches;
next	1.9;

1.9
date	89.08.01.18.04.40;	author goh;	state Exp;
branches;
next	1.8;

1.8
date	89.07.28.20.22.26;	author hirohama;	state Exp;
branches;
next	1.7;

1.7
date	89.07.13.19.39.10;	author dillon;	state Exp;
branches;
next	1.6;

1.6
date	89.05.04.18.10.44;	author hirohama;	state Exp;
branches;
next	1.5;

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

1.4
date	89.05.01.13.47.42;	author hirohama;	state Exp;
branches;
next	1.3;

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

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

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


desc
@@


1.59
log
@hacks for sunpro compiler
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	c.h
 *
 *   DESCRIPTION
 *	Fundamental C definitions.  This is included by 
 *	every .c file in postgres.
 *
 *   TABLE OF CONTENTS
 *
 *	When adding stuff to this file, please try and put stuff
 *	into the relevent section, or add new sections as appropriate.
 *
 *    section	description
 *    -------	------------------------------------------------
 *	1)	palloc debugging defines
 *	2)	bool, true, false, TRUE, FALSE
 *	3)	__STDC__, non-ansi C definitions:
 *		Pointer typedef, NULL
 *		cpp magic macros
 *		ARGS() prototype macro
 *		type prefixes: const, signed, volatile, inline
 *
 *	4)	standard system types
 *	5)	malloc, free, malloc_debug stuff, new, delete, ALLOCATE
 *	6)	IsValid macros for system types
 *	7)	offsetof, lengthof, endof 
 *	8)	exception handling definitions, Assert, Trap, etc macros
 *	9)	Min, Max, Abs macros
 *	10)	LintCast, RevisionId, RcsId, SccsId macros
 *	11)	<dead>
 *	12)	externs
 *	13)	system-specific hacks
 *
 *   NOTES
 *	This file reorganized as a result of eliminating wastful
 *	nested IsValid calls -cim 4/27/91
 *
 *	This file is MACHINE AND COMPILER dependent!!!  (For now.)
 *
 *   IDENTIFICATION
 *	$Header: /import/faerie/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.58 1994/06/20 21:58:53 aoki Exp aoki $
 * ----------------------------------------------------------------
 */

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

#define C_H	"$Header: /import/faerie/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.58 1994/06/20 21:58:53 aoki Exp aoki $"

/* ----------------------------------------------------------------
 *		Section 1:  palloc debugging defines
 * ----------------------------------------------------------------
 */

/* ----------------
 *	file / line macros
 *
 *	_FLD_ 		File/Line Data
 *	_FLV_ 		File/Line Variables
 *	_FLV_DCL_ 	File/Line Variable Declarations
 *
 *	the FLD0 and FLV0 macros are for functions taking no arguments
 * ----------------
 */
#define _FLD_ 		__FILE__, __LINE__, 
#define _FLD0_ 		__FILE__, __LINE__
#define _FLV_ 		_FL_file, int _FL_line,
#define _FLV0_ 		_FL_file, int _FL_line
#define _FLV_DCL_ 	char *_FL_file; int _FL_line;
#define _FL_PRINT_	printf("f: %s l: %d ", _FL_file, _FL_line)

/* ----------------
 *	storage managers
 *
 *	These are experimental and are not supported in the code that
 *	we distribute to other sites.
 * ----------------
 */
#ifdef SEQUOIA
#define SONY_JUKEBOX
#define MAIN_MEMORY
#define JAQUITH
#endif

/* ----------------
 *	allocation debugging stuff
 * ----------------
 */
#undef PALLOC_DEBUG 

#ifdef PALLOC_DEBUG
#define palloc(size)       palloc_debug(_FLD_ size)
#define pfree(ptr)         pfree_debug(_FLD_ ptr)
#define MemoryContextAlloc(context, size) \
	MemoryContextAlloc_Debug(_FLD_ context, size)
#define MemoryContextFree(context, ptr)  \
	MemoryContextFree_Debug(_FLD_ context, ptr)
#define AllocSetReset(set) AllocSetReset_debug(_FLD_ set)
#define malloc(size)	    malloc_debug(_FLD_ size)
#define free(ptr)	    free_debug(_FLD_ ptr)
#endif /* PALLOC_DEBUG */

/* -------------------
 *	buffer pool pin count debugging stuff
 * -------------------
 */
#undef BUFMGR_DEBUG

#ifdef BUFMGR_DEBUG
#define IncrBufferRefCount(buffer)	IncrBufferRefCount_Debug(_FLD_ buffer)
#define ReleaseBuffer(buffer)		ReleaseBuffer_Debug(_FLD_ buffer)
#define ReleaseAndReadBuffer(buffer, relation, blockNum) \
		ReleaseAndReadBuffer_Debug(_FLD_ buffer, relation, blockNum)
#define ReadBuffer(reln, blockNum)	ReadBuffer_Debug(_FLD_ reln, blockNum)
#define WriteBuffer(buffer)		WriteBuffer_Debug(_FLD_ buffer)
/*
#define PinBuffer(buf)			PinBuffer_Debug(_FLD_ buf)
#define UnpinBuffer(buf)		UnpinBuffer_Debug(_FLD_ buf)
*/
#endif /* BUFMGR_DEBUG */

/*
 * Begin COMPILER DEPENDENT section
 */

/* ----------------------------------------------------------------
 *		Section 2:  bool, true, false, TRUE, FALSE
 * ----------------------------------------------------------------
 */
/*
 * bool --
 *	Boolean value, either true or false.
 *
 * used to be:
 *
 * typedef enum bool {
 *	false,		must be first, to be 0
 *	true
 * } bool;
 *
 * this may soon be moved to postgres.h -cim
 */
#define bool	char
#define false	((char) 0)
#define true	((char) 1)
typedef bool	*BoolPtr;

#ifndef TRUE
#define TRUE	1
#endif /* TRUE */
#ifndef FALSE
#define FALSE	0
#endif /* FALSE */

/* ----------------------------------------------------------------
 *		Section 3: __STDC__, non-ansi C definitions:
 *
 *		cpp magic macros
 *		ARGS() prototype macro
 *		Pointer typedef, NULL
 *		type prefixes: const, signed, volatile, inline
 * ----------------------------------------------------------------
 */

#ifdef	__STDC__ /* ANSI C */

#if defined(__GNUC__)
#define PROTOTYPES
#endif

/*
 * Pointer --
 *	Variable holding address of any memory resident object.
 */
#if defined(__GNUC__)
typedef void	*Pointer;
#else /* __GNUC__ */
/*
 *	XXX Pointer arithmetic is done with this, so it can't be void *
 *	under "true" ANSI compilers.
 */
typedef char	*Pointer;
#endif /* __GNUC__ */

#ifndef	NULL
/*
 * NULL --
 *	Null pointer.
 */
#define NULL	((void *) 0)
#endif	/* !defined(NULL) */

#define	HAVE_ANSI_CPP	/* all ANSI C compilers must have this! */
#if defined(NEED_STD_HDRS)
#undef NEED_STD_HDRS	/* all ANSI systems must have stddef/stdlib */
#endif /* NEED_STD_HDRS */

#else	/* !defined(__STDC__) */ /* NOT ANSI C */

/*
 * Pointer --
 *	Variable containing address of any memory resident object.
 */
typedef char	*Pointer;

#ifndef	NULL
/*
 * NULL --
 *	Null pointer.
 */
#define NULL	0
#endif	/* !defined(NULL) */

/*
 * const --
 *	Type modifier.  Identifies read only variables.
 *
 * Example:
 *	extern const Version	RomVersion;
 */
#define const		/* const */

/*
 * signed --
 *	Type modifier.  Identifies signed integral types.
 */
#define signed		/* signed */

/*
 * volatile --
 *	Type modifier.  Identifies variables which may change in ways not
 *	noticeable by the compiler, e.g. via asynchronous interrupts.
 *
 * Example:
 *	extern volatile unsigned int	NumberOfInterrupts;
 */
#define volatile	/* volatile */

#endif	/* !defined(__STDC__) */ /* NOT ANSI C */

/*
 * CppAsString --
 *	Convert the argument to a string, using the C preprocessor.
 * CppConcat --
 *	Concatenate two arguments together, using the C preprocessor.
 */
#if defined(HAVE_ANSI_CPP)

#define CppAsString(identifier)	#identifier
#define CppConcat(x, y)		x##y
#define CppConcat0(x, y)	x##y
#define CppConcat1(x, y)	x##y
#define CppConcat2(x, y)	x##y
#define CppConcat3(x, y)	x##y
#define CppConcat4(x, y)	x##y

#else /* !HAVE_ANSI_CPP */

#define CppAsString(identifier)	"identifier"

/*
 * CppIdentity -- On Reiser based cpp's this is used to concatenate
 *	two tokens.  That is
 *		CppIdentity(A)B	==> AB
 *	We renamed it to _private_CppIdentity because it should not
 *	be referenced outside this file.  On other cpp's it
 *	produces  A  B.
 */
#define _priv_CppIdentity(x)x
#define CppConcat(x, y)		_priv_CppIdentity(x)y
#define CppConcat0(x, y)	_priv_CppIdentity(x)y
#define CppConcat1(x, y)	_priv_CppIdentity(x)y
#define CppConcat2(x, y)	_priv_CppIdentity(x)y
#define CppConcat3(x, y)	_priv_CppIdentity(x)y
#define CppConcat4(x, y)	_priv_CppIdentity(x)y

#endif /* !HAVE_ANSI_CPP */

#ifndef __GNUC__	/* GNU cc */
# define inline
#endif

#ifdef PROTOTYPES
#define ARGS(args)	args
#else
#define ARGS(args)	(/*args*/)
#endif /* PROTOTYPES */

#if defined(NEED_STD_HDRS)
/*
 * You're doomed.  We've removed almost all of our own C library 
 * extern declarations because they conflict on the different
 * systems.  You'll have to write your own stdlib.h.
 */
#include "stdlib.h"
#else /* NEED_STD_HDRS */
#include <stddef.h>
#include <stdlib.h>
#endif /* NEED_STD_HDRS */

/* ----------------------------------------------------------------
 *		Section 4:  standard system types
 * ----------------------------------------------------------------
 */

/*
 * End COMPILER DEPENDENT section
 */


/*
 * Begin COMPILER AND HARDWARE DEPENDENT section
 */

/*
 * intN --
 *	Signed integer, AT LEAST N BITS IN SIZE,
 *	used for numerical computations.
 */
typedef signed char	int8;		/* >= 8 bits */
typedef signed short	int16;		/* >= 16 bits */
typedef signed int	int32;		/* >= 32 bits */

/*
 * AsInt8 --
 *	Coerce the argument to int8.
 *
 * Note:
 *	This macro must be used to reference all int8 variables, because
 *
 *		o Not all compilers support the signed char type.
 *		o Depending on the compiler and/or machine, char
 *		  types can be either signed or unsigned.
 */
#define AsInt8(n)	((int) (((n) & 0x80) ? (~0x7f | (n)) : (n)))

/*
 * uintN --
 *	Unsigned integer, AT LEAST N BITS IN SIZE,
 *	used for numerical computations.
 */
typedef unsigned char	uint8;		/* >= 8 bits */
typedef unsigned short	uint16;		/* >= 16 bits */
typedef unsigned int	uint32;		/* >= 32 bits */

/*
 * floatN --
 *	Floating point number, AT LEAST N BITS IN SIZE,
 *	used for numerical computations.
 *
 *	Since sizeof(floatN) may be > sizeof(char *), always pass
 *	floatN by reference.
 */
typedef float		float32data;
typedef double		float64data;
typedef float		*float32;
typedef double		*float64;

/*
 * AsUint8 --
 *	Coerce the argument to uint8.
 *
 * Note:
 *	This macro must be used to reference all int8 variables, because
 *
 *		o Not all compilers support the unsigned char type.
 *		o Depending on the compiler and/or machine, char
 *		  types can be either signed or unsigned.
 */
#define AsUint8(n)	((unsigned) ((n) & 0xff))

/*
 * boolN --
 *	Boolean value, AT LEAST N BITS IN SIZE.
 */
typedef uint8		bool8;		/* >= 8 bits */
typedef uint16		bool16;		/* >= 16 bits */
typedef uint32		bool32;		/* >= 32 bits */

/*
 * bitsN --
 *	Unit of bitwise operation, AT LEAST N BITS IN SIZE.
 */
typedef uint8		bits8;		/* >= 8 bits */
typedef uint16		bits16;		/* >= 16 bits */
typedef uint32		bits32;		/* >= 32 bits */

/*
 * wordN --
 *	Unit of storage, AT LEAST N BITS IN SIZE,
 *	used to fetch/store data.
 */
typedef uint8		word8;		/* >= 8 bits */
typedef uint16		word16;		/* >= 16 bits */
typedef uint32		word32;		/* >= 32 bits */

/*
 * IoChar --
 *	Either a character or EOF, as returned by getchar.
 */
typedef int		IoChar;

/*
 * Address --
 *	Address of any memory resident object.
 *
 * Note:
 *	This differs from Pointer type in that an object of type
 *	Pointer contains an address, whereas an object of type
 *	Address is an address (e.g. a constant).
 *
 * Example:
 *	extern Address	EndOfMemory;
 *	extern Pointer	TopOfStack;
 */
typedef char		Address[];

/*
 * Size --
 *	Size of any memory resident object, as returned by sizeof.
 */
typedef unsigned int	Size;

/*
 * Index --
 *	Index into any memory resident array.
 *
 * Note:
 *	Indices are non negative.
 */
typedef unsigned int	Index;

#define MAXDIM 6
typedef struct {
	int indx[MAXDIM];
} IntArray;

/*
 * Count --
 *	Generic counter type.
 */
typedef unsigned int	Count;

/*
 * Offset --
 *	Offset into any memory resident array.
 *
 * Note:
 *	This differs from an Index in that an Index is always
 *	non negative, whereas Offset may be negative.
 */
typedef signed int	Offset;

/*
 * String --
 *	String of characters.
 */
typedef char	*String;

typedef int	*intPtr;
/*
 * ReturnStatus --
 *	Return status from POSTGRES library functions.
 *
 * Note:
 *	Most POSTGRES functions will not return a status.
 *	In the future, there should be a global variable
 *	which indicates the reason for the failure--the
 *	identifier of an error message in the ERROR relation.
 */
typedef int	ReturnStatus;

/* ----------------------------------------------------------------
 *		Section 5:  malloc, free, malloc_debug stuff
 *			    new, delete macros
 * ----------------------------------------------------------------
 */
#ifdef PALLOC_DEBUG
extern
char *	/* as defined in /usr/lib/lint/llib-lc */
malloc_debug ARGS((
	String	file,
	int 	line,
	Size	nBytes
));
extern
/* void */      /* as defined in /usr/lib/lint/llib-lc */
free_debug ARGS((
	String	file,
	int	line,
        char    *p
));
#endif /* PALLOC_DEBUG */

/*
 * newv --
 *	Allocate a new array.
 */
#define newv(type, n)	LintCast(type *, malloc(sizeof (type) * (n)))

/*
 * delete --
 *	Free allocated storage.
 *
 * Note:
 *	The variable is set to null to help catch errors.
 */
#define delete(pointer)	(free((char *) (pointer)), (pointer) = NULL)

/* 
 * ALLOCATE() macro
 */
#define ALLOCATE(foo) (foo) palloc(sizeof(struct CppConcat(_,foo)))

/* ----------------------------------------------------------------
 *		Section 6:  IsValid macros for system types
 * ----------------------------------------------------------------
 */
/*
 * BoolIsValid --
 *	True iff bool is valid.
 */
#define	BoolIsValid(boolean)	((boolean) == false || (boolean) == true)

#define boolIsValid(b) \
    ((bool) ((b) == false || (b) == true))

/*
 * PointerIsValid --
 *	True iff pointer is valid.
 */
#define PointerIsValid(pointer)	(bool)((Pointer)(pointer) != NULL)

/*
 * PointerIsInBounds --
 *	True iff pointer is within given bounds.
 *
 * Note:
 *	Assumes the bounded interval to be [min,max),
 *	i.e. closed on the left and open on the right.
 */
#define PointerIsInBounds(pointer, min, max) \
	((min) <= (pointer) && (pointer) < (max))

/*
 * PointerIsAligned --
 *	True iff pointer is properly aligned to point to the given type.
 */
#define PointerIsAligned(pointer, type)	\
	(((long)(pointer) % (sizeof (type))) == 0)

/*
 * SizeIsValid --
 *	True iff size is valid.
 *
 * Note:
 *	Assumes that Size is an unsigned type.
 *
 *	Assumes valid size to be in the interval (0,infinity).
 */
#define SizeIsValid(size)		((size) > 0)

/*
 * SizeIsInBounds --
 *	True iff size is within given bounds.
 *
 * Note:
 *	Assumes Size is an unsigned type.
 *
 *	Assumes the bounded interval to be (0,max].
 */
#define SizeIsInBounds(size, max)	(0 < (size) && (size) <= (max))

/*
 * IndexIsValid --
 *	True iff index is valid.
 *
 * Note:
 *	Assumes Index is an unsigned type.
 *
 *	Assumes valid index to be in the interval [0,infinity).
 */
#define IndexIsValid(index)	true

/*
 * IndexIsInBounds --
 *	True iff index is within given bounds.
 *
 * Note:
 *	Assumes Index is an unsigned type.
 *
 *	Assumes the bounded interval to be [0,max).
 */
#define IndexIsInBounds(index, max)	((index) < (max))

/*
 * CountIsValid --
 *	True iff count is valid
 *
 * Note:
 *	Assumes Count is an unsigned type.
 *
 *	Assumes valid counts to be in the interval [0,infinity).
 */
#define CountIsValid(count)		true

/*
 * CountIsInBounds --
 *	True iff count is within given bounds.
 *
 * Note:
 *	Assumes Count is an unsigned type.
 *
 *	Assumes the bounded interval to be [0,max).
 */
#define CountIsInBounds(count, max)	IndexIsInBounds(count, max)

/*
 * OffsetIsInBounds --
 *	True iff offset is within given bounds.
 *
 * Note:
 *	Assumes the bounded interval to be [0,max).
 */
#define OffsetIsInBounds(offset, min, max) \
	((min) <= (offset) && (offset) < (max))

/*
 * StringIsValid --
 *	True iff string is valid.
 */
#define	StringIsValid(string)	PointerIsValid(string)

/*
 * ReturnStatusIsValid --
 *	True iff return status is valid.
 *
 * Note:
 *	Assumes that a library function can only indicate
 *	sucess or failure.
 */
#define ReturnStatusIsValid(status) \
	((-1) <= (status) && (status) <= 0)

/*
 * ReturnStatusIsSucess --
 *	True iff return status indicates a sucessful call.
 */
#define SucessfulReturnStatus(status) \
	((status) >= 0)

/*
 * End COMPILER AND HARDWARE DEPENDENT section
 */

/*
 * Begin COMPILER AND MACHINE INDEPENDENT section
 */
/* ----------------------------------------------------------------
 *		Section 7:  offsetof, lengthof, endof
 * ----------------------------------------------------------------
 */
/*
 * offsetof --
 *	Offset of a structure/union field within that structure/union.
 *
 *	XXX This is supposed to be part of stddef.h, but isn't on
 *	some systems (like SunOS 4).
 */
#ifndef offsetof
#define offsetof(type, field)	((long) &((type *)0)->field)
#endif /* offsetof */

/*
 * lengthof --
 *	Number of elements in an array.
 */
#define lengthof(array)	(sizeof (array) / sizeof ((array)[0]))

/*
 * endof --
 *	Address of the element one past the last in an array.
 */
#define endof(array)	(&array[lengthof(array)])

/* ----------------------------------------------------------------
 *		Section 8:  exception handling definitions
 *			    Assert, Trap, etc macros
 * ----------------------------------------------------------------
 */
/*
 * Exception Handling definitions
 */

typedef String	ExcMessage;
typedef struct Exception {
	ExcMessage	message;
} Exception;

extern Exception	FailedAssertion;
extern Exception	BadArg;
extern Exception	BadState;

extern
int
ExceptionalCondition ARGS((
	const String	conditionName,
	const Exception	*exceptionP,
	const String	details,
	const String	fileName,
	int		lineNumber
));

/*
 * NO_ASSERT_CHECKING, if defined, turns off all the assertions.
 * - plai  9/5/90
 *
 * It should _NOT_ be undef'ed in releases or in benchmark copies
 * 
 * #undef NO_ASSERT_CHECKING
 */

/*
 * Trap --
 *	Generates an exception if the given condition is true.
 *
 * Note:
 *	The trailing else is used to allow this macro to be used in
 *	single statement if, while, for, and do expressions, e.g.
 *
 *		if (tapeCount < 3)
 *			Trap(fd == -1, FailedFileOpen);
 *
 *		if (requests > 0)
 *			Assert(!QueueIsEmpty(queue));
 *
 *		if (!beenHere)
 *			AssertArg(PointerIsValid(initP));
 *
 *		if (beenHere)
 *			AssertState(ModuleInitialized)
 */
#define Trap(condition, exception) \
	if (condition) \
		ExceptionalCondition(CppAsString(condition), &(exception), \
			(String)NULL, __FILE__, __LINE__); \
	else

/*    
 *  TrapMacro is the same as Trap but it's intended for use in macros:
 *
 *	#define foo(x) (AssertM(x != 0) && bar(x))
 *
 *  Isn't CPP fun?
 */
#define TrapMacro(condition, exception) \
    ((bool) ((! condition) || \
	     (ExceptionalCondition(CppAsString(condition), \
				  &(exception), \
				  (String) NULL, __FILE__, __LINE__))))
    
#ifdef NO_ASSERT_CHECKING
#define Assert(condition)
#define AssertMacro(condition)	true
#define AssertArg(condition)
#define AssertState(condition)
#else
#define Assert(condition) \
	Trap(!(condition), FailedAssertion)

#define AssertMacro(condition) \
	TrapMacro(!(condition), FailedAssertion)

#define AssertArg(condition) \
	Trap(!(condition), BadArg)

#define AssertState(condition) \
	Trap(!(condition), BadState)

#endif   /* NO_ASSERT_CHECKING */

/*
 * LogTrap --
 *	Generates an exception with a message if the given condition is true.
 *
 * Note:
 *	The trailing else is used to allow this macro to be used in
 *	single statement if, while, for, and do expressions, e.g.
 *
 *		if (slowPointer)
 *			LogTrap(!PointerIsValid(pointer), NoMoreMemory,
 *				("size 0x%x", size));
 *
 *		if (requests > 0)
 *			LogAssert(!QueueIsEmpty(queue), ("req. %d", requests));
 *
 *		if (PointerIsSlowPointer(pointer))
 *			LogAssertArg(pointer >= &end, ("ptr 0x%x", pointer));
 *
 *		if (!slowPointer)
 *			LogAssertState(IsStackable(Current),
 *				("state %d", typeof(current)))
 */
#define LogTrap(condition, exception, printArgs) \
	if (condition) \
		ExceptionalCondition(CppAsString(condition), &(exception), \
			form printArgs, __FILE__, __LINE__); \
	else

/*    
 *  LogTrapMacro is the same as LogTrap but it's intended for use in macros:
 *
 *	#define foo(x) (LogAssertMacro(x != 0, "yow!") && bar(x))
 */
#define LogTrapMacro(condition, exception, printArgs) \
    ((bool) ((! condition) || \
	     (ExceptionalCondition(CppAsString(condition), \
				   &(exception), \
				   form printArgs, __FILE__, __LINE__))))
    
#ifdef NO_ASSERT_CHECKING
#define LogAssert(condition, printArgs)
#define LogAssertMacro(condition, printArgs) true
#define LogAssertArg(condition, printArgs)
#define LogAssertState(condition, printArgs)
#else
#define LogAssert(condition, printArgs) \
	LogTrap(!(condition), FailedAssertion, printArgs)

#define LogAssertMacro(condition, printArgs) \
	LogTrapMacro(!(condition), FailedAssertion, printArgs)

#define LogAssertArg(condition, printArgs) \
	LogTrap(!(condition), BadArg, printArgs)

#define LogAssertState(condition, printArgs) \
	LogTrap(!(condition), BadState, printArgs)

#endif   /* NO_ASSERT_CHECKING */

/* ----------------------------------------------------------------
 *		Section 9:  Min, Max, Abs macros
 * ----------------------------------------------------------------
 */
/*
 * Max --
 *	Return the maximum of two numbers.
 */
#define Max(x, y)	((x) > (y) ? (x) : (y))
#ifndef MAX
#define MAX(x, y)	((x) > (y) ? (x) : (y))
#endif /* MAX */

/*
 * Min --
 *	Return the minimum of two numbers.
 */
#define Min(x, y)	((x) < (y) ? (x) : (y))
#ifndef MIN
#define MIN(x, y)	((x) < (y) ? (x) : (y))
#endif /* MIN */

/*
 * Abs --
 *	Return the absolute value of the argument.
 */
#define Abs(x)		((x) >= 0 ? (x) : -(x))

/* ----------------------------------------------------------------
 *		Section 10:  LintCast, RevisionId, RcsId, SccsId macros
 * ----------------------------------------------------------------
 */
/*
 * LintCast --
 *	Coerce value to a given type, without upsetting lint.
 *	Use *ONLY* for *VALID* casts that lint complains about.
 *
 * Note:
 *	The ?: operator is used to avoid "variable unused" warnings.
 */
#ifdef	lint
# define LintCast(type, value)	((value) ? ((type) 0) : ((type) 0))

# define RevisionId(var, value)
#else	/* !defined(lint) */
# define LintCast(type, value)	((type) (value))

# ifdef XSTR
#  define RevisionId(var, value)	static char *var = value
# else	/* !defined(XSTR) */
#  define RevisionId(var, value)	static char var[] = value
# endif	/* !defined(XSTR) */
#endif	/* !defined(lint) */

/* ----------------
 *	RcsId and SccsId macros..
 * ----------------
 */
#if (defined(lint) || defined(SABER))
#define SccsId(id)	
#define RcsId(id)	
#else
#define SccsId(id)	RevisionId(_SccsId_, id)
#define RcsId(id)	RevisionId(_RcsId_, id)
#endif

/* ----------------------------------------------------------------
 *		Section 12: externs
 * ----------------------------------------------------------------
 */

/* ----------------
 *	form is used by assert and the exception handling stuff
 * ----------------
 */
extern String form();

/* ----------------------------------------------------------------
 *		Section 13: system-specific hacks
 *
 *	This should be limited to things that absolutely have to be
 *	included in every source file.  The changes should be factored
 *	into a separate file so that changes to one port don't require
 *	changes to c.h (and everyone recompiling their whole system).
 * ----------------------------------------------------------------
 */

#if defined(PORTNAME_hpux) 
#include "port/hpux/fixade.h"		/* for 8.07 unaligned access fixup */
#endif /* PORTNAME_hpux */

#if defined(PORTNAME_sparc_solaris) 
#include "port/sparc_solaris/strings.h"	/* b{copy,zero,cmp} is pervasive */
#endif /* PORTNAME_sparc_solaris */

/* ----------------
 *	end of c.h
 * ----------------
 */
#endif	/* !defined(CIncluded) */
@


1.58
log
@change ExceptionalCondition to return int instead of void
(it doesn't actually return but it is used in macro expressions;
the way it was being used broke the aix compiler.)
@
text
@d42 1
a42 1
 *	$Header: /faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.57 1994/06/16 03:23:06 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.57 1994/06/16 03:23:06 aoki Exp aoki $"
d168 1
a168 1
#if ! defined(PORTNAME_bsd44)
d176 1
d178 7
@


1.57
log
@fix for ridiculously pervasive bcopy
@
text
@d42 1
a42 1
 *	$Header: /import/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.56 1994/02/07 11:45:48 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /import/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.56 1994/02/07 11:45:48 aoki Exp aoki $"
d698 1
a698 1
void
d753 1
a753 2
				  (String) NULL, __FILE__, __LINE__), \
	      false)))
d812 1
a812 2
				   form printArgs, __FILE__, __LINE__), \
	      false)))
@


1.56
log
@proto fixes
@
text
@d42 1
a42 1
 *	$Header: /import/faerie/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.55 1994/01/18 21:15:02 boris Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /import/faerie/faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.55 1994/01/18 21:15:02 boris Exp aoki $"
d924 1
a924 1
#include "port/hpux/fixade.h"	/* for 8.07 unaligned access fixup */
d927 4
@


1.55
log
@added #define for jaquith
@
text
@d42 1
a42 1
 *	$Header: /local/postgres4-1/src/backend/tmp/RCS/c.h,v 1.54 1993/09/27 04:48:18 aoki Exp boris $
d49 1
a49 1
#define C_H	"$Header: /local/postgres4-1/src/backend/tmp/RCS/c.h,v 1.54 1993/09/27 04:48:18 aoki Exp boris $"
d168 1
a168 1
#if ! defined(PORTNAME_bsd44) && ! defined(PORTNAME_alpha)
d911 1
a911 3
extern
String
form ARGS(( int, ... ));
@


1.54
log
@removed HAVE_STD_HDRS (made it NEED_STD_HDRS instead :-)
@
text
@d42 1
a42 1
 *	$Header: /faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.53 1993/09/21 20:28:16 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /faerie/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.53 1993/09/21 20:28:16 aoki Exp aoki $"
d83 1
@


1.53
log
@parameterized <stdlib> <stddef> with HAVE_STD_HDRS
some systems have ANSI cpp but don't define __STDC__ so ANSI cpp
	is parameterized as HAVE_ANSI_CPP
removed SymbolDecl and ExternDecl as these are no longer required
	for the ultrix dynamic loader stuff
@
text
@d42 1
a42 1
 *	$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.52 1993/08/15 05:42:04 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.52 1993/08/15 05:42:04 aoki Exp aoki $"
d186 3
a188 1
#define	HAVE_STD_HDRS	/* all ANSI systems must have stddef/stdlib */
d281 1
a281 4
#ifdef HAVE_STD_HDRS
#include <stddef.h>
#include <stdlib.h>
#else /* HAVE_STD_HDRS */
d288 4
a291 1
#endif /* HAVE_STD_HDRS */
@


1.52
log
@moved all of the awful #pragma cruft into port/hpux where it belongs.
@
text
@d31 1
a31 1
 *	11)	SymbolDecl, ExternDecl macros
d42 1
a42 1
 *	$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.51 1993/08/14 21:30:04 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.51 1993/08/14 21:30:04 aoki Exp aoki $"
d185 2
a186 16
/*
 * CppAsString --
 *	Convert the argument to a string, using the C preprocessor.
 */
#define CppAsString(identifier)	#identifier

/*
 * CppConcat --
 *	Concatenate two arguments together, using the C preprocessor.
 */
#define CppConcat(x, y)		x##y
#define CppConcat0(x, y)	x##y
#define CppConcat1(x, y)	x##y
#define CppConcat2(x, y)	x##y
#define CppConcat3(x, y)	x##y
#define CppConcat4(x, y)	x##y
a204 27
 * CppIdentity -- On Reiser based cpp's this is used to concatenate
 *	two tokens.  That is
 *		CppIdentity(A)B	==> AB
 *	We renamed it to _private_CppIdentity because it should not
 *	be referenced outside this file.  On other cpp's it
 *	produces  A  B.
 */
#define _priv_CppIdentity(x)x

/*
 * CppAsString --
 *	Convert the argument to a string, using the C preprocessor.
 */
#define CppAsString(identifier)	"identifier"

/*
 * CppConcat --
 *	Concatenate two arguments together, using the C preprocessor.
 */
#define CppConcat(x, y)		_priv_CppIdentity(x)y
#define CppConcat0(x, y)	_priv_CppIdentity(x)y
#define CppConcat1(x, y)	_priv_CppIdentity(x)y
#define CppConcat2(x, y)	_priv_CppIdentity(x)y
#define CppConcat3(x, y)	_priv_CppIdentity(x)y
#define CppConcat4(x, y)	_priv_CppIdentity(x)y

/*
d229 21
d251 15
a265 1
#endif	/* !defined(__STDC__) */ /* NOT ANSI C */
d267 1
d273 1
a273 1
#ifdef	PROTOTYPES
d277 1
a277 1
#endif
d279 11
d426 2
a427 1
	} IntArray;
a482 26
#else /* PALLOC_DEBUG */

#if defined(PORTNAME_ultrix4) || \
    defined(PORTNAME_hpux) || \
    defined(PORTNAME_sparc) || \
    defined(PORTNAME_bsd44) || \
    defined(PORTNAME_alpha) || \
    defined(__STDC__)
/*
 * All of our target machines have <stdlib.h>
 * (mind you, they sometimes aren't very "std"...)
 */
#include <stdlib.h>
#else /* stdlib */
extern
char *	/* as defined in /usr/lib/lint/llib-lc */
malloc ARGS((
	Size	nBytes
));
extern
/* void */      /* as defined in /usr/lib/lint/llib-lc */
free ARGS((
        char    *p
));
#endif /* stdlib */

d656 3
d660 2
a661 2
#ifdef offsetof
#undef offsetof
a662 1
#define offsetof(type, field)	((long) &((type *)0)->field)
a899 37
 *		Section 11:  SymbolDecl, ExternDecl macros
 * ----------------------------------------------------------------
 */
/*
 * SymbolDecl --
 * ExternDecl --
 *	Dynamic function and data symbol declaration macros.
 *
 * Sample usage:
 *
 *	extern int fooValue;
 *	extern void foo ARGS((void));
 *	// more declarations ...
 *
 *	#define yourfilename_SYMBOLS \
 *		ExternDecl(fooValue), \
 *		SymbolDecl(foo)
 *
 *	// DO *NOT* INCLUDE A TRAILING ^ COMMA
 */
#ifndef SABER
#define constantquote(x)"
#define prefixquote(x)constantquote(x)x
#define prefixquoteunder(x)prefixquote(_)x
#define symstring(x)prefixquoteunder(x)"

#define SymbolDecl(_symbol_) \
	{ (func_ptr)_symbol_, symstring(_symbol_) }

#define ExternDecl(_external_) \
	{ (data_ptr)&(_external_), symstring(_external_) }
#else
#define SymbolDecl(_symbol_) 
#define ExternDecl(_external_)
#endif

/* ----------------------------------------------------------------
d914 5
a921 2
/* HP-UX */

d923 1
a923 1
#include "port/hpux/fixade.h"
@


1.51
log
@added some stuff to work around broken struct initialization in
hpux 9.01
@
text
@d42 1
a42 1
 *	$Header: /home2/aoki/master/src/backend/tmp/RCS/c.h,v 1.50 1993/07/10 03:13:08 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /home2/aoki/master/src/backend/tmp/RCS/c.h,v 1.50 1993/07/10 03:13:08 aoki Exp aoki $"
d974 1
a974 27
#if !defined(NOFIXADE)
/* ----------------
 *	This cheesy hack turns ON unaligned-access fixup on H-P PA-RISC;
 *	the resulting object files contain code that explicitly handles
 *	realignment on reference, so it slows memory access down by a 
 *	considerable factor.  It must be used in conjunction with the +u 
 *	flag to cc.  The #pragma is included in c.h to be safe since EVERY 
 *	source file that performs unaligned access must contain the #pragma.
 * ----------------
 */
#pragma HP_ALIGN HPUX_NATURAL_S500
#endif /* !NOFIXADE */
/* ----------------
 *	This is so bogus.  The HP-UX 9.01 compiler has totally broken
 *	struct initialization code.  It actually length-checks ALL 
 *	array initializations within structs against the FIRST one that 
 *	it sees (when #pragma HP_ALIGN HPUX_NATURAL_S500 is defined).. 
 *	we have to throw in this unused structure before struct varlena
 *	is defined.
 * ----------------
 */
struct HP_WAY_BOGUS {
	char	hpwb_bogus[8192];
};
struct HP_TOO_BOGUS {
	int	hptb_bogus[8192];
};
@


1.50
log
@changed HPUX_WORD to HPUX_NATURAL_S500 :-P
@
text
@d42 1
a42 1
 *	$Header: /faerie/hpux/postgres/src/backend/tmp/RCS/c.h,v 1.49 1993/07/07 01:21:06 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /faerie/hpux/postgres/src/backend/tmp/RCS/c.h,v 1.49 1993/07/07 01:21:06 aoki Exp aoki $"
d973 10
a982 7
/*
 * This cheesy hack turns ON unaligned-access fixup on H-P PA-RISC;
 * the resulting object files contain code that explicitly handles
 * realignment on reference, so it slows memory access down by a 
 * considerable factor.  It must be used in conjunction with the +u 
 * flag to cc.  The #pragma is included in c.h to be safe since EVERY 
 * source file that performs unaligned access must contain the #pragma.
a983 2
#if defined(PORTNAME_hpux) && !defined(NOFIXADE)
/* permit unaligned access */
d985 17
a1001 1
#endif /* PORTNAME_hpux && !NOFIXADE */
@


1.49
log
@added the magical HP-UX #pragma that permits unaligned access.
fully conditionalized, of course.
@
text
@d42 1
a42 1
 *	$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.48 1993/06/16 04:19:02 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.48 1993/06/16 04:19:02 aoki Exp aoki $"
d982 2
a983 2
/* permit unaligned access (down to 16-bit shortword boundaries). */
#pragma HP_ALIGN HPUX_WORD
@


1.48
log
@more linux compat cruft - removed sprite-isms, added __STDC__ to
list of items to make <stdlib.h> conditional on, #undef'd offsetof
prior to defining it..
@
text
@d6 1
a6 1
 *	Fundamental C definitions.  This is included by nearly
d33 1
d42 1
a42 1
 *	$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.47 1993/06/13 22:58:21 aoki Exp aoki $
d49 1
a49 1
#define C_H	"$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.47 1993/06/13 22:58:21 aoki Exp aoki $"
d966 20
@


1.47
log
@got rid of new() macro since c++ compilers *really* don't like
it (this is a problem when using postgres .h files with c++)
@
text
@d41 1
a41 1
 *	$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.46 1993/04/14 00:14:36 sunita Exp aoki $
d48 1
a48 1
#define C_H	"$Header: /home2/aoki/postgres/src/backend/tmp/RCS/c.h,v 1.46 1993/04/14 00:14:36 sunita Exp aoki $"
d147 1
d149 2
d152 1
d169 1
a236 8
#ifdef sprite
#define CppConcat(x, y)         x/**/y
#define CppConcat0(x, y)        x/**/y
#define CppConcat1(x, y)        x/**/y
#define CppConcat2(x, y)        x/**/y
#define CppConcat3(x, y)        x/**/y
#define CppConcat4(x, y)        x/**/y
#else
a242 1
#endif /* sprite */
d476 1
d481 2
a482 1
    defined(PORTNAME_alpha)
d500 1
d675 3
@


1.46
log
@Added some array definitions.
@
text
@d41 1
a41 1
 *	$Header: /home2/aoki/master/src/backend/tmp/RCS/c.h,v 1.45 1993/03/23 02:26:31 aoki Exp $
d48 1
a48 1
#define C_H	"$Header: /home2/aoki/master/src/backend/tmp/RCS/c.h,v 1.45 1993/03/23 02:26:31 aoki Exp $"
a503 9
/*
 * new --
 *	Allocate a new instance of the given type.
 *
 * Note:
 *	Does NOT work with arrays.  Use newv instead.
 */
#define new(type)	LintCast(type *, malloc(sizeof (type)))

@


1.45
log
@c.h now includes <stdlib.h> (though strange things may happen
if you are recompiling from scratch with PALLOC_DEBUG set, since
inclusion of <stdlib.h> is dependent on it being false).

int32 is now "int" since this works on everything we support
or will support in the near future.  we should think about
how to factor out architecture and o/s dependencies better,
but for now this works.
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.44 1993/02/22 20:27:18 marc Exp $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.44 1993/02/22 20:27:18 marc Exp $"
d420 4
@


1.44
log
@make SONY_JUKEBOX and MAIN_MEMORY conditional on SEQUOIA
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.43 1993/01/01 00:06:09 marc Exp marc $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.43 1993/01/01 00:06:09 marc Exp marc $"
d309 1
a309 1
typedef signed long	int32;		/* >= 32 bits */
d331 1
a331 1
typedef unsigned long	uint32;		/* >= 32 bits */
d476 9
a484 1
#if defined(PORTNAME_bsd44) || defined(PORTNAME_alpha)
d486 1
a486 1
#else
d497 1
a497 1
#endif /* ! PORTNAME_bsd44 */
@


1.43
log
@don't prototype malloc/free on alpha
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.42 1992/12/31 02:36:12 marc Exp marc $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.42 1992/12/31 02:36:12 marc Exp marc $"
d79 1
d82 1
@


1.42
log
@check for PORTNAME_${PORTNAME} (duh...)
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.41 1992/12/31 02:03:45 marc Exp marc $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.41 1992/12/31 02:03:45 marc Exp marc $"
d474 1
a474 1
#if defined(PORTNAME_bsd44)
@


1.41
log
@oops - priv_CppIdentity
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.40 1992/12/30 17:17:45 marc Exp marc $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.40 1992/12/30 17:17:45 marc Exp marc $"
d160 1
a160 1
#if PORTNAME != bsd44
d474 1
a474 1
#if PORTNAME == bsd44
d487 1
a487 1
#endif /* ! PORTNAME == bsd44 */
@


1.40
log
@CppIdentity is not public
@
text
@d41 1
a41 1
 *	$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.39 92/07/13 07:40:12 hong Exp Locker: marc $
d48 1
a48 1
#define C_H	"$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/c.h,v 1.39 92/07/13 07:40:12 hong Exp Locker: marc $"
d218 1
a218 1
#define _private_CppIdentity(x)x
@


1.39
log
@introduced intPtr type, to be used in class defs.
@
text
@d41 1
a41 1
 *	$Header: /home/postgres/hong/postgres/src/lib/H/tmp/RCS/c.h,v 1.38 1992/06/26 17:55:11 mer Exp $
d48 1
a48 1
#define C_H	"$Header: /home/postgres/hong/postgres/src/lib/H/tmp/RCS/c.h,v 1.38 1992/06/26 17:55:11 mer Exp $"
d160 1
d162 1
a177 6
 * CppIdentity --
 *	C preprocessor identity macro, returns the argument.
 */
#define CppIdentity(x)x

/*
d211 6
a216 2
 * CppIdentity --
 *	C preprocessor identity macro, returns the argument.
d218 1
a218 1
#define CppIdentity(x)x
d238 6
a243 6
#define CppConcat(x, y)		CppIdentity(x)y
#define CppConcat0(x, y)	CppIdentity(x)y
#define CppConcat1(x, y)	CppIdentity(x)y
#define CppConcat2(x, y)	CppIdentity(x)y
#define CppConcat3(x, y)	CppIdentity(x)y
#define CppConcat4(x, y)	CppIdentity(x)y
d474 3
d487 1
@


1.38
log
@add a type BoolPtr (pointer to bool)
@
text
@d41 1
a41 1
 *	$Header: /private/mer/pg/src/lib/H/tmp/RCS/c.h,v 1.37 1992/03/05 00:40:25 hong Exp mer $
d48 1
a48 1
#define C_H	"$Header: /private/mer/pg/src/lib/H/tmp/RCS/c.h,v 1.37 1992/03/05 00:40:25 hong Exp mer $"
d440 1
@


1.37
log
@added stuff for debugging buffer leaks
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.36 91/12/10 15:59:38 mao Exp Locker: hong $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.36 91/12/10 15:59:38 mao Exp Locker: hong $"
d143 1
@


1.36
log
@turn experimental storage managers back on
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.35 91/11/20 21:25:01 mer Exp Locker: mao $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.35 91/11/20 21:25:01 mer Exp Locker: mao $"
d99 19
@


1.35
log
@undefine storage manager switch for the release
@
text
@d41 1
a41 1
 *	$Header: /users/mer/postgres/src/lib/H/tmp/RCS/c.h,v 1.34 1991/11/07 22:12:13 mer Exp mer $
d48 1
a48 1
#define C_H	"$Header: /users/mer/postgres/src/lib/H/tmp/RCS/c.h,v 1.34 1991/11/07 22:12:13 mer Exp mer $"
d79 2
a80 2
#undef SONY_JUKEBOX
#undef MAIN_MEMORY
@


1.34
log
@fix prototype of form()
@
text
@d41 1
a41 1
 *	$Header: /users/mer/postgres/src/lib/H/tmp/RCS/c.h,v 1.33 1991/10/06 21:34:05 hong Exp $
d48 1
a48 1
#define C_H	"$Header: /users/mer/postgres/src/lib/H/tmp/RCS/c.h,v 1.33 1991/10/06 21:34:05 hong Exp $"
d79 2
a80 2
#define SONY_JUKEBOX
#define MAIN_MEMORY
@


1.33
log
@added macros MIN and MAX here so that they are only defined at one
place
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.32 91/10/01 16:40:34 glass Exp Locker: hong $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.32 91/10/01 16:40:34 glass Exp Locker: hong $"
d931 1
a931 3
form ARGS((
	String	format,...
));
@


1.32
log
@initial ansi c compatibility checkin
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.31 91/08/20 05:32:45 mao Exp $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.31 91/08/20 05:32:45 mao Exp $"
d826 3
d835 3
@


1.31
log
@turn on jukebox, main memory storage managers for development.
@
text
@d41 1
a41 1
 *	$Header: /local/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.30 1991/08/12 19:48:22 mao Exp mao $
d48 1
a48 1
#define C_H	"$Header: /local/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.30 1991/08/12 19:48:22 mao Exp mao $"
d140 1
d172 5
a177 10
/*
 * ARGS --
 *	Specifies parameter types of the declared function.
 *
 * Example:
 *	extern int	printf ARGS((const String format, ...));
 *	extern void	noop ARGS((void));
 */
#define ARGS(args)	args

d212 5
d219 5
a250 8
/*
 * ARGS --
 *	Specifies parameter types of the declared function.
 *
 * Example:
 *	extern int	printf ARGS((const String format, ...));
 */
#define ARGS(args)	(/* args */)
d258 7
@


1.30
log
@turn off MAIN_MEMORY, SONY_JUKEBOX for the released system
@
text
@d41 1
a41 1
 *	$Header: /local/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.29 1991/07/24 07:48:20 mao Exp mao $
d48 1
a48 1
#define C_H	"$Header: /local/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.29 1991/07/24 07:48:20 mao Exp mao $"
d79 2
a80 2
#undef SONY_JUKEBOX
#undef MAIN_MEMORY
@


1.29
log
@add main memory storage manager
@
text
@d41 1
a41 1
 *	$Header: /users/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.28 1991/07/22 22:21:35 mao Exp mao $
d48 1
a48 1
#define C_H	"$Header: /users/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.28 1991/07/22 22:21:35 mao Exp mao $"
d74 3
d79 2
a80 2
#define SONY_JUKEBOX
#define MAIN_MEMORY
@


1.28
log
@jukebox storage manager installation
@
text
@d41 1
a41 1
 *	$Header: /users/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.27 1991/06/18 23:28:26 cimarron Exp mao $
d48 1
a48 1
#define C_H	"$Header: /users/mao/postgres/src/lib/H/tmp/RCS/c.h,v 1.27 1991/06/18 23:28:26 cimarron Exp mao $"
d77 1
@


1.27
log
@reorganized executor to use tuple table properly for nested dot stuff
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.26 91/06/13 11:19:58 kemnitz Exp Locker: cimarron $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.26 91/06/13 11:19:58 kemnitz Exp Locker: cimarron $"
d71 6
@


1.26
log
@got rid of "undef NO_ASSERT_CHECKING".
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.25 91/04/28 09:15:08 cimarron Exp Locker: kemnitz $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.25 91/04/28 09:15:08 cimarron Exp Locker: kemnitz $"
a53 1
#undef PALLOC_DEBUG 
d56 17
d76 2
d79 2
a80 2
#define palloc(size)       palloc_debug(__FILE__, __LINE__, size)
#define pfree(ptr)         pfree_debug(__FILE__, __LINE__, ptr)
d82 1
a82 1
	MemoryContextAlloc_Debug(__FILE__, __LINE__, context, size)
d84 4
a87 4
	MemoryContextFree_Debug(__FILE__, __LINE__, context, ptr)
#define AllocSetReset(set) AllocSetReset_debug(__FILE__, __LINE__, set)
#define malloc(size)	    malloc_debug(__FILE__, __LINE__, size)
#define free(ptr)	    free_debug(__FILE__, __LINE__, ptr)
@


1.25
log
@Converted IsValid code into macros and added an improved NodeIsType scheme
@
text
@d41 1
a41 1
 *	$Header: RCS/c.h,v 1.24 91/04/01 08:44:00 hong Exp Locker: cimarron $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.24 91/04/01 08:44:00 hong Exp Locker: cimarron $"
d659 3
a662 1
#undef NO_ASSERT_CHECKING
@


1.24
log
@PALLOC_DEBUG now also catches memory allocations that bypasses palloc(),
e.g., allocations through MemoryContextAlloc() or simply direct
malloc().
@
text
@d1 3
a3 3
/*
 * c.h --
 *	Fundamental C definitions.
d5 33
a37 1
 * Note:
d40 3
a42 2
 * Identification:
 *	$Header: RCS/c.h,v 1.23 91/02/24 00:59:43 cimarron Exp Locker: hong $
d48 1
a48 1
#define C_H	"$Header: RCS/c.h,v 1.23 91/02/24 00:59:43 cimarron Exp Locker: hong $"
d50 3
a52 3
/* ----------------
 *	these govern behaviour of palloc
 * ----------------
a59 1

d76 4
d99 13
d113 14
a128 1
 *	Used in non ANSI C compilers to concatenate tokens.
a131 2
#ifdef	__STDC__ /* ANSI C */

d154 2
d158 1
a158 1
 *	Variable holding address of any memory resident object.
d160 1
a160 1
typedef void	*Pointer;
d167 1
a167 1
#define NULL	((void *) 0)
d170 5
a174 1
#else	/* !defined(__STDC__) */ /* NOT ANSI C */
a225 20
/*
 * offsetof --
 *	Offset of a structure/union field within that structure/union.
 */
#define offsetof(type, field)	((long) &((type *)0)->field)

/*
 * Pointer --
 *	Variable containing address of any memory resident object.
 */
typedef char	*Pointer;

#ifndef	NULL
/*
 * NULL --
 *	Null pointer.
 */
#define NULL	0
#endif	/* !defined(NULL) */

d233 3
a235 4

/*
 * BoolIsValid --
 *	True iff bool is valid.
a236 1
#define	BoolIsValid(boolean)	((boolean) == false || (boolean) == true)
a238 23
 * PointerIsValid --
 *	True iff pointer is valid.
 */
#define PointerIsValid(pointer)	(bool)((pointer) != NULL)

/*
 * PointerIsInBounds --
 *	True iff pointer is within given bounds.
 *
 * Note:
 *	Assumes the bounded interval to be [min,max),
 *	i.e. closed on the left and open on the right.
 */
#define PointerIsInBounds(pointer, min, max) \
	((min) <= (pointer) && (pointer) < (max))

/*
 * PointerIsAligned --
 *	True iff pointer is properly aligned to point to the given type.
 */
#define PointerIsAligned(pointer, type)	\
	(((long)(pointer) % (sizeof (type))) == 0)
/*
d357 142
a520 9
 * Index --
 *	Index into any memory resident array.
 *
 * Note:
 *	Indices are non negative.
 */
typedef unsigned int	Index;

/*
a542 6
 * Count --
 *	Generic counter type.
 */
typedef unsigned int	Count;

/*
a564 10
 * Offset --
 *	Offset into any memory resident array.
 *
 * Note:
 *	This differs from an Index in that an Index is always
 *	non negative, whereas Offset may be negative.
 */
typedef signed int	Offset;

/*
d575 2
a576 1
 * End COMPILER AND HARDWARE DEPENDENT section
d578 1
a579 1

d581 6
a586 1
 * Begin COMPILER AND MACHINE INDEPENDENT section
d588 2
d592 2
a593 2
 * lengthof --
 *	Number of elements in an array.
d595 2
a596 1
#define lengthof(array)	(sizeof (array) / sizeof ((array)[0]))
d599 1
a599 2
 * endof --
 *	Address of the element one past the last in an array.
d601 1
a601 30
#define endof(array)	(&array[lengthof(array)])

#ifdef PALLOC_DEBUG
extern
char *	/* as defined in /usr/lib/lint/llib-lc */
malloc_debug ARGS((
	String	file,
	int 	line,
	Size	nBytes
));
extern
/* void */      /* as defined in /usr/lib/lint/llib-lc */
free_debug ARGS((
	String	file,
	int	line,
        char    *p
));
#else /* PALLOC_DEBUG */
extern
char *	/* as defined in /usr/lib/lint/llib-lc */
malloc ARGS((
	Size	nBytes
));
extern
/* void */      /* as defined in /usr/lib/lint/llib-lc */
free ARGS((
        char    *p
));
#endif /* PALLOC_DEBUG */

d603 1
a603 5
 * new --
 *	Allocate a new instance of the given type.
 *
 * Note:
 *	Does NOT work with arrays.  Use newv instead.
d605 4
a608 2
#define new(type)	LintCast(type *, malloc(sizeof (type)))

d610 2
a611 2
 * newv --
 *	Allocate a new array.
d613 1
a613 1
#define newv(type, n)	LintCast(type *, malloc(sizeof (type) * (n)))
d616 2
a617 5
 * delete --
 *	Free allocated storage.
 *
 * Note:
 *	The variable is set to null to help catch errors.
d619 1
a619 1
#define delete(pointer)	(free((char *) (pointer)), (pointer) = NULL)
d622 2
a623 2
 * String --
 *	String of characters.
d625 1
a625 1
typedef char	*String;
d627 4
a630 3
/*
 * StringIsValid --
 *	True iff string is valid.
a631 2
#define	StringIsValid(string)	PointerIsValid(string)

a659 1

d688 14
a702 1

d704 1
a704 1

a705 1

a706 1

a707 1

d711 3
a721 6
extern
String
form ARGS((
	String	format,...
));

d750 12
a762 1

d764 1
a764 1

a765 1

a766 1

a767 1

d771 3
d782 4
d804 4
d842 4
a845 2
#define ALLOCATE(foo) (foo)palloc(sizeof(struct CppConcat(_,foo)))

d878 4
a881 3
/* ----------------
 *	stuff added from status.h
 * ----------------
a882 5
/*
 * status.h --
 *	POSTGRES library function return status.
 * 	$Header: RCS/c.h,v 1.23 91/02/24 00:59:43 cimarron Exp Locker: hong $
 */
d884 3
a886 12
#ifndef	StatusIncluded	/* Include this file only once. */
#define StatusIncluded	1

/*
 * ReturnStatus --
 *	Return status from POSTGRES library functions.
 *
 * Note:
 *	Most POSTGRES functions will not return a status.
 *	In the future, there should be a global variable
 *	which indicates the reason for the failure--the
 *	identifier of an error message in the ERROR relation.
d888 5
a892 21
typedef int	ReturnStatus;

/*
 * ReturnStatusIsValid --
 *	True iff return status is valid.
 *
 * Note:
 *	Assumes that a library function can only indicate
 *	sucess or failure.
 */
#define ReturnStatusIsValid(status) \
	((-1) <= (status) && (status) <= 0)

/*
 * ReturnStatusIsSucess --
 *	True iff return status indicates a sucessful call.
 */
#define SucessfulReturnStatus(status) \
	((status) >= 0)

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


1.23
log
@made #undef PALLOC_DEBUG the default
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.22 91/02/24 00:47:31 cimarron Exp Locker: cimarron $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.22 91/02/24 00:47:31 cimarron Exp Locker: cimarron $"
d23 17
d457 1
d460 15
d478 6
a484 11
/* ----------------
 *	allocation debugging stuff
 * ----------------
 */

#ifdef PALLOC_DEBUG
#define palloc(size)       palloc_debug(__FILE__, __LINE__, size)
#define pfree(ptr)         pfree_debug(__FILE__, __LINE__, ptr)
#define AllocSetReset(set) AllocSetReset_debug(__FILE__, __LINE__, set)
#endif PALLOC_DEBUG

a499 6
extern
/* void */	/* as defined in /usr/lib/lint/llib-lc */
free ARGS((
	char	*p
));

d747 1
a747 1
 * 	$Header: RCS/c.h,v 1.22 91/02/24 00:47:31 cimarron Exp Locker: cimarron $
@


1.22
log
@added palloc_debug tracing facility
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.21 91/01/18 21:56:28 hong Exp Locker: cimarron $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.21 91/01/18 21:56:28 hong Exp Locker: cimarron $"
d21 1
a21 1
#define PALLOC_DEBUG 
d725 1
a725 1
 * 	$Header: RCS/c.h,v 1.21 91/01/18 21:56:28 hong Exp Locker: cimarron $
@


1.21
log
@change for the new buffer manager
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.20 90/10/02 06:16:52 goh Exp Locker: hong $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.20 90/10/02 06:16:52 goh Exp Locker: hong $"
d17 6
d446 11
d725 1
a725 1
 * 	$Header: RCS/c.h,v 1.20 90/10/02 06:16:52 goh Exp Locker: hong $
@


1.20
log
@minor fix so saber won't barf over rcsid's
if you are only "upgrading" this file from 1.19 to 1.20
you may safely touch all ".o"s in your tree
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.20 90/10/02 05:56:21 goh Exp $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.20 90/10/02 05:56:21 goh Exp $"
d38 2
d708 1
a708 1
 * 	$Header: RCS/c.h,v 1.20 90/10/02 05:56:21 goh Exp $
@


1.19
log
@a minor fix so that saber will load these
non-conforming files
... someone really should take out the SymbolDecls
and all that bogus #define foo "
stuff ... it doesn't conform _at_all_ to ANSI standards
..
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.18 90/09/06 13:03:01 plai Exp $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.18 90/09/06 13:03:01 plai Exp $"
d657 1
a657 1
#ifdef LINT
d706 1
a706 1
 * 	$Header: RCS/c.h,v 1.18 90/09/06 13:03:01 plai Exp $
@


1.18
log
@Set the default so that NO_ASSERT_CHECKING is undefined i.e. do assertions
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.17 90/09/06 12:58:40 plai Exp Locker: plai $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.17 90/09/06 12:58:40 plai Exp Locker: plai $"
d684 1
a684 1

d695 4
a698 1

d706 1
a706 1
 * 	$Header: RCS/c.h,v 1.17 90/09/06 12:58:40 plai Exp Locker: plai $
@


1.17
log
@added macro so that if NO_ASSERT_CHECKING is defined, no assertions will
be done at all
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.16 90/08/20 14:30:17 choi Exp $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.16 90/08/20 14:30:17 choi Exp $"
d509 1
a509 1
#define NO_ASSERT_CHECKING 1
d703 1
a703 1
 * 	$Header: RCS/c.h,v 1.16 90/08/20 14:30:17 choi Exp $
@


1.16
log
@lines added for Sprite OS port.
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.15 90/08/17 11:31:11 cimarron Exp Locker: choi $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.15 90/08/17 11:31:11 cimarron Exp Locker: choi $"
d504 8
d537 10
d556 2
d592 10
d611 2
d703 1
a703 1
 * 	$Header: RCS/c.h,v 1.15 90/08/17 11:31:11 cimarron Exp Locker: choi $
@


1.15
log
@added status.h stuff to the bottom of this file.
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.14 90/08/08 08:16:21 cimarron Exp Locker: cimarron $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.14 90/08/08 08:16:21 cimarron Exp Locker: cimarron $"
d95 3
d99 1
d671 1
a671 1
 * 	$Header: RCS/status.h,v 1.5 90/08/17 08:54:57 cimarron Exp $
@


1.14
log
@
reorganized some header files
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.13 89/09/25 11:27:24 cimarron Version_2 Locker: cimarron $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.13 89/09/25 11:27:24 cimarron Version_2 Locker: cimarron $"
d660 49
@


1.13
log
@moved dynamic symbol stuff to syms.h
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.12 89/09/21 19:04:47 hirohama Exp $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.12 89/09/21 19:04:47 hirohama Exp $"
d24 9
d34 3
a36 4
typedef enum bool {
	false,	/* must be first, to be 0 */
	true
} bool;
@


1.12
log
@added SymbolDecl and ExternDecl macros for declaring visible symbols
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.11 89/09/18 08:01:32 cimarron Exp Locker: hirohama $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.11 89/09/18 08:01:32 cimarron Exp Locker: hirohama $"
d635 2
a636 2
 *		ExternDecl(fooValue, "_fooValue"), \
 *		SymbolDecl(foo, "_foo")
a639 2
#define SymbolDecl(_symbol_, _string_) \
	{ (func_ptr)_symbol_, _string_ }
d641 4
a644 2
#define ExternDecl(_external_, _string_) \
	{ (data_ptr)&(_external_), _string_ }
d646 5
a650 3
#define C_SYMBOLS \
	SymbolDecl(ExceptionalCondition, "_ExceptionalCondition"), \
	SymbolDecl(form, "_form")
@


1.11
log
@added code to support index scans in the executor.
@
text
@d9 1
a9 1
 *	$Header: RCS/c.h,v 1.9 89/08/01 18:04:40 goh Exp Locker: goh $
d15 1
a15 1
#define C_H	"$Header: RCS/c.h,v 1.9 89/08/01 18:04:40 goh Exp Locker: goh $"
d622 27
@


1.10
log
@Working version of C-only demo
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/c.h,v 1.9 89/08/01 18:04:40 goh Exp $
d15 1
a15 1
#define C_H	"$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/c.h,v 1.9 89/08/01 18:04:40 goh Exp $"
d609 8
d619 1
@


1.9
log
@*** empty log message ***
@
text
@d9 1
a9 1
 *	$Header: c.h,v 1.6 89/05/04 18:10:44 dillon Locked $
d15 1
a15 1
#define C_H	"$Header: c.h,v 1.6 89/05/04 18:10:44 dillon Locked $"
@


1.8
log
@fix for Saber's ANSI-style cpp
@
text
@d9 1
a9 1
 *	$Header: c.h,v 1.7 89/07/13 19:39:10 hirohama Locked $
d15 1
a15 1
#define C_H	"$Header: c.h,v 1.7 89/07/13 19:39:10 hirohama Locked $"
a76 2
#ifndef	__SABER__	/* Saber requires ANSI for the following */

a88 7
#else	/* defined(__SABER__) */

#define CppAsString(identifier)	#identifier
#define CppConcat(x, y)		x##y

#endif	/* defined(__SABER__) */

d612 1
a612 5
/*
 *  Force a syntax error during compilation
 */

#define CauseCompilerError()	{ a b; }
@


1.7
log
@added CauseCompilerError()
@
text
@d9 1
a9 1
 *	$Header: c.h,v 1.6 89/05/04 18:10:44 dillon Locked $
d15 1
a15 1
#define C_H	"$Header: c.h,v 1.6 89/05/04 18:10:44 dillon Locked $"
d77 2
d90 7
@


1.6
log
@now names the bool enum
this should make Saber more happy
@
text
@d9 1
a9 1
 *	$Header: c.h,v 1.5 89/05/02 17:43:02 hirohama Locked $
d15 1
a15 1
#define C_H	"$Header: c.h,v 1.5 89/05/02 17:43:02 hirohama Locked $"
d611 7
@


1.5
log
@style changes
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/hirohama/postgres/src/lib/H/RCS/c.h,v 1.4 89/05/01 13:47:42 hirohama Exp $
d15 1
a15 1
#define C_H	"$Header$"
d25 1
a25 1
typedef enum {
@


1.4
log
@added new exception handling definitions
@
text
@d9 1
a9 1
 *	$Header: c.h,v 1.3 89/04/12 19:26:40 hirohama Locked $
d12 2
a13 2
#ifndef	C_H		/* Include this file only once */
#define C_H	1
d15 2
d611 1
a611 1
#endif	/* !defined(C_H) */
@


1.3
log
@slight mod
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/c.h,v 1.2 89/03/22 17:32:27 muir Stab $
d12 2
a13 2
#ifndef C_H
#define C_H
d150 6
d159 1
a159 1
#define PointerIsValid(pointer)	((pointer) != NULL)
d460 19
d481 4
a484 2
AssertionFailed ARGS((
	const String	assertionName,
d490 2
a491 2
 * Assert --
 *	Assert the given expression to be true.
d497 3
d502 6
d509 4
a512 3
#define Assert(expression) \
	if (!(expression)) \
		AssertionFailed(CppAsString(expression), __FILE__, __LINE__); \
d515 15
d531 37
d609 1
a609 3

#endif  /* !defined(C_H)	*/

@


1.2
log
@copyright removal
@
text
@d9 1
a9 1
 *	$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/c.h,v 1.1 89/01/17 05:53:53 cimarron Exp $
d12 2
a13 2
#ifndef	CIncluded		/* Include this file only once */
#define CIncluded	1
d520 3
a522 1
#endif	/* !defined(CIncluded) */
@


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: c.h,v 1.1 88/11/11 16:36:57 postgres Exp $
@
