head 1.34; access; symbols release_4_2:1.34 aix_ok:1.31 Version_2_1:1.14 old_buffer_manager:1.12 Version_2:1.8 C_Demo_1:1.6; locks; strict; comment @ * @; 1.34 date 94.06.30.03.04.16; author aoki; state Exp; branches; next 1.33; 1.33 date 94.01.11.17.35.02; author jiangwu; state Exp; branches; next 1.32; 1.32 date 93.10.05.22.20.23; author marcel; state Exp; branches; next 1.31; 1.31 date 93.07.16.18.48.29; author avi; state Exp; branches; next 1.30; 1.30 date 93.07.02.03.09.56; author aoki; state Exp; branches; next 1.29; 1.29 date 93.05.16.18.59.41; author avi; state Exp; branches; next 1.28; 1.28 date 93.03.23.02.26.31; author aoki; state Exp; branches; next 1.27; 1.27 date 92.12.19.01.38.45; author aoki; state Exp; branches; next 1.26; 1.26 date 92.12.18.21.06.21; author mao; state Exp; branches; next 1.25; 1.25 date 92.11.23.23.32.01; author marc; state Exp; branches; next 1.24; 1.24 date 92.07.13.03.34.15; author hong; state Exp; branches; next 1.23; 1.23 date 92.06.25.19.32.44; author mer; state Exp; branches; next 1.22; 1.22 date 92.05.28.20.30.44; author mer; state Exp; branches; next 1.21; 1.21 date 92.03.02.21.27.45; author mer; state Exp; branches; next 1.20; 1.20 date 92.02.19.01.51.53; author mer; state Exp; branches; next 1.19; 1.19 date 91.11.17.21.00.49; author mer; state Exp; branches; next 1.18; 1.18 date 91.11.05.06.13.58; author mao; state Exp; branches; next 1.17; 1.17 date 91.09.18.18.20.34; author mer; state Exp; branches; next 1.16; 1.16 date 91.08.14.12.43.59; author mer; state Exp; branches; next 1.15; 1.15 date 91.04.28.09.15.06; author cimarron; state Exp; branches; next 1.14; 1.14 date 91.02.21.23.45.53; author mer; state Exp; branches; next 1.13; 1.13 date 91.01.18.21.57.20; author hong; state Exp; branches; next 1.12; 1.12 date 90.10.08.12.14.33; author cimarron; state Exp; branches; next 1.11; 1.11 date 90.08.18.00.40.51; author cimarron; state Exp; branches; next 1.10; 1.10 date 90.08.17.08.54.54; author cimarron; state Exp; branches; next 1.9; 1.9 date 90.08.08.08.16.34; author cimarron; state Exp; branches; next 1.8; 1.8 date 90.02.08.14.46.42; author hong; state Version_2; branches; next 1.7; 1.7 date 89.09.21.19.13.05; author hirohama; state Exp; branches; next 1.6; 1.6 date 89.09.05.17.10.38; author mao; state C_Demo_1; branches; next 1.5; 1.5 date 89.07.17.14.32.38; author dillon; state Exp; branches; next 1.4; 1.4 date 89.04.14.18.20.22; author dillon; state Exp; branches; next 1.3; 1.3 date 89.04.12.19.55.50; author dillon; state Exp; branches; next 1.2; 1.2 date 89.03.22.17.34.17; author muir; state Stab; branches; next 1.1; 1.1 date 89.01.17.05.54.42; author cimarron; state Exp; branches; next ; desc @@ 1.34 log @hacks for sunpro compiler @ text @/* ---------------------------------------------------------------- * FILE * postgres.h * * DESCRIPTION * definition of (and support for) postgres system types. * * NOTES * this file will eventually contain the definitions for the * following (and perhaps other) system types: * * bool bytea char * char16 dt int2 * int28 int4 oid * oid8 regproc text * char8 * * Currently this file is also the home of struct varlena and * some other stuff. Some of this may change. -cim 8/6/90 * * TABLE OF CONTENTS * 1) simple type definitions * 1a) oid types (currently being reorganized) * 2) array types * 3) name type + support macros \ * 4) datum type + support macros \ being reorganized * 5) xid type + support macros / * 6) time types + support macros / * 7) genbki macros used by catalog/pg_xxx.h files * 8) old types being obsoleted * 9) random SIGNBIT, PSIZE, MAXPGPATH, STATUS macros * * IDENTIFICATION * $Header: /faerie/aoki/postgres/src/backend/tmp/RCS/postgres.h,v 1.33 1994/01/11 17:35:02 jiangwu Exp aoki $ * ---------------------------------------------------------------- */ #ifndef PostgresHIncluded /* include only once */ #define PostgresHIncluded #include "tmp/c.h" /* ---------------------------------------------------------------- * Section 1: simple type definitions * ---------------------------------------------------------------- */ /* ---------------- * bool * * this is defined in c.h at present, but that will change soon. * Boolean should be obsoleted. * ---------------- */ /* XXX put bool here */ #define Boolean bool /* ---------------- * dt * ---------------- */ typedef int32 dt; /* ---------------- * int2 * ---------------- */ typedef int16 int2; /* ---------------- * int4 * ---------------- */ typedef int32 int4; /* ---------------- * float4 * ---------------- */ typedef float float4; /* ---------------- * float8 * ---------------- */ typedef double float8; /* ---------------------------------------------------------------- * Section 1a: oid types * ---------------------------------------------------------------- */ /* ---------------- * oid * ---------------- */ typedef uint32 oid; #define ObjectId oid #define InvalidObjectId 0 #define ObjectIdIsValid(objectId) \ ((bool) (objectId != InvalidObjectId)) /* ---------------- * regproc * ---------------- */ typedef oid regproc; typedef ObjectId RegProcedure; #define RegProcedureIsValid(p) \ ObjectIdIsValid(p) /* ---------------------------------------------------------------- * Section 2: array types * ---------------------------------------------------------------- */ /* ---------------- * struct varlena * ---------------- */ struct varlena { int32 vl_len; char vl_dat[1]; }; #define VARSIZE(PTR) (((struct varlena *)(PTR))->vl_len) #define VARDATA(PTR) (((struct varlena *)(PTR))->vl_dat) #define VARHDRSZ sizeof(int32) /* ---------------- * aclitem * ---------------- */ typedef int4 aclitem; /* ---------------- * bytea * ---------------- */ typedef struct varlena bytea; /* ---------------- * char8 * ---------------- */ typedef struct char8 { char data[8]; } char8; typedef char8 *Char8; /* ---------------- * char16 * ---------------- */ typedef struct char16 { char data[16]; } char16; typedef char16 *Char16; /* ---------------- * int28 * ---------------- */ typedef struct int28 { int2 data[8]; } int28; /* ---------------- * oid8 * ---------------- */ typedef struct oid8 { oid data[8]; } oid8; /* ---------------- * text * ---------------- */ typedef struct varlena text; /* ---------------- * stub * * this is a new system type used by the rule manager. * ---------------- */ typedef struct varlena stub; /* ---------------- * oidint4 * * this is a new system type used by the file interface. * ---------------- */ typedef struct OidInt4Data { ObjectId oi_oid; int32 oi_int4; } OidInt4Data; typedef struct OidInt4Data *OidInt4; /* ---------------- * oidint2 * * this is a new system type used to define indices on two attrs. * ---------------- */ typedef struct OidInt2Data { ObjectId oi_oid; int16 oi_int2; } OidInt2Data; typedef struct OidInt2Data *OidInt2; /* ---------------- * oidchar16 * * this is a new system type used to define indices on two attrs. * ---------------- */ typedef struct OidChar16Data { ObjectId id; char16 name; } OidChar16Data; typedef struct OidChar16Data *OidChar16; /* ---------------------------------------------------------------- * Section 3: name type + support macros * ---------------------------------------------------------------- */ /* ---------------- * name * * definition of the catalog/system "name" data type. * This is used by some of the access method and catalog * support code. * ---------------- */ typedef char16 NameData; typedef NameData *Name; #define InvalidName ((Name) NULL) #define NameIsValid(name) PointerIsValid(name) /* maximum string length of a NameData */ #define NAMEDATALEN 16 /* ---------------------------------------------------------------- * Section 4: datum type + support macros * ---------------------------------------------------------------- */ /* * datum.h -- * POSTGRES abstract data type datum representation definitions. * * Note: * * Port Notes: * Postgres makes the following assumption about machines: * * sizeof(Datum) == sizeof(long) >= sizeof(void *) >= 4 * * Postgres also assumes that * * sizeof(char) == 1 * * and that * * sizeof(short) == 2 * * If your machine meets these requirements, Datums should also be checked * to see if the positioning is correct. * * This file is MACHINE AND COMPILER dependent!!! */ #ifndef DatumIncluded /* Include this file only once */ #define DatumIncluded 1 /* XXX wrong place */ #ifdef PORTNAME_alpha #define LONG64 #endif /* * Identification: */ typedef struct AnyStruct { char character; double largeFloat; } AnyStruct; typedef unsigned long Datum; /* XXX sizeof(long) >= sizeof(void *) */ typedef Datum * DatumPtr; #define GET_1_BYTE(datum) (((Datum) (datum)) & 0x000000ff) #define GET_2_BYTES(datum) (((Datum) (datum)) & 0x0000ffff) #define GET_4_BYTES(datum) (((Datum) (datum)) & 0xffffffff) #define SET_1_BYTE(value) (((Datum) (value)) & 0x000000ff) #define SET_2_BYTES(value) (((Datum) (value)) & 0x0000ffff) #define SET_4_BYTES(value) (((Datum) (value)) & 0xffffffff) /* * DatumGetChar -- * Returns character value of a datum. */ #define DatumGetChar(X) ((char) GET_1_BYTE(X)) /* * CharGetDatum -- * Returns datum representation for a character. */ #define CharGetDatum(X) ((Datum) SET_1_BYTE(X)) /* * DatumGetInt8 -- * Returns 8-bit integer value of a datum. */ #define DatumGetInt8(X) ((int8) GET_1_BYTE(X)) /* * Int8GetDatum -- * Returns datum representation for an 8-bit integer. */ #define Int8GetDatum(X) ((Datum) SET_1_BYTE(X)) /* * DatumGetUInt8 -- * Returns 8-bit unsigned integer value of a datum. */ #define DatumGetUInt8(X) ((uint8) GET_1_BYTE(X)) /* * UInt8GetDatum -- * Returns datum representation for an 8-bit unsigned integer. */ #define UInt8GetDatum(X) ((Datum) SET_1_BYTE(X)) /* * DatumGetInt16 -- * Returns 16-bit integer value of a datum. */ #define DatumGetInt16(X) ((int16) GET_2_BYTES(X)) /* * Int16GetDatum -- * Returns datum representation for a 16-bit integer. */ #define Int16GetDatum(X) ((Datum) SET_2_BYTES(X)) /* * DatumGetUInt16 -- * Returns 16-bit unsigned integer value of a datum. */ #define DatumGetUInt16(X) ((uint16) GET_2_BYTES(X)) /* * UInt16GetDatum -- * Returns datum representation for a 16-bit unsigned integer. */ #define UInt16GetDatum(X) ((Datum) SET_2_BYTES(X)) /* * DatumGetInt32 -- * Returns 32-bit integer value of a datum. */ #define DatumGetInt32(X) ((int32) GET_4_BYTES(X)) /* * Int32GetDatum -- * Returns datum representation for a 32-bit integer. */ #define Int32GetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetUInt32 -- * Returns 32-bit unsigned integer value of a datum. */ #define DatumGetUInt32(X) ((uint32) GET_4_BYTES(X)) /* * UInt32GetDatum -- * Returns datum representation for a 32-bit unsigned integer. */ #define UInt32GetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetObjectId -- * Returns object identifier value of a datum. */ #define DatumGetObjectId(X) ((ObjectId) GET_4_BYTES(X)) /* * ObjectIdGetDatum -- * Returns datum representation for an object identifier. */ #define ObjectIdGetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetPointer -- * Returns pointer value of a datum. */ #define DatumGetPointer(X) ((Pointer) X) /* * PointerGetDatum -- * Returns datum representation for a pointer. */ #define PointerGetDatum(X) ((Datum) X) /* * DatumGetStructPointer -- * Returns pointer to structure value of a datum. */ #define DatumGetStructPointer(X) ((AnyStruct *) X) /* * StructPointerGetDatum -- * Returns datum representation for a pointer to structure. */ #define StructPointerGetDatum(X) ((Datum) X) /* * DatumGetName -- * Returns name value of a datum. */ #define DatumGetName(X) ((Name) DatumGetPointer((Datum) X)) /* * NameGetDatum -- * Returns datum representation for a name. */ #define NameGetDatum(X) PointerGetDatum((Pointer) X) /* * DatumGetFloat32 -- * Returns 32-bit floating point value of a datum. * This is really a pointer, of course. */ #define DatumGetFloat32(X) ((float32) DatumGetPointer((Datum) X)) /* * Float32GetDatum -- * Returns datum representation for a 32-bit floating point number. * This is really a pointer, of course. */ #define Float32GetDatum(X) PointerGetDatum((Pointer) X) /* * DatumGetFloat64 -- * Returns 64-bit floating point value of a datum. * This is really a pointer, of course. */ #define DatumGetFloat64(X) ((float64) DatumGetPointer(X)) /* * Float64GetDatum -- * Returns datum representation for a 64-bit floating point number. * This is really a pointer, of course. */ #define Float64GetDatum(X) PointerGetDatum((Pointer) X) #endif /* !defined(DatumIncluded) */ /* ---------------------------------------------------------------- * Section 5: xid type + support macros * ---------------------------------------------------------------- */ /* * TransactionId definition */ typedef uint32 TransactionId; #define TransactionIdDataSize sizeof(TransactionId) #define InvalidTransactionId 0 #define NullTransactionIdValue 0 typedef uint32 TransactionIdValueData; typedef uint32 TransactionIdValue; typedef uint16 CommandId; #define FirstCommandId 0 #define TransactionMultiplierPerByte (1 << BitsPerByte) #define TransactionsPerSecondAdjustment TransactionMultiplierPerByte /* ---------------------------------------------------------------- * Section 6: some time types + support macros * * Note: see nabstime.h for time support macros * ---------------------------------------------------------------- */ /* XXX These have all been moved to nabstime.h - avi 07/07/93 */ /* ---------------------------------------------------------------- * Section 7: genbki macros used by the * catalog/pg_xxx.h files * ---------------------------------------------------------------- */ #define CATALOG(x) \ typedef struct CppConcat(FormData_,x) #if defined(NO_EMPTY_STMTS) #define DATA(x) extern int errno #define DECLARE_INDEX(x) extern int errno #else /* NO_EMPTY_STMTS */ #define DATA(x) #define DECLARE_INDEX(x) #endif /* NO_EMPTY_STMTS */ #define BUILD_INDICES #define BOOTSTRAP #define BKI_BEGIN #define BKI_END /* ---------------------------------------------------------------- * Section 8: old types being obsoleted * ---------------------------------------------------------------- */ typedef int32 PG_XID; #define CID uint16 #define OID oid #define REGPROC oid /* for now */ typedef char *DATUM; /* ---------------------------------------------------------------- * Section 9: random stuff * SIGNBIT, PSIZE, MAXPGPATH, STATUS... * ---------------------------------------------------------------- */ /* msb for int/unsigned */ #define SIGNBIT (0x8000) /* msb for char */ #define CSIGNBIT (1 << 7) /* ---------------- * PSIZE * ---------------- */ #define PSIZE(PTR) (*((int32 *)(PTR) - 1)) #define PSIZEALL(PTR) (*((int32 *)(PTR) - 1) + sizeof (int32)) #define PSIZESKIP(PTR) ((char *)((int32 *)(PTR) + 1)) #define PSIZEFIND(PTR) ((char *)((int32 *)(PTR) - 1)) #define PSIZESPACE(LEN) ((LEN) + sizeof (int32)) /* ---------------- * global variable which should probably go someplace else. * ---------------- */ #define MAXPGPATH 128 #define STATUS_OK (0) #define STATUS_ERROR (-1) #define STATUS_NOT_FOUND (-2) #define STATUS_INVALID (-3) #define STATUS_UNCATALOGUED (-4) #define STATUS_REPLACED (-5) #define STATUS_NOT_DONE (-6) #define STATUS_FOUND (1) /* * The following is a gimmick to pass functions that return void as * paramters to other functions. This type defined here is used as * the cast. */ typedef Pointer (*VoidFunctionType)(); /* ---------------------------------------------------------------- * externs * * This should be eliminated or moved elsewhere * ---------------------------------------------------------------- */ extern bool NameIsEqual ARGS((Name name1, Name name2)); extern uint32 NameComputeLength ARGS((Name name)); extern TransactionId NullTransactionId; extern TransactionId AmiTransactionId; extern TransactionId FirstTransactionId; extern bool TransactionIdIsValid ARGS((TransactionId transactionId)); extern void GetNewTransactionId ARGS((TransactionId *xid)); extern TransactionId StringFormTransactionId ARGS((String representation)); extern String TransactionIdFormString ARGS((TransactionId transactionId)); extern void TransactionIdStore ARGS((TransactionId transactionId, TransactionId *destination)); extern void PointerStoreInvalidTransactionId ARGS((Pointer destination)); extern bool TransactionIdEquals ARGS((TransactionId id1,TransactionId id2)); extern bool TransactionIdIsLessThan ARGS((TransactionId id1, TransactionId id2)); extern bool TransactionIdValueIsValid ARGS((TransactionIdValue value)); extern void TransactionIdIncrement ARGS((TransactionId *transactionId)); /* ---------------- * end of postgres.h * ---------------- */ #endif PostgresHIncluded @ 1.33 log @Changed type XID to PG_XID to avoid confict with Xlib - jw, 1/11/94 @ text @d34 1 a34 1 * $Header: /private/src/postgres/src/backend/tmp/RCS/postgres.h,v 1.32 1993/10/05 22:20:23 marcel Exp jiangwu $ d540 4 d546 1 @ 1.32 log @added char8 type definition @ text @d34 1 a34 1 * $Header: /home2/aoki/master/src/backend/tmp/RCS/postgres.h,v 1.31 1993/07/16 18:48:29 avi Exp $ d552 1 a552 1 typedef int32 XID; @ 1.31 log @moved time type definitions and macros to nabstime.h @ text @d16 1 d34 1 a34 1 * $Header: /private/src/postgres/src/backend/tmp/RCS/postgres.h,v 1.30 1993/07/02 03:09:56 aoki Exp avi $ d144 10 @ 1.30 log @dorked with some of the DatumGetFoo macros. defined VARHDRSZ so that varlena-allocating code can use this instead of saying sizeof(..) defined NAMEDATALEN for all of those strncpy's, printf's, etc. @ text @d33 1 a33 1 * $Header: /home2/aoki/postgres/src/backend/tmp/RCS/postgres.h,v 1.29 1993/05/16 18:59:41 avi Exp aoki $ d519 1 a519 1 typedef uint32 Time; /* XXX this will disappear */ a520 3 typedef uint32 RelativeTime; #define InvalidRelativeTime 0 a542 2 #define ABSTIME uint32 #define RELTIME uint32 @ 1.29 log @OidInt2 type added @ text @d33 1 a33 1 * $Header: /private/src/postgres/src/backend/tmp/RCS/postgres.h,v 1.28 1993/03/23 02:26:31 aoki Exp avi $ d129 1 d240 3 d297 1 a297 1 #define SET_4_BYTES(datum) (((Datum) (datum)) & 0xffffffff) d398 2 a399 2 * DatumGetFloat32 -- * Returns 32-bit floating point value of a datum. d402 1 a402 1 #define DatumGetFloat32(X) ((float32) GET_4_BYTES(X)) d405 2 a406 2 * Float32GetDatum -- * Returns datum representation for a 32-bit floating point number. d409 1 a409 15 #define Float32GetDatum(X) ((Datum) SET_4_BYTES(X)) /* * DatumGetFloat64 -- * Returns 64-bit floating point value of a datum. */ #define DatumGetFloat64(X) ((float64) GET_4_BYTES(X)) /* * Float64GetDatum -- * Returns datum representation for a 64-bit floating point number. */ #define Float64GetDatum(X) ((Datum) SET_4_BYTES(X)) a415 3 #ifndef LONG64 #define DatumGetPointer(X) ((Pointer) GET_4_BYTES(X)) #else /* LONG64 */ a416 1 #endif /* LONG64 */ a422 3 #ifndef LONG64 #define PointerGetDatum(X) ((Datum) SET_4_BYTES(X)) #else /* LONG64 */ a423 12 #endif /* LONG64 */ /* * DatumGetPointerPointer -- * Returns pointer to pointer value of a datum. */ #ifndef LONG64 #define DatumGetPointerPointer(X) ((Pointer *) GET_4_BYTES(X)) #else /* LONG64 */ #define DatumGetPointerPointer(X) ((Pointer *) X) #endif /* LONG64 */ a425 11 * PointerPointerGetDatum -- * Returns datum representation for a pointer to pointer. */ #ifndef LONG64 #define PointerPointerGetDatum(X) ((Datum) SET_4_BYTES(X)) #else /* LONG64 */ #define PointerPointerGetDatum(X) ((Datum) X) #endif /* LONG64 */ /* a429 3 #ifndef LONG64 #define DatumGetStructPointer(X) ((AnyStruct *) GET_4_BYTES(X)) #else /* LONG64 */ a430 1 #endif /* LONG64 */ a436 3 #ifndef LONG64 #define StructPointerGetDatum(X) ((Datum) SET_4_BYTES(X)) #else /* LONG64 */ a437 1 #endif /* LONG64 */ d444 1 a444 5 #ifndef LONG64 #define DatumGetName(X) ((Name) GET_4_BYTES(X)) #else /* LONG64 */ #define DatumGetName(X) ((Name) X) #endif /* LONG64 */ d451 17 a467 5 #ifndef LONG64 #define NameGetDatum(X) ((Datum) SET_4_BYTES(X)) #else /* LONG64 */ #define NameGetDatum(X) ((Datum) X) #endif /* LONG64 */ d470 3 a472 2 * DatumGetObjectId -- * Returns object identifier value of a datum. d475 1 a475 1 #define DatumGetObjectId(X) ((ObjectId) GET_4_BYTES(X)) d478 3 a480 2 * ObjectIdGetDatum -- * Returns datum representation for an object identifier. d483 1 a483 1 #define ObjectIdGetDatum(X) ((Datum) SET_4_BYTES(X)) @ 1.28 log @diddled the GET_X_BYTE definitions to work with 64bits. changed some use of long, etc. to "int32". this is the wrong thing to do, but it works for now. @ text @d33 1 a33 1 * $Header: /usr/local/devel/postgres/src/backend/tmp/RCS/postgres.h,v 1.27 1992/12/19 01:38:45 aoki Exp $ d194 13 @ 1.27 log @second checkin for acls and other stuff @ text @d33 1 a33 1 * $Header: /home2/aoki/postgres/tmp/RCS/postgres.h,v 1.26 1992/12/18 21:06:21 mao Exp aoki $ d61 1 a61 1 typedef long dt; d123 1 a123 1 long vl_len; d239 1 a239 1 * sizeof(Datum) == sizeof(char *) == sizeof(long) == 4 d258 5 d272 1 a272 1 typedef unsigned long Datum; a274 19 /* * We want to pad to the right on Sun computers and to the right on * the others. * */ #ifdef NOTDEF #define GET_1_BYTE(datum) ((((long) (datum)) & 0xff000000) >> 24) #define GET_2_BYTES(datum) ((((long) (datum)) & 0xffff0000) >> 16) #define GET_4_BYTES(datum) (datum) #define SET_1_BYTE(value) (((long) (value)) << 24) #define SET_2_BYTES(value) (((long) (value)) << 16) #define SET_4_BYTES(value) (value) #endif #if defined(sequent) || defined(mips) || defined(sun) || defined(sparc) d277 1 a277 1 #define GET_4_BYTES(datum) ((Datum) (datum)) d280 1 a280 3 #define SET_4_BYTES(value) ((Datum) (value)) #endif d413 1 d415 3 d424 1 d426 3 d435 1 d437 3 d446 1 d448 3 d457 1 d459 3 d468 1 d470 3 d479 1 d481 3 d490 1 d492 3 d521 2 a522 2 typedef unsigned long TransactionId; #define TransactionIdDataSize sizeof(long) d527 2 a528 2 typedef unsigned long TransactionIdValueData; typedef unsigned long TransactionIdValue; d530 1 a530 1 typedef unsigned short CommandId; d569 4 a572 4 typedef long XID; #define CID unsigned short #define ABSTIME long #define RELTIME long @ 1.26 log @rcs header line was trashed, so i had to edit the ,v file by hand to fix it up and check this revision in. most mysterious. real change in this revision: add cpp macros to ignore the syntax we use for declaring and building catalog indices at bootstrap time in the catalog .h files. @ text @d33 1 a33 1 * $Header$ d129 6 @ 1.25 log @DATUM is no longer a union on some machines @ text @d33 1 a33 1 * $Header: /usr/local/devel/postgres/src/backend/tmp/RCS/postgres.h,v 1.24 92/07/13 03:34:15 hong Exp Locker: marc $ a254 1 #define DATUM_H "$Header: /usr/local/devel/postgres/src/backend/tmp/RCS/postgres.h,v 1.24 92/07/13 03:34:15 hong Exp Locker: marc $" d536 2 a537 1 #define DEFINE_INDEX(x) @ 1.24 log @prototyping @ text @d33 1 a33 1 * $Header: RCS/postgres.h,v 1.23 92/06/25 19:32:44 mer Exp Locker: hong $ d255 1 a255 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.23 92/06/25 19:32:44 mer Exp Locker: hong $" a553 2 #if defined(sun) || defined(sequent) || defined(mips) a554 13 #else typedef union { char *da_cprt; short *da_shprt; long *da_lprt; char **da_cpprt; struct { char s_c; double s_d; } *da_stptr; long da_long; } DATUM; #endif @ 1.23 log @add a new type DatumPtr to the system (Datum *) @ text @d33 1 a33 1 * $Header: /private/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.22 1992/05/28 20:30:44 mer Exp mer $ d255 1 a255 1 #define DATUM_H "$Header: /private/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.22 1992/05/28 20:30:44 mer Exp mer $" d630 1 a630 1 extern void GetNewTransactionId ARGS((TransactionId xid)); @ 1.22 log @transaction ids are now simple longs, cids are shorts @ text @d33 1 a33 1 * $Header: /private/mer/pg.latest/src/lib/H/tmp/RCS/postgres.h,v 1.21 1992/03/02 21:27:45 mer Exp mer $ d255 1 a255 1 #define DATUM_H "$Header: /private/mer/pg.latest/src/lib/H/tmp/RCS/postgres.h,v 1.21 1992/03/02 21:27:45 mer Exp mer $" d263 1 @ 1.21 log @define 2 oid composite types for indices on 2 attrs (used on pg_attribute). @ text @d33 1 a33 1 * $Header: /users/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.20 1992/02/19 01:51:53 mer Exp mer $ d255 1 a255 1 #define DATUM_H "$Header: /users/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.20 1992/02/19 01:51:53 mer Exp mer $" d499 2 a500 3 typedef struct TransactionIdData { uint8 data[5]; } TransactionIdData; d502 2 a503 1 #define TransactionIdDataSize 5 d505 2 a506 1 typedef TransactionIdData *TransactionId; d508 1 a508 2 #define InvalidTransactionId NULL #define NullTransactionIdValue 0.0 a509 5 typedef double TransactionIdValueData; typedef TransactionIdValueData *TransactionIdValue; typedef uint8 CommandId; d546 2 a547 2 typedef char XID[5]; #define CID unsigned char d633 1 a633 1 ARGS((TransactionId transactionId, Pointer destination)); d639 2 a640 8 extern void StringSetTransactionIdValue ARGS((String representation, TransactionIdValue value)); extern String TransactionIdValueFormString ARGS((TransactionIdValue value)); extern void TransactionIdValueSetTransactionId ARGS((TransactionIdValue idValue, TransactionId id)); extern void TransactionIdSetTransactionIdValue ARGS((TransactionId id, TransactionIdValue idValue)); extern void TransactionIdIncrement ARGS((TransactionId transactionId)); @ 1.20 log @changes for the new abstime implementation @ text @d33 1 a33 1 * $Header: /users/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.19 1991/11/17 21:00:49 mer Exp mer $ d177 1 a177 1 * oidseq d182 4 a185 4 typedef struct OidSeqData { ObjectId os_oid; uint32 os_seq; } OidSeqData; d187 1 a187 1 typedef struct OidSeqData *OidSeq; d189 13 d255 1 a255 1 #define DATUM_H "$Header: /users/mer/pg/src/lib/H/tmp/RCS/postgres.h,v 1.19 1991/11/17 21:00:49 mer Exp mer $" d541 1 @ 1.19 log @add typdef hack to cast functions passed as paramters @ text @d33 1 a33 1 * $Header: /users/mer/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.18 1991/11/05 06:13:58 mao Exp mer $ d242 1 a242 1 #define DATUM_H "$Header: /users/mer/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.18 1991/11/05 06:13:58 mao Exp mer $" d508 1 a508 1 * Section 6: time types + support macros d510 1 a510 1 * Note: see miscadmin.h for time support macros a512 2 typedef uint32 AbsoluteTime; #define InvalidAbsoluteTime 0 d514 2 a518 11 typedef uint32 Time; /* XXX this will disappear */ #define InvalidTime 0 /* XXX this will disappear */ /* * XXX INVALID_ABSTIME from adt/date.h. * XXX access/tim and adt/date should be merged somehow. */ #ifndef INVALID_ABSTIME #define INVALID_ABSTIME 2147483647 #endif /* !defined(INVALID_ABSTIME) */ a613 3 extern bool AbsoluteTimeIsBefore ARGS((AbsoluteTime time1,AbsoluteTime time2)); extern bool AbsoluteTimeIsAfter ARGS((AbsoluteTime time1,AbsoluteTime time2)); @ 1.18 log @oidseq type decl @ text @d33 1 a33 1 * $Header: /users/mao/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.17 1991/09/18 18:20:34 mer Exp mao $ d242 1 a242 1 #define DATUM_H "$Header: /users/mao/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.17 1991/09/18 18:20:34 mer Exp mao $" d609 7 @ 1.17 log @purge IsSystemRelation() from the code @ text @d33 1 a33 1 * $Header: /users/mer/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.16 1991/08/14 12:43:59 mer Exp mer $ d176 13 d242 1 a242 1 #define DATUM_H "$Header: /users/mer/postgres/src/lib/H/tmp/RCS/postgres.h,v 1.16 1991/08/14 12:43:59 mer Exp mer $" @ 1.16 log @make BootstrapObjectIdData a defined costant and add a macro function that determines whether or not a reln is a system reln @ text @d33 1 a33 1 * $Header: RCS/postgres.h,v 1.15 91/04/28 09:15:06 cimarron Exp Locker: mer $ a102 11 /* ---------- * note: we reserve the first 16384 object ids for internal use. * oid's less than this appear in the .bki files. the choice of * 16384 is completely arbitrary. * ---------- */ #define BootstrapObjectIdData 16384 #define IsSystemRelation(rel) \ (RelationGetRelationId(rel) <= BootstrapObjectIdData) d229 1 a229 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.15 91/04/28 09:15:06 cimarron Exp Locker: mer $" @ 1.15 log @Converted IsValid code into macros and added an improved NodeIsType scheme @ text @d33 1 a33 1 * $Header: RCS/postgres.h,v 1.14 91/02/21 23:45:53 mer Exp Locker: cimarron $ d103 11 d240 1 a240 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.14 91/02/21 23:45:53 mer Exp Locker: cimarron $" @ 1.14 log @added a status code for new postmaster stuff (STATUS_NOT_DONE) @ text @d20 12 d33 1 a33 1 * $Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $ d42 3 a44 3 /* -------------------------------- * simple types * -------------------------------- d46 1 d87 5 a91 1 /* ---------------- a92 2 * * (oid.h is being obsoleted -cim) a94 10 /* * oid.h -- * POSTGRES object identifier definitions. * * $Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $ */ #ifndef OIdIncluded /* Include this file only once */ #define OIdIncluded 1 a97 1 d100 2 a101 9 /* * ObjectIdIsValid * True iff the object identifier is valid. */ extern bool ObjectIdIsValid ARGS(( ObjectId objectId )); a102 2 #endif /* !defined(OIdIncluded) */ a104 2 * * (regproc.h is being obsoleted) d109 1 a109 4 /* * regproc.h -- * POSTGRES registered procedure definitions. */ d111 2 a112 2 #ifndef RegProcIncluded /* Include this file only once */ #define RegProcIncluded 1 d114 3 a116 22 /* * Identification: */ #define REGPROC_H "$Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $" typedef ObjectId RegProcedure; /* * RegProcedureIsValid * True iff the registered procedure is valid. */ extern bool RegProcedureIsValid ARGS(( RegProcedure proc )); #endif /* !defined(RegProcIncluded) */ /* -------------------------------- * array types * -------------------------------- d177 1 a177 6 * other system types imported from: * * name.h system "name" data type * datum.h attribute values * xid.h transaction ids * tim.h absolute and relative time a179 1 d181 1 a181 6 * name.h * ---------------- */ /* * FILE * name.h a182 1 * DESCRIPTION d186 1 a186 8 * * NOTES * Since "name" derives directly from a system type, this * stuff should arguably go in postgres.h * * IDENTIFICATION * $Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $ * a187 8 #ifndef NameIncluded /* Include this file only once */ #define NameIncluded 1 /* * definition of NameData and Name * Note: char16 is a system type in postgres.h * */ d191 2 a192 5 /* * Name support stuff. * */ #define InvalidName ((Name)NULL) d194 3 a196 35 /* * NameIsValid * True iff the name is valid. */ extern bool NameIsValid ARGS(( Name name )); /* * NameIsEqual * True iff the names are the same. */ extern bool NameIsEqual ARGS(( Name name1, Name name2 )); /* * NameComputeLength * Returns the lenght of a name. */ uint32 NameComputeLength ARGS(( Name name )); #endif /* !defined(NameIncluded) */ /* ---------------- * datum.h * ---------------- d229 1 a229 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $" d464 4 a467 3 /* ---------------- * xid.h * ---------------- a468 13 /* * xid.h -- * POSTGRES transaction identifier definitions. */ #ifndef XIdIncluded /* Include this file only once */ #define XIdIncluded 1 /* * Identification: */ #define XID_H "$Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $" a470 1 * d494 2 a495 51 extern TransactionId NullTransactionId; extern TransactionId AmiTransactionId; extern TransactionId FirstTransactionId; /* * TransactionIdIsValid -- * True iff transaction identifier is valid. * */ extern bool TransactionIdIsValid ARGS(( TransactionId transactionId )); /* * GetNewTransactionId -- * Returns a new transaction identifier. * */ extern void GetNewTransactionId ARGS(( TransactionId xid )); /* * StringFormTransactionId -- * Returns transaction identifier associated with a string. * */ extern TransactionId StringFormTransactionId ARGS(( String representation )); /* * TransactionIdValueFormString -- * Returns string representation for a transaction identifier. * */ extern String TransactionIdFormString ARGS(( TransactionId transactionId )); /* * TransactionIdStore -- * Stores the transaction identifier in external form. d497 2 a498 4 * Note: * Assumes transaction identifier is valid. * Assumes destination pointer is valid. * a499 139 extern void TransactionIdStore ARGS(( TransactionId transactionId, Pointer destination )); /* * PointerStoreInvalidTransactionId -- * Stores an invalid transaction identifier (in external form). * * Note: * Assumes destination pointer is valid. * */ extern void PointerStoreInvalidTransactionId ARGS(( Pointer destination )); /* * TransactionIdEquals -- * True iff transaction identifiers are equal. * * Note: * Assumes transaction identifiers are valid. * */ extern bool TransactionIdEquals ARGS(( TransactionId id1, TransactionId id2 )); /* * TransactionIdIsLessThan -- * True iff first transaction identifier is less than the second. * * Note: * Assumes transaction identifiers are valid. * */ extern bool TransactionIdIsLessThan ARGS(( TransactionId id1, TransactionId id2 )); /* * TransactionIdValueIsValid -- * True iff transaction identifier value is valid. * */ extern bool TransactionIdValueIsValid ARGS(( TransactionIdValue value )); /* * StringGetTransactionIdValue -- * Returns transaction identifier value associated with a string. * */ extern void StringSetTransactionIdValue ARGS(( String representation, TransactionIdValue value )); /* * TransactionIdValueFormString -- * Returns string representation for a transaction identifier value. * */ extern String TransactionIdValueFormString ARGS(( TransactionIdValue value )); /* * TransactionIdValueSetTransactionId -- * Sets transaction identifier to a transaction identifier value. * */ extern void TransactionIdValueSetTransactionId ARGS(( TransactionIdValue idValue, TransactionId id )); /* * TransactionIdSetTransactionIdValue -- * Sets transaction identifier value for a transaction identifier. * */ extern void TransactionIdSetTransactionIdValue ARGS(( TransactionId id, TransactionIdValue idValue )); /* * TransactionIdIncrement -- * Increments transaction identifier. * */ extern void TransactionIdIncrement ARGS(( TransactionId transactionId )); #endif /* !defined(XIdIncluded) */ /* ---------------- * tim.h * ---------------- */ /* * tim.h -- * POSTGRES time definitions. */ #ifndef TimIncluded /* Include this file only once */ #define TimIncluded 1 /* * Identification: */ #define TIM_H "$Header: RCS/postgres.h,v 1.13 91/01/18 21:57:20 hong Exp Locker: mer $" a500 1 a503 1 a506 1 a516 57 /* * AbsoluteTimeIsValid -- * True iff absolute time is valid. */ extern bool AbsoluteTimeIsValid ARGS(( AbsoluteTime time )); /* * RelativeTimeIsValid -- * True iff relative time is valid. */ extern bool RelativeTimeIsValid ARGS(( AbsoluteTime time )); /* * GetCurrentAbsoluteTime -- * Returns the current absolute time. */ AbsoluteTime GetCurrentAbsoluteTime ARGS(( void )); /* * AbsoluteTimeIsBefore -- * True iff an absolute time is before or the same as another. * * Note: * Assumes absolute times are valid. */ bool AbsoluteTimeIsBefore ARGS(( AbsoluteTime time1, AbsoluteTime time2 )); /* * AbsoluteTimeIsAfter -- * True iff an absolute time is strictly after another. * * Note: * Assumes absolute times are valid. */ bool AbsoluteTimeIsAfter ARGS(( AbsoluteTime time1, AbsoluteTime time2 )); #endif /* !defined(TimIncluded) */ d518 2 a519 1 * system catalog macros used by the catalog/pg_xxx.h files d532 1 a532 2 * real old type names, may be obsoleted soon -cim 8/6/90 * XXX These should disappear!!! -hirohama d539 1 d560 4 a563 3 /* ---------------- * random stuff * ---------------- a564 2 #define SIGNBIT (0x8000) /* msb for int/unsigned */ #define CSIGNBIT (1 << 7) /* msb for char */ d566 6 d596 37 @ 1.13 log @change for the new buffer manager @ text @d21 1 a21 1 * $Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $ d84 1 a84 1 * $Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $ d127 1 a127 1 #define REGPROC_H "$Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $" d233 1 a233 1 * $Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $ d320 1 a320 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $" d570 1 a570 1 #define XID_H "$Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $" d791 1 a791 1 #define TIM_H "$Header: RCS/postgres.h,v 1.12 90/10/08 12:14:33 cimarron Exp Locker: hong $" d942 1 @ 1.12 log @added two #defines used by lib/Gen/genbki.sh @ text @d21 1 a21 1 * $Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $ d84 1 a84 1 * $Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $ d127 1 a127 1 #define REGPROC_H "$Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $" d233 1 a233 1 * $Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $ d320 1 a320 1 #define DATUM_H "$Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $" d570 1 a570 1 #define XID_H "$Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $" d791 1 a791 1 #define TIM_H "$Header: RCS/postgres.h,v 1.11 90/08/18 00:40:51 cimarron Exp Locker: cimarron $" d936 7 @ 1.11 log @eliminated less significant .h files @ text @d21 1 a21 1 * $Header: RCS/postgres.h,v 1.10 90/08/17 08:54:54 cimarron Exp Locker: cimarron $ d84 1 a84 1 * $Header: RCS/oid.h,v 1.9 90/08/17 08:54:45 cimarron Exp $ d127 1 a127 1 #define REGPROC_H "$Header: RCS/regproc.h,v 1.2 90/08/17 08:54:33 cimarron Exp $" d233 1 a233 1 * $Header: RCS/name.h,v 1.10 90/08/17 08:54:44 cimarron Exp $ d320 1 a320 1 #define DATUM_H "$Header: RCS/datum.h,v 1.11 90/06/09 18:56:50 kemnitz Version_2 Locker: cimarron $" d570 1 a570 1 #define XID_H "$Header: RCS/xid.h,v 1.8 90/08/17 08:55:04 cimarron Exp $" d791 1 a791 1 #define TIM_H "$Header: RCS/tim.h,v 1.8 90/08/17 08:54:58 cimarron Exp $" d880 3 @ 1.10 log @added pathnames to #include statements @ text @d21 1 a21 1 * $Header: RCS/postgres.h,v 1.9 90/08/08 08:16:34 cimarron Exp Locker: cimarron $ d77 1 a77 1 * this is defined in oid.h at present, but that should change. d80 6 a85 1 #include "tmp/oid.h" d87 21 d111 1 a111 1 * regproc.h should be obsoleted. a114 1 #include "tmp/regproc.h" d116 27 d206 666 d933 4 @ 1.9 log @ reorganized some header files @ text @d21 1 a21 1 * $Header$ d28 1 a28 1 #include "c.h" d80 1 a80 1 #include "oid.h" d89 1 a89 1 #include "regproc.h" @ 1.8 log @fix for hermes to reduce levels of #include nesting. @ text @d1 3 a3 5 #ifndef POSTGRES_H #define POSTGRES_H "$Header: RCS/postgres.h,v 1.7 89/09/21 19:13:05 hirohama Exp $" /* * postgres.h - Central and misc definitions for POSTGRES d5 2 a6 1 * This is bound to grow without bound. d8 15 a22 2 * XXX This file should be obsoleted and the necessary definitions moved * XXX to new places. -hirohama d25 3 a27 1 #ifndef C_H a28 1 #endif d30 50 a79 1 #ifndef OID_H a80 1 #endif d82 8 a89 2 #define SIGNBIT (0x8000) /* msb for int/unsigned */ #define CSIGNBIT (1 << 7) /* msb for char */ d91 56 a146 2 /* * Postgres default basic datatypes: d148 2 a149 1 * Boolean, u_int1, int2, u_int2, int4, u_int4 d151 1 d153 3 a155 3 /* * Boolean -- * temporary--represents a boolean value on disk and in memory d157 2 a158 1 #define Boolean char d160 5 a164 1 /* d166 1 a168 1 #define OID ObjectId d172 2 a190 2 #define REGPROC OID /* for now */ #define SPQUEL OID /* XXX (is this used?) */ d192 11 d209 4 a212 13 struct varlena { long vl_len; char vl_dat[1]; }; #define VARSIZE(PTR) (((struct varlena *)(PTR))->vl_len) #define VARDATA(PTR) (((struct varlena *)(PTR))->vl_dat) /* char *calloc(); #define ALLOC(t, c) (t *)calloc((unsigned)(c), sizeof(t)) */ d215 1 a215 1 #endif @ 1.7 log @added ...SYMBOLS declarations miscellaneous cleanup @ text @d1 2 a2 2 #ifndef _POSTGRES_H_ #define _POSTGRES_H_ "$Header: RCS/postgres.h,v 1.6 89/09/05 17:10:38 mao C_Demo_1 Locker: hirohama $" d17 1 d19 1 @ 1.6 log @Working version of C-only demo @ text @d2 1 a2 1 #define _POSTGRES_H_ "$Header: /usr6/postgres/mao/postgres/src/lib/H/RCS/postgres.h,v 1.5 89/07/17 14:32:38 dillon Exp $" d8 3 d16 1 a18 3 #ifndef NULL #define NULL 0L #endif d76 1 a76 1 char *palloc(); d79 1 @ 1.5 log @#if defined changes for 3100's @ text @d2 1 a2 1 #define _POSTGRES_H_ "$Header: postgres.h,v 1.4 89/04/14 18:20:22 dillon Locked $" @ 1.4 log @*** empty log message *** @ text @d2 1 a2 1 #define _POSTGRES_H_ "$Header: postgres.h,v 1.3 89/04/12 19:55:50 dillon Locked $" d42 1 a42 1 #if defined(sun) || defined(sequent) @ 1.3 log @c.h @ text @d2 1 a2 1 #define _POSTGRES_H_ "$Header: /usr6/postgres/dillon/ptree/src/lib/H/RCS/postgres.h,v 1.2 89/03/22 17:34:17 muir Stab $" d15 3 a17 1 #define NULL 0 d42 1 a42 1 #if defined(sun) @ 1.2 log @copyright removal @ text @d2 1 a2 1 #define _POSTGRES_H_ "$Header: /usr6/postgres/muir/postgres/src/lib/H/RCS/postgres.h,v 1.1 89/01/17 05:54:42 cimarron Exp $" d10 1 d12 1 @ 1.1 log @Initial revision @ text @a0 27 ; /* ; * ; * POSTGRES Data Base Management System ; * ; * Copyright (c) 1988 Regents of the University of California ; * ; * Permission to use, copy, modify, and distribute this software and its ; * documentation for educational, research, and non-profit purposes and ; * without fee is hereby granted, provided that the above copyright ; * notice appear in all copies and that both that copyright notice and ; * this permission notice appear in supporting documentation, and that ; * the name of the University of California not be used in advertising ; * or publicity pertaining to distribution of the software without ; * specific, written prior permission. Permission to incorporate this ; * software into commercial products can be obtained from the Campus ; * Software Office, 295 Evans Hall, University of California, Berkeley, ; * Ca., 94720 provided only that the the requestor give the University ; * of California a free licence to any derived software for educational ; * and research purposes. The University of California makes no ; * representations about the suitability of this software for any ; * purpose. It is provided "as is" without express or implied warranty. ; * ; */ d2 1 a2 1 #define _POSTGRES_H_ "$Header: postgres.h,v 1.1 88/11/11 16:37:21 postgres Exp $" @