- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo2_callbacks.h
r9034ba0 rba16895 30 30 */ 31 31 32 32 33 #ifndef YAHOO2_CALLBACKS_H 33 34 #define YAHOO2_CALLBACKS_H … … 45 46 */ 46 47 47 48 49 50 51 48 typedef enum { 49 YAHOO_INPUT_READ = 1 << 0, 50 YAHOO_INPUT_WRITE = 1 << 1, 51 YAHOO_INPUT_EXCEPTION = 1 << 2 52 } yahoo_input_condition; 52 53 53 54 /* … … 55 56 * 56 57 * Params: 57 * fd - The file descriptor object that has been connected, or NULL on 58 * error 58 * fd - The file descriptor that has been connected, or -1 on 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) (void *fd, int error, 66 void *callback_data); 65 typedef void (*yahoo_connect_callback)(int fd, int error, void *callback_data); 66 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, 97 const char *url); 96 void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, const char *url); 97 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); 106 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies)(int id, YList * buds); 107 107 108 108 109 /* … … 113 114 * igns - the ignore list 114 115 */ 115 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore) (int id, YList *igns); 116 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore)(int id, YList * igns); 117 116 118 117 119 /* … … 122 124 * ids - the identity list 123 125 */ 124 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities) (int id, YList *ids); 126 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities)(int id, YList * ids); 127 125 128 126 129 /* … … 130 133 * id - the id that identifies the server connection 131 134 */ 132 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies) (int id); 135 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies)(int id); 136 133 137 134 138 /* … … 139 143 * errormsg - optional error message 140 144 */ 141 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping) (int id, 142 const char *errormsg); 145 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping)(int id, const char *errormsg); 146 143 147 144 148 /* … … 155 159 * TODO: add support for pager, chat, and game states 156 160 */ 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); 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 172 163 173 164 /* … … 186 177 * utf8 - whether the message is encoded as utf8 or not 187 178 */ 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); 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 190 181 191 182 /* … … 200 191 * members - the initial members of the conference (null terminated list) 201 192 */ 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); 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 205 195 206 196 /* … … 214 204 * msg - the declining message 215 205 */ 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); 206 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, const char *me, const char *who, const char *room, const char *msg); 207 219 208 220 209 /* … … 227 216 * room - the room joined 228 217 */ 229 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin) (int id, 230 const char *me, const char *who, const char *room); 218 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, const char *me, const char *who, const char *room); 219 231 220 232 221 /* … … 239 228 * room - the room left 240 229 */ 241 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave) (int id, 242 const char *me, const char *who, const char *room); 230 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, const char *me, const char *who, const char *room); 231 243 232 244 233 /* … … 249 238 * xml - ? 250 239 */ 251 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml) (int id, 252 const char *xml); 240 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml); 241 253 242 254 243 /* … … 263 252 * members - the initial members of the chatroom (null terminated YList 264 253 * of yahoo_chat_member's) Must be freed by the client 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); 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 269 258 270 259 /* … … 277 266 * who - the user who has joined, Must be freed by the client 278 267 */ 279 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin) (int id, 280 const char *me, const char *room, 281 struct yahoo_chat_member *who); 268 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, const char *me, const char *room, struct yahoo_chat_member *who); 269 282 270 283 271 /* … … 290 278 * who - the user who has left (Just the User ID) 291 279 */ 292 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave) (int id, 293 const char *me, const char *room, const char *who); 280 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, const char *me, const char *room, const char *who); 281 294 282 295 283 /* … … 306 294 * utf8 - whether the message is utf8 encoded or not 307 295 */ 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); 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 311 298 312 299 /* … … 323 310 * nothing. 324 311 */ 325 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout) (int id, 326 const char *me); 312 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id, const char *me); 313 327 314 328 315 /* … … 340 327 * nothing. 341 328 */ 342 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror) (int id, 343 const char *me); 329 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id, const char *me); 330 344 331 345 332 /* … … 354 341 * utf8 - whether the message is utf8 encoded or not 355 342 */ 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); 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 359 345 360 346 /* … … 365 351 * me - the identity the file was sent to 366 352 * who - the user who sent the file 353 * url - the file url 354 * expires - the expiry date of the file on the server (timestamp) 367 355 * msg - the message 368 356 * fname- the file name if direct transfer 369 357 * fsize- the file size if direct transfer 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); 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 403 373 404 374 /* … … 411 381 * msg - any message sent 412 382 */ 413 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added) (int id, 414 const char *myid, const char *who, const char *msg); 383 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, const char *myid, const char *who, const char *msg); 384 415 385 416 386 /* … … 422 392 * msg - any message sent 423 393 */ 424 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected) (int id, const char *who, 425 const char *msg); 394 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, const char *who, const char *msg); 395 426 396 427 397 /* … … 434 404 * stat - 1 if typing, 0 if stopped typing 435 405 */ 436 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify) (int id, 437 const char *me, const char *who, int stat); 406 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, const char *me, const char *who, int stat); 407 438 408 439 409 /* … … 445 415 * who - the handle of the remote user 446 416 * stat - 1 if game, 0 if stopped gaming 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); 417 */ 418 void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, const char *me, const char *who, int stat); 419 451 420 452 421 /* … … 459 428 * cnt - mail count - 0 if new mail notification 460 429 */ 461 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify) (int id, 462 const char *from, const char *subj, int cnt); 430 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, const char *from, const char *subj, int cnt); 431 463 432 464 433 /* … … 467 436 * Params: 468 437 * id - the id that identifies the server connection 469 * me - the handle of the identity the notification is sent to470 * who - the source of the system message (there are different types)471 438 * msg - the message 472 439 */ 473 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message) (int id, 474 const char *me, const char *who, const char *msg); 440 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, const char *msg); 475 441 476 442 /* … … 484 450 * checksum - the checksum of the icon content 485 451 */ 486 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon) (int id, 487 const char *me, const char *who, const char *url, int checksum); 452 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon)(int id, const char *me, const char *who, const char *url, int checksum); 488 453 489 454 /* … … 496 461 * checksum - the checksum of the icon content 497 462 */ 498 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum) (int id, 499 const char *me, const char *who, int checksum); 463 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum)(int id, const char *me,const char *who, int checksum); 500 464 501 465 /* … … 507 471 * who - the yahoo id of the buddy that requested the buddy icon 508 472 */ 509 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request) (int id, 510 const char *me, const char *who); 473 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request)(int id, const char *me, const char *who); 511 474 512 475 /* … … 517 480 * url - remote url, the uploaded buddy icon can be fetched from 518 481 */ 519 void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded) (int id, 520 const char *url); 482 void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded)(int id, const char *url); 521 483 522 484 /* … … 543 505 * a timestamp to stay in sync 544 506 */ 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, 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, 548 509 unsigned int timestamp); 510 549 511 550 512 /* … … 556 518 * from - who the invitation is from 557 519 */ 558 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite) (int id, 559 const char *me, const char *from); 520 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, const char *me, const char *from); 521 560 522 561 523 /* … … 568 530 * accept - 0 (decline), 1 (accept) 569 531 */ 570 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply) (int id, 571 const char *me, const char *from, int accept); 532 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, const char *me, const char *from, int accept); 533 572 534 573 535 /* … … 583 545 * 4 = user does not have webcam online 584 546 */ 585 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed) (int id, 586 const char *who, int reason); 547 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, const char *who, int reason); 548 587 549 588 550 /* … … 598 560 * if you need to use the information, make a copy 599 561 */ 600 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result) (int id, 601 int found, int start, int total, YList *contacts); 562 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result)(int id, int found, int start, int total, YList *contacts); 563 602 564 603 565 /* … … 610 572 * num - Which error is this 611 573 */ 612 void YAHOO_CALLBACK_TYPE(ext_yahoo_error) (int id, const char *err, 613 int fatal, int num); 574 void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, const char *err, int fatal, int num); 575 614 576 615 577 /* … … 621 583 * connect - 0=disconnect 1=connect 2=request 622 584 */ 623 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer) (int id, 624 const char *who, int connect); 585 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, const char *who, int connect); 586 625 587 626 588 /* … … 631 593 * send - whether to send images or not 632 594 */ 633 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request) (int id, 634 int send); 595 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send); 596 635 597 636 598 /* … … 642 604 * 0 643 605 */ 644 int YAHOO_CALLBACK_TYPE(ext_yahoo_log) (const char *fmt, ...); 606 int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...); 607 645 608 646 609 /* … … 651 614 * Params: 652 615 * id - the id that identifies the server connection 653 * fd - the fd o bject on which to listen616 * fd - the fd on which to listen 654 617 * cond - the condition on which to call the callback 655 618 * data - callback data to pass to yahoo_*_ready … … 657 620 * Returns: a tag to be used when removing the handler 658 621 */ 659 int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler) (int id, void *fd, 660 yahoo_input_condition cond, void *data); 622 int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, int fd, yahoo_input_condition cond, void *data); 623 661 624 662 625 /* … … 667 630 * tag - the handler tag to remove 668 631 */ 669 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler) (int id, int tag); 632 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag); 633 670 634 671 635 /* … … 678 642 * a unix file descriptor to the socket 679 643 */ 680 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect) (const char *host, int port); 644 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(const char *host, int port); 645 681 646 682 647 /* 683 648 * Name: ext_yahoo_connect_async 684 * Connect to a host:port asynchronously. This function should return649 * Connect to a host:port asynchronously. This function should return 685 650 * immediately returing a tag used to identify the connection handler, 686 651 * or a pre-connect error (eg: host name lookup failure). … … 695 660 * callback - function to call when connect completes 696 661 * callback_data - data to pass to the callback function 697 * use_ssl - Whether we need an SSL connection698 662 * 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); 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); 765 667 766 668 #ifdef USE_STRUCT_CALLBACKS … … 771 673 * before doing anything else 772 674 */ 773 void yahoo_register_callbacks(struct yahoo_callbacks * tyc);675 void yahoo_register_callbacks(struct yahoo_callbacks * tyc); 774 676 775 677 #undef YAHOO_CALLBACK_TYPE … … 782 684 783 685 #endif 686
Note: See TracChangeset
for help on using the changeset viewer.