comparison src/gaimrc.c @ 1051:713b0e14e0a9

[gaim-migrate @ 1061] user_info only in aim_user (saves 2k per connection); mem leak fixes in dialogs.c and multi.c; and proto_opt in aim_user (so prpls can have their own saved information per user). no way to draw protocol option selection window thingy yet, so prpls will either have to do that on their own or something. i don't know. we'll figure it out. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 02 Nov 2000 22:29:51 +0000
parents ece2d1543b20
children d50d3abb9eb7
comparison
equal deleted inserted replaced
1050:c4baa5509558 1051:713b0e14e0a9
426 426
427 static struct aim_user *gaimrc_read_user(FILE *f) 427 static struct aim_user *gaimrc_read_user(FILE *f)
428 { 428 {
429 struct parse *p; 429 struct parse *p;
430 struct aim_user *u; 430 struct aim_user *u;
431 int i;
431 char buf[4096]; 432 char buf[4096];
432 433
433 if (!fgets(buf, sizeof(buf), f)) 434 if (!fgets(buf, sizeof(buf), f))
434 return NULL; 435 return NULL;
435 436
480 return u; 481 return u;
481 482
482 u->options = atoi(p->value[0]); 483 u->options = atoi(p->value[0]);
483 u->protocol = atoi(p->value[1]); 484 u->protocol = atoi(p->value[1]);
484 485
486 if (!fgets(buf, sizeof(buf), f))
487 return u;
488
489 if (!strcmp(buf, "\t}"))
490 return u;
491
492 p = parse_line(buf);
493
494 if (strcmp(p->option, "proto_opts"))
495 return u;
496
497 for (i = 0; i < 6; i++)
498 g_snprintf(u->proto_opt[i], sizeof u->proto_opt[i], "%s", p->value[i]);
499
485 return u; 500 return u;
486 501
487 } 502 }
488 503
489 static void gaimrc_write_user(FILE *f, struct aim_user *u) 504 static void gaimrc_write_user(FILE *f, struct aim_user *u)
490 { 505 {
491 char *c; 506 char *c;
492 int nl = 1;; 507 int nl = 1, i;
493 if (u->options & OPT_USR_REM_PASS) 508 if (u->options & OPT_USR_REM_PASS)
494 fprintf(f, "\t\tident { %s } { %s }\n", u->username, u->password); 509 fprintf(f, "\t\tident { %s } { %s }\n", u->username, u->password);
495 else 510 else
496 fprintf(f, "\t\tident { %s } { }\n", u->username); 511 fprintf(f, "\t\tident { %s } { }\n", u->username);
497 fprintf(f, "\t\tuser_info {"); 512 fprintf(f, "\t\tuser_info {");
511 } 526 }
512 c++; 527 c++;
513 } 528 }
514 fprintf(f, "\n\t\t}\n"); 529 fprintf(f, "\n\t\t}\n");
515 fprintf(f, "\t\tuser_opts { %d } { %d }\n", u->options, u->protocol); 530 fprintf(f, "\t\tuser_opts { %d } { %d }\n", u->options, u->protocol);
516 531 fprintf(f, "\t\tproto_opts");
532 for (i = 0; i < 6; i++)
533 fprintf(f, " { %s }", u->proto_opt[i]);
534 fprintf(f, "\n");
517 } 535 }
518 536
519 537
520 static void gaimrc_read_users(FILE *f) 538 static void gaimrc_read_users(FILE *f)
521 { 539 {