X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fwhowas.h;h=6f3eae182d2fd55ac9d0e97b47ad9c7708c803ed;hb=refs%2Fheads%2Fupstream;hp=9084e00d3a6e3b4f5a1e509dc1fa1aa0bfa3c54f;hpb=ae91ef6320f611af74e70a0db2620c338fbaa7d5;p=ircu2.10.12-pk.git diff --git a/include/whowas.h b/include/whowas.h index 9084e00..6f3eae1 100644 --- a/include/whowas.h +++ b/include/whowas.h @@ -15,8 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ + */ +/** @file + * @brief Globally visible declarations to manipulate whowas information. + * @version $Id$ */ #ifndef INCLUDED_whowas_h #define INCLUDED_whowas_h @@ -31,32 +33,36 @@ struct Client; * General defines */ -#define BITS_PER_COL 3 -#define BITS_PER_COL_MASK 0x7 -#define WW_MAX_INITIAL 16 +#define BITS_PER_COL 3 /**< Magic number used by whowas hash function. */ +#define BITS_PER_COL_MASK 0x7 /**< Mask with #BITS_PER_COL least significant bits set. */ +#define WW_MAX_INITIAL 16 /**< Magic number used by whowas hash function. */ -#define MAX_SUB (1 << BITS_PER_COL) -#define WW_MAX_INITIAL_MASK (WW_MAX_INITIAL - 1) -#define WW_MAX (WW_MAX_INITIAL * MAX_SUB) +#define MAX_SUB (1 << BITS_PER_COL) /**< Magic number used by whowas hash function. */ +#define WW_MAX_INITIAL_MASK (WW_MAX_INITIAL - 1) /**< Magic number used by whowas hash function. */ +#define WW_MAX (WW_MAX_INITIAL * MAX_SUB) /**< Size of whowas hash table. */ /* * Structures */ +/** Tracks previously used nicknames. */ struct Whowas { - unsigned int hashv; - char *name; - char *username; - char *hostname; - char *servername; - char *realname; - char *away; - time_t logoff; - struct Client *online; /* Needed for get_history() (nick chasing) */ - struct Whowas *hnext; /* Next entry with the same hash value */ - struct Whowas **hprevnextp; /* Pointer to previous next pointer */ - struct Whowas *cnext; /* Next entry with the same 'online' pointer */ - struct Whowas **cprevnextp; /* Pointer to previous next pointer */ + unsigned int hashv; /**< Hash value for nickname. */ + char *name; /**< Client's old nickname. */ + char *username; /**< Client's username. */ + char *hostname; /**< Client's hostname. */ + char *realhost; /**< Client's real hostname. */ + char *servername; /**< Name of client's server. */ + char *realname; /**< Client's realname (user info). */ + char *away; /**< Client's away message. */ + time_t logoff; /**< When the client logged off. */ + struct Client *online; /**< Needed for get_history() (nick chasing). */ + struct Whowas *hnext; /**< Next entry with the same hash value. */ + struct Whowas **hprevnextp; /**< Pointer to previous next pointer. */ + struct Whowas *cnext; /**< Next entry with the same 'online' pointer. */ + struct Whowas **cprevnextp; /**< Pointer to previous next pointer. */ + struct Whowas *wnext; /**< Next entry in whowas linked list. */ + struct Whowas *wprev; /**< Pointer to previous next pointer. */ }; /* @@ -72,4 +78,6 @@ extern void off_history(const struct Client *cptr); extern void initwhowas(void); extern void count_whowas_memory(int *wwu, size_t *wwm, int *wwa, size_t *wwam); +extern void whowas_realloc(void); + #endif /* INCLUDED_whowas_h */