Various cleanups in opkg_remove.{c,h}
[oweals/opkg-lede.git] / libopkg / pkg.h
index a7c98ec39ef1a2f80205127fab8dc86c3b626082..229594d92cf2b0b4cacd7e4090f3c1abb5de9221 100644 (file)
@@ -161,6 +161,9 @@ struct pkg
      char *url;
      char *tmp_unpack_dir;
      char *md5sum;
+#if defined HAVE_SHA256
+     char *sha256sum;
+#endif
      char *size;
      char *installed_size;
      char *priority;
@@ -185,11 +188,9 @@ struct pkg
 };
 
 pkg_t *pkg_new(void);
-int pkg_init(pkg_t *pkg);
 void pkg_deinit(pkg_t *pkg);
-int pkg_init_from_file(pkg_t *pkg, const char *filename);
+int pkg_init_from_file(opkg_conf_t *conf, pkg_t *pkg, const char *filename);
 abstract_pkg_t *abstract_pkg_new(void);
-int abstract_pkg_init(abstract_pkg_t *ab_pkg);
 
 /* 
  * merges fields from newpkg into oldpkg.
@@ -203,34 +204,28 @@ int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
 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 );
+void pkg_formatted_info(FILE *fp, pkg_t *pkg);
+void pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field);
 
 void set_flags_from_control(opkg_conf_t *conf, pkg_t *pkg);
 
-void pkg_print_info(pkg_t *pkg, FILE *file);
 void pkg_print_status(pkg_t * pkg, FILE * file);
-void pkg_print_field(pkg_t *pkg, FILE *file, const char *field);
-str_list_t *pkg_get_installed_files(pkg_t *pkg);
-int pkg_free_installed_files(pkg_t *pkg);
-int pkg_remove_installed_files_list(opkg_conf_t *conf, pkg_t *pkg);
+str_list_t *pkg_get_installed_files(opkg_conf_t *conf, pkg_t *pkg);
+void pkg_free_installed_files(pkg_t *pkg);
+void pkg_remove_installed_files_list(opkg_conf_t *conf, pkg_t *pkg);
 conffile_t *pkg_get_conffile(pkg_t *pkg, const char *file_name);
 int pkg_run_script(struct opkg_conf *conf, pkg_t *pkg,
                   const char *script, const char *args);
 
 /* enum mappings */
-char *pkg_state_want_to_str(pkg_state_want_t sw);
 pkg_state_want_t pkg_state_want_from_str(char *str);
-char *pkg_state_flag_to_str(pkg_state_flag_t sf);
 pkg_state_flag_t pkg_state_flag_from_str(const char *str);
-char *pkg_state_status_to_str(pkg_state_status_t ss);
 pkg_state_status_t pkg_state_status_from_str(const char *str);
 
 int pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op);
 
 int pkg_arch_supported(opkg_conf_t *conf, pkg_t *pkg);
-int pkg_info_preinstall_check(opkg_conf_t *conf);
-int pkg_free_installed_files(pkg_t *pkg);
+void pkg_info_preinstall_check(opkg_conf_t *conf);
 
 int pkg_write_filelist(opkg_conf_t *conf, pkg_t *pkg);
 int pkg_write_changed_filelists(opkg_conf_t *conf);