X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fs_stats.h;h=417e5c2a2b7af4b10a7ccbd09c689e3f05858f99;hb=a36ad5e29241b0c89379947b13887cb6930ef3e0;hp=17cc5eeb691fda79489b57871edcbc012628aac1;hpb=284b39b15f53f438c7f1a28e7e3a10e2e25bac3b;p=ircu2.10.12-pk.git diff --git a/include/s_stats.h b/include/s_stats.h index 17cc5ee..417e5c2 100644 --- a/include/s_stats.h +++ b/include/s_stats.h @@ -18,22 +18,48 @@ * 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 Report configuration lines and other statistics from this server. + * @version $Id$ */ #ifndef INCLUDED_s_stats_h #define INCLUDED_s_stats_h +#ifndef INCLUDED_features_h +#include "ircd_features.h" +#endif struct Client; -extern const char *statsinfo[]; -extern void report_stats(struct Client *sptr, char stat); -extern void report_configured_links(struct Client *sptr, int mask); -extern int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[], char stat, int MustBeOper); +struct StatDesc; + +/** Statistics callback function. + * @param[in] cptr Client requesting statistics. + * @param[in] sd Stats descriptor for request. + * @param[in] param Extra parameter from user (may be NULL). + */ +typedef void (*StatFunc)(struct Client *cptr, const struct StatDesc *sd, char *param); + +/** Statistics entry. */ +struct StatDesc +{ + char sd_c; /**< stats character (or '\\0') */ + char *sd_name; /**< full name for stats */ + unsigned int sd_flags; /**< flags to control the stats */ + enum Feature sd_control; /**< feature controlling stats */ + StatFunc sd_func; /**< function to dispatch to */ + int sd_funcdata; /**< extra data for the function */ + char *sd_desc; /**< descriptive text */ +}; + +#define STAT_FLAG_OPERONLY 0x01 /**< Oper-only stat */ +#define STAT_FLAG_OPERFEAT 0x02 /**< Oper-only if the feature is true */ +#define STAT_FLAG_LOCONLY 0x04 /**< Local user only */ +#define STAT_FLAG_CASESENS 0x08 /**< Flag is case-sensitive */ +#define STAT_FLAG_VARPARAM 0x10 /**< May have an extra parameter */ -extern void report_crule_list(struct Client* to, int mask); -extern void report_motd_list(struct Client* to); -extern void report_deny_list(struct Client* to); +extern void stats_init(void); +const struct StatDesc *stats_find(const char *name_or_char); #endif /* INCLUDED_s_stats_h */