Skip to content

Commit

Permalink
move leftover metalink bits from core to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkurth committed Dec 1, 2022
1 parent 407f1ff commit 7121dcc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
6 changes: 0 additions & 6 deletions client/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ TDNFFreeHistoryInfoItems(
int nCount
);

uint32_t
TDNFCheckRepoMDFileHashFromMetalink(
const char *pszFile,
TDNF_ML_CTX *ml_ctx
);

//remoterepo.c
uint32_t
TDNFDownloadFileFromRepo(
Expand Down
34 changes: 0 additions & 34 deletions client/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,40 +81,6 @@ typedef struct _TDNF_EVENT_DATA_
struct _TDNF_EVENT_DATA_ *pNext;
} TDNF_EVENT_DATA, *PTDNF_EVENT_DATA;

//Metalink Structures.
typedef struct _TDNF_ML_LIST_
{
struct _TDNF_ML_LIST_ *next;
void* data;
} TDNF_ML_LIST, TDNF_ML_URL_LIST, TDNF_ML_HASH_LIST;

//Metalink hash info per hash type.
typedef struct _TDNF_ML_HASH_INFO_
{
char *type;
char *value;
} TDNF_ML_HASH_INFO;

//Metalink url info per hash type.
typedef struct _TDNF_ML_URL_INFO_
{
char *protocol;
char *type;
char *location;
char *url;
int preference;
} TDNF_ML_URL_INFO;

//Metalink global parsed info.
typedef struct _TDNF_ML_CTX_
{
char *filename;
signed long timestamp;
signed long size;
TDNF_ML_LIST *hashes;
TDNF_ML_LIST *urls;
} TDNF_ML_CTX;

typedef struct progress_cb_data {
time_t cur_time;
time_t prev_time;
Expand Down
6 changes: 6 additions & 0 deletions plugins/metalink/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ TDNFParseUrlTag(
xmlNode *node
);

uint32_t
TDNFCheckRepoMDFileHashFromMetalink(
const char *pszFile,
TDNF_ML_CTX *ml_ctx
);

// api.c

const char *
Expand Down
34 changes: 34 additions & 0 deletions plugins/metalink/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@

#pragma once

//Metalink Structures.
typedef struct _TDNF_ML_LIST_
{
struct _TDNF_ML_LIST_ *next;
void* data;
} TDNF_ML_LIST, TDNF_ML_URL_LIST, TDNF_ML_HASH_LIST;

//Metalink hash info per hash type.
typedef struct _TDNF_ML_HASH_INFO_
{
char *type;
char *value;
} TDNF_ML_HASH_INFO;

//Metalink url info per hash type.
typedef struct _TDNF_ML_URL_INFO_
{
char *protocol;
char *type;
char *location;
char *url;
int preference;
} TDNF_ML_URL_INFO;

//Metalink global parsed info.
typedef struct _TDNF_ML_CTX_
{
char *filename;
signed long timestamp;
signed long size;
TDNF_ML_LIST *hashes;
TDNF_ML_LIST *urls;
} TDNF_ML_CTX;

/* per repo */
typedef struct _TDNF_METALINK_DATA_
{
Expand Down

0 comments on commit 7121dcc

Please sign in to comment.