Browse Source

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

pre-master-46
rlar 10 years ago
parent
commit
8691368a81
  1. 10
      src/frontend/variable.c
  2. 2
      src/frontend/variable.h

10
src/frontend/variable.c

@ -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)
{

2
src/frontend/variable.h

@ -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…
Cancel
Save