1 /* 2 * Copyright (C) 2012-2014 Red Hat, Inc. 3 * Copyright (C) 2015 Richard Hughes <richard@hughsie.com> 4 * 5 * Licensed under the GNU Lesser General Public License Version 2.1 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 #ifndef __HY_PACKAGE_H 23 #define __HY_PACKAGE_H 24 25 #include <glib-object.h> 26 #include "hy-types.h" 27 #include "dnf-packagedelta.h" 28 #include "dnf-reldep-list.h" 29 30 G_BEGIN_DECLS 31 32 #define DNF_TYPE_PACKAGE (dnf_package_get_type ()) 33 G_DECLARE_DERIVABLE_TYPE (DnfPackage, dnf_package, DNF, PACKAGE, GObject) 34 35 struct _DnfPackageClass 36 { 37 GObjectClass parent_class; 38 /*< private >*/ 39 void (*_dnf_reserved1) (void); 40 void (*_dnf_reserved2) (void); 41 void (*_dnf_reserved3) (void); 42 void (*_dnf_reserved4) (void); 43 void (*_dnf_reserved5) (void); 44 void (*_dnf_reserved6) (void); 45 void (*_dnf_reserved7) (void); 46 void (*_dnf_reserved8) (void); 47 }; 48 49 DnfPackage *dnf_package_new (DnfSack *sack, Id id); 50 51 gboolean dnf_package_get_identical (DnfPackage *pkg1, DnfPackage *pkg2); 52 gboolean dnf_package_installed (DnfPackage *pkg); 53 int dnf_package_cmp (DnfPackage *pkg1, DnfPackage *pkg2); 54 int dnf_package_evr_cmp (DnfPackage *pkg1, DnfPackage *pkg2); 55 56 const char *dnf_package_get_location (DnfPackage *pkg); 57 const char *dnf_package_get_baseurl (DnfPackage *pkg); 58 const char *dnf_package_get_nevra (DnfPackage *pkg); 59 const char *dnf_package_get_sourcerpm (DnfPackage *pkg); 60 const char *dnf_package_get_version (DnfPackage *pkg); 61 const char *dnf_package_get_release (DnfPackage *pkg); 62 63 Id dnf_package_get_id (DnfPackage *pkg); 64 const char *dnf_package_get_name (DnfPackage *pkg); 65 const char *dnf_package_get_vendor (DnfPackage *pkg); 66 const char *dnf_package_get_arch (DnfPackage *pkg); 67 const unsigned char *dnf_package_get_chksum(DnfPackage *pkg, int *type); 68 const char *dnf_package_get_description(DnfPackage *pkg); 69 const char *dnf_package_get_evr (DnfPackage *pkg); 70 const char *dnf_package_get_group (DnfPackage *pkg); 71 const char *dnf_package_get_license (DnfPackage *pkg); 72 const unsigned char *dnf_package_get_hdr_chksum(DnfPackage *pkg, int *type); 73 const char *dnf_package_get_packager (DnfPackage *pkg); 74 const char *dnf_package_get_reponame (DnfPackage *pkg); 75 const char *dnf_package_get_summary (DnfPackage *pkg); 76 const char *dnf_package_get_url (DnfPackage *pkg); 77 guint64 dnf_package_get_downloadsize(DnfPackage *pkg); 78 guint64 dnf_package_get_epoch (DnfPackage *pkg); 79 guint64 dnf_package_get_hdr_end (DnfPackage *pkg); 80 guint64 dnf_package_get_installsize(DnfPackage *pkg); 81 guint64 dnf_package_get_medianr (DnfPackage *pkg); 82 guint64 dnf_package_get_rpmdbid (DnfPackage *pkg); 83 guint64 dnf_package_get_size (DnfPackage *pkg); 84 guint64 dnf_package_get_buildtime (DnfPackage *pkg); 85 guint64 dnf_package_get_installtime(DnfPackage *pkg); 86 87 DnfReldepList *dnf_package_get_conflicts (DnfPackage *pkg); 88 DnfReldepList *dnf_package_get_enhances (DnfPackage *pkg); 89 DnfReldepList *dnf_package_get_obsoletes (DnfPackage *pkg); 90 DnfReldepList *dnf_package_get_provides (DnfPackage *pkg); 91 DnfReldepList *dnf_package_get_recommends (DnfPackage *pkg); 92 DnfReldepList *dnf_package_get_requires (DnfPackage *pkg); 93 DnfReldepList *dnf_package_get_requires_pre (DnfPackage *pkg); 94 DnfReldepList *dnf_package_get_suggests (DnfPackage *pkg); 95 DnfReldepList *dnf_package_get_supplements (DnfPackage *pkg); 96 DnfReldepList *dnf_package_get_prereq_ignoreinst(DnfPackage *pkg); 97 DnfReldepList *dnf_package_get_regular_requires(DnfPackage *pkg); 98 char **dnf_package_get_files (DnfPackage *pkg); 99 GPtrArray *dnf_package_get_advisories (DnfPackage *pkg, int cmp_type); 100 101 DnfPackageDelta *dnf_package_get_delta_from_evr(DnfPackage *pkg, const char *from_evr); 102 103 G_END_DECLS 104 105 #endif /* __HY_PACKAGE_H */ 106