Changeset 5ebff60 for protocols/yahoo/yahoo2_callbacks.h
- Timestamp:
- 2015-02-20T22:50:54Z (9 years ago)
- Branches:
- master
- Children:
- 0b9daac, 3d45471, 7733b8c
- Parents:
- af359b4
- git-author:
- Indent <please@…> (19-02-15 05:47:20)
- git-committer:
- dequis <dx@…> (20-02-15 22:50:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/yahoo/yahoo2_callbacks.h
raf359b4 r5ebff60 45 45 */ 46 46 47 48 49 50 51 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; 52 52 53 53 /* 54 54 * A callback function called when an asynchronous connect completes. 55 * 56 * Params: 57 * fd - The file descriptor object that has been connected, or NULL on 55 * 56 * Params: 57 * fd - The file descriptor object that has been connected, or NULL on 58 58 * error 59 59 * error - The value of errno set by the call to connect or 0 if no error … … 63 63 * function 64 64 */ 65 66 65 typedef void (*yahoo_connect_callback) (void *fd, int error, 66 void *callback_data); 67 67 68 68 /* … … 72 72 */ 73 73 74 /* 74 /* 75 75 * should we use a callback structure or directly call functions 76 76 * if you want the structure, you *must* define USE_STRUCT_CALLBACKS … … 80 80 81 81 #ifdef USE_STRUCT_CALLBACKS 82 #define YAHOO_CALLBACK_TYPE(x) 82 #define YAHOO_CALLBACK_TYPE(x) (*x) 83 83 struct yahoo_callbacks { 84 84 #else 85 #define YAHOO_CALLBACK_TYPE(x) 85 #define YAHOO_CALLBACK_TYPE(x) x 86 86 #endif 87 87 88 88 /* 89 89 * Name: ext_yahoo_login_response 90 * 91 * Params: 92 * 93 * 94 * 90 * Called when the login process is complete 91 * Params: 92 * id - the id that identifies the server connection 93 * succ - enum yahoo_login_status 94 * url - url to reactivate account if locked 95 95 */ 96 96 void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response) (int id, int succ, 97 97 const char *url); 98 98 99 99 /* 100 100 * Name: ext_yahoo_got_buddies 101 * 102 * Params: 103 * 104 * 101 * Called when the contact list is got from the server 102 * Params: 103 * id - the id that identifies the server connection 104 * buds - the buddy list 105 105 */ 106 106 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies) (int id, YList *buds); … … 108 108 /* 109 109 * Name: ext_yahoo_got_ignore 110 * 111 * Params: 112 * 113 * 110 * Called when the ignore list is got from the server 111 * Params: 112 * id - the id that identifies the server connection 113 * igns - the ignore list 114 114 */ 115 115 // void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore) (int id, YList *igns); … … 117 117 /* 118 118 * Name: ext_yahoo_got_identities 119 * 120 * Params: 121 * 122 * 119 * Called when the contact list is got from the server 120 * Params: 121 * id - the id that identifies the server connection 122 * ids - the identity list 123 123 */ 124 124 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities) (int id, YList *ids); … … 126 126 /* 127 127 * Name: ext_yahoo_got_cookies 128 * 129 * Params: 130 * 128 * Called when the cookie list is got from the server 129 * Params: 130 * id - the id that identifies the server connection 131 131 */ 132 132 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies) (int id); … … 134 134 /* 135 135 * Name: ext_yahoo_got_ping 136 * 137 * Params: 138 * 136 * Called when the ping packet is received from the server 137 * Params: 138 * id - the id that identifies the server connection 139 139 * errormsg - optional error message 140 140 */ 141 141 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping) (int id, 142 142 const char *errormsg); 143 143 144 144 /* 145 145 * Name: ext_yahoo_status_changed 146 * 147 * Params: 148 * 149 * 150 * 151 * 152 * 153 * 146 * Called when remote user's status changes. 147 * Params: 148 * id - the id that identifies the server connection 149 * who - the handle of the remote user 150 * stat - status code (enum yahoo_status) 151 * msg - the message if stat == YAHOO_STATUS_CUSTOM 152 * away - whether the contact is away or not (YAHOO_STATUS_CUSTOM) 153 * idle - this is the number of seconds he is idle [if he is idle] 154 154 * mobile - this is set for mobile users/buddies 155 155 * TODO: add support for pager, chat, and game states 156 156 */ 157 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); 158 const char *who, int stat, const char *msg, int away, 159 int idle, 160 int mobile); 160 161 161 162 /* 162 163 * Name: ext_yahoo_got_buzz 163 * 164 * Params: 165 * 166 * 167 * 168 * 164 * Called when remote user sends you a buzz. 165 * Params: 166 * id - the id that identifies the server connection 167 * me - the identity the message was sent to 168 * who - the handle of the remote user 169 * tm - timestamp of message if offline 169 170 */ 170 171 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buzz) (int id, const char *me, 171 172 const char *who, long tm); 172 173 173 174 /* 174 175 * Name: ext_yahoo_got_im 175 * 176 * Params: 177 * 178 * 179 * 180 * 181 * 182 * 183 * 184 * 185 * 186 * 176 * Called when remote user sends you a message. 177 * Params: 178 * id - the id that identifies the server connection 179 * me - the identity the message was sent to 180 * who - the handle of the remote user 181 * msg - the message - NULL if stat == 2 182 * tm - timestamp of message if offline 183 * stat - message status - 0 184 * 1 185 * 2 == error sending message 186 * 5 187 * utf8 - whether the message is encoded as utf8 or not 187 188 */ 188 189 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im) (int id, const char *me, 189 190 const char *who, const char *msg, long tm, int stat, int utf8); 190 191 191 192 /* 192 193 * Name: ext_yahoo_got_conf_invite 193 * 194 * Params: 195 * 196 * 197 * 198 * 199 * 194 * Called when remote user sends you a conference invitation. 195 * Params: 196 * id - the id that identifies the server connection 197 * me - the identity the invitation was sent to 198 * who - the user inviting you 199 * room - the room to join 200 * msg - the message 200 201 * members - the initial members of the conference (null terminated list) 201 202 */ 202 203 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite) (int id, 203 204 204 const char *me, const char *who, const char *room, 205 const char *msg, YList *members); 205 206 206 207 /* 207 208 * Name: ext_yahoo_conf_userdecline 208 * 209 * Params: 210 * 211 * 212 * 213 * 214 * 209 * Called when someone declines to join the conference. 210 * Params: 211 * id - the id that identifies the server connection 212 * me - the identity in the conference 213 * who - the user who has declined 214 * room - the room 215 * msg - the declining message 215 216 */ 216 217 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline) (int id, 217 218 218 const char *me, const char *who, const char *room, 219 const char *msg); 219 220 220 221 /* 221 222 * Name: ext_yahoo_conf_userjoin 222 * 223 * Params: 224 * 225 * 226 * 227 * 223 * Called when someone joins the conference. 224 * Params: 225 * id - the id that identifies the server connection 226 * me - the identity in the conference 227 * who - the user who has joined 228 * room - the room joined 228 229 */ 229 230 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin) (int id, 230 231 const char *me, const char *who, const char *room); 231 232 232 233 /* 233 234 * Name: ext_yahoo_conf_userleave 234 * 235 * Params: 236 * 237 * 238 * 239 * 235 * Called when someone leaves the conference. 236 * Params: 237 * id - the id that identifies the server connection 238 * me - the identity in the conference 239 * who - the user who has left 240 * room - the room left 240 241 */ 241 242 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave) (int id, 242 243 const char *me, const char *who, const char *room); 243 244 244 245 /* 245 246 * Name: ext_yahoo_chat_cat_xml 246 * 247 * Params: 248 * 249 * 247 * Called when ? 248 * Params: 249 * id - the id that identifies the server connection 250 * xml - ? 250 251 */ 251 252 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml) (int id, 252 253 const char *xml); 253 254 254 255 /* 255 256 * Name: ext_yahoo_chat_join 256 * 257 * Params: 258 * 259 * 260 * room - the room joined, used in all other chat calls, freed by261 * 262 * 263 * members - the initial members of the chatroom (null terminated YList 257 * Called when joining the chatroom. 258 * Params: 259 * id - the id that identifies the server connection 260 * me - the identity in the chatroom 261 * room - the room joined, used in all other chat calls, freed by 262 * library after call 263 * topic - the topic of the room, freed by library after call 264 * members - the initial members of the chatroom (null terminated YList 264 265 * of yahoo_chat_member's) Must be freed by the client 265 266 * fd - the object where the connection is coming from (for tracking) 266 267 */ 267 268 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join) (int id, const char *me, 268 269 const char *room, const char *topic, YList *members, void *fd); 269 270 270 271 /* 271 272 * Name: ext_yahoo_chat_userjoin 272 * 273 * Params: 274 * 275 * 276 * 277 * 273 * Called when someone joins the chatroom. 274 * Params: 275 * id - the id that identifies the server connection 276 * me - the identity in the chatroom 277 * room - the room joined 278 * who - the user who has joined, Must be freed by the client 278 279 */ 279 280 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin) (int id, 280 281 281 const char *me, const char *room, 282 struct yahoo_chat_member *who); 282 283 283 284 /* 284 285 * Name: ext_yahoo_chat_userleave 285 * 286 * Params: 287 * 288 * 289 * 290 * 286 * Called when someone leaves the chatroom. 287 * Params: 288 * id - the id that identifies the server connection 289 * me - the identity in the chatroom 290 * room - the room left 291 * who - the user who has left (Just the User ID) 291 292 */ 292 293 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave) (int id, 293 294 const char *me, const char *room, const char *who); 294 295 295 296 /* 296 297 * Name: ext_yahoo_chat_message 297 * 298 * Params: 299 * 300 * 301 * 302 * 303 * 304 * 305 * 306 * 298 * Called when someone messages in the chatroom. 299 * Params: 300 * id - the id that identifies the server connection 301 * me - the identity in the chatroom 302 * room - the room 303 * who - the user who messaged (Just the user id) 304 * msg - the message 305 * msgtype - 1 = Normal message 306 * 2 = /me type message 307 * utf8 - whether the message is utf8 encoded or not 307 308 */ 308 309 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message) (int id, 309 310 310 const char *me, const char *who, const char *room, 311 const char *msg, int msgtype, int utf8); 311 312 312 313 /* … … 315 316 * called when yahoo disconnects your chat session 316 317 * Note this is called whenver a disconnect happens, client or server 317 * requested. Care should be taken to make sure you know the origin 318 * requested. Care should be taken to make sure you know the origin 318 319 * of the disconnect request before doing anything here (auto-join's etc) 319 320 * Params: 320 321 * id - the id that identifies this connection 321 * 322 * me - the identity in the chatroom 322 323 * Returns: 323 324 * nothing. 324 325 */ 325 326 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout) (int id, 326 327 const char *me); 327 328 328 329 /* … … 332 333 * Note this is called whenver chat message is sent into a room 333 334 * in error (fd not connected, room doesn't exists etc) 334 * Care should be taken to make sure you know the origin 335 * Care should be taken to make sure you know the origin 335 336 * of the error before doing anything about it. 336 337 * Params: 337 338 * id - the id that identifies this connection 338 * 339 * me - the identity in the chatroom 339 340 * Returns: 340 341 * nothing. 341 342 */ 342 343 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror) (int id, 343 344 const char *me); 344 345 345 346 /* 346 347 * Name: ext_yahoo_conf_message 347 * 348 * Params: 349 * 350 * 351 * 352 * 353 * 354 * 348 * Called when someone messages in the conference. 349 * Params: 350 * id - the id that identifies the server connection 351 * me - the identity the conf message was sent to 352 * who - the user who messaged 353 * room - the room 354 * msg - the message 355 * utf8 - whether the message is utf8 encoded or not 355 356 */ 356 357 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message) (int id, 357 358 358 const char *me, const char *who, const char *room, 359 const char *msg, int utf8); 359 360 360 361 /* 361 362 * Name: ext_yahoo_got_file 362 * 363 * Params: 364 * 365 * 366 * 367 * 368 * 369 * 370 * 363 * Called when someone sends you a file 364 * Params: 365 * id - the id that identifies the server connection 366 * me - the identity the file was sent to 367 * who - the user who sent the file 368 * msg - the message 369 * fname- the file name if direct transfer 370 * fsize- the file size if direct transfer 371 * trid - transfer id. Unique for this transfer 371 372 * 372 373 * NOTE: Subsequent callbacks for file transfer do not send all of this … … 376 377 */ 377 378 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file) (int id, const char *me, 378 379 379 const char *who, const char *msg, const char *fname, 380 unsigned long fesize, char *trid); 380 381 381 382 /* 382 383 * Name: ext_yahoo_got_ft_data 383 * 384 * Params: 385 * 386 * 387 * 388 * 384 * Called multiple times when parts of the file are received 385 * Params: 386 * id - the id that identifies the server connection 387 * in - The data 388 * len - Length of the data 389 * data - callback data 389 390 */ 390 391 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ft_data) (int id, 391 392 const unsigned char *in, int len, void *data); 392 393 393 394 /* 394 395 * Name: ext_yahoo_file_transfer_done 395 * 396 * Params: 397 * 398 * 399 * 396 * File transfer is done 397 * Params: 398 * id - the id that identifies the server connection 399 * result - To notify if it finished successfully or with a failure 400 * data - callback data 400 401 */ 401 402 void YAHOO_CALLBACK_TYPE(ext_yahoo_file_transfer_done) (int id, 402 403 int result, void *data); 403 404 404 405 /* 405 406 * Name: ext_yahoo_contact_added 406 * 407 * Params: 408 * 409 * 410 * 411 * 407 * Called when a contact is added to your list 408 * Params: 409 * id - the id that identifies the server connection 410 * myid - the identity he was added to 411 * who - who was added 412 * msg - any message sent 412 413 */ 413 414 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added) (int id, 414 415 const char *myid, const char *who, const char *msg); 415 416 416 417 /* 417 418 * Name: ext_yahoo_rejected 418 * 419 * Params: 420 * 421 * 422 * 419 * Called when a contact rejects your add 420 * Params: 421 * id - the id that identifies the server connection 422 * who - who rejected you 423 * msg - any message sent 423 424 */ 424 425 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected) (int id, const char *who, 425 426 const char *msg); 426 427 427 428 /* 428 429 * Name: ext_yahoo_typing_notify 429 * 430 * Params: 431 * 432 * 433 * 434 * 430 * Called when remote user starts or stops typing. 431 * Params: 432 * id - the id that identifies the server connection 433 * me - the handle of the identity the notification is sent to 434 * who - the handle of the remote user 435 * stat - 1 if typing, 0 if stopped typing 435 436 */ 436 437 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify) (int id, 437 438 const char *me, const char *who, int stat); 438 439 439 440 /* 440 441 * Name: ext_yahoo_game_notify 441 * 442 * Params: 443 * 444 * 445 * 446 * 447 * 442 * Called when remote user starts or stops a game. 443 * Params: 444 * id - the id that identifies the server connection 445 * me - the handle of the identity the notification is sent to 446 * who - the handle of the remote user 447 * stat - 1 if game, 0 if stopped gaming 448 * msg - game description and/or other text 448 449 */ 449 450 void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify) (int id, const char *me, 450 451 const char *who, int stat, const char *msg); 451 452 452 453 /* 453 454 * Name: ext_yahoo_mail_notify 454 * 455 * Params: 456 * 457 * 458 * 459 * 455 * Called when you receive mail, or with number of messages 456 * Params: 457 * id - the id that identifies the server connection 458 * from - who the mail is from - NULL if only mail count 459 * subj - the subject of the mail - NULL if only mail count 460 * cnt - mail count - 0 if new mail notification 460 461 */ 461 462 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify) (int id, 462 463 const char *from, const char *subj, int cnt); 463 464 464 465 /* 465 466 * Name: ext_yahoo_system_message 466 * 467 * Params: 468 * 469 * 470 * 471 * 467 * System message 468 * Params: 469 * id - the id that identifies the server connection 470 * me - the handle of the identity the notification is sent to 471 * who - the source of the system message (there are different types) 472 * msg - the message 472 473 */ 473 474 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message) (int id, 474 475 const char *me, const char *who, const char *msg); 475 476 476 477 /* 477 478 * Name: ext_yahoo_got_buddyicon 478 * 479 * Params: 480 * 481 * 482 * 483 * 484 * 479 * Buddy icon received 480 * Params: 481 * id - the id that identifies the server connection 482 * me - the handle of the identity the notification is sent to 483 * who - the person the buddy icon is for 484 * url - the url to use to load the icon 485 * checksum - the checksum of the icon content 485 486 */ 486 487 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon) (int id, 487 const char *me, const char *who, const char *url, int checksum); 488 const char *me, const char *who, const char *url, 489 int checksum); 488 490 489 491 /* 490 492 * Name: ext_yahoo_got_buddyicon_checksum 491 * 492 * Params: 493 * 494 * 495 * 496 * 493 * Buddy icon checksum received 494 * Params: 495 * id - the id that identifies the server connection 496 * me - the handle of the identity the notification is sent to 497 * who - the yahoo id of the buddy icon checksum is for 498 * checksum - the checksum of the icon content 497 499 */ 498 500 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum) (int id, 499 501 const char *me, const char *who, int checksum); 500 502 501 503 /* 502 504 * Name: ext_yahoo_got_buddyicon_request 503 * 504 * Params: 505 * 506 * 507 * 505 * Buddy icon request received 506 * Params: 507 * id - the id that identifies the server connection 508 * me - the handle of the identity the notification is sent to 509 * who - the yahoo id of the buddy that requested the buddy icon 508 510 */ 509 511 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request) (int id, 510 512 const char *me, const char *who); 511 513 512 514 /* 513 515 * Name: ext_yahoo_got_buddyicon_request 514 * 515 * Params: 516 * 517 * 516 * Buddy icon request received 517 * Params: 518 * id - the id that identifies the server connection 519 * url - remote url, the uploaded buddy icon can be fetched from 518 520 */ 519 521 void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded) (int id, 520 522 const char *url); 521 523 522 524 /* 523 525 * Name: ext_yahoo_got_webcam_image 524 * 526 * Called when you get a webcam update 525 527 * An update can either be receiving an image, a part of an image or 526 528 * just an update with a timestamp 527 529 * Params: 528 * 529 * 530 * id - the id that identifies the server connection 531 * who - the user who's webcam we're viewing 530 532 * image - image data 531 533 * image_size - length of the image in bytes … … 544 546 */ 545 547 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image) (int id, 546 547 548 548 const char *who, const unsigned char *image, 549 unsigned int image_size, unsigned int real_size, 550 unsigned int timestamp); 549 551 550 552 /* 551 553 * Name: ext_yahoo_webcam_invite 552 * 553 * Params: 554 * 555 * 556 * 554 * Called when you get a webcam invitation 555 * Params: 556 * id - the id that identifies the server connection 557 * me - identity the invitation is to 558 * from - who the invitation is from 557 559 */ 558 560 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite) (int id, 559 561 const char *me, const char *from); 560 562 561 563 /* 562 564 * Name: ext_yahoo_webcam_invite_reply 563 * 564 * Params: 565 * 566 * 567 * 565 * Called when you get a response to a webcam invitation 566 * Params: 567 * id - the id that identifies the server connection 568 * me - identity the invitation response is to 569 * from - who the invitation response is from 568 570 * accept - 0 (decline), 1 (accept) 569 571 */ 570 572 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply) (int id, 571 573 const char *me, const char *from, int accept); 572 574 573 575 /* 574 576 * Name: ext_yahoo_webcam_closed 575 * 576 * Params: 577 * 578 * 577 * Called when the webcam connection closed 578 * Params: 579 * id - the id that identifies the server connection 580 * who - the user who we where connected to 579 581 * reason - reason why the connection closed 580 582 * 1 = user stopped broadcasting … … 584 586 */ 585 587 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed) (int id, 586 588 const char *who, int reason); 587 589 588 590 /* … … 590 592 * Called when the search result received from server 591 593 * Params: 592 * id 593 * 594 * 595 * 596 * 597 * 598 * 594 * id - the id that identifies the server connection 595 * found - total number of results returned in the current result set 596 * start - offset from where the current result set starts 597 * total - total number of results available (start + found <= total) 598 * contacts - the list of results as a YList of yahoo_found_contact 599 * these will be freed after this function returns, so 600 * if you need to use the information, make a copy 599 601 */ 600 602 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result) (int id, 601 603 int found, int start, int total, YList *contacts); 602 604 603 605 /* 604 606 * Name: ext_yahoo_error 605 * 606 * Params: 607 * 608 * 609 * 610 * 607 * Called on error. 608 * Params: 609 * id - the id that identifies the server connection 610 * err - the error message 611 * fatal- whether this error is fatal to the connection or not 612 * num - Which error is this 611 613 */ 612 614 void YAHOO_CALLBACK_TYPE(ext_yahoo_error) (int id, const char *err, 613 615 int fatal, int num); 614 616 615 617 /* … … 622 624 */ 623 625 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer) (int id, 624 626 const char *who, int connect); 625 627 626 628 /* … … 632 634 */ 633 635 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request) (int id, 634 636 int send); 635 637 636 638 /* 637 639 * Name: ext_yahoo_log 638 * 639 * Params: 640 * 641 * Returns: 642 * 640 * Called to log a message. 641 * Params: 642 * fmt - the printf formatted message 643 * Returns: 644 * 0 643 645 */ 644 646 int YAHOO_CALLBACK_TYPE(ext_yahoo_log) (const char *fmt, ...); … … 646 648 /* 647 649 * Name: ext_yahoo_add_handler 648 * 649 * 650 * 651 * Params: 652 * 653 * 654 * 655 * 656 * 650 * Add a listener for the fd. Must call yahoo_read_ready 651 * when a YAHOO_INPUT_READ fd is ready and yahoo_write_ready 652 * when a YAHOO_INPUT_WRITE fd is ready. 653 * Params: 654 * id - the id that identifies the server connection 655 * fd - the fd object on which to listen 656 * cond - the condition on which to call the callback 657 * data - callback data to pass to yahoo_*_ready 658 * 657 659 * Returns: a tag to be used when removing the handler 658 660 */ 659 661 int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler) (int id, void *fd, 660 662 yahoo_input_condition cond, void *data); 661 663 662 664 /* 663 665 * Name: ext_yahoo_remove_handler 664 * 665 * Params: 666 * 667 * 666 * Remove the listener for the fd. 667 * Params: 668 * id - the id that identifies the connection 669 * tag - the handler tag to remove 668 670 */ 669 671 void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler) (int id, int tag); … … 671 673 /* 672 674 * Name: ext_yahoo_connect 673 * 674 * Params: 675 * 676 * 677 * Returns: 678 * 675 * Connect to a host:port 676 * Params: 677 * host - the host to connect to 678 * port - the port to connect on 679 * Returns: 680 * a unix file descriptor to the socket 679 681 */ 680 682 // int YAHOO_CALLBACK_TYPE(ext_yahoo_connect) (const char *host, int port); … … 682 684 /* 683 685 * Name: ext_yahoo_connect_async 684 * 685 * 686 * 687 * 688 * 689 * 690 * 691 * Params: 692 * 693 * 694 * 695 * 696 * 697 * 698 * Returns: 699 * 686 * Connect to a host:port asynchronously. This function should return 687 * immediately returing a tag used to identify the connection handler, 688 * or a pre-connect error (eg: host name lookup failure). 689 * Once the connect completes (successfully or unsuccessfully), callback 690 * should be called (see the signature for yahoo_connect_callback). 691 * The callback may safely be called before this function returns, but 692 * it should not be called twice. 693 * Params: 694 * id - the id that identifies this connection 695 * host - the host to connect to 696 * port - the port to connect on 697 * callback - function to call when connect completes 698 * callback_data - data to pass to the callback function 699 * use_ssl - Whether we need an SSL connection 700 * Returns: 701 * a tag signifying the connection attempt 700 702 */ 701 703 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async) (int id, 702 703 704 const char *host, int port, yahoo_connect_callback callback, 705 void *callback_data, int use_ssl); 704 706 705 707 /* 706 708 * Name: ext_yahoo_get_ip_addr 707 * 708 * Params: 709 * 710 * Returns: 711 * 709 * get IP Address for a domain name 710 * Params: 711 * domain - Domain name 712 * Returns: 713 * Newly allocated string containing the IP Address in IPv4 notation 712 714 */ 713 715 char *YAHOO_CALLBACK_TYPE(ext_yahoo_get_ip_addr) (const char *domain); … … 715 717 /* 716 718 * Name: ext_yahoo_write 717 * 718 * Params: 719 * 720 * 721 * 722 * Returns: 723 * 719 * Write data from the buffer into the socket for the specified connection 720 * Params: 721 * fd - the file descriptor object that identifies this connection 722 * buf - Buffer to write the data from 723 * len - Length of the data 724 * Returns: 725 * Number of bytes written or -1 for error 724 726 */ 725 727 int YAHOO_CALLBACK_TYPE(ext_yahoo_write) (void *fd, char *buf, int len); … … 727 729 /* 728 730 * Name: ext_yahoo_read 729 * 730 * Params: 731 * 732 * 733 * 734 * Returns: 735 * 731 * Read data into a buffer from socket for the specified connection 732 * Params: 733 * fd - the file descriptor object that identifies this connection 734 * buf - Buffer to read the data into 735 * len - Max length to read 736 * Returns: 737 * Number of bytes read or -1 for error 736 738 */ 737 739 int YAHOO_CALLBACK_TYPE(ext_yahoo_read) (void *fd, char *buf, int len); … … 739 741 /* 740 742 * Name: ext_yahoo_close 741 * 742 * 743 * Params: 744 * 745 * Returns: 746 * 743 * Close the file descriptor object and free its resources. Libyahoo2 will not 744 * use this object again. 745 * Params: 746 * fd - the file descriptor object that identifies this connection 747 * Returns: 748 * Nothing 747 749 */ 748 750 void YAHOO_CALLBACK_TYPE(ext_yahoo_close) (void *fd); … … 750 752 /* 751 753 * Name: ext_yahoo_got_buddy_change_group 752 * 753 * Params: 754 * 755 * 756 * 757 * 758 * 759 * Returns: 760 * 754 * Acknowledgement of buddy changing group 755 * Params: 756 * id: client id 757 * me: The user 758 * who: Buddy name 759 * old_group: Old group name 760 * new_group: New group name 761 * Returns: 762 * Nothing 761 763 */ 762 764 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); 765 const char *me, const char *who, 766 const char *old_group, 767 const char *new_group); 765 768 766 769 #ifdef USE_STRUCT_CALLBACKS
Note: See TracChangeset
for help on using the changeset viewer.