annotate src/lib/var-expand.h @ 6410:e4eb71ae8e96 HEAD

Changed .h ifdef/defines to use <NAME>_H format.
author Timo Sirainen <tss@iki.fi>
date Sun, 16 Sep 2007 11:31:27 +0300
parents 9b873c82bc88
children 81806d402514
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5485
diff changeset
1 #ifndef VAR_EXPAND_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 5485
diff changeset
2 #define VAR_EXPAND_H
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
2057
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
4 struct var_expand_table {
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
5 char key;
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
6 const char *value;
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
7 };
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
2057
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
9 /* Expand % variables in src and append the string in dest.
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
10 table must end with key = 0. */
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 void var_expand(string_t *dest, const char *str,
2057
5e0167577399 Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents: 1034
diff changeset
12 const struct var_expand_table *table);
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13
2975
c59fd95ad3ee Auth cache key was built wrong if any modifiers were used for %vars.
Timo Sirainen <tss@iki.fi>
parents: 2057
diff changeset
14 /* Returns the actual key character for given string, ie. skip any modifiers
c59fd95ad3ee Auth cache key was built wrong if any modifiers were used for %vars.
Timo Sirainen <tss@iki.fi>
parents: 2057
diff changeset
15 that are before it. The string should be the data after the '%' character. */
c59fd95ad3ee Auth cache key was built wrong if any modifiers were used for %vars.
Timo Sirainen <tss@iki.fi>
parents: 2057
diff changeset
16 char var_get_key(const char *str);
c59fd95ad3ee Auth cache key was built wrong if any modifiers were used for %vars.
Timo Sirainen <tss@iki.fi>
parents: 2057
diff changeset
17
5485
9b873c82bc88 Added var_expand_table_build()
Timo Sirainen <tss@iki.fi>
parents: 2975
diff changeset
18 const struct var_expand_table *
9b873c82bc88 Added var_expand_table_build()
Timo Sirainen <tss@iki.fi>
parents: 2975
diff changeset
19 var_expand_table_build(char key, const char *value, char key2, ...);
9b873c82bc88 Added var_expand_table_build()
Timo Sirainen <tss@iki.fi>
parents: 2975
diff changeset
20
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 #endif