Skip to content

Commit 9efba67

Browse files
committed
lib: remove xhp argument from xbps_plist_{array,dictionary}_from_file
1 parent de484e9 commit 9efba67

7 files changed

Lines changed: 17 additions & 19 deletions

File tree

bin/xbps-dgraph/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ main(int argc, char **argv)
612612
if (conf_file == NULL)
613613
conf_file = _DGRAPH_CFFILE;
614614

615-
confd = xbps_plist_dictionary_from_file(&xh, conf_file);
615+
confd = xbps_plist_dictionary_from_file(conf_file);
616616
if (confd == NULL) {
617617
if (errno != ENOENT)
618618
die("cannot read conf file `%s'", conf_file);

bin/xbps-pkgdb/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ check_pkg_integrity(struct xbps_handle *xhp,
9595
buf = xbps_xasprintf("%s/.%s-files.plist",
9696
xhp->metadir, pkgname);
9797
assert(buf);
98-
filesd = xbps_plist_dictionary_from_file(xhp, buf);
98+
filesd = xbps_plist_dictionary_from_file(buf);
9999
if (filesd == NULL) {
100100
fprintf(stderr, "%s: cannot read %s, ignoring...\n",
101101
pkgname, buf);

include/xbps.h.in

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,26 +2345,24 @@ char *xbps_symlink_target(struct xbps_handle *xhp, const char *path, const char
23452345
bool xbps_patterns_match(xbps_array_t patterns, const char *path);
23462346

23472347
/**
2348-
* Internalizes a plist file declared in \a fname and returns a proplib array.
2348+
* Internalizes a plist file declared in \a path and returns a proplib array.
23492349
*
2350-
* @param[in] xhp The pointer to an xbps_handle struct.
2351-
* @param[in] fname The file path.
2350+
* @param[in] path The file path.
23522351
*
23532352
* @return The internalized proplib array, NULL otherwise.
23542353
*/
23552354
xbps_array_t
2356-
xbps_plist_array_from_file(struct xbps_handle *xhp, const char *fname);
2355+
xbps_plist_array_from_file(const char *path);
23572356

23582357
/**
2359-
* Internalizes a plist file declared in \a fname and returns a proplib dictionary.
2358+
* Internalizes a plist file declared in \a path and returns a proplib dictionary.
23602359
*
2361-
* @param[in] xhp The pointer to an xbps_handle struct.
2362-
* @param[in] fname The file path.
2360+
* @param[in] path The file path.
23632361
*
23642362
* @return The internalized proplib array, NULL otherwise.
23652363
*/
23662364
xbps_dictionary_t
2367-
xbps_plist_dictionary_from_file(struct xbps_handle *xhp, const char *fname);
2365+
xbps_plist_dictionary_from_file(const char *path);
23682366

23692367
/**@}*/
23702368

lib/pkgdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,5 +496,5 @@ xbps_pkgdb_get_pkg_files(struct xbps_handle *xhp, const char *pkg)
496496
return NULL;
497497

498498
snprintf(plist, sizeof(plist)-1, "%s/.%s-files.plist", xhp->metadir, pkgname);
499-
return xbps_plist_dictionary_from_file(xhp, plist);
499+
return xbps_plist_dictionary_from_file(plist);
500500
}

lib/proplib_wrapper.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -934,27 +934,27 @@ xbps_string_equals_cstring(xbps_string_t s, const char *ss)
934934

935935
/* xbps specific helpers */
936936
xbps_array_t
937-
xbps_plist_array_from_file(struct xbps_handle *xhp, const char *f)
937+
xbps_plist_array_from_file(const char *path)
938938
{
939939
xbps_array_t a;
940940

941-
a = xbps_array_internalize_from_zfile(f);
941+
a = xbps_array_internalize_from_zfile(path);
942942
if (xbps_object_type(a) != XBPS_TYPE_ARRAY) {
943943
xbps_dbg_printf(
944-
"xbps: failed to internalize array from %s\n", f);
944+
"xbps: failed to internalize array from %s\n", path);
945945
}
946946
return a;
947947
}
948948

949949
xbps_dictionary_t
950-
xbps_plist_dictionary_from_file(struct xbps_handle *xhp, const char *f)
950+
xbps_plist_dictionary_from_file(const char *path)
951951
{
952952
xbps_dictionary_t d;
953953

954-
d = xbps_dictionary_internalize_from_zfile(f);
954+
d = xbps_dictionary_internalize_from_zfile(path);
955955
if (xbps_object_type(d) != XBPS_TYPE_DICTIONARY) {
956956
xbps_dbg_printf(
957-
"xbps: failed to internalize dict from %s\n", f);
957+
"xbps: failed to internalize dict from %s\n", path);
958958
}
959959
return d;
960960
}

lib/repo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ xbps_repo_key_import(struct xbps_repo *repo)
660660
* Check if the public key is alredy stored.
661661
*/
662662
rkeyfile = xbps_xasprintf("%s/keys/%s.plist", repo->xhp->metadir, hexfp);
663-
repokeyd = xbps_plist_dictionary_from_file(repo->xhp, rkeyfile);
663+
repokeyd = xbps_plist_dictionary_from_file(rkeyfile);
664664
if (xbps_object_type(repokeyd) == XBPS_TYPE_DICTIONARY) {
665665
xbps_dbg_printf("[repo] `%s' public key already stored.\n", repo->uri);
666666
goto out;

lib/verifysig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ xbps_verify_signature(struct xbps_repo *repo, const char *sigfile,
9898
* Prepare repository RSA public key to verify fname signature.
9999
*/
100100
rkeyfile = xbps_xasprintf("%s/keys/%s.plist", repo->xhp->metadir, hexfp);
101-
repokeyd = xbps_plist_dictionary_from_file(repo->xhp, rkeyfile);
101+
repokeyd = xbps_plist_dictionary_from_file(rkeyfile);
102102
if (xbps_object_type(repokeyd) != XBPS_TYPE_DICTIONARY) {
103103
xbps_dbg_printf("cannot read rkey data at %s: %s\n",
104104
rkeyfile, strerror(errno));

0 commit comments

Comments
 (0)