Mercurial > pidgin
comparison src/protocols/irc/irc.c @ 3720:34c95669952f
[gaim-migrate @ 3853]
WIN32 ifdef removals
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 16 Oct 2002 21:14:51 +0000 |
parents | da6e3c984985 |
children | a20bf3d247ff |
comparison
equal
deleted
inserted
replaced
3719:5233e2276a72 | 3720:34c95669952f |
---|---|
136 } | 136 } |
137 | 137 |
138 static int irc_write(int fd, char *data, int len) | 138 static int irc_write(int fd, char *data, int len) |
139 { | 139 { |
140 debug_printf("IRC C: %s", data); | 140 debug_printf("IRC C: %s", data); |
141 #ifndef _WIN32 | |
142 return write(fd, data, len); | 141 return write(fd, data, len); |
143 #else | |
144 return send(fd, data, len, 0); | |
145 #endif | |
146 } | 142 } |
147 | 143 |
148 static struct conversation *irc_find_chat(struct gaim_connection *gc, char *name) | 144 static struct conversation *irc_find_chat(struct gaim_connection *gc, char *name) |
149 { | 145 { |
150 GSList *bcs = gc->buddy_chats; | 146 GSList *bcs = gc->buddy_chats; |
456 gchar buffer[IRC_BUF_LEN]; | 452 gchar buffer[IRC_BUF_LEN]; |
457 gchar buf[128]; | 453 gchar buf[128]; |
458 int n = 0, l; | 454 int n = 0, l; |
459 struct conversation *convo; | 455 struct conversation *convo; |
460 debug_printf("THIS IS TOO MUCH EFFORT\n"); | 456 debug_printf("THIS IS TOO MUCH EFFORT\n"); |
461 #ifndef _WIN32 | |
462 n = read (chat->fd, buffer, IRC_BUF_LEN); | 457 n = read (chat->fd, buffer, IRC_BUF_LEN); |
463 #else | |
464 n = recv (chat->fd, buffer, IRC_BUF_LEN, 0); | |
465 #endif | |
466 if (n > 0) { | 458 if (n > 0) { |
467 | 459 |
468 buffer[n] = 0; | 460 buffer[n] = 0; |
469 g_strstrip(buffer); | 461 g_strstrip(buffer); |
470 | 462 |
1421 struct irc_data *idata = gc->proto_data; | 1413 struct irc_data *idata = gc->proto_data; |
1422 int i = 0; | 1414 int i = 0; |
1423 gchar buf[1024]; | 1415 gchar buf[1024]; |
1424 gboolean off; | 1416 gboolean off; |
1425 | 1417 |
1426 #ifndef _WIN32 | |
1427 i = read(idata->fd, buf, 1024); | 1418 i = read(idata->fd, buf, 1024); |
1428 #else | |
1429 i = recv(idata->fd, buf, 1024, 0); | |
1430 #endif | |
1431 if (i <= 0) { | 1419 if (i <= 0) { |
1432 hide_login_progress_error(gc, "Read error"); | 1420 hide_login_progress_error(gc, "Read error"); |
1433 signoff(gc); | 1421 signoff(gc); |
1434 return; | 1422 return; |
1435 } | 1423 } |
1479 struct irc_data *idata; | 1467 struct irc_data *idata; |
1480 char hostname[256]; | 1468 char hostname[256]; |
1481 char buf[IRC_BUF_LEN]; | 1469 char buf[IRC_BUF_LEN]; |
1482 | 1470 |
1483 if (!g_slist_find(connections, gc)) { | 1471 if (!g_slist_find(connections, gc)) { |
1484 #ifndef _WIN32 | |
1485 close(source); | 1472 close(source); |
1486 #else | |
1487 closesocket(source); | |
1488 #endif | |
1489 return; | 1473 return; |
1490 } | 1474 } |
1491 | 1475 |
1492 idata = gc->proto_data; | 1476 idata = gc->proto_data; |
1493 | 1477 |
1599 g_source_remove(idata->timer); | 1583 g_source_remove(idata->timer); |
1600 | 1584 |
1601 if (gc->inpa) | 1585 if (gc->inpa) |
1602 gaim_input_remove(gc->inpa); | 1586 gaim_input_remove(gc->inpa); |
1603 | 1587 |
1604 #ifndef _WIN32 | |
1605 close(idata->fd); | 1588 close(idata->fd); |
1606 #else | |
1607 closesocket(idata->fd); | |
1608 #endif | |
1609 g_free(gc->proto_data); | 1589 g_free(gc->proto_data); |
1610 } | 1590 } |
1611 | 1591 |
1612 static void set_mode_3(struct gaim_connection *gc, char *who, int sign, int mode, | 1592 static void set_mode_3(struct gaim_connection *gc, char *who, int sign, int mode, |
1613 int start, int end, char *word[]) | 1593 int start, int end, char *word[]) |