diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-10-26 13:47:53 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-10-26 18:26:28 +0300 |
commit | 95fee14dfa5bd3896c510077af36ea371a9a2975 (patch) | |
tree | b1a85ba6ab458731e3aeba30efc645c7b2a50225 /libpkgconf/path.c | |
parent | 9be7ac171fba73340e2974ff7ba55739a7ca81fb (diff) |
Merge with 1.5.4 upstream package version
Diffstat (limited to 'libpkgconf/path.c')
-rw-r--r-- | libpkgconf/path.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libpkgconf/path.c b/libpkgconf/path.c index 2f4cfbb..02d1c97 100644 --- a/libpkgconf/path.c +++ b/libpkgconf/path.c @@ -225,6 +225,38 @@ pkgconf_path_match_list(const char *path, const pkgconf_list_t *dirlist) /* * !doc * + * .. c:function:: void pkgconf_path_copy_list(pkgconf_list_t *dst, const pkgconf_list_t *src) + * + * Copies a path list to another path list. + * + * :param pkgconf_list_t* dst: The path list to copy to. + * :param pkgconf_list_t* src: The path list to copy from. + * :return: nothing + */ +void +pkgconf_path_copy_list(pkgconf_list_t *dst, const pkgconf_list_t *src) +{ + pkgconf_node_t *n; + + PKGCONF_FOREACH_LIST_ENTRY(src->head, n) + { + pkgconf_path_t *srcpath = n->data, *path; + + path = calloc(sizeof(pkgconf_path_t), 1); + path->path = strdup(srcpath->path); + +#ifdef PKGCONF_CACHE_INODES + path->handle_path = srcpath->handle_path; + path->handle_device = srcpath->handle_device; +#endif + + pkgconf_node_insert_tail(&path->lnode, path, dst); + } +} + +/* + * !doc + * * .. c:function:: void pkgconf_path_free(pkgconf_list_t *dirlist) * * Releases any path nodes attached to the given path list. |