diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/format/format.c | 8 | ||||
| -rw-r--r-- | src/plugins/pglist.h | 3 | ||||
| -rw-r--r-- | src/plugins/plugin-def.h | 20 | ||||
| -rw-r--r-- | src/plugins/plugin-int.h | 4 | ||||
| -rw-r--r-- | src/plugins/plugin.c | 33 | ||||
| -rw-r--r-- | src/plugins/plugin.h | 3 | 
6 files changed, 67 insertions, 4 deletions
diff --git a/src/format/format.c b/src/format/format.c index ac6b215..de57e4c 100644 --- a/src/format/format.c +++ b/src/format/format.c @@ -326,10 +326,14 @@ bool g_binary_format_analyze(GBinFormat *format, wgroup_id_t gid, GtkStatusStack      bool result;                            /* Bilan à retourner           */      GBinFormatClass *class;                 /* Classe de l'instance        */ +    handle_binary_format_analysis(PGA_FORMAT_ANALYSIS_STARTED, format, gid, status); +      class = G_BIN_FORMAT_GET_CLASS(format);      result = class->analyze(format, gid, status); +    handle_binary_format_analysis(PGA_FORMAT_ANALYSIS_ENDED, format, gid, status); +      return result;  } @@ -470,11 +474,15 @@ void g_binary_format_complete_analysis(GBinFormat *format, wgroup_id_t gid, GtkS  {      GBinFormatClass *class;                 /* Classe de l'instance        */ +    handle_binary_format_analysis(PGA_FORMAT_POST_ANALYSIS_STARTED, format, gid, status); +      class = G_BIN_FORMAT_GET_CLASS(format);      if (class->complete != NULL)          class->complete(format, gid, status); +    handle_binary_format_analysis(PGA_FORMAT_POST_ANALYSIS_ENDED, format, gid, status); +  } diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h index 7cc4416..5fc2867 100644 --- a/src/plugins/pglist.h +++ b/src/plugins/pglist.h @@ -98,6 +98,9 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *);  /* DPS_FORMAT */ +#define handle_binary_format_analysis(a, f, g, s) \ +    process_all_plugins_for(a, g_plugin_module_handle_binary_format_analysis, f, g, s) +  #define handle_binary_format(a, f, s) \      process_all_plugins_for(a, g_plugin_module_handle_binary_format, f, s) diff --git a/src/plugins/plugin-def.h b/src/plugins/plugin-def.h index 643b6e2..f404b14 100644 --- a/src/plugins/plugin-def.h +++ b/src/plugins/plugin-def.h @@ -130,11 +130,23 @@ typedef enum _PluginAction       * DPC_BINARY_PROCESSING | DPS_FORMAT       */ -    /* Accompagnement du chargement (fin) */ -    PGA_FORMAT_LOADER_LAST = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(0), +    /* Début de l'analyse d'un format */ +    PGA_FORMAT_ANALYSIS_STARTED      = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(0), -    /* Accompagnement du chargement (fin) */ -    PGA_FORMAT_PRELOAD     = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(1), +    /* Accompagnement du chargement */ +    PGA_FORMAT_PRELOAD               = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(1), + +    /* Accompagnement du chargement */ +    PGA_FORMAT_LOADER_LAST           = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(2), + +    /* Fin de l'analyse d'un format */ +    PGA_FORMAT_ANALYSIS_ENDED        = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(3), + +    /* Début de la vague finale d'analyse d'un format */ +    PGA_FORMAT_POST_ANALYSIS_STARTED = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(4), + +    /* Début de la vague finale d'analyse d'un format */ +    PGA_FORMAT_POST_ANALYSIS_ENDED   = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(5),      /**       * DPC_BINARY_PROCESSING | DPS_DISASSEMBLY diff --git a/src/plugins/plugin-int.h b/src/plugins/plugin-int.h index d04d9ab..0ab4f56 100644 --- a/src/plugins/plugin-int.h +++ b/src/plugins/plugin-int.h @@ -53,6 +53,9 @@ typedef void (* pg_handle_content_fc) (const GPluginModule *, PluginAction, GBin  /* Procède à une opération liée à un contenu chargé. */  typedef void (* pg_handle_loaded_fc) (const GPluginModule *, PluginAction, GLoadedContent *, wgroup_id_t, GtkStatusStack *); +/* Assure l'interprétation d'un format en différé. */ +typedef bool (* pg_handle_format_analysis_fc) (const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *); +  /* Procède à une opération liée au format de fichier uniquement. */  typedef bool (* pg_handle_format_fc) (const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *); @@ -124,6 +127,7 @@ struct _GPluginModule      pg_handle_content_fc handle_content;    /* Explorations ou résolutions */      pg_handle_loaded_fc handle_loaded;      /* Traitement de contenu chargé*/ +    pg_handle_format_analysis_fc handle_fmt_analysis; /* Analyse de format */      pg_handle_format_fc handle_format;      /* Manipulation du format      */      pg_preload_format_fc preload_format;    /* Préchargement d'un format   */ diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 40f44ce..b63b263 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -334,6 +334,16 @@ GPluginModule *g_plugin_module_new(const gchar *filename)                          switch (action)                          { +                            case PGA_FORMAT_ANALYSIS_STARTED: +                            case PGA_FORMAT_ANALYSIS_ENDED: +                            case PGA_FORMAT_POST_ANALYSIS_STARTED: +                            case PGA_FORMAT_POST_ANALYSIS_ENDED: +                                if (!load_plugin_symbol(result->module, +                                                        "handle_binary_format_analysis", +                                                        &result->handle_fmt_analysis)) +                                    goto bad_plugin; +                                break; +                              case PGA_FORMAT_LOADER_LAST:                                  if (!load_plugin_symbol(result->module,                                                          "handle_binary_format", &result->handle_format)) @@ -781,6 +791,29 @@ void g_plugin_module_handle_loaded_content(const GPluginModule *plugin, PluginAc  *  Paramètres  : plugin = greffon à manipuler.                                *  *                action = type d'action attendue.                             *  *                format = format de binaire à manipuler pendant l'opération.  * +*                gid    = groupe de travail dédié.                            * +*                status = barre de statut à tenir informée.                   * +*                                                                             * +*  Description : Procède à une opération liée à l'analyse d'un format.        * +*                                                                             * +*  Retour      : Bilan de l'exécution du traitement.                          * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +bool g_plugin_module_handle_binary_format_analysis(const GPluginModule *plugin, PluginAction action, GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status) +{ +    return plugin->handle_fmt_analysis(plugin, action, format, gid, status); + +} + + +/****************************************************************************** +*                                                                             * +*  Paramètres  : plugin = greffon à manipuler.                                * +*                action = type d'action attendue.                             * +*                format = format de binaire à manipuler pendant l'opération.  *  *                status = barre de statut à tenir informée.                   *  *                                                                             *  *  Description : Procède à une opération liée au format de fichier uniquement.* diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h index a73cc6f..718531a 100644 --- a/src/plugins/plugin.h +++ b/src/plugins/plugin.h @@ -97,6 +97,9 @@ void g_plugin_module_handle_binary_content(const GPluginModule *, PluginAction,  /* Procède à une opération liée à un contenu chargé. */  void g_plugin_module_handle_loaded_content(const GPluginModule *, PluginAction, GLoadedContent *, wgroup_id_t, GtkStatusStack *); +/* Procède à une opération liée à l'analyse d'un format. */ +bool g_plugin_module_handle_binary_format_analysis(const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *); +  /* Procède à une opération liée au format de fichier uniquement. */  bool g_plugin_module_handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *);  | 
