Librepo library  1.7.13
C library for downloading linux repository metadata and packages
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules
Basic types and constants

Macros

#define LR_YUM_FULL   NULL
 
#define LR_YUM_REPOMDONLY   {NULL}
 
#define LR_YUM_BASEXML   {"primary", "filelists", "other", NULL}
 
#define LR_YUM_BASEDB   {"primary_db", "filelists_db", "other_db", NULL}
 
#define LR_YUM_HAWKEY   {"primary", "filelists", "prestodelta", NULL}
 

Typedefs

typedef enum LrCbReturnCode_e LrCbReturnCode
 
typedef int(* LrProgressCb )(void *clientp, double total_to_download, double now_downloaded)
 
typedef int(* LrEndCb )(void *clientp, LrTransferStatus status, const char *msg)
 
typedef int(* LrMirrorFailureCb )(void *clientp, const char *msg, const char *url)
 
typedef int(* LrHandleMirrorFailureCb )(void *clientp, const char *msg, const char *url, const char *metadata)
 
typedef void(* LrFastestMirrorCb )(void *clientp, LrFastestMirrorStages stage, void *ptr)
 

Enumerations

enum  LrChecks { LR_CHECK_GPG = (1<<0), LR_CHECK_CHECKSUM = (1<<1) }
 
enum  LrRepotype { LR_YUMREPO = (1<<1), LR_SUSEREPO = (1<<2), LR_DEBREPO = (1<<3) }
 
enum  LrProxyType {
  LR_PROXY_HTTP, LR_PROXY_HTTP_1_0, LR_PROXY_SOCKS4, LR_PROXY_SOCKS5,
  LR_PROXY_SOCKS4A, LR_PROXY_SOCKS5_HOSTNAME
}
 
enum  LrIpResolveType { LR_IPRESOLVE_WHATEVER, LR_IPRESOLVE_V4, LR_IPRESOLVE_V6 }
 
enum  LrCbReturnCode_e { LR_CB_OK = 0, LR_CB_ABORT, LR_CB_ERROR }
 
enum  LrTransferStatus { LR_TRANSFER_SUCCESSFUL, LR_TRANSFER_ALREDYEXISTS, LR_TRANSFER_ERROR }
 
enum  LrFastestMirrorStages {
  LR_FMSTAGE_INIT, LR_FMSTAGE_CACHELOADING, LR_FMSTAGE_CACHELOADINGSTATUS, LR_FMSTAGE_DETECTION,
  LR_FMSTAGE_FINISHING, LR_FMSTAGE_STATUS
}
 

Detailed Description

Macro Definition Documentation

#define LR_YUM_BASEDB   {"primary_db", "filelists_db", "other_db", NULL}

Predefined value for LRO_YUMDLIST option - Download only base db files.

Definition at line 79 of file types.h.

#define LR_YUM_BASEXML   {"primary", "filelists", "other", NULL}

Predefined value for LRO_YUMDLIST option - Download only base xml files.

Definition at line 76 of file types.h.

#define LR_YUM_FULL   NULL

Predefined value for LRO_YUMDLIST option - Download whole repo.

Definition at line 70 of file types.h.

#define LR_YUM_HAWKEY   {"primary", "filelists", "prestodelta", NULL}

Predefined value for LRO_YUMDLIST option - Download only primary, filelists and prestodelta.

Definition at line 84 of file types.h.

#define LR_YUM_REPOMDONLY   {NULL}

Predefined value for LRO_YUMDLIST option - Download only repomd.xml.

Definition at line 73 of file types.h.

Typedef Documentation

typedef int(* LrEndCb)(void *clientp, LrTransferStatus status, const char *msg)

Called when a transfer is done (use transfer status to check if successful or failed).

Parameters
clientpPointer to user data.
statusTransfer status
msgError message or NULL.
Returns
See LrCbReturnCode codes

Definition at line 119 of file types.h.

typedef void(* LrFastestMirrorCb)(void *clientp, LrFastestMirrorStages stage, void *ptr)

Fastest mirror status callback

Parameters
clientpPointer to user data.
stageStage of fastest mirror detection.
ptrValue specific for each stage of detection.

Definition at line 181 of file types.h.

typedef int(* LrHandleMirrorFailureCb)(void *clientp, const char *msg, const char *url, const char *metadata)

MirrorFailure callback

Parameters
clientpPointer to user data.
msgError message.
urlMirror URL
metadataMetadata type "primary", etc.
Returns
See LrCbReturnCode codes

Definition at line 140 of file types.h.

typedef int(* LrMirrorFailureCb)(void *clientp, const char *msg, const char *url)

MirrorFailure callback prototype

Parameters
clientpPointer to user data.
msgError message.
urlMirror URL
Returns
See LrCbReturnCode codes

Definition at line 129 of file types.h.

typedef int(* LrProgressCb)(void *clientp, double total_to_download, double now_downloaded)

Progress callback prototype

Parameters
clientpPointer to user data.
total_to_downloadTotal number of bytes to download
now_downloadedNumber of bytes currently downloaded
Returns
See LrCbReturnCode codes

Definition at line 101 of file types.h.

Enumeration Type Documentation

Enumerator
LR_CB_OK 

All fine

LR_CB_ABORT 

Abort the transfer - if no failfast is set, then, it just abort the current download

LR_CB_ERROR 

Error - Fatal error, abort all downloading and return from the download function (e.g. lr_download_packages, ...)

Definition at line 86 of file types.h.

enum LrChecks

Handle object containing configration for repository metadata and package downloading.Flags for available checks.

Enumerator
LR_CHECK_GPG 

GPG check

LR_CHECK_CHECKSUM 

Checksum check

Definition at line 38 of file types.h.

Enumerator
LR_FMSTAGE_INIT 

Fastest mirror detection just started. ptr is NULL

LR_FMSTAGE_CACHELOADING 

ptr is (char *) pointer to string with path to the cache file. (Do not modify or free the string).

LR_FMSTAGE_CACHELOADINGSTATUS 

if cache was loaded successfully, ptr is NULL, otherwise ptr is (char *) string with error message. (Do not modify or free the string)

LR_FMSTAGE_DETECTION 

Detection (pinging) in progress. If all data was loaded from cache, this stage is skiped. ptr is pointer to long. This is the number of how much mirrors have to be "pinged"

LR_FMSTAGE_FINISHING 

Detection is done, sorting mirrors, updating cache, etc. ptr is NULL

LR_FMSTAGE_STATUS 

The very last invocation of fastest mirror callback. If fastest mirror detection was successful ptr is NULL, otherwise ptr contain (char *) string with error message. (Do not modify or free the string)

Definition at line 145 of file types.h.

IpResolve types

Enumerator
LR_IPRESOLVE_WHATEVER 

Default - resolves addresses to all IP versions

LR_IPRESOLVE_V4 

Resolve to IPv4 addresses

LR_IPRESOLVE_V6 

Resolve to IPv6 addresses

Definition at line 61 of file types.h.

Proxy types.

Enumerator
LR_PROXY_HTTP 

HTTP proxy (Default)

LR_PROXY_HTTP_1_0 

HTTP 1.0 proxy

LR_PROXY_SOCKS4 

SOCKS4 proxy

LR_PROXY_SOCKS5 

SOCKS5 proxy

LR_PROXY_SOCKS4A 

SOCKS4A proxy

LR_PROXY_SOCKS5_HOSTNAME 

SOCKS5 proxy

Definition at line 51 of file types.h.

enum LrRepotype

Repo types flags.

Enumerator
LR_YUMREPO 

Yum repository

LR_SUSEREPO 

YaST2 repository - Not implemented yet

LR_DEBREPO 

Debian repository - Not implemented yet

Definition at line 44 of file types.h.

Transfer status codes

Definition at line 106 of file types.h.