index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Nathan Jones <nathanj@insightbb.com> | 2007-10-19 13:17:51 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-10-19 19:21:44 -0500 |
commit | 0c2cc108d332837de4a33ca9cabe717bd414c407 (patch) | |
tree | 78e7901eedf2bf0c0d27ea3d77dff8ac9580875d /lib/libalpm/alpm_list.c | |
parent | 1118e00fe91125e464e8c3487f58f6000e0036b2 (diff) |
-rw-r--r-- | lib/libalpm/alpm_list.c | 18 |
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 |