/* Chrysalide - Outil d'analyse de fichiers binaires * expr-int.h - prototypes internes pour la définition d'une expression servant aux conditions de correspondance * * Copyright (C) 2022 Cyrille Bagard * * This file is part of Chrysalide. * * Chrysalide is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Chrysalide is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Foobar. If not, see . */ #ifndef _ANALYSIS_SCAN_EXPR_INT_H #define _ANALYSIS_SCAN_EXPR_INT_H #include "expr.h" #include #include "../../glibext/comparison-int.h" /* Réalise une comparaison entre objets selon un critère précis. */ typedef bool (* compare_expr_rich_fc) (const GScanExpression *, const GScanExpression *, RichCmpOperation, bool *); /* Vérifie la validité d'une expression. */ typedef bool (* check_expr_validity_fc) (const GScanExpression *); /* Reproduit une expression en place dans une nouvelle instance. */ typedef GScanExpression * (* dup_expr_fc) (const GScanExpression *); /* Reproduit une expression en place dans une nouvelle instance. */ typedef void (* copy_expr_fc) (GScanExpression *, const GScanExpression *); /* Réduit une expression à une forme plus simple. */ typedef bool (* reduce_expr_fc) (GScanExpression *, GScanContext *, GScanScope *, GScanExpression **); /* Expression d'évaluation généraliste (instance) */ struct _GScanExpression { GObject parent; /* A laisser en premier */ ExprValueType value_type; /* Type de valeur portée */ }; /* Expression d'évaluation généraliste (classe) */ struct _GScanExpressionClass { GObjectClass parent; /* A laisser en premier */ compare_expr_rich_fc cmp_rich; /* Comparaison de façon précise*/ check_expr_validity_fc check; /* Validation de la cohérence */ copy_expr_fc copy; /* Reproduction d'expression */ dup_expr_fc dup; /* Reproduction d'expression */ reduce_expr_fc reduce; /* Simplification d'expression */ }; /* Met en place une expression d'évaluation pour analyse. */ bool g_scan_expression_create(GScanExpression *, ExprValueType); #endif /* _ANALYSIS_SCAN_EXPR_INT_H */