Introduce xbps_callback_array_iter_reverse_in_dict().

This function works by iterating an array in a dictionary
in reverse order, i.e from down to top.

--HG--
extra : convert_revision : 5e655c2edf3d42453f16830e2e944c7f6e2cd974
This commit is contained in:
Juan RP
2009-08-08 22:14:42 +02:00
parent 9affd1491a
commit 8b2fe3efe3
2 changed files with 93 additions and 4 deletions

View File

@@ -50,7 +50,7 @@
/* Filename of the packages register. */
#define XBPS_REGPKGDB "regpkgdb.plist"
/* Filename of the package properties plist file. */
/* Package metadata files. */
#define XBPS_PKGPROPS "props.plist"
#define XBPS_PKGFILES "files.plist"
@@ -66,6 +66,9 @@
#define __UNCONST(a) ((void *)(unsigned long)(const void *)(a))
#endif
/* From lib/configure.c */
int xbps_configure_pkg(const char *, const char *);
/* from lib/cmpver.c */
int xbps_cmpver(const char *, const char *);
@@ -99,14 +102,14 @@ void xbps_release_repolist_data(void);
prop_dictionary_t xbps_get_pkg_props(void);
/* From lib/register.c */
int xbps_register_pkg(prop_dictionary_t, bool, bool);
int xbps_register_pkg(prop_dictionary_t, bool);
/* From lib/requiredby.c */
int xbps_requiredby_pkg_add(prop_array_t, prop_dictionary_t);
int xbps_requiredby_pkg_remove(const char *);
/* From lib/unpack.c */
int xbps_unpack_binary_pkg(prop_dictionary_t);
int xbps_unpack_binary_pkg(prop_dictionary_t, bool);
/* From lib/depends.c */
int xbps_find_deps_in_pkg(prop_dictionary_t, prop_dictionary_t);
@@ -120,6 +123,10 @@ int xbps_callback_array_iter_in_dict(prop_dictionary_t,
const char *,
int (*fn)(prop_object_t, void *, bool *),
void *);
int xbps_callback_array_iter_reverse_in_dict(prop_dictionary_t,
const char *,
int (*fn)(prop_object_t, void *, bool *),
void *);
int xbps_callback_array_iter_in_repolist(int (*fn)(prop_object_t,
void *, bool *), void *);
@@ -134,13 +141,16 @@ void xbps_release_regpkgdb_dict(void);
prop_object_iterator_t xbps_get_array_iter_from_dict(prop_dictionary_t,
const char *);
prop_dictionary_t xbps_read_dict_from_archive_entry(struct archive *,
struct archive_entry *);
int xbps_remove_pkg_dict_from_file(const char *, const char *);
int xbps_remove_pkg_from_dict(prop_dictionary_t, const char *,
const char *);
int xbps_remove_string_from_array(prop_array_t, const char *);
/* From lib/remove.c */
int xbps_remove_binary_pkg(const char *, bool);
int xbps_remove_pkg(const char *, const char *, bool);
int xbps_unregister_pkg(const char *);
/* From lib/repository.c */
@@ -150,6 +160,19 @@ int xbps_unregister_repository(const char *);
/* From lib/sortdeps.c */
int xbps_sort_pkg_deps(prop_dictionary_t);
/* From lib/state.c */
typedef enum pkg_state {
XBPS_PKG_STATE_UNPACKED = 1,
XBPS_PKG_STATE_INSTALLED,
XBPS_PKG_STATE_BROKEN,
XBPS_PKG_STATE_CONFIG_FILES,
XBPS_PKG_STATE_NOT_INSTALLED
} pkg_state_t;
int xbps_get_pkg_state_installed(const char *, pkg_state_t *);
int xbps_get_pkg_state_dictionary(prop_dictionary_t, pkg_state_t *);
int xbps_set_pkg_state_installed(const char *, pkg_state_t);
int xbps_set_pkg_state_dictionary(prop_dictionary_t, pkg_state_t);
/* From lib/util.c */
char * xbps_xasprintf(const char *, ...);
char * xbps_get_file_hash(const char *);