Mercurial > pidgin.yaz
comparison libfaim/aim_info.c @ 840:595ac7759563
[gaim-migrate @ 850]
lots of (mostly useless for us) libfaim changes. should help portability, but it was always portable between unices.... stupid win32ers.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 04 Sep 2000 23:37:32 +0000 |
parents | 88f8f98de02d |
children | e1da6a6ec42b |
comparison
equal
deleted
inserted
replaced
839:8f66e00af045 | 840:595ac7759563 |
---|---|
12 struct aim_priv_inforeq { | 12 struct aim_priv_inforeq { |
13 char sn[MAXSNLEN]; | 13 char sn[MAXSNLEN]; |
14 unsigned short infotype; | 14 unsigned short infotype; |
15 }; | 15 }; |
16 | 16 |
17 u_long aim_getinfo(struct aim_session_t *sess, | 17 faim_export unsigned long aim_getinfo(struct aim_session_t *sess, |
18 struct aim_conn_t *conn, | 18 struct aim_conn_t *conn, |
19 const char *sn, | 19 const char *sn, |
20 unsigned short infotype) | 20 unsigned short infotype) |
21 { | 21 { |
22 struct command_tx_struct *newpacket; | 22 struct command_tx_struct *newpacket; |
23 int i = 0; | 23 int i = 0; |
24 | 24 |
25 if (!sess || !conn || !sn) | 25 if (!sess || !conn || !sn) |
55 } | 55 } |
56 | 56 |
57 return (sess->snac_nextid++); | 57 return (sess->snac_nextid++); |
58 } | 58 } |
59 | 59 |
60 int aim_parse_locateerr(struct aim_session_t *sess, | 60 faim_internal int aim_parse_locateerr(struct aim_session_t *sess, |
61 struct command_rx_struct *command) | 61 struct command_rx_struct *command) |
62 { | 62 { |
63 u_long snacid = 0x000000000; | 63 u_long snacid = 0x000000000; |
64 struct aim_snac_t *snac = NULL; | 64 struct aim_snac_t *snac = NULL; |
65 int ret = 0; | 65 int ret = 0; |
66 rxcallback_t userfunc = NULL; | 66 rxcallback_t userfunc = NULL; |
129 /* Send file */ | 129 /* Send file */ |
130 {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, | 130 {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, |
131 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} | 131 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00} |
132 }; | 132 }; |
133 | 133 |
134 u_short aim_getcap(unsigned char *capblock, int buflen) | 134 faim_internal unsigned short aim_getcap(unsigned char *capblock, int buflen) |
135 { | 135 { |
136 u_short ret = 0; | 136 u_short ret = 0; |
137 int y; | 137 int y; |
138 int offset = 0; | 138 int offset = 0; |
139 | 139 |
154 offset += 0x10; | 154 offset += 0x10; |
155 } | 155 } |
156 return ret; | 156 return ret; |
157 } | 157 } |
158 | 158 |
159 int aim_putcap(unsigned char *capblock, int buflen, u_short caps) | 159 faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps) |
160 { | 160 { |
161 int offset = 0; | 161 int offset = 0; |
162 | 162 |
163 if (!capblock) | 163 if (!capblock) |
164 return -1; | 164 return -1; |
193 | 193 |
194 /* | 194 /* |
195 * AIM is fairly regular about providing user info. This | 195 * AIM is fairly regular about providing user info. This |
196 * is a generic routine to extract it in its standard form. | 196 * is a generic routine to extract it in its standard form. |
197 */ | 197 */ |
198 int aim_extractuserinfo(u_char *buf, struct aim_userinfo_s *outinfo) | 198 faim_internal int aim_extractuserinfo(u_char *buf, struct aim_userinfo_s *outinfo) |
199 { | 199 { |
200 int i = 0; | 200 int i = 0; |
201 int tlvcnt = 0; | 201 int tlvcnt = 0; |
202 int curtlv = 0; | 202 int curtlv = 0; |
203 int tlv1 = 0; | 203 int tlv1 = 0; |
419 * Oncoming Buddy notifications contain a subset of the | 419 * Oncoming Buddy notifications contain a subset of the |
420 * user information structure. Its close enough to run | 420 * user information structure. Its close enough to run |
421 * through aim_extractuserinfo() however. | 421 * through aim_extractuserinfo() however. |
422 * | 422 * |
423 */ | 423 */ |
424 int aim_parse_oncoming_middle(struct aim_session_t *sess, | 424 faim_internal int aim_parse_oncoming_middle(struct aim_session_t *sess, |
425 struct command_rx_struct *command) | 425 struct command_rx_struct *command) |
426 { | 426 { |
427 struct aim_userinfo_s userinfo; | 427 struct aim_userinfo_s userinfo; |
428 u_int i = 0; | 428 u_int i = 0; |
429 rxcallback_t userfunc=NULL; | 429 rxcallback_t userfunc=NULL; |
430 | 430 |
441 /* | 441 /* |
442 * Offgoing Buddy notifications contain no useful | 442 * Offgoing Buddy notifications contain no useful |
443 * information other than the name it applies to. | 443 * information other than the name it applies to. |
444 * | 444 * |
445 */ | 445 */ |
446 int aim_parse_offgoing_middle(struct aim_session_t *sess, | 446 faim_internal int aim_parse_offgoing_middle(struct aim_session_t *sess, |
447 struct command_rx_struct *command) | 447 struct command_rx_struct *command) |
448 { | 448 { |
449 char sn[MAXSNLEN+1]; | 449 char sn[MAXSNLEN+1]; |
450 u_int i = 0; | 450 u_int i = 0; |
451 rxcallback_t userfunc=NULL; | 451 rxcallback_t userfunc=NULL; |
452 | 452 |
453 strncpy(sn, command->data+11, (int)command->data[10]); | 453 strncpy(sn, (char *)command->data+11, (int)command->data[10]); |
454 sn[(int)command->data[10]] = '\0'; | 454 sn[(int)command->data[10]] = '\0'; |
455 | 455 |
456 userfunc = aim_callhandler(command->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING); | 456 userfunc = aim_callhandler(command->conn, AIM_CB_FAM_BUD, AIM_CB_BUD_OFFGOING); |
457 if (userfunc) | 457 if (userfunc) |
458 i = userfunc(sess, command, sn); | 458 i = userfunc(sess, command, sn); |
463 /* | 463 /* |
464 * This parses the user info stuff out all nice and pretty then calls | 464 * This parses the user info stuff out all nice and pretty then calls |
465 * the higher-level callback (in the user app). | 465 * the higher-level callback (in the user app). |
466 * | 466 * |
467 */ | 467 */ |
468 int aim_parse_userinfo_middle(struct aim_session_t *sess, | 468 faim_internal int aim_parse_userinfo_middle(struct aim_session_t *sess, |
469 struct command_rx_struct *command) | 469 struct command_rx_struct *command) |
470 { | 470 { |
471 struct aim_userinfo_s userinfo; | 471 struct aim_userinfo_s userinfo; |
472 char *text_encoding = NULL; | 472 char *text_encoding = NULL; |
473 char *text = NULL; | 473 char *text = NULL; |
474 u_int i = 0; | 474 u_int i = 0; |
546 } | 546 } |
547 | 547 |
548 /* | 548 /* |
549 * Inverse of aim_extractuserinfo() | 549 * Inverse of aim_extractuserinfo() |
550 */ | 550 */ |
551 int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info) | 551 faim_internal int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info) |
552 { | 552 { |
553 int i = 0; | 553 int i = 0; |
554 struct aim_tlvlist_t *tlvlist = NULL; | 554 struct aim_tlvlist_t *tlvlist = NULL; |
555 | 555 |
556 if (!buf || !info) | 556 if (!buf || !info) |
574 aim_freetlvchain(&tlvlist); | 574 aim_freetlvchain(&tlvlist); |
575 | 575 |
576 return i; | 576 return i; |
577 } | 577 } |
578 | 578 |
579 int aim_sendbuddyoncoming(struct aim_session_t *sess, struct aim_conn_t *conn, struct aim_userinfo_s *info) | 579 faim_export int aim_sendbuddyoncoming(struct aim_session_t *sess, struct aim_conn_t *conn, struct aim_userinfo_s *info) |
580 { | 580 { |
581 struct command_tx_struct *tx; | 581 struct command_tx_struct *tx; |
582 int i = 0; | 582 int i = 0; |
583 | 583 |
584 if (!sess || !conn || !info) | 584 if (!sess || !conn || !info) |
602 aim_tx_enqueue(sess, tx); | 602 aim_tx_enqueue(sess, tx); |
603 | 603 |
604 return 0; | 604 return 0; |
605 } | 605 } |
606 | 606 |
607 int aim_sendbuddyoffgoing(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn) | 607 faim_export int aim_sendbuddyoffgoing(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn) |
608 { | 608 { |
609 struct command_tx_struct *tx; | 609 struct command_tx_struct *tx; |
610 int i = 0; | 610 int i = 0; |
611 | 611 |
612 if (!sess || !conn || !sn) | 612 if (!sess || !conn || !sn) |