summaryrefslogtreecommitdiffstats
path: root/include/statistic.h
blob: 81ad937b589ec73c29410fefbf8d1fe0002c3cc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _STATISTIC_H_
#define _STATISTIC_H_
#define STAT(X, OP) do { \
    if(SHM && SHM->version==SHM_VERSION && 0<=(X) && (X)<STAT_MAX) \
      SHM->statistic[X] OP; \
} while(0)
#define STATINC(X) STAT(X, ++)

enum { // XXX description in shmctl.c
    STAT_LOGIN,
    STAT_SHELLLOGIN,
    STAT_VEDIT,
    STAT_TALKREQUEST,
    STAT_WRITEREQUEST,
    STAT_MORE,
    STAT_SYSWRITESOCKET,
    STAT_SYSSELECT,
    STAT_SYSREADSOCKET,
    STAT_DOSEND,
    STAT_SEARCHUSER,
    STAT_THREAD,
    STAT_SELECTREAD,
    STAT_QUERY,
    STAT_DOTALK,
    STAT_FRIENDDESC,
    STAT_FRIENDDESC_FILE,
    STAT_PICKMYFRIEND,
    STAT_PICKBFRIEND,
    STAT_GAMBLE,
    STAT_DOPOST,
    STAT_READPOST,
    STAT_RECOMMEND,
    STAT_TODAYLOGIN_MIN,
    STAT_TODAYLOGIN_MAX,
    /* insert here. don't forget update shmctl.c */
    STAT_NUM,
    STAT_MAX=512
};
#endif