Inline some very common functions in the API.

This commit is contained in:
Juan RP 2011-02-23 17:27:51 +01:00
parent 8baad7b5da
commit d357dfed90
3 changed files with 16 additions and 16 deletions

View File

@ -72,7 +72,7 @@ find_pkg_dict_from_plist(const char *plist,
return res;
}
prop_dictionary_t
inline prop_dictionary_t
xbps_find_pkg_dict_from_plist_by_name(const char *plist,
const char *key,
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);
}
prop_dictionary_t
inline prop_dictionary_t
xbps_find_pkg_dict_from_plist_by_pattern(const char *plist,
const char *key,
const char *pattern)
@ -152,13 +152,13 @@ find_pkg_in_array(prop_array_t array, const char *str, bool bypattern)
return obj;
}
prop_dictionary_t
inline prop_dictionary_t
xbps_find_pkg_in_array_by_name(prop_array_t array, const char *name)
{
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)
{
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);
}
prop_dictionary_t
inline prop_dictionary_t
xbps_find_pkg_in_dict_by_name(prop_dictionary_t d,
const char *key,
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);
}
prop_dictionary_t
inline prop_dictionary_t
xbps_find_pkg_in_dict_by_pattern(prop_dictionary_t d,
const char *key,
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);
}
prop_dictionary_t HIDDEN
inline prop_dictionary_t HIDDEN
xbps_find_virtualpkg_user_in_dict_by_name(prop_dictionary_t d,
const char *key,
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);
}
prop_dictionary_t HIDDEN
inline prop_dictionary_t HIDDEN
xbps_find_virtualpkg_user_in_dict_by_pattern(prop_dictionary_t d,
const char *key,
const char *pattern)
@ -386,19 +386,19 @@ find_string_in_array(prop_array_t array, const char *str, int mode)
return found;
}
bool
inline bool
xbps_find_string_in_array(prop_array_t array, const char *str)
{
return find_string_in_array(array, str, 0);
}
bool
inline bool
xbps_find_pkgname_in_array(prop_array_t array, const char *pkgname)
{
return find_string_in_array(array, pkgname, 1);
}
bool
inline bool
xbps_find_pkgpattern_in_array(prop_array_t array, const char *pattern)
{
return find_string_in_array(array, pattern, 2);

View File

@ -87,19 +87,19 @@ remove_string_from_array(prop_array_t array, const char *str, int mode)
return true;
}
bool
inline bool
xbps_remove_string_from_array(prop_array_t array, const char *str)
{
return remove_string_from_array(array, str, 0);
}
bool
inline bool
xbps_remove_pkgname_from_array(prop_array_t array, const char *name)
{
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)
{
return remove_string_from_array(array, name, 2);

View File

@ -245,13 +245,13 @@ xbps_repository_update_allpkgs(void)
return rv;
}
int
inline int
xbps_repository_update_pkg(const char *pkgname)
{
return repository_find_pkg(pkgname, "update");
}
int
inline int
xbps_repository_install_pkg(const char *pkgpattern)
{
return repository_find_pkg(pkgpattern, "install");