Librepo library  1.7.13
C library for downloading linux repository metadata and packages
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules
Substitution of variables in url

Data Structures

struct  LrVar
 

Typedefs

typedef GSList LrUrlVars
 

Functions

LrUrlVarslr_urlvars_set (LrUrlVars *list, const char *var, const char *value)
 
void lr_urlvars_free (LrUrlVars *list)
 
char * lr_url_substitute (const char *url, LrUrlVars *list)
 

Detailed Description

Typedef Documentation

typedef GSList LrUrlVars

LrUrlVars list is in fact GSList

Definition at line 41 of file url_substitution.h.

Function Documentation

char* lr_url_substitute ( const char *  url,
LrUrlVars list 
)

Substitute variables in the url. Returns a newly allocated string.

Parameters
urla url
lista list of variables and its substitutions or NULL
Returns
a newly allocated string with substituted url
void lr_urlvars_free ( LrUrlVars list)

Frees all of the memory used by LrUrlVars.

Parameters
lista list of substitutions
LrUrlVars* lr_urlvars_set ( LrUrlVars list,
const char *  var,
const char *  value 
)

Set value of variable. Use variable names without '$' prefix. If value is NULL, variable will be removed from the list. If list is NULL, new list will be created.

Parameters
lista GSList or NULL for the first item
vara variable name (must not be a NULL)
valuea variable value
Returns
the new start of the GSList of url substitutions