Skip to content

Commit

Permalink
filterx: add isset/unset virtual functions to FilterXExpr
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Apr 9, 2024
1 parent 184307c commit d7d8077
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/filterx/filterx-expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ struct _FilterXExpr
/* assign a new value to this expr */
gboolean (*assign)(FilterXExpr *self, FilterXObject *new_value);

/* is the expression set? */
gboolean (*isset)(FilterXExpr *self);
/* unset the expression */
gboolean (*unset)(FilterXExpr *self);

void (*free_fn)(FilterXExpr *self);
};

Expand Down Expand Up @@ -109,6 +114,22 @@ filterx_expr_assign(FilterXExpr *self, FilterXObject *new_value)
return FALSE;
}

static inline gboolean
filterx_expr_isset(FilterXExpr *self)
{
if (self->isset)
return self->isset(self);
return FALSE;
}

static inline gboolean
filterx_expr_unset(FilterXExpr *self)
{
if (self->unset)
return self->unset(self);
return FALSE;
}

void filterx_expr_init_instance(FilterXExpr *self);
FilterXExpr *filterx_expr_new(void);
FilterXExpr *filterx_expr_ref(FilterXExpr *self);
Expand Down

0 comments on commit d7d8077

Please sign in to comment.