Mercurial > pidgin
comparison src/core.c @ 2430:0ba75351a01b
[gaim-migrate @ 2443]
core.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 05 Oct 2001 19:52:11 +0000 |
parents | a2cc1cf4198f |
children | b4f2a53c0ee5 |
comparison
equal
deleted
inserted
replaced
2429:18b68d5cc7d8 | 2430:0ba75351a01b |
---|---|
34 #include <errno.h> | 34 #include <errno.h> |
35 #include <signal.h> | 35 #include <signal.h> |
36 #include <getopt.h> | 36 #include <getopt.h> |
37 | 37 |
38 #include "gaim.h" | 38 #include "gaim.h" |
39 | |
40 #if DEVEL | |
41 | 39 |
42 static gint UI_fd = -1; | 40 static gint UI_fd = -1; |
43 struct UI { | 41 struct UI { |
44 GIOChannel *channel; | 42 GIOChannel *channel; |
45 guint inpa; | 43 guint inpa; |
171 } else | 169 } else |
172 g_log(NULL, G_LOG_LEVEL_CRITICAL, "Unable to open socket: %s", strerror(errno)); | 170 g_log(NULL, G_LOG_LEVEL_CRITICAL, "Unable to open socket: %s", strerror(errno)); |
173 return fd; | 171 return fd; |
174 } | 172 } |
175 | 173 |
176 #endif /* DEVEL */ | |
177 | |
178 int core_main() | 174 int core_main() |
179 { | 175 { |
180 /* | 176 /* |
181 GMainLoop *loop; | 177 GMainLoop *loop; |
182 */ | 178 */ |
183 | 179 |
184 #if DEVEL | |
185 GIOChannel *channel; | 180 GIOChannel *channel; |
186 | 181 |
187 UI_fd = open_socket(); | 182 UI_fd = open_socket(); |
188 if (UI_fd < 0) | 183 if (UI_fd < 0) |
189 return 1; | 184 return 1; |
190 | 185 |
191 channel = g_io_channel_unix_new(UI_fd); | 186 channel = g_io_channel_unix_new(UI_fd); |
192 g_io_add_watch(channel, G_IO_IN, socket_readable, NULL); | 187 g_io_add_watch(channel, G_IO_IN, socket_readable, NULL); |
193 g_io_channel_unref(channel); | 188 g_io_channel_unref(channel); |
194 #endif | |
195 | 189 |
196 /* | 190 /* |
197 loop = g_main_new(TRUE); | 191 loop = g_main_new(TRUE); |
198 g_main_run(loop); | 192 g_main_run(loop); |
199 */ | 193 */ |
201 return 0; | 195 return 0; |
202 } | 196 } |
203 | 197 |
204 void core_quit() | 198 void core_quit() |
205 { | 199 { |
206 #ifdef DEVEL | |
207 char buf[1024]; | 200 char buf[1024]; |
208 close(UI_fd); | 201 close(UI_fd); |
209 sprintf(buf, "%s/gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), getpid()); | 202 sprintf(buf, "%s/gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), getpid()); |
210 unlink(buf); | 203 unlink(buf); |
211 #endif | 204 } |
212 } |