- Timestamp:
- 2010-03-26T12:14:37Z (14 years ago)
- Branches:
- master
- Children:
- ebaebfe
- Parents:
- ba7d16f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
rba7d16f r3ddb7477 5 5 \********************************************************************/ 6 6 7 /* The big hairy IRCd part of the project*/7 /* The IRC-based UI (for now the only one) */ 8 8 9 9 /* … … 49 49 } irc_status_t; 50 50 51 struct irc_user; 52 51 53 typedef struct irc 52 54 { … … 59 61 GIConv iconv, oconv; 60 62 61 int sentbytes;62 time_t oldtime;63 struct irc_user *root; 64 struct irc_user *user; 63 65 64 char *nick;65 char *user;66 char *host;67 char *realname;68 66 char *password; /* HACK: Used to save the user's password, but before 69 67 logging in, this may contain a password we should … … 72 70 char umode[8]; 73 71 74 char *myhost;75 char *mynick;76 77 char *channel;78 int c_id;79 80 char is_private; /* Not too nice... */81 char *last_target;82 83 72 struct query *queries; 84 73 struct account *accounts; … … 86 75 struct chat *chatrooms; 87 76 88 struct __USER*users;89 GHashTable * userhash;77 GSList *users; 78 GHashTable *nick_user_hash; 90 79 GHashTable *watches; 91 struct __NICK *nicks;92 struct set *set;93 80 94 81 gint r_watch_source_id; 95 82 gint w_watch_source_id; 96 83 gint ping_source_id; 84 85 struct bee *b; 97 86 } irc_t; 87 88 typedef struct irc_user 89 { 90 char *nick; 91 char *user; 92 char *host; 93 char *fullname; 94 95 /* Nickname in lowercase for case sensitive searches */ 96 char *key; 97 98 char is_private; 99 100 char *sendbuf; 101 int sendbuf_len; 102 guint sendbuf_timer; 103 int sendbuf_flags; 104 105 //struct user *b; 106 } irc_user_t; 98 107 99 108 #include "user.h" 100 109 110 /* irc.c */ 101 111 extern GSList *irc_connection_list; 102 112 … … 105 115 void irc_free( irc_t *irc ); 106 116 107 void irc_exec( irc_t *irc, char **cmd );108 117 void irc_process( irc_t *irc ); 109 118 char **irc_parse_line( char *line ); 110 119 char *irc_build_line( char **cmd ); 111 120 112 void irc_vawrite( irc_t *irc, char *format, va_list params );113 121 void irc_write( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); 114 122 void irc_write_all( int now, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); 115 void irc_reply( irc_t *irc, int code, char *format, ... ) G_GNUC_PRINTF( 3, 4 ); 116 G_MODULE_EXPORT int irc_usermsg( irc_t *irc, char *format, ... ) G_GNUC_PRINTF( 2, 3 ); 117 char **irc_tokenize( char *buffer ); 123 void irc_vawrite( irc_t *irc, char *format, va_list params ); 118 124 119 void irc_login( irc_t *irc );120 125 int irc_check_login( irc_t *irc ); 121 void irc_motd( irc_t *irc );122 void irc_names( irc_t *irc, char *channel );123 void irc_topic( irc_t *irc, char *channel );124 void irc_umode_set( irc_t *irc, char *s, int allow_priv );125 void irc_who( irc_t *irc, char *channel );126 void irc_spawn( irc_t *irc, user_t *u );127 void irc_join( irc_t *irc, user_t *u, char *channel );128 void irc_part( irc_t *irc, user_t *u, char *channel );129 void irc_kick( irc_t *irc, user_t *u, char *channel, user_t *kicker );130 void irc_kill( irc_t *irc, user_t *u );131 void irc_invite( irc_t *irc, char *nick, char *channel );132 void irc_whois( irc_t *irc, char *nick );133 void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */134 126 135 int irc_send( irc_t *irc, char *nick, char *s, int flags ); 136 int irc_privmsg( irc_t *irc, user_t *u, char *type, char *to, char *prefix, char *msg ); 137 int irc_msgfrom( irc_t *irc, char *nick, char *msg ); 138 int irc_noticefrom( irc_t *irc, char *nick, char *msg ); 127 /* irc_commands.c */ 128 void irc_exec( irc_t *irc, char **cmd ); 139 129 140 void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ); 141 struct groupchat *irc_chat_by_channel( irc_t *irc, char *channel ); 130 /* irc_send.c */ 131 void irc_send_num( irc_t *irc, int code, char *format, ... ) G_GNUC_PRINTF( 3, 4 ); 132 void irc_send_login( irc_t *irc ); 133 void irc_send_motd( irc_t *irc ); 134 int irc_usermsg( irc_t *irc, char *format, ... ); 135 136 /* irc_user.c */ 137 irc_user_t *irc_user_new( irc_t *irc, const char *nick ); 138 int irc_user_free( irc_t *irc, const char *nick ); 139 irc_user_t *irc_user_find( irc_t *irc, const char *nick ); 140 int irc_user_rename( irc_t *irc, const char *old, const char *new ); 142 141 143 142 #endif
Note: See TracChangeset
for help on using the changeset viewer.