diff mcabber/src/hbuf.c @ 462:d580e87c11ed

Add "/buffer %n"
author Mikael Berthe <mikael@lilotux.net>
date Thu, 29 Sep 2005 21:28:39 +0200
parents f8f3c7493457
children e4840b288be0
line wrap: on
line diff
--- 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);
+}