createrepo_c library 1.2.1 C library for metadata manipulation

Data Structures | Functions
Locate metadata API.

## Data Structures
struct | cr_MetadataLocation
struct | cr_Metadatum

## Functions
struct cr_MetadataLocation * | cr_parse_repomd (const char *repomd_path, const char *repopath, int ignore_sqlite)
GSList * | cr_insert_additional_metadatum (const gchar *path, const gchar *type, GSList *additional_metadata)
gint | cr_cmp_metadatum_type (gconstpointer metadatum, gconstpointer type)
gint | cr_cmp_repomd_record_type (gconstpointer repomd_record, gconstpointer type)
struct cr_MetadataLocation * | cr_locate_metadata (const char *repopath, gboolean ignore_sqlite, GError **err)
void | cr_metadatalocation_free (struct cr_MetadataLocation *ml)
void | cr_metadatum_free (cr_Metadatum *m)
gchar * | cr_copy_metadatum (const gchar *src, const gchar *tmp_out_repo, GError **err)

## Detailed Description

## Function Documentation

## ◆ cr_cmp_metadatum_type()

gint cr_cmp_metadatum_type | ( | gconstpointer | metadatum,
|  | gconstpointer | type
| ) |  |

Compares type (string) of specified metadatum with second parameter string (type)

Parameters

  metadatum | Cmp type of this metadatum
  type | String value

Returns
  an integer less than, equal to, or greater than zero, if metadatum type is <, == or > than type (string cmp)

## ◆ cr_cmp_repomd_record_type()

gint cr_cmp_repomd_record_type | ( | gconstpointer | repomd_record,
|  | gconstpointer | type
| ) |  |

Compares type (string) of specified cr_RepomdRecord with second parameter string (type)

Parameters

  cr_RepomdRecord | Cmp type of this cr_RepomdRecord
  type | String value

Returns
  an integer less than, equal to, or greater than zero, if repomdRecord type is <, == or > than type (string cmp)

## ◆ cr_copy_metadatum()

gchar* cr_copy_metadatum | ( | const gchar * | src,
|  | const gchar * | tmp_out_repo,
|  | GError ** | err
| ) |  |

Copies metadata files, exactly, even hashed name It first constructs target path (location + name), Then it copies file to that location

Metadatum as in singular of metadata, it is eg. groupfile, updateinfo..

Parameters

  src | From where are we copying
  tmp_out_repo | Copying destination dir
  err | GError **

Returns
  Path to copied file

## ◆ cr_insert_additional_metadatum()

GSList* cr_insert_additional_metadatum | ( | const gchar * | path,
|  | const gchar * | type,
|  | GSList * | additional_metadata
| ) |  |

Inserts additional metadatum to list of additional metadata if this type is already present it gets overridden

Parameters

  path | Path to metadatum
  type | Type of metadatum
  additional_metadata | List of additional metadata

Returns
  Original list with new element

## ◆ cr_locate_metadata()

struct cr_MetadataLocation* cr_locate_metadata | ( | const char * | repopath,
|  | gboolean | ignore_sqlite,
|  | GError ** | err
| ) |  |

Parses repomd.xml and returns a filled cr_MetadataLocation structure. Remote repodata (repopath with prefix "ftp://" or "http://") are dowloaded into a temporary directory and removed when the cr_metadatalocation_free() is called on the cr_MetadataLocation.

Parameters

  repopath | path to directory with repodata/ subdirectory
  ignore_sqlite | if ignore_sqlite != 0 sqlite dbs are ignored
  err | GError **

Returns
  filled cr_MetadataLocation structure or NULL

## ◆ cr_metadatalocation_free()

void cr_metadatalocation_free | ( | struct cr_MetadataLocation * | ml | ) |

Free cr_MetadataLocation. If repodata were downloaded remove a temporary directory with repodata.

Parameters

  ml | MeatadaLocation

## ◆ cr_metadatum_free()

void cr_metadatum_free | ( | cr_Metadatum * | m | ) |

Free cr_Metadatum.

Parameters

  m | Meatadatum