You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
577 B
C

#ifndef VARIABLE_H_
#define VARIABLE_H_
7 years ago
#include <stdint.h>
typedef struct {
uint8_t used :1;
uint8_t fromc :1;
uint8_t valtype :4;
union {
float f;
uint32_t p;
} value;
7 years ago
} variable;
enum valtype {
STRING = 0,
NUMBER,
FUNC,
EXPR
7 years ago
};
variable *make_varn(variable *v, float value);
variable *make_vars(variable *v, const char *s);
variable *make_varf(variable *v, uint8_t fromc, uint32_t func);
variable *make_vare(variable *v, const char *e);
int try_number(variable *v, const char *text);
int try_variable(char **name, const char *text);
#endif // VARIABLE_H_