Librepo library  1.12.1
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,
112  LR_CB_ABORT,
114  LR_CB_ERROR,
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
LR_AUTH_NEGOTIATE
@ LR_AUTH_NEGOTIATE
Definition: types.h:73
LrEndCb
int(* LrEndCb)(void *clientp, LrTransferStatus status, const char *msg)
Definition: types.h:144
LR_CHECK_CHECKSUM
@ LR_CHECK_CHECKSUM
Definition: types.h:40
LrAuth
LrAuth
Definition: types.h:69
LR_IPRESOLVE_V6
@ LR_IPRESOLVE_V6
Definition: types.h:65
LR_AUTH_ONLY
@ LR_AUTH_ONLY
Definition: types.h:77
LR_AUTH_ANY
@ LR_AUTH_ANY
Definition: types.h:83
LR_CB_ERROR
@ LR_CB_ERROR
Definition: types.h:114
LR_FMSTAGE_DETECTION
@ LR_FMSTAGE_DETECTION
Definition: types.h:184
LR_CB_ABORT
@ LR_CB_ABORT
Definition: types.h:112
LrProxyType
LrProxyType
Definition: types.h:52
LR_IPRESOLVE_WHATEVER
@ LR_IPRESOLVE_WHATEVER
Definition: types.h:63
LrTransferStatus
LrTransferStatus
Definition: types.h:130
LR_SUSEREPO
@ LR_SUSEREPO
Definition: types.h:47
LrRepotype
LrRepotype
Definition: types.h:44
LrMirrorFailureCb
int(* LrMirrorFailureCb)(void *clientp, const char *msg, const char *url)
Definition: types.h:154
LR_IPRESOLVE_V4
@ LR_IPRESOLVE_V4
Definition: types.h:64
LrIpResolveType
LrIpResolveType
Definition: types.h:62
LR_PROXY_HTTP
@ LR_PROXY_HTTP
Definition: types.h:53
LR_PROXY_HTTP_1_0
@ LR_PROXY_HTTP_1_0
Definition: types.h:54
LR_CB_OK
@ LR_CB_OK
Definition: types.h:111
LR_DEBREPO
@ LR_DEBREPO
Definition: types.h:48
LR_FMSTAGE_CACHELOADINGSTATUS
@ LR_FMSTAGE_CACHELOADINGSTATUS
Definition: types.h:179
LrCbReturnCode_e
LrCbReturnCode_e
Definition: types.h:110
LR_PROXY_SOCKS4
@ LR_PROXY_SOCKS4
Definition: types.h:55
LrHandleMirrorFailureCb
int(* LrHandleMirrorFailureCb)(void *clientp, const char *msg, const char *url, const char *metadata)
Definition: types.h:165
LR_AUTH_DIGEST_IE
@ LR_AUTH_DIGEST_IE
Definition: types.h:75
LR_FMSTAGE_CACHELOADING
@ LR_FMSTAGE_CACHELOADING
Definition: types.h:175
LrFastestMirrorStages
LrFastestMirrorStages
Definition: types.h:170
LrProgressCb
int(* LrProgressCb)(void *clientp, double total_to_download, double now_downloaded)
Definition: types.h:125
LR_AUTH_DIGEST
@ LR_AUTH_DIGEST
Definition: types.h:72
LR_AUTH_BASIC
@ LR_AUTH_BASIC
Definition: types.h:71
LR_PROXY_SOCKS5_HOSTNAME
@ LR_PROXY_SOCKS5_HOSTNAME
Definition: types.h:58
LR_CHECK_GPG
@ LR_CHECK_GPG
Definition: types.h:39
LR_FMSTAGE_INIT
@ LR_FMSTAGE_INIT
Definition: types.h:171
LR_AUTH_NTLM_WB
@ LR_AUTH_NTLM_WB
Definition: types.h:76
LrFastestMirrorCb
void(* LrFastestMirrorCb)(void *clientp, LrFastestMirrorStages stage, void *ptr)
Definition: types.h:206
LrChecks
LrChecks
Definition: types.h:38
LR_FMSTAGE_STATUS
@ LR_FMSTAGE_STATUS
Definition: types.h:194
LR_AUTH_NONE
@ LR_AUTH_NONE
Definition: types.h:70
LR_PROXY_SOCKS5
@ LR_PROXY_SOCKS5
Definition: types.h:56
LR_FMSTAGE_FINISHING
@ LR_FMSTAGE_FINISHING
Definition: types.h:190
LR_YUMREPO
@ LR_YUMREPO
Definition: types.h:45
LR_PROXY_SOCKS4A
@ LR_PROXY_SOCKS4A
Definition: types.h:57
LR_AUTH_NTLM
@ LR_AUTH_NTLM
Definition: types.h:74