1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  *
3  * Copyright (C) 2013-2015 Richard Hughes <richard@hughsie.com>
4  * Copyright (C) 2015 Colin Walters <walters@verbum.org>
5  *
6  * Licensed under the GNU Lesser General Public License Version 2.1
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
21  */
22 
23 
24 #ifndef __DNF_TYPES_H
25 #define __DNF_TYPES_H
26 
27 #include <gio/gio.h>
28 
29 #ifdef __cplusplus
30 namespace libdnf {
31     struct ModulePackageContainer;
32     struct Swdb;
33     struct PackageSet;
34     struct Dependency;
35     struct DependencyContainer;
36 }
37 typedef struct libdnf::ModulePackageContainer DnfModulePackageContainer;
38 typedef struct libdnf::Swdb DnfDb;
39 typedef struct libdnf::PackageSet DnfPackageSet;
40 typedef struct libdnf::Dependency DnfReldep;
41 typedef struct libdnf::DependencyContainer DnfReldepList;
42 #else
43 typedef struct ModulePackageContainer   DnfModulePackageContainer;
44 typedef struct Swdb DnfDb;
45 typedef struct PackageSet DnfPackageSet;
46 typedef struct Dependency DnfReldep;
47 typedef struct DependencyContainer DnfReldepList;
48 #endif
49 typedef struct _DnfContext              DnfContext;
50 typedef struct _DnfTransaction          DnfTransaction;
51 typedef struct _DnfRepoLoader           DnfRepoLoader;
52 typedef struct _DnfRepo                 DnfRepo;
53 typedef struct _DnfState                DnfState;
54 typedef struct _DnfSack                 DnfSack;
55 
56 /**
57  * DnfError:
58  * @DNF_ERROR_FAILED:                           Failed with a non-specific error
59  * @DNF_ERROR_INTERNAL_ERROR:                   Something horrible happened
60  * @DNF_ERROR_CANNOT_GET_LOCK:                  Cannot get lock for action
61  * @DNF_ERROR_CANCELLED:                        The action was cancelled
62  * @DNF_ERROR_REPO_NOT_AVAILABLE:               The repo is not available
63  * @DNF_ERROR_CANNOT_FETCH_SOURCE:              Cannot fetch a software repo
64  * @DNF_ERROR_CANNOT_WRITE_REPO_CONFIG:         Cannot write a repo config file
65  * @DNF_ERROR_PACKAGE_CONFLICTS:                Package conflict exists
66  * @DNF_ERROR_NO_PACKAGES_TO_UPDATE:            No packages to update
67  * @DNF_ERROR_PACKAGE_INSTALL_BLOCKED:          Package install was blocked
68  * @DNF_ERROR_FILE_NOT_FOUND:                   File was not found
69  * @DNF_ERROR_UNFINISHED_TRANSACTION:           An unfinished transaction exists
70  * @DNF_ERROR_GPG_SIGNATURE_INVALID:            GPG signature was bad
71  * @DNF_ERROR_FILE_INVALID:                     File was invalid or could not be read
72  * @DNF_ERROR_REPO_NOT_FOUND:                   Source was not found
73  * @DNF_ERROR_FAILED_CONFIG_PARSING:            Configuration could not be read
74  * @DNF_ERROR_PACKAGE_NOT_FOUND:                Package was not found
75  * @DNF_ERROR_INVALID_ARCHITECTURE:             Invalid architecture
76  * @DNF_ERROR_BAD_SELECTOR:                     The selector was in some way bad
77  * @DNF_ERROR_NO_SOLUTION:                      No solution was possible
78  * @DNF_ERROR_BAD_QUERY:                        The query was in some way bad
79  * @DNF_ERROR_NO_CAPABILITY:                    This feature was not available
80  * @DNF_ERROR_NO_SPACE:                         Out of disk space
81  * @DNF_ERROR_UNKNOWN_OPTION:                   Option with the requested name was not found
82  *
83  * The error code.
84  **/
85 typedef enum {
86         DNF_ERROR_FAILED                        = 1,    /* Since: 0.1.0 */
87         DNF_ERROR_INTERNAL_ERROR                = 4,    /* Since: 0.1.0 */
88         DNF_ERROR_CANNOT_GET_LOCK               = 26,   /* Since: 0.1.0 */
89         DNF_ERROR_CANCELLED                     = 17,   /* Since: 0.1.0 */
90         DNF_ERROR_REPO_NOT_AVAILABLE            = 37,   /* Since: 0.1.0 */
91         DNF_ERROR_CANNOT_FETCH_SOURCE           = 64,   /* Since: 0.1.0 */
92         DNF_ERROR_CANNOT_WRITE_REPO_CONFIG      = 28,   /* Since: 0.1.0 */
93         DNF_ERROR_PACKAGE_CONFLICTS             = 36,   /* Since: 0.1.0 */
94         DNF_ERROR_NO_PACKAGES_TO_UPDATE         = 27,   /* Since: 0.1.0 */
95         DNF_ERROR_PACKAGE_INSTALL_BLOCKED       = 39,   /* Since: 0.1.0 */
96         DNF_ERROR_FILE_NOT_FOUND                = 42,   /* Since: 0.1.0 */
97         DNF_ERROR_UNFINISHED_TRANSACTION        = 66,   /* Since: 0.1.0 */
98         DNF_ERROR_GPG_SIGNATURE_INVALID         = 30,   /* Since: 0.1.0 */
99         DNF_ERROR_FILE_INVALID                  = 38,   /* Since: 0.1.0 */
100         DNF_ERROR_REPO_NOT_FOUND                = 19,   /* Since: 0.1.0 */
101         DNF_ERROR_FAILED_CONFIG_PARSING         = 24,   /* Since: 0.1.0 */
102         DNF_ERROR_PACKAGE_NOT_FOUND             = 8,    /* Since: 0.1.0 */
103         DNF_ERROR_NO_SPACE                      = 46,   /* Since: 0.2.3 */
104         DNF_ERROR_INVALID_ARCHITECTURE,                 /* Since: 0.7.0 */
105         DNF_ERROR_BAD_SELECTOR,                         /* Since: 0.7.0 */
106         DNF_ERROR_NO_SOLUTION,                          /* Since: 0.7.0 */
107         DNF_ERROR_BAD_QUERY,                            /* Since: 0.7.0 */
108         DNF_ERROR_CANNOT_WRITE_CACHE,                   /* Since: 0.7.0 */
109         DNF_ERROR_NO_CAPABILITY,                        /* Since: 0.7.0 */
110         DNF_ERROR_REMOVAL_OF_PROTECTED_PKG,             /* Since: 0.7.0 */
111         DNF_ERROR_UNKNOWN_OPTION,                       /* Since: 0.56.0 */
112         /*< private >*/
113         DNF_ERROR_LAST
114 } DnfError;
115 
116 #define DNF_ERROR                       (dnf_error_quark ())
117 
118 #ifdef __cplusplus
119 extern "C" {
120 #endif
121 GQuark           dnf_error_quark        (void);
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif
127