Mercurial > pidgin
comparison libfaim/faim/aim.h @ 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 |
---|---|
28 #ifdef _WIN32 | 28 #ifdef _WIN32 |
29 #include <windows.h> | 29 #include <windows.h> |
30 #include <time.h> | 30 #include <time.h> |
31 #include <io.h> | 31 #include <io.h> |
32 #else | 32 #else |
33 #include <netdb.h> | |
34 #include <sys/socket.h> | |
35 #include <netinet/in.h> | |
36 #include <sys/time.h> | 33 #include <sys/time.h> |
37 #include <unistd.h> | 34 #include <unistd.h> |
38 #endif | 35 #endif |
39 | 36 |
40 #ifdef FAIM_USEPTHREADS | 37 #ifdef FAIM_USEPTHREADS |
68 | 65 |
69 #if defined(mach) && defined(__APPLE__) | 66 #if defined(mach) && defined(__APPLE__) |
70 #define gethostbyname(x) gethostbyname2(x, AF_INET) | 67 #define gethostbyname(x) gethostbyname2(x, AF_INET) |
71 #endif | 68 #endif |
72 | 69 |
73 #if !defined(MSG_WAITALL) | 70 #if defined(_WIN32) || defined(STRICT_ANSI) |
74 #warning FIX YOUR LIBC! MSG_WAITALL is required! | 71 #define faim_shortfunc |
75 #define MSG_WAITALL 0x100 | 72 #else |
73 #define faim_shortfunc inline | |
74 #endif | |
75 | |
76 #if defined(_WIN32) | |
77 /* | |
78 * For a win32 DLL, we define WIN32_INDLL if this file | |
79 * is included while compiling the DLL. If its not | |
80 * defined (its included in a client app), the symbols | |
81 * will be imported instead of exported. | |
82 */ | |
83 #ifdef WIN32_INDLL | |
84 #define faim_export __declspec(dllexport) | |
85 #else | |
86 #define faim_export __declspec(dllimport) | |
87 #endif /* WIN32_INDLL */ | |
88 #define faim_internal | |
89 #else | |
90 /* | |
91 * Nothing normally needed for unix... | |
92 */ | |
93 #define faim_export | |
94 #define faim_internal | |
76 #endif | 95 #endif |
77 | 96 |
78 /* | 97 /* |
79 * Current Maximum Length for Screen Names (not including NULL) | 98 * Current Maximum Length for Screen Names (not including NULL) |
80 * | 99 * |
115 */ | 134 */ |
116 #define AIM_COOKIELEN 0x100 | 135 #define AIM_COOKIELEN 0x100 |
117 | 136 |
118 #define AIM_MD5_STRING "AOL Instant Messenger (SM)" | 137 #define AIM_MD5_STRING "AOL Instant Messenger (SM)" |
119 | 138 |
120 #if debug > 0 | |
121 #define faimdprintf(l, x...) {if (l >= debug) printf(x); } | |
122 #else | |
123 #define faimdprintf(l, x...) | |
124 #endif | |
125 | |
126 /* | 139 /* |
127 * Login info. Passes information from the Authorization | 140 * Login info. Passes information from the Authorization |
128 * stage of login to the service (BOS, etc) connection | 141 * stage of login to the service (BOS, etc) connection |
129 * phase. | 142 * phase. |
130 * | 143 * |
131 */ | 144 */ |
132 struct aim_login_struct { | 145 struct aim_login_struct { |
133 char screen_name[MAXSNLEN+1]; | 146 char screen_name[MAXSNLEN+1]; |
134 char *BOSIP; | 147 char *BOSIP; |
135 char cookie[AIM_COOKIELEN]; | 148 unsigned char cookie[AIM_COOKIELEN]; |
136 char *email; | 149 char *email; |
137 u_short regstatus; | 150 u_short regstatus; |
138 char *errorurl; | 151 char *errorurl; |
139 u_short errorcode; | 152 u_short errorcode; |
140 }; | 153 }; |
360 struct aim_tlv_t *tlv; | 373 struct aim_tlv_t *tlv; |
361 struct aim_tlvlist_t *next; | 374 struct aim_tlvlist_t *next; |
362 }; | 375 }; |
363 | 376 |
364 /* TLV-handling functions */ | 377 /* TLV-handling functions */ |
365 struct aim_tlvlist_t *aim_readtlvchain(u_char *buf, int maxlen); | 378 faim_internal struct aim_tlvlist_t *aim_readtlvchain(u_char *buf, int maxlen); |
366 void aim_freetlvchain(struct aim_tlvlist_t **list); | 379 faim_internal void aim_freetlvchain(struct aim_tlvlist_t **list); |
367 struct aim_tlv_t *aim_grabtlv(u_char *src); | 380 faim_internal struct aim_tlv_t *aim_grabtlv(u_char *src); |
368 struct aim_tlv_t *aim_grabtlvstr(u_char *src); | 381 faim_internal struct aim_tlv_t *aim_grabtlvstr(u_char *src); |
369 struct aim_tlv_t *aim_gettlv(struct aim_tlvlist_t *, u_short, int); | 382 faim_internal struct aim_tlv_t *aim_gettlv(struct aim_tlvlist_t *, u_short, int); |
370 char *aim_gettlv_str(struct aim_tlvlist_t *, u_short, int); | 383 faim_internal char *aim_gettlv_str(struct aim_tlvlist_t *, u_short, int); |
371 int aim_puttlv (u_char *dest, struct aim_tlv_t *newtlv); | 384 faim_internal int aim_puttlv (u_char *dest, struct aim_tlv_t *newtlv); |
372 struct aim_tlv_t *aim_createtlv(void); | 385 faim_internal struct aim_tlv_t *aim_createtlv(void); |
373 int aim_freetlv(struct aim_tlv_t **oldtlv); | 386 faim_internal int aim_freetlv(struct aim_tlv_t **oldtlv); |
374 int aim_puttlv_16(u_char *, u_short, u_short); | 387 faim_internal int aim_puttlv_16(u_char *, u_short, u_short); |
375 int aim_puttlv_32(u_char *, u_short, u_long); | 388 faim_internal int aim_puttlv_32(u_char *, u_short, u_long); |
376 int aim_puttlv_str(u_char *buf, u_short t, u_short l, u_char *v); | 389 faim_internal int aim_puttlv_str(u_char *buf, u_short t, u_short l, char *v); |
377 int aim_writetlvchain(u_char *buf, int buflen, struct aim_tlvlist_t **list); | 390 faim_internal int aim_writetlvchain(u_char *buf, int buflen, struct aim_tlvlist_t **list); |
378 int aim_addtlvtochain16(struct aim_tlvlist_t **list, unsigned short type, unsigned short val); | 391 faim_internal int aim_addtlvtochain16(struct aim_tlvlist_t **list, unsigned short type, unsigned short val); |
379 int aim_addtlvtochain32(struct aim_tlvlist_t **list, unsigned short type, unsigned long val); | 392 faim_internal int aim_addtlvtochain32(struct aim_tlvlist_t **list, unsigned short type, unsigned long val); |
380 int aim_addtlvtochain_str(struct aim_tlvlist_t **list, unsigned short type, char *str, int len); | 393 faim_internal int aim_addtlvtochain_str(struct aim_tlvlist_t **list, unsigned short type, char *str, int len); |
381 int aim_counttlvchain(struct aim_tlvlist_t **list); | 394 faim_internal int aim_counttlvchain(struct aim_tlvlist_t **list); |
382 | 395 |
383 /* | 396 /* |
384 * Get command from connections / Dispatch commands | 397 * Get command from connections / Dispatch commands |
385 * already in queue. | 398 * already in queue. |
386 */ | 399 */ |
387 int aim_get_command(struct aim_session_t *, struct aim_conn_t *); | 400 faim_export int aim_get_command(struct aim_session_t *, struct aim_conn_t *); |
388 int aim_rxdispatch(struct aim_session_t *); | 401 int aim_rxdispatch(struct aim_session_t *); |
389 | 402 |
390 u_long aim_debugconn_sendconnect(struct aim_session_t *sess, struct aim_conn_t *conn); | 403 u_long aim_debugconn_sendconnect(struct aim_session_t *sess, struct aim_conn_t *conn); |
391 | 404 |
392 int aim_logoff(struct aim_session_t *); | 405 int aim_logoff(struct aim_session_t *); |
393 | 406 |
394 void aim_conn_kill(struct aim_session_t *sess, struct aim_conn_t **deadconn); | 407 faim_export void aim_conn_kill(struct aim_session_t *sess, struct aim_conn_t **deadconn); |
395 | 408 |
396 typedef int (*rxcallback_t)(struct aim_session_t *, struct command_rx_struct *, ...); | 409 typedef int (*rxcallback_t)(struct aim_session_t *, struct command_rx_struct *, ...); |
397 int aim_register_callbacks(rxcallback_t *); | 410 int aim_register_callbacks(rxcallback_t *); |
398 | 411 |
399 u_long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype); | 412 u_long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype); |
400 u_long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *); | 413 u_long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *); |
401 u_long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *); | 414 u_long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *); |
402 | 415 |
403 struct aim_fileheader_t *aim_oft_getfh(char *hdr); | 416 faim_internal struct aim_fileheader_t *aim_oft_getfh(unsigned char *hdr); |
404 | 417 |
405 /* aim_login.c */ | 418 /* aim_login.c */ |
406 int aim_sendconnack(struct aim_session_t *sess, struct aim_conn_t *conn); | 419 faim_export int aim_sendconnack(struct aim_session_t *sess, struct aim_conn_t *conn); |
407 int aim_request_login (struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); | 420 faim_export int aim_request_login (struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); |
408 int aim_send_login (struct aim_session_t *, struct aim_conn_t *, char *, char *, struct client_info_s *, char *key); | 421 faim_export int aim_send_login (struct aim_session_t *, struct aim_conn_t *, char *, char *, struct client_info_s *, char *key); |
409 unsigned long aim_sendauthresp(struct aim_session_t *sess, | 422 faim_export unsigned long aim_sendauthresp(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn, char *bosip, char *cookie, char *email, int regstatus); |
410 struct aim_conn_t *conn, | 423 faim_export int aim_gencookie(unsigned char *buf); |
411 char *sn, char *bosip, | 424 faim_export int aim_sendserverready(struct aim_session_t *sess, struct aim_conn_t *conn); |
412 char *cookie, char *email, | 425 faim_internal int aim_authkeyparse(struct aim_session_t *sess, struct command_rx_struct *command); |
413 int regstatus); | 426 faim_export unsigned long aim_sendredirect(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned short servid, char *ip, char *cookie); |
414 int aim_gencookie(unsigned char *buf); | 427 faim_export void aim_purge_rxqueue(struct aim_session_t *); |
415 int aim_sendserverready(struct aim_session_t *sess, struct aim_conn_t *conn); | 428 faim_internal void aim_rxqueue_cleanbyconn(struct aim_session_t *sess, struct aim_conn_t *conn); |
416 int aim_authkeyparse(struct aim_session_t *sess, struct command_rx_struct *command); | |
417 unsigned long aim_sendredirect(struct aim_session_t *sess, | |
418 struct aim_conn_t *conn, | |
419 unsigned short servid, | |
420 char *ip, | |
421 char *cookie); | |
422 void aim_purge_rxqueue(struct aim_session_t *); | |
423 void aim_rxqueue_cleanbyconn(struct aim_session_t *sess, struct aim_conn_t *conn); | |
424 | 429 |
425 int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *command, ...); | 430 int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *command, ...); |
426 int aim_parse_missed_im(struct aim_session_t *, struct command_rx_struct *, ...); | 431 int aim_parse_missed_im(struct aim_session_t *, struct command_rx_struct *, ...); |
427 int aim_parse_last_bad(struct aim_session_t *, struct command_rx_struct *, ...); | 432 int aim_parse_last_bad(struct aim_session_t *, struct command_rx_struct *, ...); |
428 int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn); | 433 faim_internal int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn); |
429 | 434 |
430 struct command_tx_struct *aim_tx_new(unsigned short framing, int chan, struct aim_conn_t *conn, int datalen); | 435 faim_internal struct command_tx_struct *aim_tx_new(unsigned short framing, int chan, struct aim_conn_t *conn, int datalen); |
431 int aim_tx_enqueue__queuebased(struct aim_session_t *, struct command_tx_struct *); | 436 faim_internal int aim_tx_enqueue__queuebased(struct aim_session_t *, struct command_tx_struct *); |
432 int aim_tx_enqueue__immediate(struct aim_session_t *, struct command_tx_struct *); | 437 faim_internal int aim_tx_enqueue__immediate(struct aim_session_t *, struct command_tx_struct *); |
433 #define aim_tx_enqueue(x, y) ((*(x->tx_enqueue))(x, y)) | 438 #define aim_tx_enqueue(x, y) ((*(x->tx_enqueue))(x, y)) |
434 int aim_tx_sendframe(struct aim_session_t *sess, struct command_tx_struct *cur); | 439 faim_internal int aim_tx_sendframe(struct aim_session_t *sess, struct command_tx_struct *cur); |
435 u_int aim_get_next_txseqnum(struct aim_conn_t *); | 440 faim_internal unsigned int aim_get_next_txseqnum(struct aim_conn_t *); |
436 int aim_tx_flushqueue(struct aim_session_t *); | 441 faim_export int aim_tx_flushqueue(struct aim_session_t *); |
437 int aim_tx_printqueue(struct aim_session_t *); | 442 faim_internal int aim_tx_printqueue(struct aim_session_t *); |
438 void aim_tx_purgequeue(struct aim_session_t *); | 443 faim_export void aim_tx_purgequeue(struct aim_session_t *); |
439 | 444 |
440 struct aim_rxcblist_t { | 445 struct aim_rxcblist_t { |
441 u_short family; | 446 u_short family; |
442 u_short type; | 447 u_short type; |
443 rxcallback_t handler; | 448 rxcallback_t handler; |
444 u_short flags; | 449 u_short flags; |
445 struct aim_rxcblist_t *next; | 450 struct aim_rxcblist_t *next; |
446 }; | 451 }; |
447 | 452 |
448 int aim_conn_setlatency(struct aim_conn_t *conn, int newval); | 453 faim_export int aim_conn_setlatency(struct aim_conn_t *conn, int newval); |
449 | 454 |
450 int aim_conn_addhandler(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short type, rxcallback_t newhandler, u_short flags); | 455 faim_export int aim_conn_addhandler(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short type, rxcallback_t newhandler, u_short flags); |
451 rxcallback_t aim_callhandler(struct aim_conn_t *conn, u_short family, u_short type); | 456 faim_internal rxcallback_t aim_callhandler(struct aim_conn_t *conn, u_short family, u_short type); |
452 int aim_clearhandlers(struct aim_conn_t *conn); | 457 faim_export int aim_clearhandlers(struct aim_conn_t *conn); |
453 | 458 |
454 /* | 459 /* |
455 * Generic SNAC structure. Rarely if ever used. | 460 * Generic SNAC structure. Rarely if ever used. |
456 */ | 461 */ |
457 struct aim_snac_t { | 462 struct aim_snac_t { |
461 u_short flags; | 466 u_short flags; |
462 void *data; | 467 void *data; |
463 time_t issuetime; | 468 time_t issuetime; |
464 struct aim_snac_t *next; | 469 struct aim_snac_t *next; |
465 }; | 470 }; |
466 void aim_initsnachash(struct aim_session_t *sess); | 471 faim_internal void aim_initsnachash(struct aim_session_t *sess); |
467 u_long aim_newsnac(struct aim_session_t *, struct aim_snac_t *newsnac); | 472 faim_internal unsigned long aim_newsnac(struct aim_session_t *, struct aim_snac_t *newsnac); |
468 struct aim_snac_t *aim_remsnac(struct aim_session_t *, u_long id); | 473 faim_internal struct aim_snac_t *aim_remsnac(struct aim_session_t *, u_long id); |
469 int aim_cleansnacs(struct aim_session_t *, int maxage); | 474 faim_internal int aim_cleansnacs(struct aim_session_t *, int maxage); |
470 int aim_putsnac(u_char *, int, int, int, u_long); | 475 faim_internal int aim_putsnac(u_char *, int, int, int, u_long); |
471 | 476 |
472 | 477 |
473 void aim_connrst(struct aim_session_t *); | 478 faim_internal void aim_connrst(struct aim_session_t *); |
474 struct aim_conn_t *aim_conn_getnext(struct aim_session_t *); | 479 faim_internal struct aim_conn_t *aim_conn_getnext(struct aim_session_t *); |
475 void aim_conn_close(struct aim_conn_t *deadconn); | 480 faim_export void aim_conn_close(struct aim_conn_t *deadconn); |
476 struct aim_conn_t *aim_getconn_type(struct aim_session_t *, int type); | 481 faim_internal struct aim_conn_t *aim_getconn_type(struct aim_session_t *, int type); |
477 struct aim_conn_t *aim_newconn(struct aim_session_t *, int type, char *dest); | 482 faim_export struct aim_conn_t *aim_newconn(struct aim_session_t *, int type, char *dest); |
478 int aim_conngetmaxfd(struct aim_session_t *); | 483 faim_export int aim_conngetmaxfd(struct aim_session_t *); |
479 struct aim_conn_t *aim_select(struct aim_session_t *, struct timeval *, int *); | 484 faim_export struct aim_conn_t *aim_select(struct aim_session_t *, struct timeval *, int *); |
480 int aim_conn_isready(struct aim_conn_t *); | 485 faim_export int aim_conn_isready(struct aim_conn_t *); |
481 int aim_conn_setstatus(struct aim_conn_t *, int); | 486 faim_export int aim_conn_setstatus(struct aim_conn_t *, int); |
482 void aim_session_init(struct aim_session_t *); | 487 faim_export void aim_session_init(struct aim_session_t *); |
483 | 488 |
484 /* aim_misc.c */ | 489 /* aim_misc.c */ |
485 | 490 |
486 #define AIM_VISIBILITYCHANGE_PERMITADD 0x05 | 491 #define AIM_VISIBILITYCHANGE_PERMITADD 0x05 |
487 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06 | 492 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06 |
498 u_long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long); | 503 u_long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long); |
499 u_long aim_bos_changevisibility(struct aim_session_t *, struct aim_conn_t *, int, char *); | 504 u_long aim_bos_changevisibility(struct aim_session_t *, struct aim_conn_t *, int, char *); |
500 u_long aim_bos_setbuddylist(struct aim_session_t *, struct aim_conn_t *, char *); | 505 u_long aim_bos_setbuddylist(struct aim_session_t *, struct aim_conn_t *, char *); |
501 u_long aim_bos_setprofile(struct aim_session_t *, struct aim_conn_t *, char *, char *, unsigned int); | 506 u_long aim_bos_setprofile(struct aim_session_t *, struct aim_conn_t *, char *, char *, unsigned int); |
502 u_long aim_bos_setgroupperm(struct aim_session_t *, struct aim_conn_t *, u_long); | 507 u_long aim_bos_setgroupperm(struct aim_session_t *, struct aim_conn_t *, u_long); |
503 u_long aim_bos_clientready(struct aim_session_t *, struct aim_conn_t *); | 508 unsigned long aim_bos_clientready(struct aim_session_t *, struct aim_conn_t *); |
504 u_long aim_bos_reqrate(struct aim_session_t *, struct aim_conn_t *); | 509 u_long aim_bos_reqrate(struct aim_session_t *, struct aim_conn_t *); |
505 u_long aim_bos_ackrateresp(struct aim_session_t *, struct aim_conn_t *); | 510 u_long aim_bos_ackrateresp(struct aim_session_t *, struct aim_conn_t *); |
506 u_long aim_bos_setprivacyflags(struct aim_session_t *, struct aim_conn_t *, u_long); | 511 u_long aim_bos_setprivacyflags(struct aim_session_t *, struct aim_conn_t *, u_long); |
507 u_long aim_bos_reqpersonalinfo(struct aim_session_t *, struct aim_conn_t *); | 512 u_long aim_bos_reqpersonalinfo(struct aim_session_t *, struct aim_conn_t *); |
508 u_long aim_bos_reqservice(struct aim_session_t *, struct aim_conn_t *, u_short); | 513 u_long aim_bos_reqservice(struct aim_session_t *, struct aim_conn_t *, u_short); |
509 u_long aim_bos_reqrights(struct aim_session_t *, struct aim_conn_t *); | 514 unsigned long aim_bos_reqrights(struct aim_session_t *, struct aim_conn_t *); |
510 u_long aim_bos_reqbuddyrights(struct aim_session_t *, struct aim_conn_t *); | 515 u_long aim_bos_reqbuddyrights(struct aim_session_t *, struct aim_conn_t *); |
511 u_long aim_bos_reqlocaterights(struct aim_session_t *, struct aim_conn_t *); | 516 u_long aim_bos_reqlocaterights(struct aim_session_t *, struct aim_conn_t *); |
512 u_long aim_bos_reqicbmparaminfo(struct aim_session_t *, struct aim_conn_t *); | 517 u_long aim_bos_reqicbmparaminfo(struct aim_session_t *, struct aim_conn_t *); |
513 unsigned long aim_addicbmparam(struct aim_session_t *sess,struct aim_conn_t *conn); | 518 unsigned long aim_addicbmparam(struct aim_session_t *sess,struct aim_conn_t *conn); |
514 u_long aim_setversions(struct aim_session_t *sess, struct aim_conn_t *conn); | 519 u_long aim_setversions(struct aim_session_t *sess, struct aim_conn_t *conn); |
515 | 520 |
516 struct aim_fileheader_t *aim_getlisting(struct aim_session_t*); | 521 faim_internal struct aim_fileheader_t *aim_getlisting(struct aim_session_t*); |
517 int aim_listenestablish(u_short); | 522 faim_internal int aim_listenestablish(u_short); |
518 | 523 |
519 /* aim_rxhandlers.c */ | 524 /* aim_rxhandlers.c */ |
520 int aim_rxdispatch(struct aim_session_t *); | 525 faim_export int aim_rxdispatch(struct aim_session_t *); |
521 int aim_authparse(struct aim_session_t *, struct command_rx_struct *); | 526 faim_internal int aim_authparse(struct aim_session_t *, struct command_rx_struct *); |
522 int aim_handleredirect_middle(struct aim_session_t *, struct command_rx_struct *, ...); | 527 faim_internal int aim_handleredirect_middle(struct aim_session_t *, struct command_rx_struct *, ...); |
523 int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *, ...); | 528 faim_internal int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *, ...); |
524 int aim_parse_last_bad(struct aim_session_t *, struct command_rx_struct *, ...); | 529 int aim_parse_last_bad(struct aim_session_t *, struct command_rx_struct *, ...); |
525 int aim_parse_generalerrs(struct aim_session_t *, struct command_rx_struct *command, ...); | 530 faim_internal int aim_parse_generalerrs(struct aim_session_t *, struct command_rx_struct *command, ...); |
526 int aim_parsemotd_middle(struct aim_session_t *sess, struct command_rx_struct *command, ...); | 531 faim_internal int aim_parsemotd_middle(struct aim_session_t *sess, struct command_rx_struct *command, ...); |
527 int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command); | 532 faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command); |
528 int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command); | 533 faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command); |
529 int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command); | 534 faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command); |
535 | |
536 faim_export unsigned long aim_ads_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); | |
537 faim_export unsigned long aim_ads_requestads(struct aim_session_t *sess, struct aim_conn_t *conn); | |
530 | 538 |
531 /* aim_im.c */ | 539 /* aim_im.c */ |
532 struct aim_directim_priv { | 540 struct aim_directim_priv { |
533 unsigned char cookie[8]; | 541 unsigned char cookie[8]; |
534 char sn[MAXSNLEN+1]; | 542 char sn[MAXSNLEN+1]; |
536 }; | 544 }; |
537 | 545 |
538 #define AIM_IMFLAGS_AWAY 0x01 /* mark as an autoreply */ | 546 #define AIM_IMFLAGS_AWAY 0x01 /* mark as an autoreply */ |
539 #define AIM_IMFLAGS_ACK 0x02 /* request a receipt notice */ | 547 #define AIM_IMFLAGS_ACK 0x02 /* request a receipt notice */ |
540 | 548 |
541 u_long aim_send_im(struct aim_session_t *, struct aim_conn_t *, char *, u_int, char *); | 549 faim_export unsigned long aim_send_im(struct aim_session_t *, struct aim_conn_t *, char *, u_int, char *); |
542 int aim_parse_incoming_im_middle(struct aim_session_t *, struct command_rx_struct *); | 550 faim_internal int aim_parse_incoming_im_middle(struct aim_session_t *, struct command_rx_struct *); |
543 int aim_parse_outgoing_im_middle(struct aim_session_t *, struct command_rx_struct *); | 551 faim_internal int aim_parse_outgoing_im_middle(struct aim_session_t *, struct command_rx_struct *); |
544 u_long aim_seticbmparam(struct aim_session_t *, struct aim_conn_t *conn); | 552 faim_export unsigned long aim_seticbmparam(struct aim_session_t *, struct aim_conn_t *conn); |
545 int aim_parse_msgerror_middle(struct aim_session_t *, struct command_rx_struct *); | 553 faim_internal int aim_parse_msgerror_middle(struct aim_session_t *, struct command_rx_struct *); |
546 int aim_negchan_middle(struct aim_session_t *sess, struct command_rx_struct *command); | 554 faim_internal int aim_negchan_middle(struct aim_session_t *sess, struct command_rx_struct *command); |
547 int aim_parse_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); | 555 int aim_parse_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); |
548 int aim_parse_missedcall(struct aim_session_t *sess, struct command_rx_struct *command); | 556 faim_internal int aim_parse_missedcall(struct aim_session_t *sess, struct command_rx_struct *command); |
549 | 557 |
550 struct aim_conn_t * aim_directim_initiate(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *, char *); | 558 faim_export struct aim_conn_t * aim_directim_initiate(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *, char *); |
551 int aim_send_im_direct(struct aim_session_t *, struct aim_conn_t *, char *); | 559 faim_export int aim_send_im_direct(struct aim_session_t *, struct aim_conn_t *, char *); |
552 struct aim_conn_t *aim_directim_connect(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *); | 560 faim_export struct aim_conn_t *aim_directim_connect(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *); |
553 | 561 |
554 /* aim_info.c */ | 562 /* aim_info.c */ |
555 #define AIM_CAPS_BUDDYICON 0x01 | 563 #define AIM_CAPS_BUDDYICON 0x01 |
556 #define AIM_CAPS_VOICE 0x02 | 564 #define AIM_CAPS_VOICE 0x02 |
557 #define AIM_CAPS_IMIMAGE 0x04 | 565 #define AIM_CAPS_IMIMAGE 0x04 |
558 #define AIM_CAPS_CHAT 0x08 | 566 #define AIM_CAPS_CHAT 0x08 |
559 #define AIM_CAPS_GETFILE 0x10 | 567 #define AIM_CAPS_GETFILE 0x10 |
560 #define AIM_CAPS_SENDFILE 0x20 | 568 #define AIM_CAPS_SENDFILE 0x20 |
561 | 569 |
562 extern u_char aim_caps[6][16]; | 570 extern u_char aim_caps[6][16]; |
563 u_short aim_getcap(unsigned char *capblock, int buflen); | 571 faim_internal unsigned short aim_getcap(unsigned char *capblock, int buflen); |
564 int aim_putcap(unsigned char *capblock, int buflen, u_short caps); | 572 faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps); |
565 | 573 |
566 #define AIM_GETINFO_GENERALINFO 0x00001 | 574 #define AIM_GETINFO_GENERALINFO 0x00001 |
567 #define AIM_GETINFO_AWAYMESSAGE 0x00003 | 575 #define AIM_GETINFO_AWAYMESSAGE 0x00003 |
568 | 576 |
569 struct aim_msgcookie_t { | 577 struct aim_msgcookie_t { |
631 #define AIM_COOKIETYPE_OFTSEND 0x12 | 639 #define AIM_COOKIETYPE_OFTSEND 0x12 |
632 #define AIM_COOKIETYPE_OFTVOICE 0x13 | 640 #define AIM_COOKIETYPE_OFTVOICE 0x13 |
633 #define AIM_COOKIETYPE_OFTIMAGE 0x14 | 641 #define AIM_COOKIETYPE_OFTIMAGE 0x14 |
634 #define AIM_COOKIETYPE_OFTICON 0x15 | 642 #define AIM_COOKIETYPE_OFTICON 0x15 |
635 | 643 |
636 int aim_cachecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); | 644 faim_internal int aim_cachecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); |
637 int aim_purgecookies(struct aim_session_t *sess, int maxage); | 645 faim_export int aim_purgecookies(struct aim_session_t *sess, int maxage); |
638 struct aim_msgcookie_t *aim_uncachecookie(struct aim_session_t *sess, char *cookie, int type); | 646 faim_internal struct aim_msgcookie_t *aim_uncachecookie(struct aim_session_t *sess, unsigned char *cookie, int type); |
639 struct aim_msgcookie_t *aim_mkcookie(unsigned char *, int, void *); | 647 faim_internal struct aim_msgcookie_t *aim_mkcookie(unsigned char *, int, void *); |
640 struct aim_msgcookie_t *aim_checkcookie(struct aim_session_t *, char *, int); | 648 faim_internal struct aim_msgcookie_t *aim_checkcookie(struct aim_session_t *, unsigned char *, int); |
641 int aim_getcookietype(int); | 649 faim_internal int aim_msgcookie_gettype(int reqclass); |
642 | 650 |
643 int aim_handlerendconnect(struct aim_session_t *sess, struct aim_conn_t *cur); | 651 faim_export int aim_handlerendconnect(struct aim_session_t *sess, struct aim_conn_t *cur); |
644 | 652 |
645 #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000 | 653 #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000 |
646 #define AIM_TRANSFER_DENY_DECLINE 0x0001 | 654 #define AIM_TRANSFER_DENY_DECLINE 0x0001 |
647 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002 | 655 #define AIM_TRANSFER_DENY_NOTACCEPTING 0x0002 |
648 u_long aim_denytransfer(struct aim_session_t *sess, struct aim_conn_t *conn, char *sender, char *cookie, unsigned short code); | 656 faim_export unsigned long aim_denytransfer(struct aim_session_t *sess, struct aim_conn_t *conn, char *sender, char *cookie, unsigned short code); |
649 u_long aim_accepttransfer(struct aim_session_t *sess, struct aim_conn_t *conn,struct aim_conn_t *oftconn, char *sender, char *cookie, unsigned short rendid); | 657 faim_export unsigned long aim_accepttransfer(struct aim_session_t *sess, struct aim_conn_t *conn,struct aim_conn_t *oftconn, char *sender, char *cookie, unsigned short rendid); |
650 | 658 |
651 u_long aim_getinfo(struct aim_session_t *, struct aim_conn_t *, const char *, unsigned short); | 659 faim_export unsigned long aim_getinfo(struct aim_session_t *, struct aim_conn_t *, const char *, unsigned short); |
652 int aim_extractuserinfo(u_char *, struct aim_userinfo_s *); | 660 faim_internal int aim_extractuserinfo(u_char *, struct aim_userinfo_s *); |
653 int aim_parse_userinfo_middle(struct aim_session_t *, struct command_rx_struct *); | 661 faim_internal int aim_parse_userinfo_middle(struct aim_session_t *, struct command_rx_struct *); |
654 int aim_parse_oncoming_middle(struct aim_session_t *, struct command_rx_struct *); | 662 faim_internal int aim_parse_oncoming_middle(struct aim_session_t *, struct command_rx_struct *); |
655 int aim_parse_offgoing_middle(struct aim_session_t *, struct command_rx_struct *); | 663 faim_internal int aim_parse_offgoing_middle(struct aim_session_t *, struct command_rx_struct *); |
656 int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info); | 664 faim_internal int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info); |
657 int aim_sendbuddyoncoming(struct aim_session_t *sess, struct aim_conn_t *conn, struct aim_userinfo_s *info); | 665 faim_export int aim_sendbuddyoncoming(struct aim_session_t *sess, struct aim_conn_t *conn, struct aim_userinfo_s *info); |
658 int aim_sendbuddyoffgoing(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); | 666 faim_export int aim_sendbuddyoffgoing(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); |
659 int aim_parse_locateerr(struct aim_session_t *sess, struct command_rx_struct *command); | 667 faim_internal int aim_parse_locateerr(struct aim_session_t *sess, struct command_rx_struct *command); |
660 | 668 |
661 /* aim_auth.c */ | 669 /* aim_auth.c */ |
662 int aim_auth_sendcookie(struct aim_session_t *, struct aim_conn_t *, u_char *); | 670 faim_export int aim_auth_sendcookie(struct aim_session_t *, struct aim_conn_t *, u_char *); |
663 u_long aim_auth_clientready(struct aim_session_t *, struct aim_conn_t *); | 671 faim_export u_long aim_auth_clientready(struct aim_session_t *, struct aim_conn_t *); |
664 u_long aim_auth_changepasswd(struct aim_session_t *, struct aim_conn_t *, char *, char *); | 672 faim_export unsigned long aim_auth_changepasswd(struct aim_session_t *, struct aim_conn_t *, char *, char *); |
665 | 673 |
666 /* aim_buddylist.c */ | 674 /* aim_buddylist.c */ |
667 u_long aim_add_buddy(struct aim_session_t *, struct aim_conn_t *, char *); | 675 faim_export unsigned long aim_add_buddy(struct aim_session_t *, struct aim_conn_t *, char *); |
668 u_long aim_remove_buddy(struct aim_session_t *, struct aim_conn_t *, char *); | 676 faim_export unsigned long aim_remove_buddy(struct aim_session_t *, struct aim_conn_t *, char *); |
669 int aim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); | 677 faim_internal int aim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); |
670 | 678 |
671 /* aim_search.c */ | 679 /* aim_search.c */ |
672 u_long aim_usersearch_address(struct aim_session_t *, struct aim_conn_t *, char *); | 680 faim_export u_long aim_usersearch_address(struct aim_session_t *, struct aim_conn_t *, char *); |
673 /* u_long aim_usersearch_name(struct aim_session_t *, struct aim_conn_t *, char *); */ | |
674 | 681 |
675 | 682 |
676 struct aim_chat_roominfo { | 683 struct aim_chat_roominfo { |
677 u_short exchange; | 684 u_short exchange; |
678 char *name; | 685 char *name; |
679 u_short instance; | 686 u_short instance; |
680 }; | 687 }; |
681 int aim_chat_readroominfo(u_char *buf, struct aim_chat_roominfo *outinfo); | 688 faim_internal int aim_chat_readroominfo(u_char *buf, struct aim_chat_roominfo *outinfo); |
682 int aim_chat_parse_infoupdate(struct aim_session_t *sess, struct command_rx_struct *command); | 689 faim_internal int aim_chat_parse_infoupdate(struct aim_session_t *sess, struct command_rx_struct *command); |
683 int aim_chat_parse_joined(struct aim_session_t *sess, struct command_rx_struct *command); | 690 faim_internal int aim_chat_parse_joined(struct aim_session_t *sess, struct command_rx_struct *command); |
684 int aim_chat_parse_leave(struct aim_session_t *sess, struct command_rx_struct *command); | 691 faim_internal int aim_chat_parse_leave(struct aim_session_t *sess, struct command_rx_struct *command); |
685 int aim_chat_parse_incoming(struct aim_session_t *sess, struct command_rx_struct *command); | 692 faim_internal int aim_chat_parse_incoming(struct aim_session_t *sess, struct command_rx_struct *command); |
686 u_long aim_chat_send_im(struct aim_session_t *sess, struct aim_conn_t *conn, char *msg); | 693 faim_export unsigned long aim_chat_send_im(struct aim_session_t *sess, struct aim_conn_t *conn, char *msg); |
687 u_long aim_chat_join(struct aim_session_t *sess, struct aim_conn_t *conn, u_short exchange, const char *roomname); | 694 faim_export unsigned long aim_chat_join(struct aim_session_t *sess, struct aim_conn_t *conn, u_short exchange, const char *roomname); |
688 u_long aim_chat_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); | 695 faim_export unsigned long aim_chat_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); |
689 int aim_chat_attachname(struct aim_conn_t *conn, char *roomname); | 696 faim_export int aim_chat_attachname(struct aim_conn_t *conn, char *roomname); |
690 char *aim_chat_getname(struct aim_conn_t *conn); | 697 faim_export char *aim_chat_getname(struct aim_conn_t *conn); |
691 struct aim_conn_t *aim_chat_getconn(struct aim_session_t *, char *name); | 698 faim_export struct aim_conn_t *aim_chat_getconn(struct aim_session_t *, char *name); |
692 | 699 |
693 u_long aim_chatnav_reqrights(struct aim_session_t *sess, struct aim_conn_t *conn); | 700 faim_export unsigned long aim_chatnav_reqrights(struct aim_session_t *sess, struct aim_conn_t *conn); |
694 u_long aim_chatnav_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); | 701 faim_export unsigned long aim_chatnav_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); |
695 | 702 |
696 u_long aim_chat_invite(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn, char *msg, u_short exchange, char *roomname, u_short instance); | 703 faim_export unsigned long aim_chat_invite(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn, char *msg, u_short exchange, char *roomname, u_short instance); |
697 | 704 |
698 struct aim_chat_exchangeinfo { | 705 struct aim_chat_exchangeinfo { |
699 u_short number; | 706 u_short number; |
700 char *name; | 707 char *name; |
701 char *charset1; | 708 char *charset1; |
702 char *lang1; | 709 char *lang1; |
703 char *charset2; | 710 char *charset2; |
704 char *lang2; | 711 char *lang2; |
705 }; | 712 }; |
706 int aim_chatnav_parse_info(struct aim_session_t *sess, struct command_rx_struct *command); | 713 faim_internal int aim_chatnav_parse_info(struct aim_session_t *sess, struct command_rx_struct *command); |
707 u_long aim_chatnav_createroom(struct aim_session_t *sess, struct aim_conn_t *conn, char *name, u_short exchange); | 714 faim_export u_long aim_chatnav_createroom(struct aim_session_t *sess, struct aim_conn_t *conn, char *name, u_short exchange); |
708 int aim_chat_leaveroom(struct aim_session_t *sess, char *name); | 715 faim_export int aim_chat_leaveroom(struct aim_session_t *sess, char *name); |
709 | 716 |
710 /* aim_util.c */ | 717 /* aim_util.c */ |
711 #ifdef AIMUTIL_USEMACROS | 718 #ifdef AIMUTIL_USEMACROS |
712 /* | 719 /* |
713 * These are really ugly. You'd think this was LISP. I wish it was. | 720 * These are really ugly. You'd think this was LISP. I wish it was. |
737 u_short aimutil_get16(u_char *); | 744 u_short aimutil_get16(u_char *); |
738 int aimutil_put32(u_char *, u_long); | 745 int aimutil_put32(u_char *, u_long); |
739 u_long aimutil_get32(u_char *); | 746 u_long aimutil_get32(u_char *); |
740 #endif | 747 #endif |
741 | 748 |
742 int aimutil_putstr(u_char *, const u_char *, int); | 749 faim_export int aimutil_putstr(u_char *, const char *, int); |
743 int aimutil_tokslen(char *toSearch, int index, char dl); | 750 faim_export int aimutil_tokslen(char *toSearch, int index, char dl); |
744 int aimutil_itemcnt(char *toSearch, char dl); | 751 faim_export int aimutil_itemcnt(char *toSearch, char dl); |
745 char *aimutil_itemidx(char *toSearch, int index, char dl); | 752 faim_export char *aimutil_itemidx(char *toSearch, int index, char dl); |
746 | 753 |
747 int aim_snlen(const char *sn); | 754 faim_export int aim_snlen(const char *sn); |
748 int aim_sncmp(const char *sn1, const char *sn2); | 755 faim_export int aim_sncmp(const char *sn1, const char *sn2); |
756 | |
757 /* for libc's that dont have it */ | |
758 faim_export char *aim_strsep(char **pp, const char *delim); | |
749 | 759 |
750 /* aim_meta.c */ | 760 /* aim_meta.c */ |
751 char *aim_getbuilddate(void); | 761 faim_export char *aim_getbuilddate(void); |
752 char *aim_getbuildtime(void); | 762 faim_export char *aim_getbuildtime(void); |
753 char *aim_getbuildstring(void); | 763 faim_export char *aim_getbuildstring(void); |
764 faim_internal void faimdprintf(int dlevel, const char *format, ...); | |
754 | 765 |
755 #endif /* __AIM_H__ */ | 766 #endif /* __AIM_H__ */ |
756 | 767 |