Go to the source code of this file.
Data Structures | |
struct | list_type |
struct | user_entry_type |
struct | laston_info |
struct | bot_addr |
struct | user_entry |
struct | xtra_key |
struct | filesys_stats |
struct | chanuserrec |
struct | userrec |
struct | igrec |
Defines | |
#define | list_insert(a, b) |
#define | user_malloc(x) _user_malloc(x, __FILE__, __LINE__) |
#define | user_realloc(x, y) _user_realloc(x, y, __FILE__, __LINE__) |
#define | bot_flags(u) ((long)get_user(&USERENTRY_BOTFL, (u))) |
#define | is_bot(u) ((u) && ((u)->flags & USER_BOT)) |
#define | is_owner(u) ((u) && ((u)->flags & USER_OWNER)) |
#define | IGNORE_NAME "*ignore" |
#define | BAN_NAME "*ban" |
#define | EXEMPT_NAME "*exempt" |
#define | INVITE_NAME "*Invite" |
#define | IGREC_PERM 2 |
Functions | |
int ((int(*)(struct list_type **, struct list_type *)) global[74])(struct list_type ** | |
struct list_type * | int ((int(*)(struct list_type **, struct list_type *)) global[73])(struct list_type ** |
struct list_type *struct list_type * | int ((int(*)(struct list_type *, struct list_type *)) global[75])(struct list_type * |
struct user_entry_type(*)(*) | struct (global[196])) |
struct user_entry_type(*)(*)(*) | struct (global[192])) |
struct user_entry_type(*)(*)(*)(*) | struct (global[194])) |
struct user_entry_type(*)(*)(*)(*)(*) | struct (global[188])) |
struct user_entry_type(*)(*)(*)(*)(*)(*) | struct (global[190])) |
struct user_entry_type(*)(*)(*)(*)(*)(*)(*) | struct (global[191])) |
struct user_entry_type(*)(*)(*)(*)(*)(*)(*)(*) | struct (global[189])) |
void * | _user_malloc (int size, const char *file, int line) |
void * | _user_realloc (void *ptr, int size, const char *file, int line) |
int ((int(*)(struct user_entry_type *)) global[42])(struct user_entry_type *) | |
int ((int(*)(struct user_entry_type *)) global[43])(struct user_entry_type *) | |
struct user_entry_type *struct user_entry_type *char | global (char *) |
struct user_entry *struct user_entry *struct | global (struct user_entry_type *, struct userrec *) |
int ((int(*)(struct user_entry_type *, struct userrec *, void *)) global[41])(struct user_entry_type * | |
struct igrec *(*) | struct (global[97])) |
struct userrec *struct userrec *struct | global () |
struct userrec *struct userrec *struct | global (struct userrec *, char *) |
struct userrec * | get_user_by_nick (char *) |
struct userrec * | check_chanlist () |
struct userrec * | check_chanlist_hand () |
int | def_unpack (struct userrec *u, struct user_entry *e) |
int | def_pack (struct userrec *u, struct user_entry *e) |
int | def_kill (struct user_entry *e) |
int | def_write_userfile (FILE *f, struct userrec *u, struct user_entry *e) |
void *void *struct | global (struct userrec *u, struct user_entry *e) |
int | def_set (struct userrec *u, struct user_entry *e, void *buf) |
int | def_gotshare (struct userrec *u, struct user_entry *e, char *data, int idx) |
int | def_tcl_get (Tcl_Interp *(*(Tcl_Interp **)(global[128])), struct userrec *u, struct user_entry *e, int argc, char **argv) |
int | def_tcl_set (Tcl_Interp *irp, struct userrec *u, struct user_entry *e, int argc, char **argv) |
int | def_expmem (struct user_entry *e) |
void | def_display (int idx, struct user_entry *e) |
int | def_dupuser (struct userrec *new, struct userrec *old, struct user_entry *e) |
Variables | |
struct user_entry_type(* | struct )(global[195])) |
#define BAN_NAME "*ban" |
Definition at line 133 of file users.h.
Referenced by write_bans().
#define bot_flags | ( | u | ) | ((long)get_user(&USERENTRY_BOTFL, (u))) |
Definition at line 126 of file users.h.
Referenced by bot_actchan(), bot_away(), bot_chan2(), bot_chat(), bot_idle(), bot_join(), bot_nickchange(), bot_nlinked(), bot_part(), bot_reject(), bot_thisbot(), botnet_send_assoc(), botnet_send_reject(), check_dcc_attrs(), check_expired_tbufs(), cmd_chaddr(), cmd_chhandle(), cmd_chpass(), cmd_mns_host(), cmd_mns_user(), cmd_pls_host(), cont_link(), dump_links(), got_unban(), got_unexempt(), got_uninvite(), greet_new_bot(), link_assoc(), msg_who(), send_tand_but(), share_killuser(), share_resyncq(), share_stick_ban(), share_stick_exempt(), share_stick_invite(), share_userfileq(), and share_version().
#define EXEMPT_NAME "*exempt" |
Definition at line 134 of file users.h.
Referenced by write_exempts().
#define IGREC_PERM 2 |
Definition at line 170 of file users.h.
Referenced by equals_ignore().
#define INVITE_NAME "*Invite" |
Definition at line 135 of file users.h.
Referenced by write_invites().
#define is_bot | ( | u | ) | ((u) && ((u)->flags & USER_BOT)) |
Definition at line 127 of file users.h.
Referenced by add_note().
#define list_insert | ( | a, | |||
b | ) |
{ \ (b)->next = *(a); \ *(a) = (b); \ }
Definition at line 35 of file users.h.
Referenced by dup_userlist(), share_change(), and tcl_setuser().
#define user_malloc | ( | x | ) | _user_malloc(x, __FILE__, __LINE__) |
#define user_realloc | ( | x, | |||
y | ) | _user_realloc(x, y, __FILE__, __LINE__) |
void* _user_malloc | ( | int | size, | |
const char * | file, | |||
int | line | |||
) |
Definition at line 52 of file userrec.c.
References n_malloc(), nmalloc, and simple_sprintf.
00053 { 00054 #ifdef DEBUG_MEM 00055 char x[1024]; 00056 const char *p; 00057 00058 p = strrchr(file, '/'); 00059 simple_sprintf(x, "userrec.c:%s", p ? p + 1 : file); 00060 return n_malloc(size, x, line); 00061 #else 00062 return nmalloc(size); 00063 #endif 00064 }
void* _user_realloc | ( | void * | ptr, | |
int | size, | |||
const char * | file, | |||
int | line | |||
) |
Definition at line 66 of file userrec.c.
References n_realloc(), nrealloc, and simple_sprintf.
00067 { 00068 #ifdef DEBUG_MEM 00069 char x[1024]; 00070 const char *p; 00071 00072 p = strrchr(file, '/'); 00073 simple_sprintf(x, "userrec.c:%s", p ? p + 1 : file); 00074 return n_realloc(ptr, size, x, line); 00075 #else 00076 return nrealloc(ptr, size); 00077 #endif 00078 }
struct userrec* check_chanlist | ( | ) | [read] |
struct userrec* check_chanlist_hand | ( | ) | [read] |
void def_display | ( | int | idx, | |
struct user_entry * | e | |||
) |
Definition at line 183 of file userent.c.
References dprintf, user_entry_type::name, user_entry::string, user_entry::type, and user_entry::u.
int def_dupuser | ( | struct userrec * | new, | |
struct userrec * | old, | |||
struct user_entry * | e | |||
) |
Definition at line 188 of file userent.c.
References set_user, user_entry::string, user_entry::type, and user_entry::u.
int def_expmem | ( | struct user_entry * | e | ) |
Definition at line 178 of file userent.c.
References user_entry::string, and user_entry::u.
int def_gotshare | ( | struct userrec * | u, | |
struct user_entry * | e, | |||
char * | data, | |||
int | idx | |||
) |
Definition at line 155 of file userent.c.
References userrec::handle, LOG_CMDS, user_entry_type::name, putlog, user_entry_type::set, and user_entry::type.
int def_kill | ( | struct user_entry * | e | ) |
Definition at line 98 of file userent.c.
References nfree, user_entry::string, and user_entry::u.
int def_pack | ( | struct userrec * | u, | |
struct user_entry * | e | |||
) |
Definition at line 87 of file userent.c.
References list_type::extra, user_entry::list, list_type::next, NULL, user_entry::string, user_entry::u, and user_malloc.
int def_set | ( | struct userrec * | u, | |
struct user_entry * | e, | |||
void * | buf | |||
) |
Definition at line 117 of file userent.c.
References userrec::flags, userrec::handle, user_entry_type::name, nfree, noshare, NULL, share_greet, shareout, user_entry::string, strncpyz, user_entry::type, user_entry::u, USER_BOT, user_realloc, USER_UNSHARED, and USERENTRY_INFO.
00118 { 00119 char *string = (char *) buf; 00120 00121 if (string && !string[0]) 00122 string = NULL; 00123 if (!string && !e->u.string) 00124 return 1; 00125 if (string) { 00126 int l = strlen(string); 00127 char *i; 00128 00129 if (l > 160) 00130 l = 160; 00131 00132 00133 e->u.string = user_realloc(e->u.string, l + 1); 00134 00135 strncpyz(e->u.string, string, l + 1); 00136 00137 for (i = e->u.string; *i; i++) 00138 /* Allow bold, inverse, underline, color text here... 00139 * But never add cr or lf!! --rtc 00140 */ 00141 if ((unsigned int) *i < 32 && !strchr("\002\003\026\037", *i)) 00142 *i = '?'; 00143 } else { 00144 nfree(e->u.string); 00145 e->u.string = NULL; 00146 } 00147 if (!noshare && !(u->flags & (USER_BOT | USER_UNSHARED))) { 00148 if (e->type != &USERENTRY_INFO || share_greet) 00149 shareout(NULL, "c %s %s %s\n", e->type->name, u->handle, 00150 e->u.string ? e->u.string : ""); 00151 } 00152 return 1; 00153 }
int def_tcl_get | ( | Tcl_Interp * | *(Tcl_Interp **)(global[128]), | |
struct userrec * | u, | |||
struct user_entry * | e, | |||
int | argc, | |||
char ** | argv | |||
) |
Definition at line 162 of file userent.c.
References NULL, user_entry::string, and user_entry::u.
int def_tcl_set | ( | Tcl_Interp * | irp, | |
struct userrec * | u, | |||
struct user_entry * | e, | |||
int | argc, | |||
char ** | argv | |||
) |
Definition at line 169 of file userent.c.
References BADARGS, user_entry_type::set, and user_entry::type.
int def_unpack | ( | struct userrec * | u, | |
struct user_entry * | e | |||
) |
Definition at line 76 of file userent.c.
References list_type::extra, user_entry::list, list_type_kill, NULL, user_entry::string, and user_entry::u.
int def_write_userfile | ( | FILE * | f, | |
struct userrec * | u, | |||
struct user_entry * | e | |||
) |
Definition at line 105 of file userent.c.
References user_entry_type::name, user_entry::string, user_entry::type, and user_entry::u.
struct userrec* get_user_by_nick | ( | char * | ) | [read] |
void* void* struct global | ( | struct userrec * | u, | |
struct user_entry * | e | |||
) |
Definition at line 112 of file userent.c.
References user_entry::string, and user_entry::u.
Definition at line 200 of file userrec.c.
References cache_hit, cache_miss, check_chanlist_hand(), check_dcclist_hand(), egg_strcasecmp, userrec::handle, userrec::next, NULL, and rmspace.
00201 { 00202 struct userrec *u, *ret; 00203 00204 if (!handle) 00205 return NULL; 00206 /* FIXME: This should be done outside of this function. */ 00207 rmspace(handle); 00208 if (!handle[0] || (handle[0] == '*')) 00209 return NULL; 00210 if (bu == userlist) { 00211 if (lastuser && !egg_strcasecmp(lastuser->handle, handle)) { 00212 cache_hit++; 00213 return lastuser; 00214 } 00215 ret = check_dcclist_hand(handle); 00216 if (ret) { 00217 cache_hit++; 00218 return ret; 00219 } 00220 ret = check_chanlist_hand(handle); 00221 if (ret) { 00222 cache_hit++; 00223 return ret; 00224 } 00225 cache_miss++; 00226 } 00227 for (u = bu; u; u = u->next) 00228 if (!egg_strcasecmp(u->handle, handle)) { 00229 if (bu == userlist) 00230 lastuser = u; 00231 return u; 00232 } 00233 return NULL; 00234 }
struct user_entry* struct user_entry* struct global | ( | struct user_entry_type * | , | |
struct userrec * | ||||
) | [read] |
struct user_entry_type* struct user_entry_type* char global | ( | char * | ) | [read] |
Definition at line 308 of file userrec.c.
References cache_hit, cache_miss, check_chanlist(), list_type::extra, fixfrom, get_user, match_useraddr, list_type::next, userrec::next, NULL, rmspace, set_chanlist(), strncpyz, UHOSTLEN, and USERENTRY_HOSTS.
00309 { 00310 struct userrec *u, *ret; 00311 struct list_type *q; 00312 int cnt, i; 00313 char host2[UHOSTLEN]; 00314 00315 if (host == NULL) 00316 return NULL; 00317 rmspace(host); 00318 if (!host[0]) 00319 return NULL; 00320 ret = check_chanlist(host); 00321 cnt = 0; 00322 if (ret != NULL) { 00323 cache_hit++; 00324 return ret; 00325 } 00326 cache_miss++; 00327 strncpyz(host2, host, sizeof host2); 00328 host = fixfrom(host); 00329 for (u = userlist; u; u = u->next) { 00330 q = get_user(&USERENTRY_HOSTS, u); 00331 for (; q; q = q->next) { 00332 i = match_useraddr(q->extra, host); 00333 if (i > cnt) { 00334 ret = u; 00335 cnt = i; 00336 } 00337 } 00338 } 00339 if (ret != NULL) { 00340 lastuser = ret; 00341 set_chanlist(host2, ret); 00342 } 00343 return ret; 00344 }
int | ( | (int(*)(struct user_entry_type *, struct userrec *, void *)) | global[41] | ) |
int | ( | (int(*)(struct user_entry_type *)) | global[43] | ) |
int | ( | (int(*)(struct user_entry_type *)) | global[42] | ) |
struct list_type* struct list_type* int | ( | (int(*)(struct list_type *, struct list_type *)) | global[75] | ) | [read] |
struct igrec*(*) struct | ( | global | [97] | ) | [read] |
struct user_entry_type(*)(*)(*)(*)(*)(*)(*)(*) struct | ( | global | [189] | ) |
struct user_entry_type(*)(*)(*)(*)(*)(*)(*) struct | ( | global | [191] | ) | [read] |
struct user_entry_type(*)(*)(*)(*)(*)(*) struct | ( | global | [190] | ) | [read] |
struct user_entry_type(*)(*)(*)(*)(*) struct | ( | global | [188] | ) | [read] |
struct user_entry_type(*)(*)(*)(*) struct | ( | global | [194] | ) | [read] |
struct user_entry_type(*)(*)(*) struct | ( | global | [192] | ) |
struct user_entry_type(*)(*) struct | ( | global | [196] | ) | [read] |
struct igrec*(* struct)(global[97])) | ( | global | [195] | ) | [read] |