summaryrefslogtreecommitdiff
path: root/src/glibext/gcodebuffer.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-08-06 20:29:20 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-08-06 20:29:20 (GMT)
commitfc49e98dc2b3e0ae08a5874ecacaef046a0f3ec1 (patch)
treee121c5eb5dd0629554a498f8e1a1cce3fc0715b4 /src/glibext/gcodebuffer.c
parentfacec716100f598a8694889274a4589c75c14722 (diff)
Saved progress toward the Android permissions display.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@258 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gcodebuffer.c')
-rw-r--r--src/glibext/gcodebuffer.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index fe00e2d..ac63a87 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -445,6 +445,37 @@ GBufferLine *g_code_buffer_append_new_line(GCodeBuffer *buffer, vmpa_t addr)
/******************************************************************************
* *
* Paramètres : buffer = composant GTK à mettre à jour. *
+* addr = adresse où retrouver la ligne recherchée. *
+* *
+* Description : Retrouve une ligne au sein d'un tampon avec une adresse. *
+* *
+* Retour : Line retrouvée ou NULL en cas d'échec. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GBufferLine *g_code_buffer_find_line_by_addr(const GCodeBuffer *buffer, vmpa_t addr)
+{
+ GBufferLine *result; /* Instance à retourner */
+ size_t i; /* Boucle de parcours */
+
+ result = NULL;
+
+ /* TODO : coder un parcours plus optimal ! */
+
+ for (i = 0; i < buffer->used && result == NULL; i++)
+ if (g_buffer_line_get_address(buffer->lines[i]) == addr)
+ result = buffer->lines[i];
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : buffer = composant GTK à mettre à jour. *
* *
* Description : Augmente l'indentation des prochaines lignes. *
* *