diff console/libgnt/gntutils.h @ 14423:cfd5bcc06a7e

[gaim-migrate @ 17131] Try to make sure the strings are not too long to get out of the range of the screen. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 02 Sep 2006 23:06:25 +0000
parents c4a32405af68
children 8a0cfee11af8
line wrap: on
line diff
--- a/console/libgnt/gntutils.h	Sat Sep 02 20:17:43 2006 +0000
+++ b/console/libgnt/gntutils.h	Sat Sep 02 23:06:25 2006 +0000
@@ -9,3 +9,11 @@
 int gnt_util_onscreen_width(const char *start, const char *end);
 
 const char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w);
+
+/* Inserts newlines in 'string' where necessary so that its onscreen width is
+ * no more than 'maxw'.
+ * 'maxw' can be <= 0, in which case the maximum screen width is considered.
+ *
+ * Returns a newly allocated string.
+ */
+char *gnt_util_onscreen_fit_string(const char *string, int maxw);