From 1bd3b87687328e1e097ca69cf18f2f14abfa9782 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Fri, 20 Mar 2009 16:12:18 +0100 Subject: expr: add support for cloning expressions Signed-off-by: Patrick McHardy --- include/expression.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/expression.h b/include/expression.h index d4222060..b0084c07 100644 --- a/include/expression.h +++ b/include/expression.h @@ -106,6 +106,7 @@ static inline void expr_set_context(struct expr_ctx *ctx, * * @type: expression type * @name: expression name for diagnostics + * @clone: function to clone type specific data * @destroy: destructor, must release inner expressions * @set_type: function to promote type and byteorder of inner types * @print: function to print the expression @@ -113,6 +114,7 @@ static inline void expr_set_context(struct expr_ctx *ctx, struct expr_ops { enum expr_types type; const char *name; + void (*clone)(struct expr *new, const struct expr *expr); void (*destroy)(struct expr *expr); void (*set_type)(const struct expr *expr, const struct datatype *dtype, @@ -238,6 +240,7 @@ extern struct expr *expr_alloc(const struct location *loc, const struct expr_ops *ops, const struct datatype *dtype, enum byteorder byteorder, unsigned int len); +extern struct expr *expr_clone(const struct expr *expr); extern struct expr *expr_get(struct expr *expr); extern void expr_free(struct expr *expr); extern void expr_print(const struct expr *expr); -- cgit v1.2.3