diff options
Diffstat (limited to 'src/analysis/scan/matches-int.h')
-rw-r--r-- | src/analysis/scan/matches-int.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/analysis/scan/matches-int.h b/src/analysis/scan/matches-int.h new file mode 100644 index 0000000..674fe03 --- /dev/null +++ b/src/analysis/scan/matches-int.h @@ -0,0 +1,65 @@ + +/* 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 <http://www.gnu.org/licenses/>. + */ + + +#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 */ + + 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 */ |