Introduce xbps_plist_{array,dictionary}_from_file().

Those are a wrapper around xbps_{array,dictionary}_internalize_from_zfile()
that prints a debugging msg when the plist file cannot be internalized.

Update xbps to use these wrappers.
This commit is contained in:
Juan RP
2015-05-28 10:15:05 +02:00
parent c4ed1b5845
commit 769a997afb
9 changed files with 59 additions and 10 deletions

View File

@ -48,7 +48,7 @@
*
* This header documents the full API for the XBPS Library.
*/
#define XBPS_API_VERSION "20150413"
#define XBPS_API_VERSION "20150528"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@ -1978,6 +1978,28 @@ char *xbps_sanitize_path(const char *src);
char *xbps_symlink_target(struct xbps_handle *xhp, const char *path,
const char *target);
/**
* Internalizes a plist file declared in \f and returns a proplib array.
*
* @param[in] xhp The pointer to an xbps_handle struct.
* @param[in] fname The file path.
*
* @return The internalized proplib array, NULL otherwise.
*/
xbps_array_t
xbps_plist_array_from_file(struct xbps_handle *xhp, const char *fname);
/**
* Internalizes a plist file declared in \f and returns a proplib dictionary.
*
* @param[in] xhp The pointer to an xbps_handle struct.
* @param[in] fname The file path.
*
* @return The internalized proplib array, NULL otherwise.
*/
xbps_dictionary_t
xbps_plist_dictionary_from_file(struct xbps_handle *xhp, const char *fname);
/*@}*/
#ifdef __cplusplus