From 674a01d4640fd869d54e1b9f1474986fda2994de Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 6 Sep 2010 01:20:01 +0100 Subject: Move whatsnew stuff into help.txt. Stop putting too much string content into the executable. --- help.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'help.c') 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; +} -- cgit v1.2.3