introduce the active_list for searching.
[oweals/opkg-lede.git] / libopkg / pkg.h
index ffb969b..3f7d6b6 100644 (file)
@@ -1,4 +1,4 @@
-/* pkg.h - the itsy package management system
+/* pkg.h - the opkg package management system
 
    Carl D. Worth
 
@@ -24,6 +24,7 @@
 
 #include "pkg_vec.h"
 #include "str_list.h"
+#include "active_list.h"
 #include "pkg_src.h"
 #include "pkg_dest.h"
 #include "opkg_conf.h"
@@ -87,6 +88,7 @@ struct abstract_pkg{
     struct abstract_pkg ** depended_upon_by; /* @@@@ this should be abstract_pkg_vec_t -Jamey */
     abstract_pkg_vec_t * provided_by;
     abstract_pkg_vec_t * replaced_by;
+    struct active_list   searched_node;   /* Used for hash search */
 };
 
 #include "pkg_depends.h"
@@ -117,13 +119,13 @@ struct pkg
      unsigned long epoch;
      char *version;
      char *revision;
-     char *familiar_revision;
      pkg_src_t *src;
      pkg_dest_t *dest;
      char *architecture;
      char *section;
      char *maintainer;
      char *description;
+     char *tags;
      pkg_state_want_t state_want;
      pkg_state_flag_t state_flag;
      pkg_state_status_t state_status;
@@ -135,6 +137,8 @@ struct pkg
      int recommends_count;
      char **suggests_str;
      int suggests_count;
+     struct active_list list; /* Used for installing|upgrading */
+     struct active_list searched_node;  /* Used for searching */
      compound_depend_t * depends;
 
      /* Abhaya: new conflicts */
@@ -198,8 +202,8 @@ int pkg_merge(pkg_t *oldpkg, pkg_t *newpkg, int set_status);
 char *pkg_version_str_alloc(pkg_t *pkg);
 
 int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
-int pkg_name_version_and_architecture_compare(void *a, void *b);
-int abstract_pkg_name_compare(void *a, void *b);
+int pkg_name_version_and_architecture_compare(const void *a, const void *b);
+int abstract_pkg_name_compare(const void *a, const void *b);
 
 char * pkg_formatted_info(pkg_t *pkg );
 char * pkg_formatted_field(pkg_t *pkg, const char *field );