--- var.pod 2002/02/28 11:40:46 1.23
+++ var.pod 2002/02/28 14:58:07 1.24
@@ -318,15 +318,21 @@
functions. Such a callback function B<cb> has to be of the following
prototype:
-var_rc_t *B<cb>(void *I<ctx>, const char *I<var_ptr>, size_t
-I<var_len>, int I<var_idx>, const char **I<val_ptr>, size_t *I<val_len>,
-size_t *I<val_size>);
+var_rc_t *B<cb>(var_t *I<var>, void *I<ctx>, const char *I<var_ptr>,
+size_t I<var_len>, int I<var_idx>, const char **I<val_ptr>, size_t
+*I<val_len>, size_t *I<val_size>);
This function will be called by var_expand() internally whenever it has
to resolve the contents of a variable. Its parameters are:
=over 4
+=item var_t *I<var>
+
+This is the passed-through argument as passed to var_expand() as the
+first argument. This can be used in the callback function to distinguish
+the expansion context or to resolve return codes, etc.
+
=item void *I<ctx>
This is the passed-through argument as passed to var_config() on
@@ -574,7 +580,7 @@
#include "var.h"
static var_rc_t lookup(
- void *ctx,
+ var_t *var, void *ctx,
const char *var_ptr, size_t var_len, int var_idx,
const char **val_ptr, size_t *val_len, size_t *val_size)
{
|