summaryrefslogtreecommitdiff
path: root/src/glibext/gcodebuffer.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-07-14 09:49:51 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-07-14 09:49:51 (GMT)
commit9371129c1b7aa830ed889abd4481cb505d90c4a7 (patch)
tree579dd07fc31bab09c30e0dcdc60a356d5eaac99e /src/glibext/gcodebuffer.c
parent412f9fd31e625dbb2b00c25b6cc6b4753acd409d (diff)
Indented the output of decompilations.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@249 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r--src/glibext/gcodebuffer.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index 97d6505..fe00e2d 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -97,6 +97,8 @@ struct _GCodeBuffer
size_t count; /* Quantité en cache */
size_t used; /* Quantité utilisée */
+ size_t indent; /* Indentation des lignes */
+
};
/* Tampon pour code désassemblé (classe) */
@@ -420,6 +422,7 @@ static size_t g_code_buffer_get_index_from_address(GCodeBuffer *buffer, vmpa_t a
GBufferLine *g_code_buffer_append_new_line(GCodeBuffer *buffer, vmpa_t addr)
{
GBufferLine *result; /* Instance à retourner */
+ size_t i; /* Boucle de parcours */
if (buffer->used == buffer->count)
{
@@ -431,6 +434,9 @@ GBufferLine *g_code_buffer_append_new_line(GCodeBuffer *buffer, vmpa_t addr)
result = g_buffer_line_new(addr);
buffer->lines[buffer->used++] = result;
+ for (i = 0; i < buffer->indent; i++)
+ g_buffer_line_insert_text(result, BLC_ASSEMBLY_HEAD, " ", 4, RTT_RAW);
+
return result;
}
@@ -438,6 +444,46 @@ GBufferLine *g_code_buffer_append_new_line(GCodeBuffer *buffer, vmpa_t addr)
/******************************************************************************
* *
+* Paramètres : buffer = composant GTK à mettre à jour. *
+* *
+* Description : Augmente l'indentation des prochaines lignes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_code_buffer_inc_indentation(GCodeBuffer *buffer)
+{
+ buffer->indent++;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : buffer = composant GTK à mettre à jour. *
+* *
+* Description : Diminue l'indentation des prochaines lignes. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_code_buffer_dec_indentation(GCodeBuffer *buffer)
+{
+ /* BUG_ON(buffer->indent == 0) */
+
+ buffer->indent--;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : buffer = tampon de données à utiliser. *
* start = première adresse visée ou 0. *
* end = dernière adresse visée ou VMPA_MAX. *