diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-12-24 16:26:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-12-24 16:26:51 (GMT) |
commit | 93dfdc30d815629a7e0c9393f0e8f0462844ff56 (patch) | |
tree | 8fe59f8c0186871ffd79873ec20905bf39170528 /src/gui/panels/symbols.c | |
parent | c388ad8910dbb1a3c478176d8b1ab3142fdbd9d5 (diff) |
Ported the panel update mechanisms to the Python API.
Diffstat (limited to 'src/gui/panels/symbols.c')
-rw-r--r-- | src/gui/panels/symbols.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c index 152d705..ab7a414 100644 --- a/src/gui/panels/symbols.c +++ b/src/gui/panels/symbols.c @@ -218,7 +218,7 @@ struct _symbols_update_data static bool is_symbol_matching(const symbols_update_data *, const GBinSymbol *, regmatch_t *); /* Prépare une opération de mise à jour de panneau. */ -static const char *g_symbols_panel_setup(const GSymbolsPanel *, unsigned int, size_t *, symbols_update_data **); +static bool g_symbols_panel_setup(const GSymbolsPanel *, unsigned int, size_t *, symbols_update_data **, char **); /* Bascule l'affichage d'un panneau avant mise à jour. */ static void g_symbols_panel_introduce(const GSymbolsPanel *, unsigned int, symbols_update_data *); @@ -230,7 +230,7 @@ static void g_symbols_panel_process(const GSymbolsPanel *, unsigned int, GtkStat static void g_symbols_panel_conclude(GSymbolsPanel *, unsigned int, symbols_update_data *); /* Supprime les données dynamiques utilisées à la mise à jour. */ -static void g_symbols_panel_clean_data(GUpdatablePanel *, unsigned int, symbols_update_data *); +static void g_symbols_panel_clean_data(const GUpdatablePanel *, unsigned int, symbols_update_data *); @@ -1614,6 +1614,7 @@ static bool is_symbol_matching(const symbols_update_data *data, const GBinSymbol * uid = identifiant de la phase de traitement. * * count = nombre d'étapes à prévoir dans le traitement. [OUT] * * data = données sur lesquelles s'appuyer ensuite. [OUT] * +* msg = description du message d'information. [OUT] * * * * Description : Prépare une opération de mise à jour de panneau. * * * @@ -1623,9 +1624,9 @@ static bool is_symbol_matching(const symbols_update_data *data, const GBinSymbol * * ******************************************************************************/ -static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned int uid, size_t *count, symbols_update_data **data) +static bool g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned int uid, size_t *count, symbols_update_data **data, char **msg) { - const char *result; /* Message à retourner */ + bool result; /* Bilan à retourner */ GBinFormat *format; /* Format du binaire */ #ifndef NDEBUG int ret; /* Bilan de mise en place */ @@ -1633,6 +1634,8 @@ static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned in GtkBuilder *builder; /* Constructeur utilisé */ GtkTreeView *treeview; /* Arborescence graphique */ + result = true; + *data = malloc(sizeof(symbols_update_data)); switch (uid) @@ -1649,7 +1652,7 @@ static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned in (*data)->count = 0; - result = _("Loading symbols registered for the binary format..."); + *msg = strdup(_("Loading symbols registered for the binary format...")); break; @@ -1658,13 +1661,13 @@ static const char *g_symbols_panel_setup(const GSymbolsPanel *panel, unsigned in *count = panel->count; (*data)->count = panel->count; - result = _("Filtering symbols registered for the binary format..."); + *msg = strdup(_("Filtering symbols registered for the binary format...")); break; default: /* Pour GCC... */ assert(false); - result = ""; + result = false; break; } @@ -1873,7 +1876,7 @@ static void g_symbols_panel_conclude(GSymbolsPanel *panel, unsigned int uid, sym * * ******************************************************************************/ -static void g_symbols_panel_clean_data(GUpdatablePanel *panel, unsigned int uid, symbols_update_data *data) +static void g_symbols_panel_clean_data(const GUpdatablePanel *panel, unsigned int uid, symbols_update_data *data) { size_t i; /* Boucle de parcours */ |