Inline some very common functions in the API.
This commit is contained in:
parent
8baad7b5da
commit
d357dfed90
@ -72,7 +72,7 @@ find_pkg_dict_from_plist(const char *plist,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_dict_from_plist_by_name(const char *plist,
|
xbps_find_pkg_dict_from_plist_by_name(const char *plist,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *pkgname)
|
const char *pkgname)
|
||||||
@ -80,7 +80,7 @@ xbps_find_pkg_dict_from_plist_by_name(const char *plist,
|
|||||||
return find_pkg_dict_from_plist(plist, key, pkgname, false);
|
return find_pkg_dict_from_plist(plist, key, pkgname, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_dict_from_plist_by_pattern(const char *plist,
|
xbps_find_pkg_dict_from_plist_by_pattern(const char *plist,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *pattern)
|
const char *pattern)
|
||||||
@ -152,13 +152,13 @@ find_pkg_in_array(prop_array_t array, const char *str, bool bypattern)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_in_array_by_name(prop_array_t array, const char *name)
|
xbps_find_pkg_in_array_by_name(prop_array_t array, const char *name)
|
||||||
{
|
{
|
||||||
return find_pkg_in_array(array, name, false);
|
return find_pkg_in_array(array, name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_in_array_by_pattern(prop_array_t array, const char *pattern)
|
xbps_find_pkg_in_array_by_pattern(prop_array_t array, const char *pattern)
|
||||||
{
|
{
|
||||||
return find_pkg_in_array(array, pattern, true);
|
return find_pkg_in_array(array, pattern, true);
|
||||||
@ -268,7 +268,7 @@ find_pkg_in_dict(prop_dictionary_t d,
|
|||||||
return find_pkg_in_array(array, str, bypattern);
|
return find_pkg_in_array(array, str, bypattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_in_dict_by_name(prop_dictionary_t d,
|
xbps_find_pkg_in_dict_by_name(prop_dictionary_t d,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *pkgname)
|
const char *pkgname)
|
||||||
@ -276,7 +276,7 @@ xbps_find_pkg_in_dict_by_name(prop_dictionary_t d,
|
|||||||
return find_pkg_in_dict(d, key, pkgname, false, false);
|
return find_pkg_in_dict(d, key, pkgname, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t
|
inline prop_dictionary_t
|
||||||
xbps_find_pkg_in_dict_by_pattern(prop_dictionary_t d,
|
xbps_find_pkg_in_dict_by_pattern(prop_dictionary_t d,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *pattern)
|
const char *pattern)
|
||||||
@ -284,7 +284,7 @@ xbps_find_pkg_in_dict_by_pattern(prop_dictionary_t d,
|
|||||||
return find_pkg_in_dict(d, key, pattern, true, false);
|
return find_pkg_in_dict(d, key, pattern, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t HIDDEN
|
inline prop_dictionary_t HIDDEN
|
||||||
xbps_find_virtualpkg_user_in_dict_by_name(prop_dictionary_t d,
|
xbps_find_virtualpkg_user_in_dict_by_name(prop_dictionary_t d,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *name)
|
const char *name)
|
||||||
@ -292,7 +292,7 @@ xbps_find_virtualpkg_user_in_dict_by_name(prop_dictionary_t d,
|
|||||||
return find_pkg_in_dict(d, key, name, false, true);
|
return find_pkg_in_dict(d, key, name, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
prop_dictionary_t HIDDEN
|
inline prop_dictionary_t HIDDEN
|
||||||
xbps_find_virtualpkg_user_in_dict_by_pattern(prop_dictionary_t d,
|
xbps_find_virtualpkg_user_in_dict_by_pattern(prop_dictionary_t d,
|
||||||
const char *key,
|
const char *key,
|
||||||
const char *pattern)
|
const char *pattern)
|
||||||
@ -386,19 +386,19 @@ find_string_in_array(prop_array_t array, const char *str, int mode)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_find_string_in_array(prop_array_t array, const char *str)
|
xbps_find_string_in_array(prop_array_t array, const char *str)
|
||||||
{
|
{
|
||||||
return find_string_in_array(array, str, 0);
|
return find_string_in_array(array, str, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_find_pkgname_in_array(prop_array_t array, const char *pkgname)
|
xbps_find_pkgname_in_array(prop_array_t array, const char *pkgname)
|
||||||
{
|
{
|
||||||
return find_string_in_array(array, pkgname, 1);
|
return find_string_in_array(array, pkgname, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_find_pkgpattern_in_array(prop_array_t array, const char *pattern)
|
xbps_find_pkgpattern_in_array(prop_array_t array, const char *pattern)
|
||||||
{
|
{
|
||||||
return find_string_in_array(array, pattern, 2);
|
return find_string_in_array(array, pattern, 2);
|
||||||
|
@ -87,19 +87,19 @@ remove_string_from_array(prop_array_t array, const char *str, int mode)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_remove_string_from_array(prop_array_t array, const char *str)
|
xbps_remove_string_from_array(prop_array_t array, const char *str)
|
||||||
{
|
{
|
||||||
return remove_string_from_array(array, str, 0);
|
return remove_string_from_array(array, str, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_remove_pkgname_from_array(prop_array_t array, const char *name)
|
xbps_remove_pkgname_from_array(prop_array_t array, const char *name)
|
||||||
{
|
{
|
||||||
return remove_string_from_array(array, name, 1);
|
return remove_string_from_array(array, name, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
inline bool
|
||||||
xbps_remove_pkg_from_array_by_name(prop_array_t array, const char *name)
|
xbps_remove_pkg_from_array_by_name(prop_array_t array, const char *name)
|
||||||
{
|
{
|
||||||
return remove_string_from_array(array, name, 2);
|
return remove_string_from_array(array, name, 2);
|
||||||
|
@ -245,13 +245,13 @@ xbps_repository_update_allpkgs(void)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
inline int
|
||||||
xbps_repository_update_pkg(const char *pkgname)
|
xbps_repository_update_pkg(const char *pkgname)
|
||||||
{
|
{
|
||||||
return repository_find_pkg(pkgname, "update");
|
return repository_find_pkg(pkgname, "update");
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
inline int
|
||||||
xbps_repository_install_pkg(const char *pkgpattern)
|
xbps_repository_install_pkg(const char *pkgpattern)
|
||||||
{
|
{
|
||||||
return repository_find_pkg(pkgpattern, "install");
|
return repository_find_pkg(pkgpattern, "install");
|
||||||
|
Loading…
Reference in New Issue
Block a user