Introduce xbps_symlink_target() and use it in two places.

This code is now shared by xbps-pkgdb and libxbps/xbps-remove.
This commit is contained in:
Juan RP
2015-02-19 09:47:09 +01:00
parent 69e3a50e75
commit 05f879ec09
4 changed files with 78 additions and 148 deletions

View File

@ -48,7 +48,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20150218"
#define XBPS_API_VERSION "20150219"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@ -1937,11 +1937,24 @@ char *xbps_pubkey2fp(struct xbps_handle *xhp, xbps_data_t pubkey);
* Returns a buffer with a sanitized path from \a src.
* This removes multiple slashes.
*
* @param[in] src A path.
*
* @return The sanitized path in a buffer.
* The returned buffer must be free(3)d when it's no longer necessary.
*/
char *xbps_sanitize_path(const char *src);
/**
* Returns a sanitized target file of \a path without the rootdir component.
*
* @param[in] xhp The pointer to an xbps_handle struct.
* @param[in] path A path to a filename.
*
* @return The sanitized path in a buffer.
* The returned buffer must be free(3)d when it's no longer necessary.
*/
char *xbps_symlink_target(struct xbps_handle *xhp, const char *path);
/*@}*/
#ifdef __cplusplus