1 /*
2  * Copyright (C) 2014-2018 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 __DNF_ADVISORY_H
23 #define __DNF_ADVISORY_H
24 
25 #include <glib-object.h>
26 
27 #ifdef __cplusplus
28 namespace libdnf {
29     struct Advisory;
30 }
31 typedef struct libdnf::Advisory DnfAdvisory;
32 #else
33 typedef struct Advisory DnfAdvisory;
34 #endif
35 
36 typedef enum {
37         DNF_ADVISORY_KIND_UNKNOWN       = 0,        /* ordered by rough importance */
38         DNF_ADVISORY_KIND_SECURITY      = 1,
39         DNF_ADVISORY_KIND_BUGFIX        = 2,
40         DNF_ADVISORY_KIND_ENHANCEMENT   = 3,
41         DNF_ADVISORY_KIND_NEWPACKAGE    = 4
42 } DnfAdvisoryKind;
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 void dnf_advisory_free(DnfAdvisory *advisory);
49 const char          *dnf_advisory_get_title         (DnfAdvisory *advisory);
50 const char          *dnf_advisory_get_id            (DnfAdvisory *advisory);
51 DnfAdvisoryKind      dnf_advisory_get_kind          (DnfAdvisory *advisory);
52 const char          *dnf_advisory_get_description   (DnfAdvisory *advisory);
53 const char          *dnf_advisory_get_rights        (DnfAdvisory *advisory);
54 const char          *dnf_advisory_get_severity      (DnfAdvisory *advisory);
55 guint64              dnf_advisory_get_updated       (DnfAdvisory *advisory);
56 GPtrArray           *dnf_advisory_get_packages      (DnfAdvisory *advisory);
57 GPtrArray           *dnf_advisory_get_references    (DnfAdvisory *advisory);
58 int                  dnf_advisory_compare           (DnfAdvisory *left,
59                                                      DnfAdvisory *right);
60 gboolean             dnf_advisory_match_id          (DnfAdvisory *advisory,
61                                                      const char  *s);
62 gboolean             dnf_advisory_match_kind        (DnfAdvisory *advisory,
63                                                      const char  *s);
64 gboolean             dnf_advisory_match_severity    (DnfAdvisory *advisory,
65                                                      const char  *s);
66 gboolean             dnf_advisory_match_cve         (DnfAdvisory *advisory,
67                                                      const char  *s);
68 gboolean             dnf_advisory_match_bug         (DnfAdvisory *advisory,
69                                                      const char  *s);
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif /* __DNF_ADVISORY_H */
76