Librepo library  1.14.3
C library for downloading linux repository metadata and packages
types.h
1 /* librepo - A library providing (libcURL like) API to downloading repository
2  * Copyright (C) 2012 Tomas Mlcoch
3  *
4  * Licensed under the GNU Lesser General Public License Version 2.1
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef __LR_TYPES_H__
22 #define __LR_TYPES_H__
23 
24 #include <glib.h>
25 
26 G_BEGIN_DECLS
27 
38 typedef enum {
39  LR_CHECK_GPG = (1<<0),
40  LR_CHECK_CHECKSUM = (1<<1),
41 } LrChecks;
42 
44 typedef enum {
45  LR_YUMREPO = (1<<1),
46  LR_RPMMDREPO = LR_YUMREPO,
47  LR_SUSEREPO = (1<<2),
48  LR_DEBREPO = (1<<3),
49 } LrRepotype;
50 
52 typedef enum {
59 } LrProxyType;
60 
62 typedef enum {
67 
69 typedef enum {
71  LR_AUTH_BASIC = (1<<0),
72  LR_AUTH_DIGEST = (1<<1),
73  LR_AUTH_NEGOTIATE = (1<<2),
74  LR_AUTH_NTLM = (1<<3),
75  LR_AUTH_DIGEST_IE = (1<<4),
76  LR_AUTH_NTLM_WB = (1<<5),
77  LR_AUTH_ONLY = (1<<31),
84 } LrAuth;
85 
86 /* Some common used arrays for LRO_YUMDLIST */
87 
89 #define LR_YUM_FULL NULL
90 #define LR_RPMMD_FULL NULL
91 
93 #define LR_YUM_REPOMDONLY {NULL}
94 #define LR_RPMMD_REPOMDONLY {NULL}
95 
97 #define LR_YUM_BASEXML {"primary", "filelists", "other", NULL}
98 #define LR_RPMMD_BASEXML {"primary", "filelists", "other", NULL}
99 
101 #define LR_YUM_BASEDB {"primary_db", "filelists_db", "other_db", NULL}
102 #define LR_RPMMD_BASEDB {"primary_db", "filelists_db", "other_db", NULL}
103 
107 #define LR_YUM_HAWKEY {"primary", "filelists", "prestodelta", NULL}
108 #define LR_RPMMD_HAWKEY {"primary", "filelists", "prestodelta", NULL}
109 
110 typedef enum LrCbReturnCode_e {
111  LR_CB_OK = 0,
117 } LrCbReturnCode;
118 
125 typedef int (*LrProgressCb)(void *clientp,
126  double total_to_download,
127  double now_downloaded);
128 
130 typedef enum {
131  LR_TRANSFER_SUCCESSFUL,
132  LR_TRANSFER_ALREADYEXISTS,
133  LR_TRANSFER_ALREDYEXISTS = LR_TRANSFER_ALREADYEXISTS, // Deprecated - Backward comp. - remove in future release
134  LR_TRANSFER_ERROR,
136 
144 typedef int (*LrEndCb)(void *clientp,
145  LrTransferStatus status,
146  const char *msg);
147 
154 typedef int (*LrMirrorFailureCb)(void *clientp,
155  const char *msg,
156  const char *url);
157 
165 typedef int (*LrHandleMirrorFailureCb)(void *clientp,
166  const char *msg,
167  const char *url,
168  const char *metadata);
169 
170 typedef enum {
200 
206 typedef void (*LrFastestMirrorCb)(void *clientp,
207  LrFastestMirrorStages stage,
208  void *ptr);
209 
212 G_END_DECLS
213 
214 #endif
LrRepotype
Definition: types.h:44
LrChecks
Definition: types.h:38
LrIpResolveType
Definition: types.h:62
LrProxyType
Definition: types.h:52
LrTransferStatus
Definition: types.h:130
int(* LrEndCb)(void *clientp, LrTransferStatus status, const char *msg)
Definition: types.h:144
LrAuth
Definition: types.h:69
int(* LrMirrorFailureCb)(void *clientp, const char *msg, const char *url)
Definition: types.h:154
int(* LrHandleMirrorFailureCb)(void *clientp, const char *msg, const char *url, const char *metadata)
Definition: types.h:165
LrFastestMirrorStages
Definition: types.h:170
int(* LrProgressCb)(void *clientp, double total_to_download, double now_downloaded)
Definition: types.h:125
LrCbReturnCode_e
Definition: types.h:110
void(* LrFastestMirrorCb)(void *clientp, LrFastestMirrorStages stage, void *ptr)
Definition: types.h:206