1 /*
2 * Copyright © 2016 Igor Gnatenko <ignatenko@redhat.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include <solv/pool.h>
20
21 #include "dnf-types.h"
22 #include "dnf-sack-private.hpp"
23 #include "repo/solvable/Dependency.hpp"
24
25
26 /**
27 * dnf_reldep_new:
28 * @sack: a #DnfSack
29 * @name: Name
30 * @cmp_type: Comparison type
31 * @evr: (nullable): EVR
32 *
33 * Returns: an #DnfReldep
34 *
35 * Since: 0.7.0
36 */
37 DnfReldep *
dnf_reldep_new(DnfSack * sack,const char * name,int cmp_type,const char * evr)38 dnf_reldep_new (DnfSack *sack, const char *name, int cmp_type, const char *evr)
39 {
40 return new libdnf::Dependency(sack, name, evr, cmp_type);
41 }
42
43 /**
44 * dnf_reldep_to_string:
45 * @reldep: a #DnfReldep
46 *
47 * Returns: a string
48 *
49 * Since: 0.7.0
50 */
51 const char *
dnf_reldep_to_string(DnfReldep * reldep)52 dnf_reldep_to_string (DnfReldep *reldep)
53 {
54 return reldep->toString();
55 }
56
57 Id
dnf_reldep_get_id(DnfReldep * reldep)58 dnf_reldep_get_id (DnfReldep *reldep)
59 {
60 return reldep->getId();
61 }
62
dnf_reldep_free(DnfReldep * reldep)63 void dnf_reldep_free(DnfReldep *reldep)
64 {
65 delete reldep;
66 }
67