@@ -45,6 +45,7 @@ typedef union ListCell
45
45
void * ptr_value ;
46
46
int int_value ;
47
47
Oid oid_value ;
48
+ TransactionId xid_value ;
48
49
} ListCell ;
49
50
50
51
typedef struct List
@@ -169,6 +170,7 @@ list_length(const List *l)
169
170
#define lfirst (lc ) ((lc)->ptr_value)
170
171
#define lfirst_int (lc ) ((lc)->int_value)
171
172
#define lfirst_oid (lc ) ((lc)->oid_value)
173
+ #define lfirst_xid (lc ) ((lc)->xid_value)
172
174
#define lfirst_node (type ,lc ) castNode(type, lfirst(lc))
173
175
174
176
#define linitial (l ) lfirst(list_nth_cell(l, 0))
@@ -194,6 +196,7 @@ list_length(const List *l)
194
196
#define llast (l ) lfirst(list_last_cell(l))
195
197
#define llast_int (l ) lfirst_int(list_last_cell(l))
196
198
#define llast_oid (l ) lfirst_oid(list_last_cell(l))
199
+ #define llast_xid (l ) lfirst_xid(list_last_cell(l))
197
200
#define llast_node (type ,l ) castNode(type, llast(l))
198
201
199
202
/*
@@ -202,6 +205,7 @@ list_length(const List *l)
202
205
#define list_make_ptr_cell (v ) ((ListCell) {.ptr_value = (v)})
203
206
#define list_make_int_cell (v ) ((ListCell) {.int_value = (v)})
204
207
#define list_make_oid_cell (v ) ((ListCell) {.oid_value = (v)})
208
+ #define list_make_xid_cell (v ) ((ListCell) {.xid_value = (v)})
205
209
206
210
#define list_make1 (x1 ) \
207
211
list_make1_impl(T_List, list_make_ptr_cell(x1))
@@ -248,6 +252,21 @@ list_length(const List *l)
248
252
list_make_oid_cell(x3), list_make_oid_cell(x4), \
249
253
list_make_oid_cell(x5))
250
254
255
+ #define list_make1_xid (x1 ) \
256
+ list_make1_impl(T_XidList, list_make_xid_cell(x1))
257
+ #define list_make2_xid (x1 ,x2 ) \
258
+ list_make2_impl(T_XidList, list_make_xid_cell(x1), list_make_xid_cell(x2))
259
+ #define list_make3_xid (x1 ,x2 ,x3 ) \
260
+ list_make3_impl(T_XidList, list_make_xid_cell(x1), list_make_xid_cell(x2), \
261
+ list_make_xid_cell(x3))
262
+ #define list_make4_xid (x1 ,x2 ,x3 ,x4 ) \
263
+ list_make4_impl(T_XidList, list_make_xid_cell(x1), list_make_xid_cell(x2), \
264
+ list_make_xid_cell(x3), list_make_xid_cell(x4))
265
+ #define list_make5_xid (x1 ,x2 ,x3 ,x4 ,x5 ) \
266
+ list_make5_impl(T_XidList, list_make_xid_cell(x1), list_make_xid_cell(x2), \
267
+ list_make_xid_cell(x3), list_make_xid_cell(x4), \
268
+ list_make_xid_cell(x5))
269
+
251
270
/*
252
271
* Locate the n'th cell (counting from 0) of the list.
253
272
* It is an assertion failure if there is no such cell.
@@ -539,6 +558,7 @@ extern List *list_make5_impl(NodeTag t, ListCell datum1, ListCell datum2,
539
558
extern pg_nodiscard List * lappend (List * list , void * datum );
540
559
extern pg_nodiscard List * lappend_int (List * list , int datum );
541
560
extern pg_nodiscard List * lappend_oid (List * list , Oid datum );
561
+ extern pg_nodiscard List * lappend_xid (List * list , TransactionId datum );
542
562
543
563
extern pg_nodiscard List * list_insert_nth (List * list , int pos , void * datum );
544
564
extern pg_nodiscard List * list_insert_nth_int (List * list , int pos , int datum );
@@ -557,6 +577,7 @@ extern bool list_member(const List *list, const void *datum);
557
577
extern bool list_member_ptr (const List * list , const void * datum );
558
578
extern bool list_member_int (const List * list , int datum );
559
579
extern bool list_member_oid (const List * list , Oid datum );
580
+ extern bool list_member_xid (const List * list , TransactionId datum );
560
581
561
582
extern pg_nodiscard List * list_delete (List * list , void * datum );
562
583
extern pg_nodiscard List * list_delete_ptr (List * list , void * datum );
0 commit comments