Loading...
Searching...
No Matches
metalink.h
/* librepo - A library providing (libcURL like) API to downloading repository
* Copyright (C) 2012 Tomas Mlcoch
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __LR_METALINK_H__
#define __LR_METALINK_H__
#include <glib.h>
#include <librepo/xmlparser.h>
G_BEGIN_DECLS
typedef struct {
char *type;
char *value;
} LrMetalinkHash;
typedef struct {
char *protocol;
char *type;
char *location;
int preference;
char *url;
} LrMetalinkUrl;
typedef struct {
gint64 timestamp;
gint64 size;
GSList *hashes;
} LrMetalinkAlternate;
typedef struct {
char *filename;
gint64 timestamp;
gint64 size;
GSList *hashes;
GSList *urls;
GSList *alternates;
} LrMetalink;
LrMetalink *
lr_metalink_init(void);
gboolean
lr_metalink_parse_file(LrMetalink *metalink,
int fd,
const char *filename,
LrXmlParserWarningCb warningcb,
void *warningcb_data,
GError **err);
void
lr_metalink_free(LrMetalink *metalink);
G_END_DECLS
#endif
lr_metalink_free
void lr_metalink_free(LrMetalink *metalink)
lr_metalink_init
LrMetalink * lr_metalink_init(void)
lr_metalink_parse_file
gboolean lr_metalink_parse_file(LrMetalink *metalink, int fd, const char *filename, LrXmlParserWarningCb warningcb, void *warningcb_data, GError **err)
LrXmlParserWarningCb
int(* LrXmlParserWarningCb)(LrXmlParserWarningType type, char *msg, void *cbdata, GError **err)
Definition xmlparser.h:57
LrMetalinkAlternate
Definition metalink.h:50
LrMetalinkAlternate::size
gint64 size
Definition metalink.h:52
LrMetalinkAlternate::timestamp
gint64 timestamp
Definition metalink.h:51
LrMetalinkAlternate::hashes
GSList * hashes
Definition metalink.h:53
LrMetalinkHash
Definition metalink.h:35
LrMetalinkHash::type
char * type
Definition metalink.h:36
LrMetalinkHash::value
char * value
Definition metalink.h:37
LrMetalink
Definition metalink.h:57
LrMetalink::size
gint64 size
Definition metalink.h:60
LrMetalink::alternates
GSList * alternates
Definition metalink.h:63
LrMetalink::timestamp
gint64 timestamp
Definition metalink.h:59
LrMetalink::hashes
GSList * hashes
Definition metalink.h:61
LrMetalink::filename
char * filename
Definition metalink.h:58
LrMetalink::urls
GSList * urls
Definition metalink.h:62
LrMetalinkUrl
Definition metalink.h:41
LrMetalinkUrl::type
char * type
Definition metalink.h:43
LrMetalinkUrl::location
char * location
Definition metalink.h:44
LrMetalinkUrl::url
char * url
Definition metalink.h:46
LrMetalinkUrl::protocol
char * protocol
Definition metalink.h:42
LrMetalinkUrl::preference
int preference
Definition metalink.h:45