aboutsummaryrefslogtreecommitdiff
path: root/src/fe_utils/simple_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe_utils/simple_list.c')
-rw-r--r--src/fe_utils/simple_list.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/fe_utils/simple_list.c b/src/fe_utils/simple_list.c
index cfdb7dc87af..b5f45126af7 100644
--- a/src/fe_utils/simple_list.c
+++ b/src/fe_utils/simple_list.c
@@ -152,3 +152,24 @@ simple_string_list_not_touched(SimpleStringList *list)
}
return NULL;
}
+
+/*
+ * Append a pointer to the list.
+ *
+ * Caller must ensure that the pointer remains valid.
+ */
+void
+simple_ptr_list_append(SimplePtrList *list, void *ptr)
+{
+ SimplePtrListCell *cell;
+
+ cell = (SimplePtrListCell *) pg_malloc(sizeof(SimplePtrListCell));
+ cell->next = NULL;
+ cell->ptr = ptr;
+
+ if (list->tail)
+ list->tail->next = cell;
+ else
+ list->head = cell;
+ list->tail = cell;
+}