about summary refs log tree commit diff stats
path: root/src/ui/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/buffer.c')
-rw-r--r--src/ui/buffer.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/buffer.c b/src/ui/buffer.c
index 29eddd89..a86e85ae 100644
--- a/src/ui/buffer.c
+++ b/src/ui/buffer.c
@@ -125,6 +125,21 @@ buffer_yield_entry(ProfBuff buffer, int entry)
     return node->data;
 }
 
+ProfBuffEntry*
+buffer_yield_entry_by_id(ProfBuff buffer, const char *const id)
+{
+    GSList *entries = buffer->entries;
+    while (entries) {
+        ProfBuffEntry *entry = entries->data;
+        if (entry->receipt && g_strcmp0(entry->receipt->id, id) == 0) {
+            return entry;
+        }
+        entries = g_slist_next(entries);
+    }
+
+    return NULL;
+}
+
 static void
 _free_entry(ProfBuffEntry *entry)
 {