diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-06 00:21:02 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-06 00:21:02 +0100 | 
| commit | b308cf9bafbdf76da73a57607b65c4763aa3057b (patch) | |
| tree | c686906b479a0edd52b18a213e1d420f7343855d /help.c | |
| parent | 3ab1d317831a6c1830bb648a1a8d63a41c92f651 (diff) | |
| parent | e774815bc621af90bb64ca314b84367659c5a005 (diff) | |
Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of
stuff from mainline it seems.
Diffstat (limited to 'help.c')
| -rw-r--r-- | help.c | 26 | 
1 files changed, 25 insertions, 1 deletions
| @@ -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; +} | 
