Mercurial > pidgin
diff libfaim/aim.h @ 1593:ec31e23aadc7
[gaim-migrate @ 1603]
libfaim updates and a bug fix for bad password.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 16 Mar 2001 14:29:54 +0000 |
parents | 1e2cc8c8bf3c |
children | 3fe5799b7823 |
line wrap: on
line diff
--- a/libfaim/aim.h Fri Mar 16 11:54:39 2001 +0000 +++ b/libfaim/aim.h Fri Mar 16 14:29:54 2001 +0000 @@ -70,8 +70,7 @@ /* Portability stuff (DMP) */ #ifdef _WIN32 -#define sleep Sleep -#define socklen_t int /* this must be a POSIXy thing */ +#define sleep(x) Sleep((x)*1000) #define snprintf _snprintf /* I'm not sure whats wrong with Microsoft here */ #define close(x) closesocket(x) /* no comment */ #endif @@ -398,28 +397,28 @@ }; /* TLV-handling functions */ -faim_internal struct aim_tlvlist_t *aim_readtlvchain(u_char *buf, int maxlen); +faim_internal struct aim_tlvlist_t *aim_readtlvchain(const unsigned char *buf, const int maxlen); faim_internal void aim_freetlvchain(struct aim_tlvlist_t **list); -faim_internal struct aim_tlv_t *aim_grabtlv(u_char *src); -faim_internal struct aim_tlv_t *aim_grabtlvstr(u_char *src); -faim_internal struct aim_tlv_t *aim_gettlv(struct aim_tlvlist_t *, u_short, int); -faim_internal char *aim_gettlv_str(struct aim_tlvlist_t *, u_short, int); -faim_internal unsigned char aim_gettlv8(struct aim_tlvlist_t *list, unsigned short type, int num); -faim_internal unsigned short aim_gettlv16(struct aim_tlvlist_t *list, unsigned short type, int num); -faim_internal unsigned long aim_gettlv32(struct aim_tlvlist_t *list, unsigned short type, int num); -faim_internal int aim_puttlv (u_char *dest, struct aim_tlv_t *newtlv); +faim_internal struct aim_tlv_t *aim_grabtlv(const unsigned char *src); +faim_internal struct aim_tlv_t *aim_grabtlvstr(const unsigned char *src); +faim_internal struct aim_tlv_t *aim_gettlv(struct aim_tlvlist_t *, const unsigned short, const int); +faim_internal char *aim_gettlv_str(struct aim_tlvlist_t *, const unsigned short, const int); +faim_internal unsigned char aim_gettlv8(struct aim_tlvlist_t *list, const unsigned short type, const int num); +faim_internal unsigned short aim_gettlv16(struct aim_tlvlist_t *list, const unsigned short type, const int num); +faim_internal unsigned long aim_gettlv32(struct aim_tlvlist_t *list, const unsigned short type, const int num); +faim_internal int aim_puttlv (unsigned char *dest, struct aim_tlv_t *newtlv); faim_internal struct aim_tlv_t *aim_createtlv(void); faim_internal int aim_freetlv(struct aim_tlv_t **oldtlv); -faim_internal int aim_puttlv_8(unsigned char *buf, unsigned short t, unsigned char v); -faim_internal int aim_puttlv_16(u_char *, u_short, u_short); -faim_internal int aim_puttlv_32(u_char *, u_short, u_long); -faim_internal int aim_puttlv_str(u_char *buf, u_short t, int l, char *v); -faim_internal int aim_writetlvchain(u_char *buf, int buflen, struct aim_tlvlist_t **list); -faim_internal int aim_addtlvtochain16(struct aim_tlvlist_t **list, unsigned short type, unsigned short val); -faim_internal int aim_addtlvtochain32(struct aim_tlvlist_t **list, unsigned short type, unsigned long val); -faim_internal int aim_addtlvtochain_str(struct aim_tlvlist_t **list, unsigned short type, char *str, int len); -faim_internal int aim_addtlvtochain_caps(struct aim_tlvlist_t **list, unsigned short type, unsigned short caps); -faim_internal int aim_addtlvtochain_noval(struct aim_tlvlist_t **list, unsigned short type); +faim_internal int aim_puttlv_8(unsigned char *buf, const unsigned short t, const unsigned char v); +faim_internal int aim_puttlv_16(unsigned char *, const unsigned short, const unsigned short); +faim_internal int aim_puttlv_32(unsigned char *, const unsigned short, const unsigned long); +faim_internal int aim_puttlv_str(u_char *buf, const unsigned short t, const int l, const char *v); +faim_internal int aim_writetlvchain(unsigned char *buf, const int buflen, struct aim_tlvlist_t **list); +faim_internal int aim_addtlvtochain16(struct aim_tlvlist_t **list, const unsigned short type, const unsigned short val); +faim_internal int aim_addtlvtochain32(struct aim_tlvlist_t **list, const unsigned short type, const unsigned long val); +faim_internal int aim_addtlvtochain_str(struct aim_tlvlist_t **list, const unsigned short type, const char *str, const int len); +faim_internal int aim_addtlvtochain_caps(struct aim_tlvlist_t **list, const unsigned short type, const unsigned short caps); +faim_internal int aim_addtlvtochain_noval(struct aim_tlvlist_t **list, const unsigned short type); faim_internal int aim_counttlvchain(struct aim_tlvlist_t **list); #endif /* FAIM_INTERNAL */ @@ -441,12 +440,6 @@ typedef int (*rxcallback_t)(struct aim_session_t *, struct command_rx_struct *, ...); -#ifdef FAIM_INTERNAL -faim_internal unsigned long aim_genericreq_n(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype); -faim_internal unsigned long aim_genericreq_l(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_long *); -faim_internal unsigned long aim_genericreq_s(struct aim_session_t *, struct aim_conn_t *conn, u_short family, u_short subtype, u_short *); -#endif - /* aim_login.c */ faim_export int aim_sendconnack(struct aim_session_t *sess, struct aim_conn_t *conn); faim_export int aim_request_login (struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); @@ -457,25 +450,6 @@ faim_export unsigned long aim_sendredirect(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned short servid, char *ip, char *cookie); faim_export void aim_purge_rxqueue(struct aim_session_t *); -#ifdef FAIM_INTERNAL -faim_internal int aim_authkeyparse(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal void aim_rxqueue_cleanbyconn(struct aim_session_t *sess, struct aim_conn_t *conn); -faim_internal int aim_recv(int fd, void *buf, size_t count); - -faim_internal int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *command, ...); -faim_internal int aim_get_command_rendezvous(struct aim_session_t *sess, struct aim_conn_t *conn); - -faim_internal int aim_tx_sendframe(struct aim_session_t *sess, struct command_tx_struct *cur); -faim_internal unsigned int aim_get_next_txseqnum(struct aim_conn_t *); -faim_internal struct command_tx_struct *aim_tx_new(struct aim_session_t *sess, struct aim_conn_t *conn, unsigned char framing, int chan, int datalen); -faim_internal int aim_tx_enqueue(struct aim_session_t *, struct command_tx_struct *); -faim_internal int aim_tx_printqueue(struct aim_session_t *); -faim_internal int aim_parse_hostonline(struct aim_session_t *sess, struct command_rx_struct *command, ...); -faim_internal int aim_parse_hostversions(struct aim_session_t *sess, struct command_rx_struct *command, ...); -faim_internal int aim_parse_accountconfirm(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_parse_infochange(struct aim_session_t *sess, struct command_rx_struct *command); -#endif /* FAIM_INTERNAL */ - #define AIM_TX_QUEUED 0 /* default */ #define AIM_TX_IMMEDIATE 1 #define AIM_TX_USER 2 @@ -497,37 +471,6 @@ 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); faim_export int aim_clearhandlers(struct aim_conn_t *conn); -#ifdef FAIM_INTERNAL -faim_internal rxcallback_t aim_callhandler(struct aim_session_t *sess, struct aim_conn_t *conn, u_short family, u_short type); -#endif - -#ifdef FAIM_INTERNAL -/* - * Generic SNAC structure. Rarely if ever used. - */ -struct aim_snac_t { - u_long id; - u_short family; - u_short type; - u_short flags; - void *data; - time_t issuetime; - struct aim_snac_t *next; -}; -faim_internal void aim_initsnachash(struct aim_session_t *sess); -faim_internal unsigned long aim_newsnac(struct aim_session_t *, struct aim_snac_t *newsnac); -faim_internal unsigned long aim_cachesnac(struct aim_session_t *sess, const unsigned short family, const unsigned short type, const unsigned short flags, const void *data, const int datalen); -faim_internal struct aim_snac_t *aim_remsnac(struct aim_session_t *, u_long id); -faim_internal int aim_cleansnacs(struct aim_session_t *, int maxage); -faim_internal int aim_putsnac(u_char *, int, int, int, u_long); -#endif /* FAIM_INTERNAL */ - -#ifdef FAIM_INTERNAL -faim_internal void aim_connrst(struct aim_session_t *); -faim_internal struct aim_conn_t *aim_conn_getnext(struct aim_session_t *); -faim_internal struct aim_conn_t *aim_cloneconn(struct aim_session_t *sess, struct aim_conn_t *src); -#endif /* FAIM_INTERNAL */ - faim_export void aim_conn_close(struct aim_conn_t *deadconn); faim_export struct aim_conn_t *aim_newconn(struct aim_session_t *, int type, char *dest); faim_export int aim_conngetmaxfd(struct aim_session_t *); @@ -585,39 +528,9 @@ faim_export struct aim_fileheader_t *aim_getlisting(struct aim_session_t *sess, FILE *); -#ifdef FAIM_INTERNAL -faim_internal int aim_oft_buildheader(unsigned char *,struct aim_fileheader_t *); -faim_internal int aim_listenestablish(u_short); -faim_internal int aim_tx_destroy(struct command_tx_struct *); -#endif /* FAIM_INTERNAL */ - /* aim_rxhandlers.c */ faim_export int aim_rxdispatch(struct aim_session_t *); -#ifdef FAIM_INTERNAL -faim_internal int aim_authparse(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_handleredirect_middle(struct aim_session_t *, struct command_rx_struct *, ...); -faim_internal int aim_parse_unknown(struct aim_session_t *, struct command_rx_struct *, ...); -faim_internal int aim_parse_generalerrs(struct aim_session_t *, struct command_rx_struct *command, ...); -faim_internal int aim_parsemotd_middle(struct aim_session_t *sess, struct command_rx_struct *command, ...); - -/* these are used by aim_*_clientready */ -#define AIM_TOOL_JAVA 0x0001 -#define AIM_TOOL_MAC 0x0002 -#define AIM_TOOL_WIN16 0x0003 -#define AIM_TOOL_WIN32 0x0004 -#define AIM_TOOL_MAC68K 0x0005 -#define AIM_TOOL_MACPPC 0x0006 -#define AIM_TOOL_NEWWIN 0x0010 -struct aim_tool_version { - unsigned short group; - unsigned short version; - unsigned short tool; - unsigned short toolversion; -}; - -#endif /* FAIM_INTERNAL */ - #define AIM_CLIENTTYPE_UNKNOWN 0x0000 #define AIM_CLIENTTYPE_MC 0x0001 #define AIM_CLIENTTYPE_WINAIM 0x0002 @@ -632,13 +545,6 @@ faim_export unsigned long aim_ads_clientready(struct aim_session_t *sess, struct aim_conn_t *conn); faim_export unsigned long aim_ads_requestads(struct aim_session_t *sess, struct aim_conn_t *conn); -#ifdef FAIM_INTERNAL -faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command); - -faim_internal int aim_parse_evilnotify_middle(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct command_rx_struct *command); -#endif /* FAIM_INTERNAL */ - /* aim_im.c */ struct aim_directim_priv { unsigned char cookie[8]; @@ -699,15 +605,6 @@ faim_export struct aim_conn_t *aim_directim_connect(struct aim_session_t *, struct aim_conn_t *, struct aim_directim_priv *); faim_export unsigned long aim_seticbmparam(struct aim_session_t *, struct aim_conn_t *conn); -#ifdef FAIM_INTERNAL -faim_internal int aim_parse_incoming_im_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_parse_outgoing_im_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_parse_msgerror_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_negchan_middle(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_parse_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); -faim_internal int aim_parse_missedcall(struct aim_session_t *sess, struct command_rx_struct *command); -#endif /* FAIM_INTERNAL */ - faim_export struct aim_conn_t *aim_getfile_initiate(struct aim_session_t *sess, struct aim_conn_t *conn, char *destsn); faim_export int aim_oft_getfile_request(struct aim_session_t *sess, struct aim_conn_t *conn, const unsigned char *name, const int size); faim_export int aim_oft_getfile_ack(struct aim_session_t *sess, struct aim_conn_t *conn); @@ -723,13 +620,6 @@ #define AIM_CAPS_GAMES 0x40 #define AIM_CAPS_SAVESTOCKS 0x80 -#ifdef FAIM_INTERNAL -extern u_char aim_caps[8][16]; -faim_internal unsigned short aim_getcap(struct aim_session_t *sess, unsigned char *capblock, int buflen); -faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps); -#endif /* FAIM_INTERNAL */ - - #define AIM_GETINFO_GENERALINFO 0x00001 #define AIM_GETINFO_AWAYMESSAGE 0x00003 @@ -765,16 +655,6 @@ #define AIM_COOKIETYPE_OFTIMAGE 0x14 #define AIM_COOKIETYPE_OFTICON 0x15 -#ifdef FAIM_INTERNAL -faim_internal int aim_cachecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); -faim_internal struct aim_msgcookie_t *aim_uncachecookie(struct aim_session_t *sess, unsigned char *cookie, int type); -faim_internal struct aim_msgcookie_t *aim_mkcookie(unsigned char *, int, void *); -faim_internal struct aim_msgcookie_t *aim_checkcookie(struct aim_session_t *, const unsigned char *, const int); -faim_internal int aim_freecookie(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); -faim_internal int aim_msgcookie_gettype(int reqclass); -faim_internal int aim_cookie_free(struct aim_session_t *sess, struct aim_msgcookie_t *cookie); -#endif /* FAIM_INTERNAL */ - faim_export int aim_handlerendconnect(struct aim_session_t *sess, struct aim_conn_t *cur); #define AIM_TRANSFER_DENY_NOTSUPPORTED 0x0000 @@ -783,15 +663,6 @@ faim_export unsigned long aim_denytransfer(struct aim_session_t *sess, struct aim_conn_t *conn, char *sender, char *cookie, unsigned short code); faim_export struct aim_conn_t *aim_accepttransfer(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn, char *cookie, char *ip, unsigned short listingfiles, unsigned short listingtotsize, unsigned short listingsize, unsigned int listingchecksum, unsigned short rendid); -#ifdef FAIM_INTERNAL -faim_internal int aim_extractuserinfo(struct aim_session_t *sess, unsigned char *, struct aim_userinfo_s *); -faim_internal int aim_parse_userinfo_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_parse_oncoming_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_parse_offgoing_middle(struct aim_session_t *, struct command_rx_struct *); -faim_internal int aim_putuserinfo(u_char *buf, int buflen, struct aim_userinfo_s *info); -faim_internal int aim_parse_locateerr(struct aim_session_t *sess, struct command_rx_struct *command); -#endif /* FAIM_INTERNAL */ - faim_export unsigned long aim_getinfo(struct aim_session_t *, struct aim_conn_t *, const char *, unsigned short); faim_export int aim_sendbuddyoncoming(struct aim_session_t *sess, struct aim_conn_t *conn, struct aim_userinfo_s *info); faim_export int aim_sendbuddyoffgoing(struct aim_session_t *sess, struct aim_conn_t *conn, char *sn); @@ -806,18 +677,9 @@ faim_export unsigned long aim_add_buddy(struct aim_session_t *, struct aim_conn_t *, char *); faim_export unsigned long aim_remove_buddy(struct aim_session_t *, struct aim_conn_t *, char *); -#ifdef FAIM_INTERNAL -faim_internal int aim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...); -#endif /* FAIM_INTERNAL */ - /* aim_search.c */ faim_export u_long aim_usersearch_address(struct aim_session_t *, struct aim_conn_t *, char *); -#ifdef FAIM_INTERNAL -faim_internal unsigned long aim_parse_searcherror(struct aim_session_t *, struct command_rx_struct *); -faim_internal unsigned long aim_parse_searchreply(struct aim_session_t *, struct command_rx_struct *); -#endif - struct aim_chat_roominfo { u_short exchange; char *name; @@ -848,15 +710,6 @@ faim_export u_long aim_chatnav_createroom(struct aim_session_t *sess, struct aim_conn_t *conn, char *name, u_short exchange); faim_export int aim_chat_leaveroom(struct aim_session_t *sess, char *name); -#ifdef FAIM_INTERNAL -faim_internal int aim_chat_readroominfo(u_char *buf, struct aim_chat_roominfo *outinfo); -faim_internal int aim_chat_parse_infoupdate(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_chat_parse_joined(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_chat_parse_leave(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_chat_parse_incoming(struct aim_session_t *sess, struct command_rx_struct *command); -faim_internal int aim_chatnav_parse_info(struct aim_session_t *sess, struct command_rx_struct *command); -#endif /* FAIM_INTERNAL */ - /* aim_util.c */ #ifdef AIMUTIL_USEMACROS /* @@ -905,14 +758,7 @@ faim_export char *aim_getbuildtime(void); faim_export char *aim_getbuildstring(void); -#ifdef FAIM_INTERNAL -faim_internal void faimdprintf(struct aim_session_t *sess, int dlevel, const char *format, ...); - -/* why the hell wont cpp let you use #error inside #define's? */ -#define printf() printf called inside libfaim -#define sprintf() unbounded sprintf used inside libfaim - -#endif /* FAIM_INTERNAL */ +#include <aim_internal.h> #endif /* __AIM_H__ */