annotate src/lib/var-expand.h @ 5485:9b873c82bc88 HEAD

Added var_expand_table_build()
author Timo Sirainen <tss@iki.fi>
date Sat, 31 Mar 2007 17:04:28 +0300
parents c59fd95ad3ee
children e4eb71ae8e96
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1034
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef __VAR_EXPAND_H
c077254cbe66 Added var_expand()
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define __VAR_EXPAND_H
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