/* * Append a pointer to the list. A pointer to the modified list is * returned. Note that this function may or may not destructively * modify the list; callers should always use this function's return * value, rather than continuing to use the pointer passed as the * first argument. */ List * lappend(List *list, void *datum) { Assert(IsPointerList(list)); if (list == NIL) list = new_list(T_List); else new_tail_cell(list); lfirst(list->tail) = datum; return list; }
/* * Append an OID to the specified list. See lappend() */ List * lappend_oid(List *list, Oid datum) { Assert(IsOidList(list)); if (list == NIL) list = new_list(T_OidList); else new_tail_cell(list); lfirst_oid(list->tail) = datum; check_list_invariants(list); return list; }
/* * Append an integer to the specified list. See lappend() */ List * lappend_int(List *list, int datum) { Assert(IsIntegerList(list)); if (list == NIL) list = new_list(T_IntList); else new_tail_cell(list); lfirst_int(list->tail) = datum; check_list_invariants(list); return list; }