* 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. */
| 333 | * first argument. |
| 334 | */ |
| 335 | List * |
| 336 | lappend(List *list, void *datum) |
| 337 | { |
| 338 | Assert(IsPointerList(list)); |
| 339 | |
| 340 | if (list == NIL) |
| 341 | list = new_list(T_List, 1); |
| 342 | else |
| 343 | new_tail_cell(list); |
| 344 | |
| 345 | llast(list) = datum; |
| 346 | check_list_invariants(list); |
| 347 | return list; |
| 348 | } |
| 349 | |
| 350 | /* |
| 351 | * Append an integer to the specified list. See lappend() |