struct variable, #11/18, introduce `var_alloc()'

This commit is contained in:
rlar 2016-03-25 15:38:31 +01:00
parent 68042b3d1b
commit 8691368a81
2 changed files with 12 additions and 0 deletions

View File

@ -973,6 +973,16 @@ cp_vprint(void)
tfree(vars);
}
struct variable *
var_alloc(char *name, struct variable *next)
{
struct variable *v = TMALLOC(struct variable, 1);
ZERO(v, struct variable);
v -> va_name = name;
v -> va_next = next;
return v;
}
void
var_set_bool(struct variable *v, bool value)
{

View File

@ -43,6 +43,8 @@ wordlist *cp_varwl(struct variable *var);
wordlist *cp_variablesubst(wordlist *wlist);
void free_struct_variable(struct variable *v);
struct variable *var_alloc(char *name, struct variable *next);
void var_set_bool(struct variable *, bool);
void var_set_num(struct variable *, int);
void var_set_real(struct variable *, double);