diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:57:06 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:59:39 +0200 |
| commit | e5af28536bfb0f4c9131df56d2009ba5196f5e3a (patch) | |
| tree | 3ab928f961a1ccd8440b070d7b57f79146457e8c /src/expr.h | |
| download | animtool-e5af28536bfb0f4c9131df56d2009ba5196f5e3a.tar.xz | |
init
Diffstat (limited to 'src/expr.h')
| -rw-r--r-- | src/expr.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/expr.h b/src/expr.h new file mode 100644 index 0000000..5795e8b --- /dev/null +++ b/src/expr.h @@ -0,0 +1,31 @@ +#ifndef ANIMTOOL_EXPR_H_ +#define ANIMTOOL_EXPR_H_ + +#include "op.h" +#include "source.h" + +enum expr_type +{ + EXPR_NUMBER, + EXPR_OP, + EXPR_TIME, +}; + +struct expr +{ + struct range loc; + enum expr_type type; + union { + double number; + struct { + enum op_type type; + array(struct expr) args; + } op; + }; +}; + +double expr_eval(struct expr *expr, double time); +void expr_free(struct expr *expr); +void expr_copy(struct expr *dst, struct expr *src); + +#endif |
