diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-02-21 21:34:55 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-02-21 21:34:55 (GMT) |
commit | a60e1fe19d09eb379c88fdbbe018ca086dc05bcb (patch) | |
tree | e72fa012a465517fe3b2f728d750b008ba88d707 /src/gui/panels | |
parent | 0769fafb253b846b58cd97c4a1df98ca7417ae1c (diff) |
Cut symbol labels using words instead of single characters.
Diffstat (limited to 'src/gui/panels')
-rw-r--r-- | src/gui/panels/symbols.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/gui/panels/symbols.c b/src/gui/panels/symbols.c index 6b0b999..d1e60fc 100644 --- a/src/gui/panels/symbols.c +++ b/src/gui/panels/symbols.c @@ -39,6 +39,7 @@ #include "panel-int.h" #include "updating-int.h" #include "../core/global.h" +#include "../../common/extstr.h" #include "../../format/format.h" #include "../../format/symiter.h" #include "../../gtkext/easygtk.h" @@ -56,6 +57,7 @@ struct _GSymbolsPanel GPanelItem parent; /* A laisser en premier */ GLoadedBinary *binary; /* Binaire à prendre en compte */ + const char *sep; /* Délimitateur à utiliser */ size_t count; /* Quantité de symboles utiles */ @@ -164,7 +166,7 @@ static gboolean show_all_classes_in_tree_view(GtkTreeModel *, GtkTreePath *, Gtk static GtkTreeIter update_symbol_partial_name_in_tree_view(GtkTreeStore *, GtkTreeIter *, const char *, const regmatch_t *, size_t); /* Met en surbrillance les éléments recherchés dans les noms. */ -static void update_symbol_name_in_tree_view(GtkTreeStore *, const GBinSymbol *, const regmatch_t *); +static void update_symbol_name_in_tree_view(const GSymbolsPanel *, GtkTreeStore *, const GBinSymbol *, const regmatch_t *); @@ -655,8 +657,13 @@ static void change_symbols_panel_current_binary(GSymbolsPanel *panel, GLoadedBin /* Si le panneau actif représente un binaire, actualisation de l'affichage */ if (binary != NULL) + { + panel->sep = "."/*"::"*/; /* FIXME */ + run_panel_update(G_UPDATABLE_PANEL(panel), PUI_0); + } + } @@ -941,10 +948,8 @@ static bool find_parent_for_symbol(const GSymbolsPanel *panel, const GBinSymbol bool result; /* Bilan à retourner */ const char *label; /* Etiquette immuable */ char *string; /* Etiquette modifiable */ - const char *sep; /* Délimitateur à utiliser */ char *start; /* Début de boucle de parcours */ char *token; /* Partie de texte isolée */ - char *saveptr; /* Ctx. interne de découpage */ char *next; /* Prochaine partie à traiter */ result = false; @@ -956,18 +961,16 @@ static bool find_parent_for_symbol(const GSymbolsPanel *panel, const GBinSymbol string = strdup(label); - sep = "."/*"::"*/; /* FIXME */ - - for (start = string, token = strtok_r(start, sep, &saveptr); ; start = NULL, token = next) + for (start = string, token = strtok_w(&start, panel->sep); ; token = next) { - next = strtok_r(NULL, sep, &saveptr); + next = strtok_w(&start, panel->sep); if (next == NULL) { *last = (token - string); break; } - *parent = ensure_symbol_node_exist(panel, (start == string ? NULL : parent), token, match, token - string); + *parent = ensure_symbol_node_exist(panel, (token == string ? NULL : parent), token, match, token - string); result = true; @@ -1245,9 +1248,10 @@ static GtkTreeIter update_symbol_partial_name_in_tree_view(GtkTreeStore *store, /****************************************************************************** * * -* Paramètres : store = gestionnaire de données en arborescence. * +* Paramètres : panel = panneau à mettre à jour. * +* store = gestionnaire de données en arborescence. * * symbol = routine ou objet à intégrer. * -* match = portion de texte à mettre en évidence. * +* match = portion de texte à mettre en évidence. * * * * Description : Met en surbrillance les éléments recherchés dans les noms. * * * @@ -1257,15 +1261,13 @@ static GtkTreeIter update_symbol_partial_name_in_tree_view(GtkTreeStore *store, * * ******************************************************************************/ -static void update_symbol_name_in_tree_view(GtkTreeStore *store, const GBinSymbol *symbol, const regmatch_t *match) +static void update_symbol_name_in_tree_view(const GSymbolsPanel *panel, GtkTreeStore *store, const GBinSymbol *symbol, const regmatch_t *match) { const char *label; /* Etiquette immuable */ char *string; /* Etiquette modifiable */ - const char *sep; /* Délimitateur à utiliser */ GtkTreeIter parent; /* Point d'analyse courant */ char *start; /* Début de boucle de parcours */ char *token; /* Partie de texte isolée */ - char *saveptr; /* Ctx. interne de découpage */ label = g_binary_symbol_get_label(symbol); @@ -1273,13 +1275,11 @@ static void update_symbol_name_in_tree_view(GtkTreeStore *store, const GBinSymbo { string = strdup(label); - sep = "."/*"::"*/; /* FIXME */ - - for (start = string, token = strtok_r(start, sep, &saveptr); + for (start = string, token = strtok_w(&start, panel->sep); token != NULL; - start = NULL, token = strtok_r(NULL, sep, &saveptr)) + token = strtok_w(&start, panel->sep)) { - parent = update_symbol_partial_name_in_tree_view(store, (start == string ? NULL : &parent), + parent = update_symbol_partial_name_in_tree_view(store, (token == string ? NULL : &parent), token, match, token - string); } @@ -1429,7 +1429,7 @@ static void do_filtering_on_symbols(const GSymbolsPanel *panel, GtkStatusStack * if (*as_list) update_symbol_name_in_list_view(store, iter, &match); else - update_symbol_name_in_tree_view(store, symbol, &match); + update_symbol_name_in_tree_view(panel, store, symbol, &match); if (!shown) update_symbol_visibility(store, iter, true); |