annotate src/gaimrc.c @ 855:82673bb41e2f

[gaim-migrate @ 865] hehehe committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 07 Sep 2000 17:53:35 +0000
parents b61607d6c2af
children 9b8b83592bb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 * (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 * GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 *
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
22 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
23 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
24 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 #include <sys/time.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 #include <sys/types.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 #include <sys/stat.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 #include <unistd.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 #include <stdio.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #include <stdlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <gtk/gtk.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include "proxy.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
38 /* for people like myself, who are too lazy to add an away msg :) */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
39 #define BORING_DEFAULT_AWAY_MSG "sorry, i ran out for a while. bbl"
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 struct aim_user *current_user = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 GList *aim_users = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 int general_options;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 int display_options;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 int sound_options;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 int font_options;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 int report_idle, web_browser;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49 struct save_pos blist_pos;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50 char web_command[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51 char aim_host[512];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52 int aim_port;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
53 char login_host[512];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 int login_port;
180
0ff9f19b9b23 [gaim-migrate @ 190]
Rob Flynn <gaim@robflynn.com>
parents: 159
diff changeset
55 char latest_ver[25];
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 struct parse {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 char option[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59 char value[6][256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 };
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 static struct parse *parse_line(char *line)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 char *c = line;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 int inopt = 1, inval = 0, curval = -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 int optlen = 0, vallen = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 static struct parse p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70 while(*c) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 if (*c == '\t') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 if (inopt) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 // if ((*c < 'a' || *c > 'z') && *c != '_') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77 if ((*c < 'a' || *c > 'z') && *c != '_' && (*c < 'A' || *c > 'Z')) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 inopt = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 p.option[optlen] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84 p.option[optlen] = *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85 optlen++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 } else if (inval) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 if ( (*c == '}') ) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 if (*(c-1) == '\\') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 p.value[curval][vallen - 1] = *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 p.value[curval][vallen - 1] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 inval = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 p.value[curval][vallen] = *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102 vallen++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 continue; }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 } else if (*c == '{') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 if (*(c-1) == '\\') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 p.value[curval][vallen-1] = *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111 else
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 curval++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 vallen = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115 inval = 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 return &p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 static int gaimrc_parse_tag(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 char buf[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 char tag[256];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131 buf[0] = '#';
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 while (buf[0] == '#' && !feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 fgets(buf, sizeof(buf), f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136 if (feof(f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 sscanf(buf, "%s {", tag);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141 if (!strcmp(tag, "users")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143 } else if (!strcmp(tag, "options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144 return 1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 } else if (!strcmp(tag, "away")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 return 2;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
147 } else if (!strcmp(tag, "plugins")) {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
148 return 3;
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
149 } else if (!strcmp(tag, "pounce")) {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
150 return 4;
774
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
151 } else if (!strcmp(tag, "chat")) {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
152 return 5;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 return -1;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 void filter_break(char *msg)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 {
44
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
160 char *c;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
161 int mc;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
162 int cc;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
163
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
164 c = g_malloc(strlen(msg)+1);
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
165 strcpy(c, msg);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166
44
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
167 mc = 0;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
168 cc = 0;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
169 while (c[cc] != '\0')
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
170 {
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
171 if (c[cc] == '\\') {
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
172 cc++;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
173 msg[mc] = c[cc];
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
174 }
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
175 else {
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
176 msg[mc] = c[cc];
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
177 }
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
178 mc++;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
179 cc++;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
180 }
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
181 msg[mc] = 0;
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
182 g_free(c);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184
44
e3e7351cf70d [gaim-migrate @ 53]
Rob Flynn <gaim@robflynn.com>
parents: 26
diff changeset
185
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 static void gaimrc_read_away(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 char buf[4096];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 struct away_message *a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 buf[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 while (buf[0] != '}')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 if (buf[0] == '}')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 p = parse_line(buf);
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
203 if (!strcmp(p->option, "message"))
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
204 {
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
205 a = g_new0(struct away_message, 1);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
207 g_snprintf(a->name, sizeof(a->name), "%s", p->value[0]);
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
208 g_snprintf(a->message, sizeof(a->message), "%s", p->value[1]);
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
209 filter_break(a->message);
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
210 away_messages = g_list_append(away_messages, a);
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
211 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 static void gaimrc_write_away(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217 GList *awy = away_messages;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 struct away_message *a;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 fprintf(f, "away {\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
222 if (awy)
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
223 {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
224 while (awy) {
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
225 char *str1, *str2;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 15
diff changeset
226
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
227 a = (struct away_message *)awy->data;
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 15
diff changeset
228
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
229 str1 = escape_text2(a->name);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
230 str2 = escape_text2(a->message);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
231
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
232 fprintf(f, "\tmessage { %s } { %s }\n", str1, str2);
26
b9e90a914e20 [gaim-migrate @ 35]
Rob Flynn <gaim@robflynn.com>
parents: 15
diff changeset
233
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
234 /* escape_text2 uses malloc(), so we don't want to g_free these */
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
235 free(str1);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
236 free(str2);
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
237
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
238 awy = awy->next;
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
239 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 }
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
241 else
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
242 fprintf(f, "\tmessage { boring default } { %s }\n", BORING_DEFAULT_AWAY_MSG);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 fprintf(f, "}\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
247 static void gaimrc_read_pounce(FILE *f)
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
248 {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
249 struct parse *p;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
250 char buf[4096];
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
251 struct buddy_pounce *b;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
252
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
253 buf[0] = 0;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
254
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
255 while (buf[0] != '}')
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
256 {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
257 if (!fgets(buf, sizeof(buf), f))
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
258 return;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
259
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
260 if (buf[0] == '}')
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
261 return;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
262
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
263 p = parse_line(buf);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
264 if (!strcmp(p->option, "entry"))
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
265 {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
266 b = g_new0(struct buddy_pounce, 1);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
267
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
268 g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
269 g_snprintf(b->message, sizeof(b->message), "%s", p->value[1]);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
270
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
271 b->popup = atoi(p->value[2]);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
272 b->sendim = atoi(p->value[3]);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
273
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
274 filter_break(b->message);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
275 buddy_pounces = g_list_append(buddy_pounces, b);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
276 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
277 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
278 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
279
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
280 static void gaimrc_write_pounce(FILE *f)
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
281 {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
282 GList *pnc = buddy_pounces;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
283 struct buddy_pounce *b;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
284
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
285 fprintf(f, "pounce {\n");
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
286
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
287 if (pnc)
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
288 {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
289 while (pnc) {
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
290 char *str1, *str2;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
291 int popup, sendim;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
292
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
293 b = (struct buddy_pounce *)pnc->data;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
294
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
295 str1 = escape_text2(b->name);
690
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
296 if (strlen(b->message))
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
297 str2 = escape_text2(b->message);
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
298 else {
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
299 str2 = malloc(1);
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
300 str2[0] = 0;
16831576f242 [gaim-migrate @ 700]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 673
diff changeset
301 }
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
302 popup = b->popup;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
303 sendim = b->sendim;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
304
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
305 fprintf(f, "\tentry { %s } { %s } { %d } { %d }\n", str1, str2, popup, sendim);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
306
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
307 /* escape_text2 uses malloc(), so we don't want to g_free these */
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
308 free(str1);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
309 free(str2);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
310
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
311 pnc = pnc->next;
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
312 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
313 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
314
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
315 fprintf(f, "}\n");
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
316 }
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
317
774
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
318 static void gaimrc_read_chat(FILE *f)
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
319 {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
320 struct parse *p;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
321 char buf[4096];
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
322 struct chat_room *b;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
323
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
324 buf[0] = 0;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
325
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
326 while (buf[0] != '}')
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
327 {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
328 if (!fgets(buf, sizeof(buf), f))
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
329 return;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
330
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
331 if (buf[0] == '}')
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
332 return;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
333
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
334 p = parse_line(buf);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
335 if (!strcmp(p->option, "entry"))
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
336 {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
337 b = g_new0(struct chat_room, 1);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
338
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
339 g_snprintf(b->name, sizeof(b->name), "%s", p->value[0]);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
340
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
341 b->exchange = atoi(p->value[1]);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
342
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
343 chat_rooms = g_list_append(chat_rooms, b);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
344 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
345 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
346 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
347
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
348 static void gaimrc_write_chat(FILE *f)
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
349 {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
350 GList *pnc = chat_rooms;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
351 struct chat_room *b;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
352
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
353 fprintf(f, "chat {\n");
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
354
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
355 if (pnc)
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
356 {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
357 while (pnc) {
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
358 char *str1;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
359
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
360 b = (struct chat_room *)pnc->data;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
361
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
362 str1 = escape_text2(b->name);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
363
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
364 fprintf(f, "\tentry { %s } { %d }\n", str1, b->exchange);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
365
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
366 /* escape_text2 uses malloc(), so we don't want to g_free these */
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
367 free(str1);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
368
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
369 pnc = pnc->next;
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
370 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
371 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
372
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
373 fprintf(f, "}\n");
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
374 }
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
375
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
376 #ifdef GAIM_PLUGINS
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
377 static void gaimrc_write_plugins(FILE *f)
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
378 {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
379 GList *pl = plugins;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
380 struct gaim_plugin *p;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
382 fprintf(f, "plugins {\n");
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
383
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
384 while (pl) {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
385 char *path;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
386
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
387 p = (struct gaim_plugin *)pl->data;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
388
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
389 path = escape_text2(p->filename);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
390
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
391 fprintf(f, "\tplugin { %s }\n", path);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
392
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
393 free(path);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
394
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
395 pl = pl->next;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
396 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
397
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
398 fprintf(f, "}\n");
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
399 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
400
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
401 static void gaimrc_read_plugins(FILE *f)
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
402 {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
403 struct parse *p;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
404 char buf[4096];
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
405
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
406 buf[0] = 0;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
407
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
408 while (buf[0] != '}')
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
409 {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
410 if (!fgets(buf, sizeof(buf), f))
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
411 return;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
412
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
413 if (buf[0] == '}')
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
414 return;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
415
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
416 p = parse_line(buf);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
417 if (!strcmp(p->option, "plugin"))
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
418 {
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
419 load_plugin(p->value[0]);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
420 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
421 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
422 }
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
423 #endif /* GAIM_PLUGINS */
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 static struct aim_user *gaimrc_read_user(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 struct aim_user *u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429 char buf[4096];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
431 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434 p = parse_line(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436 if (strcmp(p->option, "ident"))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 return NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
439 u = g_new0(struct aim_user, 1);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 strcpy(u->username, p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 strcpy(u->password, p->value[1]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444 u->user_info[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 return u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 if (strcmp(buf, "\t\tuser_info {\n")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450 return u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 return u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456 while (strncmp(buf, "\t\t}", 3)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457 if (strlen(buf) > 3)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 strcat(u->user_info, &buf[3]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460 if (!fgets(buf, sizeof(buf), f)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 return u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
462 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465 return u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469 static void gaimrc_write_user(FILE *f, struct aim_user *u)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 char *c;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472 int nl = 1;;
131
350d88f043b6 [gaim-migrate @ 141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
473 if (general_options & OPT_GEN_REMEMBER_PASS)
350d88f043b6 [gaim-migrate @ 141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
474 fprintf(f, "\t\tident { %s } { %s }\n", u->username, u->password);
350d88f043b6 [gaim-migrate @ 141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
475 else
350d88f043b6 [gaim-migrate @ 141]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 84
diff changeset
476 fprintf(f, "\t\tident { %s } { }\n", u->username);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477 fprintf(f, "\t\tuser_info {");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478 c = u->user_info;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479 while(*c) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
480 /* This is not as silly as it looks. */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481 if (*c == '\n') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 nl++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
483 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
484 if (nl) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485 while(nl) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
486 fprintf(f, "\n\t\t\t");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
487 nl--;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
488 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
489 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
490 fprintf(f, "%c", *c);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492 c++;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 fprintf(f, "\n\t\t}\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 static void gaimrc_read_users(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 char buf[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502 struct aim_user *u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504 int cur = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 buf[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 while (buf[0] != '}') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 p = parse_line(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
519 if (!strcmp(p->option, "current_user")) {
158
e9414f13d8b7 [gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 156
diff changeset
520 cur = 1;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521 } else if (strcmp(p->option, "user")) {
158
e9414f13d8b7 [gaim-migrate @ 168]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 156
diff changeset
522 cur = 0;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523 continue;
159
d56878f647fb [gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
524 } else {
d56878f647fb [gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
525 cur = 0;
d56878f647fb [gaim-migrate @ 169]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 158
diff changeset
526 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528 u = gaimrc_read_user(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 if (cur)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 current_user = u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 aim_users = g_list_append(aim_users, u);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537 static void gaimrc_write_users(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 GList *usr = aim_users;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540 struct aim_user *u;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 fprintf(f, "users {\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 while(usr) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545 u = (struct aim_user *)usr->data;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 if (current_user == u) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547 fprintf(f, "\tcurrent_user {\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 fprintf(f, "\tuser {\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
550 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 gaimrc_write_user(f, u);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553 fprintf(f, "\t}\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 usr = usr->next;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558 fprintf(f, "}\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
559 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564 static void gaimrc_read_options(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
565 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 char buf[2048];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 struct parse *p;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 buf[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 while (buf[0] != '}') {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 if (buf[0] == '#')
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573 continue;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
574
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 if (!fgets(buf, sizeof(buf), f))
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578 p = parse_line(buf);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580 if (!strcmp(p->option, "general_options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581 general_options = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 } else if (!strcmp(p->option, "display_options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 display_options = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 } else if (!strcmp(p->option, "sound_options")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585 sound_options = atoi(p->value[0]);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
586 } else if (!strcmp(p->option, "font_options")) {
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
587 font_options = atoi(p->value[0]);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
588 } else if (!strcmp(p->option, "font_face")) {
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
589 if (p->value[0] != NULL)
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
590 g_snprintf(fontface, sizeof(fontface), "%s", p->value[0]);
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
591 } else if (!strcmp(p->option, "foreground")) {
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
592 fgcolor.red = atoi(p->value[0]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
593 fgcolor.green = atoi(p->value[1]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
594 fgcolor.blue = atoi(p->value[2]);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
595 } else if (!strcmp(p->option, "background")) {
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
596 bgcolor.red = atoi(p->value[0]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
597 bgcolor.green = atoi(p->value[1]);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
598 bgcolor.blue = atoi(p->value[2]);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 } else if (!strcmp(p->option, "report_idle")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600 report_idle = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
601 } else if (!strcmp(p->option, "web_browser")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
602 web_browser = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 } else if (!strcmp(p->option, "web_command")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
604 strcpy(web_command, p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
605 } else if (!strcmp(p->option, "proxy_type")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
606 proxy_type = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
607 } else if (!strcmp(p->option, "proxy_host")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
608 strcpy(proxy_host, p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
609 } else if (!strcmp(p->option, "proxy_port")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610 proxy_port = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
611 } else if (!strcmp(p->option, "aim_host")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 strcpy(aim_host, p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613 } else if (!strcmp(p->option, "aim_port")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
614 aim_port = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615 } else if (!strcmp(p->option, "login_host")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
616 strcpy(login_host, p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
617 } else if (!strcmp(p->option, "login_port")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618 login_port = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619 } else if (!strcmp(p->option, "blist_pos")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620 blist_pos.x = atoi(p->value[0]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
621 blist_pos.y = atoi(p->value[1]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
622 blist_pos.width = atoi(p->value[2]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623 blist_pos.height = atoi(p->value[3]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 blist_pos.xoff = atoi(p->value[4]);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625 blist_pos.yoff = atoi(p->value[5]);
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 44
diff changeset
626 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632 static void gaimrc_write_options(FILE *f)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 fprintf(f, "options {\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 fprintf(f, "\tgeneral_options { %d }\n", general_options);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637 fprintf(f, "\tdisplay_options { %d }\n", display_options);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 fprintf(f, "\tsound_options { %d }\n", sound_options);
666
71ea550c22ac [gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 570
diff changeset
639 fprintf(f, "\tfont_options { %d }\n", font_options);
232
f930b55a7367 [gaim-migrate @ 242]
Rob Flynn <gaim@robflynn.com>
parents: 230
diff changeset
640 if (fontface)
230
83dd297aa363 [gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 180
diff changeset
641 fprintf(f, "\tfont_face { %s }\n", fontface);
697
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
642 fprintf(f, "\tforeground { %d } { %d } { %d }\n", fgcolor.red, fgcolor.green, fgcolor.blue);
c7c0d2590681 [gaim-migrate @ 707]
Todd Kulesza <fflewddur>
parents: 690
diff changeset
643 fprintf(f, "\tbackground { %d } { %d } { %d }\n", bgcolor.red, bgcolor.green, bgcolor.blue);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644 fprintf(f, "\treport_idle { %d }\n", report_idle);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 fprintf(f, "\tweb_browser { %d }\n", web_browser);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 fprintf(f, "\tweb_command { %s }\n", web_command);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 fprintf(f, "\tproxy_type { %d }\n", proxy_type);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 fprintf(f, "\tproxy_host { %s }\n", proxy_host);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 fprintf(f, "\tproxy_port { %d }\n", proxy_port);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 fprintf(f, "\taim_host { %s }\n", aim_host);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651 fprintf(f, "\taim_port { %d }\n", aim_port);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 fprintf(f, "\tlogin_host { %s }\n", login_host);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653 fprintf(f, "\tlogin_port { %d }\n", login_port);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 fprintf(f, "\tblist_pos { %d } { %d } { %d } { %d } { %d } { %d }\n",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 blist_pos.x, blist_pos.y, blist_pos.width, blist_pos.height,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656 blist_pos.xoff, blist_pos.yoff);
180
0ff9f19b9b23 [gaim-migrate @ 190]
Rob Flynn <gaim@robflynn.com>
parents: 159
diff changeset
657 fprintf(f, "\tlatest_ver { %s }\n", latest_ver);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 fprintf(f, "}\n");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
659 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 void set_defaults()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 {
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
664 if (aim_users)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
665 {
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
666 g_list_free(aim_users);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
667 aim_users = NULL;
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
668 }
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
669 if (away_messages)
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
670 {
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
671 g_list_free(away_messages);
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
672 away_messages = NULL;
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
673 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 general_options =
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 OPT_GEN_SEND_LINKS |
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676 OPT_GEN_ENTER_SENDS |
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 OPT_GEN_SAVED_WINDOWS |
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 OPT_GEN_REMEMBER_PASS |
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
679 OPT_GEN_REGISTERED |
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
680 OPT_GEN_NEAR_APPLET;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 display_options =
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 OPT_DISP_SHOW_IDLETIME |
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 OPT_DISP_SHOW_TIME |
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 OPT_DISP_SHOW_PIXMAPS |
453
dd82845ed7b6 [gaim-migrate @ 463]
Syd Logan <slogan>
parents: 349
diff changeset
685 OPT_DISP_SHOW_BUDDYTICKER |
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686 OPT_DISP_SHOW_BUTTON_XPM;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687 font_options = 0;
156
595c26ef5527 [gaim-migrate @ 166]
Rob Flynn <gaim@robflynn.com>
parents: 142
diff changeset
688 sound_options = OPT_SOUND_LOGIN | OPT_SOUND_LOGOUT | OPT_SOUND_RECV | OPT_SOUND_SEND | OPT_SOUND_SILENT_SIGNON;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689 report_idle = IDLE_GAIM;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690 web_browser = BROWSER_NETSCAPE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
691 proxy_type = PROXY_NONE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
692
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
693 aim_port = TOC_PORT;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694 login_port = AUTH_PORT;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 g_snprintf(aim_host, sizeof(aim_host), "%s", TOC_HOST);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696 g_snprintf(login_host, sizeof(login_host), "%s", AUTH_HOST);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697 proxy_host[0] = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698 proxy_port = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699 g_snprintf(web_command, sizeof(web_command), "xterm -e lynx %%s");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700 blist_pos.width = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701 blist_pos.height = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702 blist_pos.x = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
703 blist_pos.y = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
704 blist_pos.xoff = 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705 blist_pos.yoff = 0;
180
0ff9f19b9b23 [gaim-migrate @ 190]
Rob Flynn <gaim@robflynn.com>
parents: 159
diff changeset
706 g_snprintf(latest_ver, BUF_LONG, "%s", VERSION);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
707 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
708
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 void load_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
712 FILE *f;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
713 char buf[1024];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
714 int ver = 0;
570
93c65fbaa622 [gaim-migrate @ 580]
Todd Kulesza <fflewddur>
parents: 453
diff changeset
715
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716 if (getenv("HOME")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717 g_snprintf(buf, sizeof(buf), "%s/.gaimrc", getenv("HOME"));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718 if ((f = fopen(buf,"r"))) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
719 fgets(buf, sizeof(buf), f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
720 sscanf(buf, "# .gaimrc v%d", &ver);
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
721 if ( (ver <= 1) || (buf[0] != '#')) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
722 fclose(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723 set_defaults();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724 save_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
725 load_prefs();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
726 return;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728 while(!feof(f)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729 switch(gaimrc_parse_tag(f)) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730 case -1:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731 /* Let the loop end, EOF*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 case 0:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734 gaimrc_read_users(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 case 1:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737 gaimrc_read_options(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739 case 2:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
740 gaimrc_read_away(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741 break;
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
742 #ifdef GAIM_PLUGINS
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
743 case 3:
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
744 gaimrc_read_plugins(f);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
745 break;
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
746 #endif
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
747 case 4:
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
748 gaimrc_read_pounce(f);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
749 break;
774
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
750 case 5:
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
751 gaimrc_read_chat(f);
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
752 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 default:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
754 /* NOOP */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758 fclose(f);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764 void save_prefs()
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
766 FILE *f;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
767 char buf[BUF_LONG];
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
768
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
769 if (getenv("HOME")) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 g_snprintf(buf, sizeof(buf), "%s/.gaimrc", getenv("HOME"));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
771 if ((f = fopen(buf,"w"))) {
15
b9cc0a3a68b2 [gaim-migrate @ 24]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
772 fprintf(f, "# .gaimrc v%d\n", 2);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 gaimrc_write_users(f);
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
774 gaimrc_write_options(f);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
775 gaimrc_write_away(f);
142
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
776 #ifdef GAIM_PLUGINS
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
777 gaimrc_write_plugins(f);
fbabd28795d2 [gaim-migrate @ 152]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 131
diff changeset
778 #endif
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
779 gaimrc_write_pounce(f);
774
b61607d6c2af [gaim-migrate @ 784]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 697
diff changeset
780 gaimrc_write_chat(f);
673
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
781 fclose(f);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
782 chmod(buf, S_IRUSR | S_IWUSR);
ddc3fd0dcd51 [gaim-migrate @ 683]
Rob Flynn <gaim@robflynn.com>
parents: 666
diff changeset
783 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786