]>
Commit | Line | Data |
---|---|---|
189935b1 | 1 | /* |
2 | * IRC - Internet Relay Chat, include/s_stats.h | |
3 | * Copyright (C) 2000 Joseph Bongaarts | |
4 | * | |
5 | * See file AUTHORS in IRC package for additional names of | |
6 | * the programmers. | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation; either version 1, or (at your option) | |
11 | * any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
21 | */ | |
22 | /** @file | |
23 | * @brief Report configuration lines and other statistics from this server. | |
24 | * @version $Id: s_stats.h,v 1.12.2.1 2005/10/12 01:13:48 entrope Exp $ | |
25 | */ | |
26 | ||
27 | #ifndef INCLUDED_s_stats_h | |
28 | #define INCLUDED_s_stats_h | |
29 | #ifndef INCLUDED_features_h | |
30 | #include "ircd_features.h" | |
31 | #endif | |
32 | ||
33 | struct Client; | |
34 | ||
35 | struct StatDesc; | |
36 | ||
37 | /** Statistics callback function. | |
38 | * @param[in] cptr Client requesting statistics. | |
39 | * @param[in] sd Stats descriptor for request. | |
40 | * @param[in] param Extra parameter from user (may be NULL). | |
41 | */ | |
42 | typedef void (*StatFunc)(struct Client *cptr, const struct StatDesc *sd, char *param); | |
43 | ||
44 | /** Statistics entry. */ | |
45 | struct StatDesc | |
46 | { | |
47 | char sd_c; /**< stats character (or '\\0') */ | |
48 | char *sd_name; /**< full name for stats */ | |
49 | unsigned int sd_flags; /**< flags to control the stats */ | |
50 | enum Feature sd_control; /**< feature controlling stats */ | |
51 | StatFunc sd_func; /**< function to dispatch to */ | |
52 | int sd_funcdata; /**< extra data for the function */ | |
53 | char *sd_desc; /**< descriptive text */ | |
54 | }; | |
55 | ||
56 | #define STAT_FLAG_OPERONLY 0x01 /**< Oper-only stat */ | |
57 | #define STAT_FLAG_OPERFEAT 0x02 /**< Oper-only if the feature is true */ | |
58 | #define STAT_FLAG_LOCONLY 0x04 /**< Local user only */ | |
59 | #define STAT_FLAG_CASESENS 0x08 /**< Flag is case-sensitive */ | |
60 | #define STAT_FLAG_VARPARAM 0x10 /**< May have an extra parameter */ | |
61 | ||
62 | extern void stats_init(void); | |
63 | const struct StatDesc *stats_find(const char *name_or_char); | |
64 | ||
65 | #endif /* INCLUDED_s_stats_h */ |