- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo2_callbacks.h
rba16895 r9034ba0 30 30 */ 31 31 32 33 32 #ifndef YAHOO2_CALLBACKS_H 34 33 #define YAHOO2_CALLBACKS_H … … 46 45 */ 47 46 48 typedef enum {49 YAHOO_INPUT_READ = 1 << 0,50 YAHOO_INPUT_WRITE = 1 << 1,51 YAHOO_INPUT_EXCEPTION = 1 << 252 } yahoo_input_condition;47 typedef enum { 48 YAHOO_INPUT_READ = 1 << 0, 49 YAHOO_INPUT_WRITE = 1 << 1, 50 YAHOO_INPUT_EXCEPTION = 1 << 2 51 } yahoo_input_condition; 53 52 54 53 /* … … 56 55 * 57 56 * Params: 58 * fd - The file descriptor that has been connected, or -1 on error 57 * fd - The file descriptor object that has been connected, or NULL on 58 * error 59 59 * error - The value of errno set by the call to connect or 0 if no error 60 60 * Set both fd and error to 0 if the connect was cancelled by the … … 63 63 * function 64 64 */ 65 typedef void (*yahoo_connect_callback)(int fd, int error, void *callback_data); 66 65 typedef void (*yahoo_connect_callback) (void *fd, int error, 66 void *callback_data); 67 67 68 68 /* … … 94 94 * url - url to reactivate account if locked 95 95 */ 96 void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, const char *url); 97 96 void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response) (int id, int succ, 97 const char *url); 98 98 99 99 /* … … 104 104 * buds - the buddy list 105 105 */ 106 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies)(int id, YList * buds); 107 106 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies) (int id, YList *buds); 108 107 109 108 /* … … 114 113 * igns - the ignore list 115 114 */ 116 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore)(int id, YList * igns); 117 115 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore) (int id, YList *igns); 118 116 119 117 /* … … 124 122 * ids - the identity list 125 123 */ 126 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities)(int id, YList * ids); 127 124 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities) (int id, YList *ids); 128 125 129 126 /* … … 133 130 * id - the id that identifies the server connection 134 131 */ 135 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies)(int id); 136 132 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies) (int id); 137 133 138 134 /* … … 143 139 * errormsg - optional error message 144 140 */ 145 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping)(int id, const char *errormsg); 146 141 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping) (int id, 142 const char *errormsg); 147 143 148 144 /* … … 159 155 * TODO: add support for pager, chat, and game states 160 156 */ 161 void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, const char *who, int stat, const char *msg, int away, int idle, int mobile); 162 157 void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed) (int id, 158 const char *who, int stat, const char *msg, int away, int idle, 159 int mobile); 160 161 /* 162 * Name: ext_yahoo_got_buzz 163 * Called when remote user sends you a buzz. 164 * Params: 165 * id - the id that identifies the server connection 166 * me - the identity the message was sent to 167 * who - the handle of the remote user 168 * tm - timestamp of message if offline 169 */ 170 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buzz) (int id, const char *me, 171 const char *who, long tm); 163 172 164 173 /* … … 177 186 * utf8 - whether the message is encoded as utf8 or not 178 187 */ 179 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8); 180 188 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im) (int id, const char *me, 189 const char *who, const char *msg, long tm, int stat, int utf8); 181 190 182 191 /* … … 191 200 * members - the initial members of the conference (null terminated list) 192 201 */ 193 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, const char *me, const char *who, const char *room, const char *msg, YList *members); 194 202 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite) (int id, 203 const char *me, const char *who, const char *room, 204 const char *msg, YList *members); 195 205 196 206 /* … … 204 214 * msg - the declining message 205 215 */ 206 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, const char *me, const char *who, const char *room, const char *msg); 207 216 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline) (int id, 217 const char *me, const char *who, const char *room, 218 const char *msg); 208 219 209 220 /* … … 216 227 * room - the room joined 217 228 */ 218 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, const char *me, const char *who, const char *room); 219 229 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin) (int id, 230 const char *me, const char *who, const char *room); 220 231 221 232 /* … … 228 239 * room - the room left 229 240 */ 230 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, const char *me, const char *who, const char *room); 231 241 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave) (int id, 242 const char *me, const char *who, const char *room); 232 243 233 244 /* … … 238 249 * xml - ? 239 250 */ 240 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml); 241 251 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml) (int id, 252 const char *xml); 242 253 243 254 /* … … 252 263 * members - the initial members of the chatroom (null terminated YList 253 264 * of yahoo_chat_member's) Must be freed by the client 254 * fd - the socket where the connection is coming from (for tracking)255 */ 256 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, const char *me, const char *room, const char *topic, YList *members, int fd); 257 265 * fd - the object where the connection is coming from (for tracking) 266 */ 267 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join) (int id, const char *me, 268 const char *room, const char *topic, YList *members, void *fd); 258 269 259 270 /* … … 266 277 * who - the user who has joined, Must be freed by the client 267 278 */ 268 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, const char *me, const char *room, struct yahoo_chat_member *who); 269 279 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin) (int id, 280 const char *me, const char *room, 281 struct yahoo_chat_member *who); 270 282 271 283 /* … … 278 290 * who - the user who has left (Just the User ID) 279 291 */ 280 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, const char *me, const char *room, const char *who); 281 292 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave) (int id, 293 const char *me, const char *room, const char *who); 282 294 283 295 /* … … 294 306 * utf8 - whether the message is utf8 encoded or not 295 307 */ 296 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, const char *me, const char *who, const char *room, const char *msg, int msgtype, int utf8); 297 308 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message) (int id, 309 const char *me, const char *who, const char *room, 310 const char *msg, int msgtype, int utf8); 298 311 299 312 /* … … 310 323 * nothing. 311 324 */ 312 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id, const char *me); 313 325 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout) (int id, 326 const char *me); 314 327 315 328 /* … … 327 340 * nothing. 328 341 */ 329 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id, const char *me); 330 342 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror) (int id, 343 const char *me); 331 344 332 345 /* … … 341 354 * utf8 - whether the message is utf8 encoded or not 342 355 */ 343 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, const char *me, const char *who, const char *room, const char *msg, int utf8); 344 356 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message) (int id, 357 const char *me, const char *who, const char *room, 358 const char *msg, int utf8); 345 359 346 360 /* … … 351 365 * me - the identity the file was sent to 352 366 * who - the user who sent the file 353 * url - the file url354 * expires - the expiry date of the file on the server (timestamp)355 367 * msg - the message 356 368 * fname- the file name if direct transfer 357 369 * fsize- the file size if direct transfer 358 */ 359 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, const char *me, const char *who, const char *url, long expires, const char *msg, const char *fname, unsigned long fesize); 360 361 362 /* 363 * Name: ext_yahoo_contact_auth_request 364 * Called when a contact wants to add you to his/her contact list 365 * Params: 366 * id - the id that identifies the server connection 367 * myid - the identity s/he added 368 * who - who did it 369 * msg - any message sent 370 */ 371 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_auth_request)(int id, const char *myid, const char *who, const char *msg); 372 370 * trid - transfer id. Unique for this transfer 371 * 372 * NOTE: Subsequent callbacks for file transfer do not send all of this 373 * information again since it is wasteful. Implementations are expected to 374 * save this information and supply it as callback data when the file or 375 * confirmation is sent 376 */ 377 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file) (int id, const char *me, 378 const char *who, const char *msg, const char *fname, 379 unsigned long fesize, char *trid); 380 381 /* 382 * Name: ext_yahoo_got_ft_data 383 * Called multiple times when parts of the file are received 384 * Params: 385 * id - the id that identifies the server connection 386 * in - The data 387 * len - Length of the data 388 * data - callback data 389 */ 390 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ft_data) (int id, 391 const unsigned char *in, int len, void *data); 392 393 /* 394 * Name: ext_yahoo_file_transfer_done 395 * File transfer is done 396 * Params: 397 * id - the id that identifies the server connection 398 * result - To notify if it finished successfully or with a failure 399 * data - callback data 400 */ 401 void YAHOO_CALLBACK_TYPE(ext_yahoo_file_transfer_done) (int id, 402 int result, void *data); 373 403 374 404 /* … … 381 411 * msg - any message sent 382 412 */ 383 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, const char *myid, const char *who, const char *msg); 384 413 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added) (int id, 414 const char *myid, const char *who, const char *msg); 385 415 386 416 /* … … 392 422 * msg - any message sent 393 423 */ 394 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, const char *who, const char *msg); 395 424 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected) (int id, const char *who, 425 const char *msg); 396 426 397 427 /* … … 404 434 * stat - 1 if typing, 0 if stopped typing 405 435 */ 406 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, const char *me, const char *who, int stat); 407 436 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify) (int id, 437 const char *me, const char *who, int stat); 408 438 409 439 /* … … 415 445 * who - the handle of the remote user 416 446 * stat - 1 if game, 0 if stopped gaming 417 */ 418 void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, const char *me, const char *who, int stat); 419 447 * msg - game description and/or other text 448 */ 449 void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify) (int id, const char *me, 450 const char *who, int stat, const char *msg); 420 451 421 452 /* … … 428 459 * cnt - mail count - 0 if new mail notification 429 460 */ 430 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, const char *from, const char *subj, int cnt); 431 461 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify) (int id, 462 const char *from, const char *subj, int cnt); 432 463 433 464 /* … … 436 467 * Params: 437 468 * id - the id that identifies the server connection 469 * me - the handle of the identity the notification is sent to 470 * who - the source of the system message (there are different types) 438 471 * msg - the message 439 472 */ 440 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, const char *msg); 473 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message) (int id, 474 const char *me, const char *who, const char *msg); 441 475 442 476 /* … … 450 484 * checksum - the checksum of the icon content 451 485 */ 452 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon)(int id, const char *me, const char *who, const char *url, int checksum); 486 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon) (int id, 487 const char *me, const char *who, const char *url, int checksum); 453 488 454 489 /* … … 461 496 * checksum - the checksum of the icon content 462 497 */ 463 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum)(int id, const char *me,const char *who, int checksum); 498 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum) (int id, 499 const char *me, const char *who, int checksum); 464 500 465 501 /* … … 471 507 * who - the yahoo id of the buddy that requested the buddy icon 472 508 */ 473 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request)(int id, const char *me, const char *who); 509 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request) (int id, 510 const char *me, const char *who); 474 511 475 512 /* … … 480 517 * url - remote url, the uploaded buddy icon can be fetched from 481 518 */ 482 void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded)(int id, const char *url); 519 void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded) (int id, 520 const char *url); 483 521 484 522 /* … … 505 543 * a timestamp to stay in sync 506 544 */ 507 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image)(int id, const char * who, 508 const unsigned char *image, unsigned int image_size, unsigned int real_size, 545 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image) (int id, 546 const char *who, const unsigned char *image, 547 unsigned int image_size, unsigned int real_size, 509 548 unsigned int timestamp); 510 511 549 512 550 /* … … 518 556 * from - who the invitation is from 519 557 */ 520 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, const char *me, const char *from); 521 558 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite) (int id, 559 const char *me, const char *from); 522 560 523 561 /* … … 530 568 * accept - 0 (decline), 1 (accept) 531 569 */ 532 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, const char *me, const char *from, int accept); 533 570 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply) (int id, 571 const char *me, const char *from, int accept); 534 572 535 573 /* … … 545 583 * 4 = user does not have webcam online 546 584 */ 547 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, const char *who, int reason); 548 585 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed) (int id, 586 const char *who, int reason); 549 587 550 588 /* … … 560 598 * if you need to use the information, make a copy 561 599 */ 562 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result)(int id, int found, int start, int total, YList *contacts); 563 600 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result) (int id, 601 int found, int start, int total, YList *contacts); 564 602 565 603 /* … … 572 610 * num - Which error is this 573 611 */ 574 void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, const char *err, int fatal, int num); 575 612 void YAHOO_CALLBACK_TYPE(ext_yahoo_error) (int id, const char *err, 613 int fatal, int num); 576 614 577 615 /* … … 583 621 * connect - 0=disconnect 1=connect 2=request 584 622 */ 585 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, const char *who, int connect); 586 623 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer) (int id, 624 const char *who, int connect); 587 625 588 626 /* … … 593 631 * send - whether to send images or not 594 632 */ 595 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send); 596 633 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request) (int id, 634 int send); 597 635 598 636 /* … … 604 642 * 0 605 643 */ 606 int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...); 607 644 int YAHOO_CALLBACK_TYPE(ext_yahoo_log) (const char *fmt, ...); 608 645 609 646 /* … … 614 651 * Params: 615 652 * id - the id that identifies the server connection 616 * fd - the fd o n which to listen653 * fd - the fd object on which to listen 617 654 * cond - the condition on which to call the callback 618 655 * data - callback data to pass to yahoo_*_ready … … 620 657 * Returns: a tag to be used when removing the handler 621 658 */ 622 int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, int fd, yahoo_input_condition cond, void *data); 623 659 int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler) (int id, void *fd, 660 yahoo_input_condition cond, void *data); 624 661 625 662 /* … … 630 667 * tag - the handler tag to remove 631 668 */ 632 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag); 633 669 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler) (int id, int tag); 634 670 635 671 /* … … 642 678 * a unix file descriptor to the socket 643 679 */ 644 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(const char *host, int port); 645 680 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect) (const char *host, int port); 646 681 647 682 /* 648 683 * Name: ext_yahoo_connect_async 649 * Connect to a host:port asynchronously. 684 * Connect to a host:port asynchronously. This function should return 650 685 * immediately returing a tag used to identify the connection handler, 651 686 * or a pre-connect error (eg: host name lookup failure). … … 660 695 * callback - function to call when connect completes 661 696 * callback_data - data to pass to the callback function 662 * Returns: 663 * a unix file descriptor to the socket 664 */ 665 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, const char *host, int port, 666 yahoo_connect_callback callback, void *callback_data); 697 * use_ssl - Whether we need an SSL connection 698 * Returns: 699 * a tag signifying the connection attempt 700 */ 701 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async) (int id, 702 const char *host, int port, yahoo_connect_callback callback, 703 void *callback_data, int use_ssl); 704 705 /* 706 * Name: ext_yahoo_get_ip_addr 707 * get IP Address for a domain name 708 * Params: 709 * domain - Domain name 710 * Returns: 711 * Newly allocated string containing the IP Address in IPv4 notation 712 */ 713 char *YAHOO_CALLBACK_TYPE(ext_yahoo_get_ip_addr) (const char *domain); 714 715 /* 716 * Name: ext_yahoo_write 717 * Write data from the buffer into the socket for the specified connection 718 * Params: 719 * fd - the file descriptor object that identifies this connection 720 * buf - Buffer to write the data from 721 * len - Length of the data 722 * Returns: 723 * Number of bytes written or -1 for error 724 */ 725 int YAHOO_CALLBACK_TYPE(ext_yahoo_write) (void *fd, char *buf, int len); 726 727 /* 728 * Name: ext_yahoo_read 729 * Read data into a buffer from socket for the specified connection 730 * Params: 731 * fd - the file descriptor object that identifies this connection 732 * buf - Buffer to read the data into 733 * len - Max length to read 734 * Returns: 735 * Number of bytes read or -1 for error 736 */ 737 int YAHOO_CALLBACK_TYPE(ext_yahoo_read) (void *fd, char *buf, int len); 738 739 /* 740 * Name: ext_yahoo_close 741 * Close the file descriptor object and free its resources. Libyahoo2 will not 742 * use this object again. 743 * Params: 744 * fd - the file descriptor object that identifies this connection 745 * Returns: 746 * Nothing 747 */ 748 void YAHOO_CALLBACK_TYPE(ext_yahoo_close) (void *fd); 749 750 /* 751 * Name: ext_yahoo_got_buddy_change_group 752 * Acknowledgement of buddy changing group 753 * Params: 754 * id: client id 755 * me: The user 756 * who: Buddy name 757 * old_group: Old group name 758 * new_group: New group name 759 * Returns: 760 * Nothing 761 */ 762 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddy_change_group) (int id, 763 const char *me, const char *who, const char *old_group, 764 const char *new_group); 667 765 668 766 #ifdef USE_STRUCT_CALLBACKS … … 673 771 * before doing anything else 674 772 */ 675 void yahoo_register_callbacks(struct yahoo_callbacks * 773 void yahoo_register_callbacks(struct yahoo_callbacks *tyc); 676 774 677 775 #undef YAHOO_CALLBACK_TYPE … … 684 782 685 783 #endif 686
Note: See TracChangeset
for help on using the changeset viewer.