37 |
|
dlink_list WHOWASHASH[HASHSIZE]; |
38 |
|
|
39 |
|
|
40 |
+ |
/*! \brief Initializes whowas table |
41 |
+ |
*/ |
42 |
|
void |
43 |
|
whowas_init(void) |
44 |
|
{ |
46 |
|
WHOWAS[i].hashv = -1; |
47 |
|
} |
48 |
|
|
49 |
+ |
/*! \brief Adds the currently defined name of the client to history. |
50 |
+ |
* Usually called before changing to a new name (nick). |
51 |
+ |
* Client must be a fully registered user. |
52 |
+ |
* \param client_p pointer to Client struct to add |
53 |
+ |
* \param online either 1 if it's a nick change or 0 on client exit |
54 |
+ |
*/ |
55 |
|
void |
56 |
|
whowas_add_history(struct Client *client_p, const int online) |
57 |
|
{ |
94 |
|
dlinkAdd(whowas, &whowas->tnode, &WHOWASHASH[whowas->hashv]); |
95 |
|
} |
96 |
|
|
97 |
+ |
/*! \brief This must be called when the client structure is about to |
98 |
+ |
* be released. History mechanism keeps pointers to client |
99 |
+ |
* structures and it must know when they cease to exist. |
100 |
+ |
* \param client_p pointer to Client struct |
101 |
+ |
*/ |
102 |
|
void |
103 |
|
whowas_off_history(struct Client *client_p) |
104 |
|
{ |
111 |
|
} |
112 |
|
} |
113 |
|
|
114 |
+ |
/*! \brief Returns the current client that was using the given |
115 |
+ |
* nickname within the timelimit. Returns NULL, if no |
116 |
+ |
* one found... |
117 |
+ |
* \param nick name of the nick |
118 |
+ |
* \param timelimit maximum age for a client since log-off |
119 |
+ |
*/ |
120 |
|
struct Client * |
121 |
|
whowas_get_history(const char *nick, uintmax_t timelimit) |
122 |
|
{ |
138 |
|
return NULL; |
139 |
|
} |
140 |
|
|
141 |
+ |
/*! \brief For debugging. Counts related structures stored in whowas array |
142 |
+ |
*/ |
143 |
|
void |
144 |
|
whowas_count_memory(unsigned int *const count, size_t *const bytes) |
145 |
|
{ |