36 |
|
|
37 |
#include "debug-print.h" |
#include "debug-print.h" |
38 |
|
|
39 |
|
/* Assign auxiliary data AUX to variable V, which must not |
40 |
|
already have auxiliary data. Before V's auxiliary data is |
41 |
|
cleared, AUX_DTOR(V) will be called. */ |
42 |
void * |
void * |
43 |
var_attach_aux (struct variable *v, |
var_attach_aux (struct variable *v, |
44 |
void *aux, void (*aux_dtor) (struct variable *)) |
void *aux, void (*aux_dtor) (struct variable *)) |
50 |
return aux; |
return aux; |
51 |
} |
} |
52 |
|
|
53 |
|
/* Remove auxiliary data, if any, from V, and returns it, without |
54 |
|
calling any associated destructor. */ |
55 |
void * |
void * |
56 |
var_detach_aux (struct variable *v) |
var_detach_aux (struct variable *v) |
57 |
{ |
{ |
61 |
return aux; |
return aux; |
62 |
} |
} |
63 |
|
|
64 |
|
/* Clears auxiliary data, if any, from V, and calls any |
65 |
|
associated destructor. */ |
66 |
void |
void |
67 |
var_clear_aux (struct variable *v) |
var_clear_aux (struct variable *v) |
68 |
{ |
{ |
75 |
} |
} |
76 |
} |
} |
77 |
|
|
78 |
|
/* This function is appropriate for use an auxiliary data |
79 |
|
destructor (passed as AUX_DTOR to var_attach_aux()) for the |
80 |
|
case where the auxiliary data should be passed to free(). */ |
81 |
void |
void |
82 |
var_dtor_free (struct variable *v) |
var_dtor_free (struct variable *v) |
83 |
{ |
{ |