comparison src/core.c @ 2440:8306c042bac7

[gaim-migrate @ 2453] can load plugins. won't get any indication of it though. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 06 Oct 2001 02:25:46 +0000
parents 932adc1ac9ed
children 2c2c1f717616
comparison
equal deleted inserted replaced
2439:932adc1ac9ed 2440:8306c042bac7
36 #include <getopt.h> 36 #include <getopt.h>
37 37
38 #include "gaim.h" 38 #include "gaim.h"
39 39
40 static gint UI_fd = -1; 40 static gint UI_fd = -1;
41 struct UI {
42 GIOChannel *channel;
43 guint inpa;
44 };
45 GSList *uis = NULL; 41 GSList *uis = NULL;
46 42
47 gint UI_write(struct UI *ui, guchar *data, gint len) 43 gint UI_write(struct UI *ui, guchar *data, gint len)
48 { 44 {
49 guchar *send = g_new0(guchar, len + 6); 45 guchar *send = g_new0(guchar, len + 6);
68 } 64 }
69 65
70 static void meta_handler(struct UI *ui, guchar subtype, guchar *data) 66 static void meta_handler(struct UI *ui, guchar subtype, guchar *data)
71 { 67 {
72 switch (subtype) { 68 switch (subtype) {
73 case CUI_META_LIST: 69 case CUI_META_LIST:
74 break; 70 break;
75 case CUI_META_QUIT: 71 case CUI_META_QUIT:
76 while (uis) { 72 while (uis) {
77 ui = uis->data; 73 ui = uis->data;
78 uis = g_slist_remove(uis, ui);
79 g_io_channel_close(ui->channel);
80 g_source_remove(ui->inpa);
81 g_free(ui);
82 }
83 do_quit();
84 break;
85 case CUI_META_DETACH:
86 uis = g_slist_remove(uis, ui); 74 uis = g_slist_remove(uis, ui);
87 g_io_channel_close(ui->channel); 75 g_io_channel_close(ui->channel);
88 g_source_remove(ui->inpa); 76 g_source_remove(ui->inpa);
89 g_free(ui); 77 g_free(ui);
90 break; 78 }
91 default: 79 do_quit();
92 debug_printf("unhandled meta subtype %d\n", subtype); 80 break;
93 break; 81 case CUI_META_DETACH:
82 uis = g_slist_remove(uis, ui);
83 g_io_channel_close(ui->channel);
84 g_source_remove(ui->inpa);
85 g_free(ui);
86 break;
87 default:
88 debug_printf("unhandled meta subtype %d\n", subtype);
89 break;
94 } 90 }
95 } 91 }
96 92
97 static gint gaim_recv(GIOChannel *source, void *buf, gint len) 93 static gint gaim_recv(GIOChannel *source, void *buf, gint len)
98 { 94 {
160 156
161 switch (type) { 157 switch (type) {
162 case CUI_TYPE_META: 158 case CUI_TYPE_META:
163 meta_handler(ui, subtype, in); 159 meta_handler(ui, subtype, in);
164 break; 160 break;
165 /*
166 case CUI_TYPE_PLUGIN: 161 case CUI_TYPE_PLUGIN:
167 plugin_handler(ui, subtype, in); 162 plugin_handler(ui, subtype, in);
168 break; 163 break;
164 /*
169 case CUI_TYPE_USER: 165 case CUI_TYPE_USER:
170 user_handler(ui, subtype, in); 166 user_handler(ui, subtype, in);
171 break; 167 break;
172 case CUI_TYPE_CONN: 168 case CUI_TYPE_CONN:
173 conn_handler(ui, subtype, in); 169 conn_handler(ui, subtype, in);