Changeset e5d8d21
- Timestamp:
- 2009-11-25T00:45:27Z (15 years ago)
- Branches:
- master
- Children:
- 487f555
- Parents:
- 0ac1a375
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
help.c
r0ac1a375 re5d8d21 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-200 5Wilmer van der Gaast and others *4 * Copyright 2002-2009 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 169 169 return NULL; 170 170 } 171 172 int help_add_mem( help_t **help, const char *title, const char *content ) 173 { 174 help_t *h, *l = NULL; 175 176 for( h = *help; h; h = h->next ) 177 { 178 if( g_strcasecmp( h->title, title ) == 0 ) 179 return 0; 180 181 l = h; 182 } 183 184 if( l ) 185 h = l->next = g_new0( struct help, 1 ); 186 else 187 *help = h = g_new0( struct help, 1 ); 188 h->fd = -1; 189 h->title = g_strdup( title ); 190 h->length = strlen( content ); 191 h->offset.mem_offset = g_strdup( content ); 192 193 return 1; 194 } -
help.h
r0ac1a375 re5d8d21 46 46 void help_free( help_t **help ); 47 47 char *help_get( help_t **help, char *title ); 48 int help_add_mem( help_t **help, const char *title, const char *content_ ); 48 49 49 50 #endif -
protocols/purple/purple.c
r0ac1a375 re5d8d21 23 23 24 24 #include "bitlbee.h" 25 #include "help.h" 25 26 26 27 #include <stdarg.h> … … 475 476 476 477 g_free( q ); 478 479 return pqad; 477 480 } 478 481 … … 535 538 struct prpl funcs; 536 539 GList *prots; 540 GString *help; 537 541 538 542 if( B_EV_IO_READ != PURPLE_INPUT_READ || … … 574 578 funcs.handle_cmp = g_strcasecmp; 575 579 580 help = g_string_new("BitlBee libpurple module supports the following IM protocols:\n"); 581 576 582 for( prots = purple_plugins_get_protocols(); prots; prots = prots->next ) 577 583 { … … 584 590 ret->name += 5; 585 591 register_protocol( ret ); 592 593 g_string_append_printf( help, "\n* %s (%s)", ret->name, prot->info->name ); 586 594 587 595 if( g_strcasecmp( prot->info->id, "prpl-aim" ) == 0 ) … … 593 601 } 594 602 } 595 } 603 604 help_add_mem( &global.help, "purple", help->str ); 605 g_string_free( help, TRUE ); 606 }
Note: See TracChangeset
for help on using the changeset viewer.