extern int hstat_cycle;
extern time_t hstat_last_cycle;
-#define HSTAT_ACTIVITY_TRESHOLD (3 * 60)
+/* forward declarations */
+struct hchannel_struct;
+struct huser_struct;
+
+#define HSTAT_ACTIVITY_TRESHOLD (3 * HDEF_m)
#define HSTAT_ACCOUNT_SUM(sum, op1, op2)\
{\
#define HSTAT_CHANNEL_SUM(sum, op1, op2)\
{\
+ (sum).active_time = (op1).active_time + (op2).active_time;\
+ (sum).staff_active_time = (op1).staff_active_time + (op2).staff_active_time;\
(sum).time_spent = (op1).time_spent + (op2).time_spent;\
(sum).prime_time_spent = (op1).prime_time_spent + (op2).prime_time_spent;\
(sum).lines = (op1).lines + (op2).lines;\
#define HSTAT_CHANNEL_ZERO(target)\
{\
+ (target).active_time = 0;\
+ (target).staff_active_time = 0;\
(target).time_spent = 0;\
(target).prime_time_spent = 0;\
(target).lines = 0;\
int prime_time_spent;
int lines;
int words;
- void *owner; /* haccount* */
+ struct haccount_struct *owner; /* haccount* */
} hstat_account_entry_sum;
typedef struct hstat_channel_entry_struct
{
+ int active_time;
+ int staff_active_time;
+
int time_spent;
int prime_time_spent;
int arrlen;
} hstat_accounts_array;
+typedef enum
+{
+ HSTAT_ACCOUNT_ARRAY_TOP10,
+ HSTAT_ACCOUNT_ARRAY_WEEKSTATS
+} hstat_account_array_type;
+
/* free() this.entries, arguments: channel, level to list */
-hstat_accounts_array create_hstat_account_array(void*, hlevel);
+hstat_accounts_array create_hstat_account_array(struct hchannel_struct*, hlevel, hstat_account_array_type);
hstat_channel *get_hstat_channel(void);
hstat_account *get_hstat_account(void);
const char *hstat_account_print(hstat_account_entry*, int);
-/* void* = hchannel*, huser* */
-void hstat_calculate_general(void*, void*, const char *);
+void hstat_calculate_account(struct hchannel_struct*, struct huser_struct*, const char *);
+void hstat_calculate_channel(struct hchannel_struct*, struct huser_struct*, const char *);
-/* void* = hchannel* */
-void hstat_add_join(void*);
-void hstat_del_channel(void*);
+void hstat_add_join(struct hchannel_struct*);
+void hstat_del_channel(struct hchannel_struct*);
-/* void* = hchannel* */
-void hstat_add_queue(void*, int);
+void hstat_add_queue(struct hchannel_struct*, int);
int is_prime_time(void); /* tells if now is the "main" time in #feds */