head 1.39; access; symbols Version_2_1:1.23 old_buffer_manager:1.20 Version_2:1.13 C_Demo_1:1.10; locks glass:1.39; strict; comment @ * @; 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.39 log @introduced intPtr type, to be used in class defs. @ text @/* ---------------------------------------------------------------- * FILE * c.h * * DESCRIPTION * Fundamental C definitions. This is included by nearly * 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) SymbolDecl, ExternDecl macros * 12) externs * * 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: /home/postgres/hong/postgres/src/lib/H/tmp/RCS/c.h,v 1.38 1992/06/26 17:55:11 mer Exp $ * ---------------------------------------------------------------- */ #ifndef CIncluded /* Include this file only once */ #define CIncluded 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 $" /* ---------------------------------------------------------------- * 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. * ---------------- */ #define SONY_JUKEBOX #define MAIN_MEMORY /* ---------------- * 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; #define TRUE 1 #define FALSE 0 /* ---------------------------------------------------------------- * 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 */ #define PROTOTYPES /* * Pointer -- * Variable holding address of any memory resident object. */ typedef void *Pointer; #ifndef NULL /* * NULL -- * Null pointer. */ #define NULL ((void *) 0) #endif /* !defined(NULL) */ /* * CppIdentity -- * C preprocessor identity macro, returns the argument. */ #define 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) 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 /* !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) */ /* * CppIdentity -- * C preprocessor identity macro, returns the argument. */ #define 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. */ #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 #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 #endif /* sprite */ /* * 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 */ #ifndef __GNUC__ /* GNU cc */ # define inline #endif #ifdef PROTOTYPES #define ARGS(args) args #else #define ARGS(args) (/*args*/) #endif /* ---------------------------------------------------------------- * 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 long 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 long 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; /* * 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 )); #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 */ /* * 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))) /* * 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. */ #define offsetof(type, field) ((long) &((type *)0)->field) /* * 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 void 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__), \ false))) #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__), \ false))) #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 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 /* ---------------------------------------------------------------- * Section 12: externs * ---------------------------------------------------------------- */ /* ---------------- * form is used by assert and the exception handling stuff * ---------------- */ extern String form ARGS(( int, ... )); /* ---------------- * end of c.h * ---------------- */ #endif /* !defined(CIncluded) */ @ 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 $ @