return offsetNumber;
}
-/*
- * PageAddItem
- *
- * Add an item to a page. Return value is offset at which it was
- * inserted, or InvalidOffsetNumber if the item is not inserted for
- * any reason.
- *
- * Passing the 'overwrite' and 'is_heap' parameters as true causes the
- * PAI_OVERWRITE and PAI_IS_HEAP flags to be set, respectively.
- *
- * !!! EREPORT(ERROR) IS DISALLOWED HERE !!!
- */
-OffsetNumber
-PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber,
- bool overwrite, bool is_heap)
-{
- return PageAddItemExtended(page, item, size, offsetNumber,
- overwrite ? PAI_OVERWRITE : 0 |
- is_heap ? PAI_IS_HEAP : 0);
-}
/*
* PageGetTempPage
#define PAI_OVERWRITE (1 << 0)
#define PAI_IS_HEAP (1 << 1)
+#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \
+ PageAddItemExtended(page, item, size, offsetNumber, \
+ ((overwrite) ? PAI_OVERWRITE : 0) | \
+ ((is_heap) ? PAI_IS_HEAP : 0))
+
extern void PageInit(Page page, Size pageSize, Size specialSize);
extern bool PageIsVerified(Page page, BlockNumber blkno);
-extern OffsetNumber PageAddItem(Page page, Item item, Size size,
- OffsetNumber offsetNumber, bool overwrite, bool is_heap);
extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
OffsetNumber offsetNumber, int flags);
extern Page PageGetTempPage(Page page);