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 | /* |
| 2 | * Copyright 1987 by MIT Student Information Processing Board | |
| 3 | * | |
| 4 | * For copyright info, see mit-sipb-copyright.h. | |
| 5 | */ | |
| 6 | ||
| 7 | #include <sysdep.h> | |
| 8 | ||
| 8354 | 9 | |
| 10 | #define ERRCODE_RANGE 8 /* # of bits to shift table number */ | |
| 11 | #define BITS_PER_CHAR 6 /* # bits to shift per character in name */ | |
| 12 | ||
| 13 | ||
| 2086 | 14 | static const char char_set[] = |
| 15 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; | |
| 16 | ||
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
17 | /* Prototypes for -Wmissing-prototypes */ |
|
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
18 | const char * error_table_name(int num); |
|
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
19 | const char * error_table_name_r(int num, char *buf); |
|
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
20 | |
|
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
21 | const char * error_table_name_r(int num, char *buf) |
| 2086 | 22 | { |
| 23 | int ch; | |
| 24 | int i; | |
| 25 | char *p; | |
| 26 | ||
| 27 | /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */ | |
| 28 | p = buf; | |
| 29 | num >>= ERRCODE_RANGE; | |
| 30 | /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */ | |
| 31 | num &= 077777777; | |
| 32 | /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */ | |
| 33 | for (i = 4; i >= 0; i--) { | |
| 34 | ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1); | |
| 35 | if (ch != 0) | |
| 36 | *p++ = char_set[ch-1]; | |
| 37 | } | |
| 38 | *p = '\0'; | |
| 39 | return(buf); | |
| 40 | } | |
| 41 | ||
|
12424
af82a40f2488
[gaim-migrate @ 14731]
Richard Laager <rlaager@pidgin.im>
parents:
11105
diff
changeset
|
42 | const char * error_table_name(int num) |
| 2086 | 43 | { |
| 44 | static char buf[6]; | |
| 45 | ||
| 46 | return(error_table_name_r(num, buf)); | |
| 47 | } | |
| 48 |