Changeset 5b52a48 for storage_xml.c
- Timestamp:
- 2006-07-03T21:22:45Z (18 years ago)
- Branches:
- master
- Children:
- 7e3592e
- Parents:
- 911f2eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
r911f2eb r5b52a48 197 197 if( xd->current_account && handle && nick ) 198 198 { 199 nick_set( irc, handle, xd->current_account->prpl, nick );199 nick_set( xd->current_account, handle, nick ); 200 200 } 201 201 else … … 365 365 } 366 366 367 static gboolean xml_save_nick( gpointer key, gpointer value, gpointer data ); 368 367 369 static storage_status_t xml_save( irc_t *irc, int overwrite ) 368 370 { 369 371 char path[512], *path2, *pass_buf = NULL; 370 372 set_t *set; 371 nick_t *nick;372 373 account_t *acc; 373 374 int fd; … … 440 441 goto write_error; 441 442 442 for( nick = irc->nicks; nick; nick = nick->next ) 443 if( nick->proto == acc->prpl ) 444 if( !xml_printf( fd, 2, "<buddy handle=\"%s\" nick=\"%s\" />\n", nick->handle, nick->nick ) ) 445 goto write_error; 443 /* This probably looks pretty strange. g_hash_table_foreach 444 is quite a PITA already (but it can't get much better in 445 C without using #define, I'm afraid), and since it 446 doesn't seem to be possible to abort the foreach on write 447 errors, so instead let's use the _find function and 448 return TRUE on write errors. Which means, if we found 449 something, there was an error. :-) */ 450 if( g_hash_table_find( acc->nicks, xml_save_nick, (gpointer) fd ) ) 451 goto write_error; 446 452 447 453 if( !xml_printf( fd, 1, "</account>\n" ) ) … … 476 482 477 483 return STORAGE_OTHER_ERROR; 484 } 485 486 static gboolean xml_save_nick( gpointer key, gpointer value, gpointer data ) 487 { 488 return !xml_printf( (int) data, 2, "<buddy handle=\"%s\" nick=\"%s\" />\n", key, value ); 478 489 } 479 490
Note: See TracChangeset
for help on using the changeset viewer.