Sat, 28 Oct 2006 20:04:03 +0000
[gaim-migrate @ 17606]
Add a "handle" parameter to gaim_proxy_connect(). It seemed like
people thought this was a good idea. You can still cancel
each gaim_proxy_connect() individually, if needed. I passed in
NULL for the handle in most places. It might be better to pass
in the gc in more places, but these changes do no harm, and they
should help some Yahoo! things, and I wanted to get the API change in.
| 2086 | 1 | /* This file is part of the Project Athena Zephyr Notification System. |
| 2 | * It contains source for the ZPeekIfNotice function. | |
| 3 | * | |
| 4 | * Created by: Robert French | |
| 5 | * | |
| 6 | * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. | |
| 7 | * For copying and distribution information, see the file | |
| 8 | * "mit-copyright.h". | |
| 9 | */ | |
| 10 | ||
|
8792
b0645c9dc276
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
11 | #include "internal.h" |
| 2086 | 12 | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
13 | #if 0 |
| 2086 | 14 | Code_t ZPeekIfNotice(notice, from, predicate, args) |
| 15 | ZNotice_t *notice; | |
| 16 | struct sockaddr_in *from; | |
| 17 | int (*predicate)(); | |
| 18 | char *args; | |
| 19 | { | |
| 20 | ZNotice_t tmpnotice; | |
| 21 | Code_t retval; | |
| 22 | char *buffer; | |
| 23 | struct _Z_InputQ *qptr; | |
| 24 | ||
| 25 | if ((retval = Z_WaitForComplete()) != ZERR_NONE) | |
| 26 | return (retval); | |
| 27 | ||
| 28 | for (;;) { | |
| 29 | qptr = Z_GetFirstComplete(); | |
| 30 | while (qptr) { | |
| 31 | if ((retval = ZParseNotice(qptr->packet, qptr->packet_len, | |
| 32 | &tmpnotice)) != ZERR_NONE) | |
| 33 | return (retval); | |
| 34 | if ((*predicate)(&tmpnotice, args)) { | |
| 35 | if (!(buffer = (char *) malloc((unsigned) qptr->packet_len))) | |
| 36 | return (ENOMEM); | |
| 37 | (void) memcpy(buffer, qptr->packet, qptr->packet_len); | |
| 38 | if (from) | |
| 39 | *from = qptr->from; | |
| 40 | if ((retval = ZParseNotice(buffer, qptr->packet_len, | |
| 41 | notice)) != ZERR_NONE) { | |
| 42 | free(buffer); | |
| 43 | return (retval); | |
| 44 | } | |
| 45 | return (ZERR_NONE); | |
| 46 | } | |
| 47 | qptr = Z_GetNextComplete(qptr); | |
| 48 | } | |
| 49 | if ((retval = Z_ReadWait()) != ZERR_NONE) | |
| 50 | return (retval); | |
| 51 | } | |
| 52 | } | |
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
53 | #endif |