aboutsummaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-09-06 01:20:01 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-09-06 01:20:01 +0100
commit674a01d4640fd869d54e1b9f1474986fda2994de (patch)
treea4100503ffdadd0b22abafb020f4bf4ffa261a9e /help.c
parentd6657ce1d4fa016bfa0e013f29351229e2cc23d1 (diff)
Move whatsnew stuff into help.txt. Stop putting too much string content
into the executable.
Diffstat (limited to 'help.c')
-rw-r--r--help.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/help.c b/help.c
index 14156eaf..86013cb3 100644
--- a/help.c
+++ b/help.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2009 Wilmer van der Gaast and others *
+ * Copyright 2002-2010 Wilmer van der Gaast and others *
\********************************************************************/
/* Help file control */
@@ -25,6 +25,7 @@
#define BITLBEE_CORE
#include "bitlbee.h"
+#include "help.h"
#undef read
#undef write
@@ -193,3 +194,24 @@ int help_add_mem( help_t **help, const char *title, const char *content )
return 1;
}
+
+char *help_get_whatsnew( help_t **help, int old )
+{
+ GString *ret = NULL;
+ help_t *h;
+ int v;
+
+ for( h = *help; h; h = h->next )
+ if( h->title != NULL && strncmp( h->title, "whatsnew", 8 ) == 0 &&
+ sscanf( h->title + 8, "%x", &v ) == 1 && v > old )
+ {
+ char *s = help_get( &h, h->title );
+ if( ret == NULL )
+ ret = g_string_new( s );
+ else
+ g_string_append_printf( ret, "\n\n%s", s );
+ g_free( s );
+ }
+
+ return ret ? g_string_free( ret, FALSE ) : NULL;
+}