summaryrefslogtreecommitdiff
path: root/src/format/symbol.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-03-15 00:01:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-15 00:01:58 (GMT)
commitb94be85e00d7770af4de93bbba91b421cfb6faea (patch)
treeea16d5248b293b3a458ad16625c6919315a4aa4a /src/format/symbol.c
parentfab9d7cd46922abea7d94f36dcd4630cdf3f4719 (diff)
Marked lines which are able to start a group of lines as width managers.
Diffstat (limited to 'src/format/symbol.c')
-rw-r--r--src/format/symbol.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/format/symbol.c b/src/format/symbol.c
index 58fdfb3..2c2e5ad 100644
--- a/src/format/symbol.c
+++ b/src/format/symbol.c
@@ -36,6 +36,7 @@ struct _GBinSymbol
SymbolType type; /* Type du symbole */
+ bool block_start; /* Début d'un bloc ? */
char *alt; /* Nom alternatif */
union
@@ -244,6 +245,66 @@ SymbolType g_binary_symbol_get_target_type(const GBinSymbol *symbol)
/******************************************************************************
* *
+* Paramètres : symbol = symbole à venir compléter. *
+* start = indication quant à la nature du symbole. *
+* *
+* Description : Définit si un symbole est susceptible de démarrer un bloc. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_binary_symbol_define_as_block_start(GBinSymbol *symbol, bool start)
+{
+ symbol->block_start = start;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : symbol = symbole à venir consulter. *
+* *
+* Description : Indique si un symbole est susceptible de démarrer un bloc. *
+* *
+* Retour : Capacité de rassemblement du symbole. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_binary_symbol_is_block_start(GBinSymbol *symbol)
+{
+ bool result; /* Statut à retourner */
+
+ switch (g_binary_symbol_get_target_type(symbol))
+ {
+ case STP_ROUTINE:
+ case STP_OBJECT:
+ case STP_FUNCTION:
+ case STP_ENTRY_POINT:
+ case STP_STRING:
+ case STP_RO_STRING:
+ result = true;
+ break;
+
+ default:
+ result = false;
+ break;
+
+ }
+
+ result |= symbol->block_start;
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : symbol = symbole à venir consulter. *
* *
* Description : Fournit un étiquette pour viser un symbole. *