Loading...
Searching...
No Matches
Substitution of variables in url

## Data Structures

struct | LrVar

## Typedefs

typedef GSList | LrUrlVars

## Functions

LrUrlVars * | lr_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

## LrUrlVars

typedef GSList LrUrlVars

LrUrlVars list is in fact GSList

Definition at line 41 of file url_substitution.h.

## Function Documentation

## lr_url_substitute()

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

Substitute variables in the url. Returns a newly allocated string. ${var_name} and $var_name syntaxes are supported. var_name: [A-Za-z0-9_]+ Non-exsistent variables are not substituted.

Parameters

  url | a url
  list | a list of variables and its substitutions or NULL

Returns
  a newly allocated string with substituted url

## lr_urlvars_free()

void lr_urlvars_free | ( | LrUrlVars * | list | ) |

Frees all of the memory used by LrUrlVars.

Parameters

  list | a list of substitutions

## lr_urlvars_set()

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

  list | a GSList or NULL for the first item
  var | a variable name (must not be a NULL)
  value | a variable value

Returns
  the new start of the GSList of url substitutions