From e5af28536bfb0f4c9131df56d2009ba5196f5e3a Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Sun, 12 Apr 2026 20:57:06 +0200 Subject: init --- src/expr.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/expr.h (limited to 'src/expr.h') 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 -- cgit v1.2.3