mcabber/src/hbuf.c
changeset 462 d580e87c11ed
parent 393 f8f3c7493457
child 464 e4840b288be0
--- a/mcabber/src/hbuf.c	Wed Sep 28 21:56:35 2005 +0200
+++ b/mcabber/src/hbuf.c	Thu Sep 29 21:28:39 2005 +0200
@@ -295,3 +295,15 @@
 
   return hbuf;
 }
+
+//  hbuf_jump_percent(hbuf, pc)
+// Return a pointer to the line at % pc of the history buffer
+GList *hbuf_jump_percent(GList *hbuf, int pc)
+{
+  guint hlen;
+
+  hbuf = g_list_first(hbuf);
+  hlen = g_list_length(hbuf);
+
+  return g_list_nth(hbuf, pc*hlen/100);
+}