Add file-level doxygen comment blocks where they were missing.
[ircu2.10.12-pk.git] / include / s_misc.h
1 /** @file s_misc.h
2  * @brief Miscellaneous support functions and declarations.
3  * @version $Id$
4  */
5 #ifndef INCLUDED_s_misc_h
6 #define INCLUDED_s_misc_h
7 #ifndef INCLUDED_stdarg_h
8 #include <stdarg.h>           /* va_list */
9 #define INCLUDED_stdarg_h
10 #endif
11 #ifndef INCLUDED_sys_types_h
12 #include <sys/types.h>        /* time_t */
13 #define INCLUDED_sys_types_h
14 #endif
15
16
17 struct Client;
18 struct StatDesc;
19 struct ConfItem;
20
21 /*-----------------------------------------------------------------------------
22  * Macros
23  */
24
25 /** Return value from various functions to indicate the source has
26  * been disconnected. */
27 #define CPTR_KILLED     -2
28
29 /*
30  * Structures
31  */
32
33 /** Structure used to count many server-wide statistics. */
34 struct ServerStatistics {
35   unsigned int is_cl;           /**< number of client connections */
36   unsigned int is_sv;           /**< number of server connections */
37   unsigned int is_ni;           /**< connection but no idea who it was */
38   unsigned short int is_cbs;    /**< bytes sent to clients */
39   unsigned short int is_cbr;    /**< bytes received to clients */
40   unsigned short int is_sbs;    /**< bytes sent to servers */
41   unsigned short int is_sbr;    /**< bytes received to servers */
42   unsigned int is_cks;          /**< k-bytes sent to clients */
43   unsigned int is_ckr;          /**< k-bytes received to clients */
44   unsigned int is_sks;          /**< k-bytes sent to servers */
45   unsigned int is_skr;          /**< k-bytes received to servers */
46   time_t is_cti;                /**< time spent connected by clients */
47   time_t is_sti;                /**< time spent connected by servers */
48   unsigned int is_ac;           /**< connections accepted */
49   unsigned int is_ref;          /**< accepts refused */
50   unsigned int is_unco;         /**< unknown commands */
51   unsigned int is_wrdi;         /**< command going in wrong direction */
52   unsigned int is_unpf;         /**< unknown prefix */
53   unsigned int is_empt;         /**< empty message */
54   unsigned int is_num;          /**< numeric message */
55   unsigned int is_kill;         /**< number of kills generated on collisions */
56   unsigned int is_fake;         /**< MODE 'fakes' */
57   unsigned int is_asuc;         /**< successful auth requests */
58   unsigned int is_abad;         /**< bad auth requests */
59   unsigned int is_loc;          /**< local connections made */
60   unsigned int uping_recv;      /**< UDP Pings received */
61 };
62
63 /*
64  * Prototypes
65  */
66
67 extern int check_registered(struct Client *sptr);
68 extern int check_registered_user(struct Client *sptr);
69 extern int exit_client(struct Client *cptr, struct Client *bcptr,
70     struct Client *sptr, const char *comment);
71 extern char *myctime(time_t value);
72 extern int exit_client_msg(struct Client *cptr, struct Client *bcptr,
73                            struct Client *sptr, const char *pattern, ...);
74 extern void initstats(void);
75 extern char *date(time_t clock);
76 extern void get_sockhost(struct Client *cptr, char *host);
77 extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr,
78     struct Client *sptr, const char *pattern, va_list vl);
79 extern void tstats(struct Client *cptr, const struct StatDesc *sd,
80                    char *param);
81
82 extern struct ServerStatistics* ServerStats;
83
84 #endif /* INCLUDED_s_misc_h */
85