/* Chrysalide - Outil d'analyse de fichiers binaires * block-int.h - prototypes pour la définition interne des blocs de code * * Copyright (C) 2012-2017 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 Chrysalide. If not, see . */ #ifndef _ANALYSIS_BLOCK_INT_H #define _ANALYSIS_BLOCK_INT_H #include "block.h" #include "../common/array.h" /* ----------------------------- BLOC DE CODE GENERIQUE ----------------------------- */ /* Détermine si un bloc de code débute à une adresse donnée. */ typedef bool (* block_is_starting_fc) (const GCodeBlock *, const vmpa2t *); /* Etablit les liens entre un bloc de code et ses voisins. */ typedef void (* block_resolve_links_fc) (GCodeBlock *, const GBlockList *); /* Fournit la représentation graphique d'un bloc de code. */ typedef GBufferView * (* block_build_view_fc) (const GCodeBlock *, segcnt_list *); /* Description d'un bloc de code (instance) */ struct _GCodeBlock { GObject parent; /* A laisser en premier */ bitfield_t *domination; /* Blocs dominés de l'ensemble */ size_t index; /* Indice dans une liste */ size_t rank; /* Rang dans l'exécution */ flat_array_t *from; /* Origines des références */ flat_array_t *to; /* Instructions visées */ GBufferView *view; /* Représentation construite */ }; /* Description d'un bloc de code (classe) */ struct _GCodeBlockClass { GObjectClass parent; /* A laisser en premier */ block_is_starting_fc is_starting; /* Analyse d'adresse initiale */ block_resolve_links_fc link; /* Etablissement des liens */ block_build_view_fc build; /* Construction d'une vue */ }; /* Détermine si un bloc de code débute à une adresse donnée. */ bool g_code_block_is_starting_with(const GCodeBlock *, const vmpa2t *); #endif /* _ANALYSIS_BLOCK_INT_H */