struct variable, #11/18, introduce `var_alloc()'
This commit is contained in:
parent
68042b3d1b
commit
8691368a81
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue