/* Chrysalide - Outil d'analyse de fichiers binaires * matches-int.h - prototypes internes pour la sauvegarde de correspondances de motif identifiées * * 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_MATCHES_INT_H #define _ANALYSIS_SCAN_MATCHES_INT_H #include "matches.h" /* Dénombre les correspondances enregistrées pour un motif. */ typedef size_t (* count_scan_matches_fc) (const GScanMatches *); /* Affiche une série de correspondances au format texte. */ typedef void (* output_scan_matches_to_text_fc) (const GScanMatches *, int); /* Affiche une série de correspondances au format JSON. */ typedef void (* output_scan_matches_to_json_fc) (const GScanMatches *, const sized_string_t *, unsigned int, int); /* Correspondances trouvées avec un motif (instance) */ struct _GScanMatches { GObject parent; /* A laisser en premier */ /** * L'aspect constant des instances marque seulement le fait que les * pointeurs sont partagés avec un contexte, qui est le réel propriétaire * de ces instances. */ const GScanContext *context; /* Contexte de rattachement */ const GSearchPattern *source; /* Motif d'origine recherché */ }; /* Correspondances trouvées avec un motif (classe) */ struct _GScanMatchesClass { GObjectClass parent; /* A laisser en premier */ count_scan_matches_fc count; /* Décompte des correspondances*/ output_scan_matches_to_text_fc to_text; /* Impression au format texte */ output_scan_matches_to_json_fc to_json; /* Impression au format JSON */ }; #endif /* _ANALYSIS_SCAN_MATCHES_INT_H */