comparison src/protocols/icq/gaim_icq.c @ 2090:b66aca8e8dce

[gaim-migrate @ 2100] change ../config.h to <config.h> because that's better. change from GdkInput functions to GaimInput for reasons mentioned elsewhere. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 31 Jul 2001 23:23:40 +0000
parents 424a40f12a6c
children 56c4382f2909
comparison
equal deleted inserted replaced
2089:bb1ddaaf0d26 2090:b66aca8e8dce
56 int socket; 56 int socket;
57 int type; 57 int type;
58 gint inpa; 58 gint inpa;
59 }; 59 };
60 60
61 static void gaim_icq_handler(gpointer data, gint source, GdkInputCondition cond) { 61 static void gaim_icq_handler(gpointer data, gint source, GaimInputCondition cond) {
62 if (cond & GDK_INPUT_READ) 62 if (cond & GAIM_INPUT_READ)
63 icq_HandleReadySocket(source, ICQ_SOCKET_READ); 63 icq_HandleReadySocket(source, ICQ_SOCKET_READ);
64 if (cond & GDK_INPUT_WRITE) 64 if (cond & GAIM_INPUT_WRITE)
65 icq_HandleReadySocket(source, ICQ_SOCKET_WRITE); 65 icq_HandleReadySocket(source, ICQ_SOCKET_WRITE);
66 } 66 }
67 67
68 static void icq_sock_notify(int socket, int type, int status) { 68 static void icq_sock_notify(int socket, int type, int status) {
69 struct gaim_sock *gs = NULL; 69 struct gaim_sock *gs = NULL;
70 if (status) { 70 if (status) {
71 GdkInputCondition cond; 71 GaimInputCondition cond;
72 if (type == ICQ_SOCKET_READ) 72 if (type == ICQ_SOCKET_READ)
73 cond = GDK_INPUT_READ; 73 cond = GAIM_INPUT_READ;
74 else 74 else
75 cond = GDK_INPUT_WRITE; 75 cond = GAIM_INPUT_WRITE;
76 gs = g_new0(struct gaim_sock, 1); 76 gs = g_new0(struct gaim_sock, 1);
77 gs->socket = socket; 77 gs->socket = socket;
78 gs->type = type; 78 gs->type = type;
79 gs->inpa = gdk_input_add(socket, cond, gaim_icq_handler, NULL); 79 gs->inpa = gaim_input_add(socket, cond, gaim_icq_handler, NULL);
80 sockets = g_list_append(sockets, gs); 80 sockets = g_list_append(sockets, gs);
81 debug_printf("Adding socket notifier: %d %d (%d)\n", socket, type, gs->inpa); 81 debug_printf("Adding socket notifier: %d %d (%d)\n", socket, type, gs->inpa);
82 } else { 82 } else {
83 GList *m = sockets; 83 GList *m = sockets;
84 while (m) { 84 while (m) {
86 if ((gs->socket == socket) && (gs->type == type)) 86 if ((gs->socket == socket) && (gs->type == type))
87 break; 87 break;
88 m = g_list_next(m); 88 m = g_list_next(m);
89 } 89 }
90 if (m) { 90 if (m) {
91 gdk_input_remove(gs->inpa); 91 gaim_input_remove(gs->inpa);
92 sockets = g_list_remove(sockets, gs); 92 sockets = g_list_remove(sockets, gs);
93 debug_printf("Removing socket notifier: %d %d (%d)\n", socket, type, gs->inpa); 93 debug_printf("Removing socket notifier: %d %d (%d)\n", socket, type, gs->inpa);
94 g_free(gs); 94 g_free(gs);
95 } 95 }
96 } 96 }