diff options
Diffstat (limited to 'src/include/access/heapam.h')
-rw-r--r-- | src/include/access/heapam.h | 106 |
1 files changed, 50 insertions, 56 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index f8e05b60cf6..ecaed32c9fe 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.36 1998/09/01 03:27:32 momjian Exp $ + * $Id: heapam.h,v 1.37 1998/09/01 04:34:12 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -127,53 +127,54 @@ typedef HeapAccessStatisticsData *HeapAccessStatistics; ) \ ) -#else /* !defined(DISABLE_COMPLEX_MACRO) */ +#else /* !defined(DISABLE_COMPLEX_MACRO) */ extern Datum nocachegetattr(HeapTuple tup, int attnum, - TupleDesc att, bool *isnull); + TupleDesc att, bool *isnull); -static Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, - bool *isnull) +static Datum +fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, + bool *isnull) { - return ( - (attnum) > 0 ? - ( - ((isnull) ? (*(isnull) = false) : (dummyret)NULL), - HeapTupleNoNulls(tup) ? + return ( + (attnum) > 0 ? ( - ((tupleDesc)->attrs[(attnum)-1]->attcacheoff != -1 || - (attnum) == 1) ? - ( - (Datum)fetchatt(&((tupleDesc)->attrs[(attnum)-1]), - (char *) (tup) + (tup)->t_hoff + - ( - ((attnum) != 1) ? - (tupleDesc)->attrs[(attnum)-1]->attcacheoff - : - 0 - ) - ) - ) - : - nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) - ) + ((isnull) ? (*(isnull) = false) : (dummyret) NULL), + HeapTupleNoNulls(tup) ? + ( + ((tupleDesc)->attrs[(attnum) - 1]->attcacheoff != -1 || + (attnum) == 1) ? + ( + (Datum) fetchatt(&((tupleDesc)->attrs[(attnum) - 1]), + (char *) (tup) + (tup)->t_hoff + + ( + ((attnum) != 1) ? + (tupleDesc)->attrs[(attnum) - 1]->attcacheoff + : + 0 + ) + ) + ) + : + nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) + ) + : + ( + att_isnull((attnum) - 1, (tup)->t_bits) ? + ( + ((isnull) ? (*(isnull) = true) : (dummyret) NULL), + (Datum) NULL + ) + : + ( + nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) + ) + ) + ) : ( - att_isnull((attnum)-1, (tup)->t_bits) ? - ( - ((isnull) ? (*(isnull) = true) : (dummyret)NULL), - (Datum)NULL - ) - : - ( - nocachegetattr((tup), (attnum), (tupleDesc), (isnull)) - ) - ) - ) - : - ( - (Datum)NULL - ) + (Datum) NULL + ) ); } @@ -246,8 +247,7 @@ extern void doinsert(Relation relation, HeapTuple tup); extern Relation heap_open(Oid relationId); extern Relation heap_openr(char *relationName); extern void heap_close(Relation relation); -extern HeapScanDesc -heap_beginscan(Relation relation, int atend, +extern HeapScanDesc heap_beginscan(Relation relation, int atend, Snapshot snapshot, unsigned nkeys, ScanKey key); extern void heap_rescan(HeapScanDesc scan, bool scanFromEnd, ScanKey key); extern void heap_endscan(HeapScanDesc scan); @@ -255,31 +255,26 @@ extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw); extern HeapTuple heap_fetch(Relation relation, Snapshot snapshot, ItemPointer tid, Buffer *userbuf); extern Oid heap_insert(Relation relation, HeapTuple tup); extern int heap_delete(Relation relation, ItemPointer tid); -extern int -heap_replace(Relation relation, ItemPointer otid, +extern int heap_replace(Relation relation, ItemPointer otid, HeapTuple tup); extern void heap_markpos(HeapScanDesc scan); extern void heap_restrpos(HeapScanDesc scan); /* in common/heaptuple.c */ extern Size ComputeDataSize(TupleDesc tupleDesc, Datum *value, char *nulls); -extern void -DataFill(char *data, TupleDesc tupleDesc, +extern void DataFill(char *data, TupleDesc tupleDesc, Datum *value, char *nulls, uint16 *infomask, bits8 *bit); extern int heap_attisnull(HeapTuple tup, int attnum); extern int heap_sysattrlen(AttrNumber attno); extern bool heap_sysattrbyval(AttrNumber attno); extern Datum heap_getsysattr(HeapTuple tup, Buffer b, int attnum); -extern Datum -nocachegetattr(HeapTuple tup, int attnum, +extern Datum nocachegetattr(HeapTuple tup, int attnum, TupleDesc att, bool *isnull); extern HeapTuple heap_copytuple(HeapTuple tuple); -extern HeapTuple -heap_formtuple(TupleDesc tupleDescriptor, +extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor, Datum *value, char *nulls); -extern HeapTuple -heap_modifytuple(HeapTuple tuple, +extern HeapTuple heap_modifytuple(HeapTuple tuple, Relation relation, Datum *replValue, char *replNull, char *repl); HeapTuple heap_addheader(uint32 natts, int structlen, char *structure); @@ -288,9 +283,8 @@ extern void PrintHeapAccessStatistics(HeapAccessStatistics stats); extern void initam(void); /* hio.c */ -extern void -RelationPutHeapTuple(Relation relation, BlockNumber blockIndex, +extern void RelationPutHeapTuple(Relation relation, BlockNumber blockIndex, HeapTuple tuple); extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple); -#endif /* HEAPAM_H */ +#endif /* HEAPAM_H */ |