From: Piotr S. <ps...@us...> - 2009-09-17 12:05:39
|
Update of /cvsroot/ayttm/ayttm/modules/aim-toc/libtoc In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12682/modules/aim-toc/libtoc Modified Files: libtoc.c libtoc.h Log Message: reformatted source code Index: libtoc.c =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/aim-toc/libtoc/libtoc.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- libtoc.c 22 May 2009 06:02:23 -0000 1.19 +++ libtoc.c 17 Sep 2009 12:04:58 -0000 1.20 @@ -52,7 +52,6 @@ #define snprintf _snprintf #endif - #define TOC_HOST "toc.oscar.aol.com" #define TOC_PORT 80 #ifndef MSG_NOSIGNAL @@ -74,27 +73,24 @@ static char user_info_id[1024]; [...1997 lines suppressed...] } - int main() { - toc_conn * conn; - char buff[] = "toc_send_im tsearle256 \"if you see this message send a message to tsearle256\""; - proxy_set_proxy( PROXY_NONE, "", 0 ); + toc_conn *conn; + char buff[] = + "toc_send_im tsearle256 \"if you see this message send a message to tsearle256\""; + proxy_set_proxy(PROXY_NONE, "", 0); conn = toc_signon("", ""); toc_im_in = toc_test_im_in; eb_input_add(conn->fd, EB_INPUT_READ, toc_callback_handler, conn); @@ -1699,4 +1616,3 @@ gtk_main(); } #endif - Index: libtoc.h =================================================================== RCS file: /cvsroot/ayttm/ayttm/modules/aim-toc/libtoc/libtoc.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- libtoc.h 22 May 2009 06:02:23 -0000 1.11 +++ libtoc.h 17 Sep 2009 12:04:58 -0000 1.12 @@ -24,76 +24,75 @@ #include <stdio.h> #include "llist.h" -typedef struct _toc_conn -{ - int fd; - int seq_num; - void * account; - char server[255]; - short port; - char *username; - char *password; - int input; +typedef struct _toc_conn { + int fd; + int seq_num; + void *account; + char server[255]; + short port; + char *username; + char *password; + int input; } toc_conn; -typedef struct _toc_file_conn -{ +typedef struct _toc_file_conn { char header1[7]; char header2[2048]; - int fd; + int fd; unsigned long amount; - FILE * file; - int handle; - int progress; + FILE *file; + int handle; + int progress; } toc_file_conn; -void (*toc_new_user)(toc_conn *conn, char * group, char * handle); -void (*toc_new_group)(char * group); -int (*toc_begin_file_receive)( const char * filename, unsigned long size ); -void (*toc_update_file_status)( int tag, unsigned long progress ); -void (*toc_complete_file_receive)( int tag ); -void (*toc_im_in)(toc_conn * conn, char * user, char * message ); -void (*toc_chat_im_in)(toc_conn * conn, char * id, char * user, char * message ); -void (*update_user_status)(toc_conn *conn, char * user, int online, time_t idle, int evil, int unavailable ); -void (*toc_error_message)(char * message); -void (*toc_disconnect)(toc_conn * conn); -void (*toc_chat_invite)(toc_conn * conn, char * id, char * name, - char * sender, char * message ); -void (*toc_join_ack)(toc_conn * conn, char * id, char * name); -void (*toc_join_error)(toc_conn * conn, char * name); -void (*toc_chat_update_buddy)(toc_conn * conn, char * id, - char * user, int online ); -void (*toc_file_offer)( toc_conn * conn, char * nick, char * ip, short port, - char * cookie, char * filename ); - -void (*toc_user_info)(toc_conn * conn, char * user, char * message ); -void (*toc_logged_in)(toc_conn *conn); -int (*toc_async_socket)(const char *host, int port, void *cb, void *data); - -void toc_callback( toc_conn * conn ); -int toc_signon( const char * username, const char * password, - const char * server, short port, const char * info ); -void toc_send_keep_alive( toc_conn * conn ); -void toc_signoff( toc_conn * conn ); -void toc_send_im( toc_conn * conn, const char * username, const char * message ); -void toc_get_info( toc_conn * conn, const char * user ); -void toc_add_buddies( toc_conn * conn, const char * group, LList * list ); -void toc_add_buddy( toc_conn * conn, char * user, const char * group ); -void toc_set_idle( toc_conn * conn, int idle ); -void toc_set_away( toc_conn * conn, const char * message); -void toc_invite( toc_conn * conn, const char * id, const char * buddy, const char * message ); -void toc_chat_join( toc_conn * conn, const char * chat_room_name ); -void toc_chat_send( toc_conn * conn, const char * id, const char * message); -void toc_chat_leave( toc_conn * conn, const char * id ); -void toc_chat_accept( toc_conn * conn, const char * id); -void toc_file_accept( toc_conn * conn, const char * nick, const char * ip, short port, - const char * cookie, const char * filename ); -void toc_file_cancel( toc_conn * conn, const char * nick, const char * cookie ); -void toc_talk_accept( toc_conn * conn, const char * nick, const char * ip, short port, - const char * cookie ); -void toc_remove_buddy( toc_conn * conn, const char * user, const char * group ); +void (*toc_new_user) (toc_conn *conn, char *group, char *handle); +void (*toc_new_group) (char *group); +int (*toc_begin_file_receive) (const char *filename, unsigned long size); +void (*toc_update_file_status) (int tag, unsigned long progress); +void (*toc_complete_file_receive) (int tag); +void (*toc_im_in) (toc_conn *conn, char *user, char *message); +void (*toc_chat_im_in) (toc_conn *conn, char *id, char *user, char *message); +void (*update_user_status) (toc_conn *conn, char *user, int online, time_t idle, + int evil, int unavailable); +void (*toc_error_message) (char *message); +void (*toc_disconnect) (toc_conn *conn); +void (*toc_chat_invite) (toc_conn *conn, char *id, char *name, + char *sender, char *message); +void (*toc_join_ack) (toc_conn *conn, char *id, char *name); +void (*toc_join_error) (toc_conn *conn, char *name); +void (*toc_chat_update_buddy) (toc_conn *conn, char *id, + char *user, int online); +void (*toc_file_offer) (toc_conn *conn, char *nick, char *ip, short port, + char *cookie, char *filename); + +void (*toc_user_info) (toc_conn *conn, char *user, char *message); +void (*toc_logged_in) (toc_conn *conn); +int (*toc_async_socket) (const char *host, int port, void *cb, void *data); + +void toc_callback(toc_conn *conn); +int toc_signon(const char *username, const char *password, + const char *server, short port, const char *info); +void toc_send_keep_alive(toc_conn *conn); +void toc_signoff(toc_conn *conn); +void toc_send_im(toc_conn *conn, const char *username, const char *message); +void toc_get_info(toc_conn *conn, const char *user); +void toc_add_buddies(toc_conn *conn, const char *group, LList *list); +void toc_add_buddy(toc_conn *conn, char *user, const char *group); +void toc_set_idle(toc_conn *conn, int idle); +void toc_set_away(toc_conn *conn, const char *message); +void toc_invite(toc_conn *conn, const char *id, const char *buddy, + const char *message); +void toc_chat_join(toc_conn *conn, const char *chat_room_name); +void toc_chat_send(toc_conn *conn, const char *id, const char *message); +void toc_chat_leave(toc_conn *conn, const char *id); +void toc_chat_accept(toc_conn *conn, const char *id); +void toc_file_accept(toc_conn *conn, const char *nick, const char *ip, + short port, const char *cookie, const char *filename); +void toc_file_cancel(toc_conn *conn, const char *nick, const char *cookie); +void toc_talk_accept(toc_conn *conn, const char *nick, const char *ip, + short port, const char *cookie); +void toc_remove_buddy(toc_conn *conn, const char *user, const char *group); void toc_add_group(toc_conn *conn, const char *group); void toc_remove_group(toc_conn *conn, const char *group); - #endif |