aboutsummaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-06-07 15:31:07 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-06-07 15:31:07 +0100
commit4aa0f6bc5645e124738ab15ad1eb65d4147dba25 (patch)
tree0f15a76a814c33c8759c9d97253423ed12c0e1cc /help.c
parent0d9d53ed0b3eb068cf57355a4d1465beaf191f8a (diff)
parent1fdb0a48438d6dc4a4795d195737890ed3e46a96 (diff)
Merging killerbee stuff, bringing all the bleeding-edge stuff together.
Diffstat (limited to 'help.c')
-rw-r--r--help.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/help.c b/help.c
index 587b9940..c43d0459 100644
--- a/help.c
+++ b/help.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2005 Wilmer van der Gaast and others *
+ * Copyright 2002-2009 Wilmer van der Gaast and others *
\********************************************************************/
/* Help file control */
@@ -168,3 +168,27 @@ char *help_get( help_t **help, char *title )
return NULL;
}
+
+int help_add_mem( help_t **help, const char *title, const char *content )
+{
+ help_t *h, *l = NULL;
+
+ for( h = *help; h; h = h->next )
+ {
+ if( g_strcasecmp( h->title, title ) == 0 )
+ return 0;
+
+ l = h;
+ }
+
+ if( l )
+ h = l->next = g_new0( struct help, 1 );
+ else
+ *help = h = g_new0( struct help, 1 );
+ h->fd = -1;
+ h->title = g_strdup( title );
+ h->length = strlen( content );
+ h->offset.mem_offset = g_strdup( content );
+
+ return 1;
+}