diff --git a/parse.c b/parse.c index 2772ce8..1fe209b 100644 --- a/parse.c +++ b/parse.c @@ -320,7 +320,7 @@ pkg_dependency_parse(pkg_t *pkg, const char *depends) * Parse a .pc file into a pkg_t object structure. */ pkg_t * -parse_file(const char *filename, FILE *f) +pkg_new_from_file(const char *filename, FILE *f) { pkg_t *pkg; char readbuf[BUFSIZ]; diff --git a/pkg.c b/pkg.c index fc14bfc..276eac9 100644 --- a/pkg.c +++ b/pkg.c @@ -142,7 +142,7 @@ pkg_find(const char *name, unsigned int flags) if (str_has_suffix(name, PKG_CONFIG_EXT)) { if ((f = fopen(name, "r")) != NULL) - return parse_file(name, f); + return pkg_new_from_file(name, f); } /* PKG_CONFIG_PATH has to take precedence */ @@ -158,7 +158,7 @@ pkg_find(const char *name, unsigned int flags) if (!(flags & PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL) { - pkg = parse_file(locbuf, f); + pkg = pkg_new_from_file(locbuf, f); pkg->uninstalled = true; goto out; @@ -166,7 +166,7 @@ pkg_find(const char *name, unsigned int flags) if ((f = fopen(locbuf, "r")) != NULL) { - pkg = parse_file(locbuf, f); + pkg = pkg_new_from_file(locbuf, f); goto out; } @@ -190,7 +190,7 @@ pkg_find(const char *name, unsigned int flags) if (!(flags & PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL) { - pkg_t *pkg = parse_file(locbuf, f); + pkg_t *pkg = pkg_new_from_file(locbuf, f); pkg->uninstalled = true; goto out; @@ -198,7 +198,7 @@ pkg_find(const char *name, unsigned int flags) if ((f = fopen(locbuf, "r")) != NULL) { - pkg = parse_file(locbuf, f); + pkg = pkg_new_from_file(locbuf, f); goto out; } diff --git a/pkg.h b/pkg.h index 1f26cc4..19fa58a 100644 --- a/pkg.h +++ b/pkg.h @@ -144,7 +144,7 @@ pkg_t *pkg_verify_dependency(pkg_dependency_t *pkgdep, unsigned int flags, unsig const char *pkg_get_comparator(pkg_dependency_t *pkgdep); /* parse.c */ -pkg_t *parse_file(const char *path, FILE *f); +pkg_t *pkg_new_from_file(const char *path, FILE *f); pkg_dependency_t *pkg_dependency_parse(pkg_t *pkg, const char *depends); pkg_dependency_t *pkg_dependency_append(pkg_dependency_t *head, pkg_dependency_t *tail); void pkg_dependency_free(pkg_dependency_t *head);