Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/alpm_list.c
diff options
context:
space:
mode:
authorNathan Jones <nathanj@insightbb.com>2007-10-19 13:17:51 -0400
committerDan McGee <dan@archlinux.org>2007-10-19 19:21:44 -0500
commit0c2cc108d332837de4a33ca9cabe717bd414c407 (patch)
tree78e7901eedf2bf0c0d27ea3d77dff8ac9580875d /lib/libalpm/alpm_list.c
parent1118e00fe91125e464e8c3487f58f6000e0036b2 (diff)
Add pmdelta_t structure and functions to libalpm.
Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm_list.c')
-rw-r--r--lib/libalpm/alpm_list.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index 5671b4a2..2301411a 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -379,6 +379,24 @@ alpm_list_t SYMEXPORT *alpm_list_strdup(const alpm_list_t *list)
}
/**
+ * @brief Copy a list, without copying data.
+ *
+ * @param list the list to copy
+ *
+ * @return a copy of the original list
+ */
+alpm_list_t SYMEXPORT *alpm_list_copy(const alpm_list_t *list)
+{
+ const alpm_list_t *lp = list;
+ alpm_list_t *newlist = NULL;
+ while(lp) {
+ newlist = alpm_list_add(newlist, lp->data);
+ lp = lp->next;
+ }
+ return(newlist);
+}
+
+/**
* @brief Create a new list in reverse order.
*
* @param list the list to copy