home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
C
/
TOPUSE4S
/
TOPUSERS.H
< prev
Wrap
Text File
|
1991-12-24
|
4KB
|
163 lines
/*
** Useful macros
*/
#define MAX_USERS 4000
#define eqstri(a, b) (stricmp(a,b)==0)
/*
** prototypes
*/
void defaults();
int compare_times(const void *a, const void *b);
int compare_downs(const void *a, const void *b);
int compare_ups(const void *a, const void *b);
/*
** Keywords in the config file
*/
/* 0 1 2 3 4 */
char *parse[]={ "NAMEBBS", "USERFILE", "OUTFILE", "TOPNUMBER", "SYSOP",
/* 5 6 7 */
"DOUBLEHORIZ", "DOUBLEVERT", "COLORTOP&SIDES",
/* 8 9 10 */
"COLORCALLHEADER", "COLORUPLDHEADER", "COLORDNLDHEADER",
/* 11 12 13 14 */
"COLORTOPCALL", "COLORTOPUPLD", "COLORTOPDNLD", "COLORREST",
/* 15 16 17 */
"COLORTOTALCALLS", "COLORTOTALUPLDS", "COLORTOTALDNLDS",
/*18 19 20 21 22 */
"CLS", "MOREOFF", "COLORVACANT", "COLORBANNER", "COLORLINE",
/* 23 24 25 26 */
"NOAVERAGE", "COLORAVGDNLDS", "COLORAVGUPLDS", "COLORAVGCALLS",
/* 27 28 29 30 */
"NOSYSTEM", "COLORSYSCALLS", "COLORSYSDNLDS", "COLORSYSUPLDS",
/* 31 32 */
"MAXDIR", "NOTOTALS" };
/*
** Structure for config file
*/
typedef struct _cnf {
char bbsname[41];
char userfile[80];
char outfile[80];
char maxdir[80];
unsigned int topnumber : 7;
unsigned int avg : 1;
unsigned int sys : 1;
unsigned int sysop : 1;
unsigned int dhoriz : 1;
unsigned int shoriz : 1;
unsigned int dvert : 1;
unsigned int svert : 1;
unsigned int cls : 1;
unsigned int more : 1;
char totals;
char topsides[9];
char callheader[9];
char upldheader[9];
char dnldheader[9];
char topcall[9];
char topupld[9];
char topdnld[9];
char rest[9];
char totalcalls[9];
char totaluplds[9];
char totaldnlds[9];
char avgcalls[9];
char avguplds[9];
char avgdnlds[9];
char syscalls[9];
char sysuplds[9];
char sysdnlds[9];
char vacant[9];
char banner[9];
char line[9];
} CONFIG;
/*
** Local structures
*/
typedef struct _ind {
int index;
dword upk;
dword downk;
int times;
} IND;
typedef struct _info {
int user_num;
dword upk;
dword downk;
int times;
char name[20];
} INFO;
INFO *info[100];
IND *ind[MAX_USERS];
CONFIG config;
/*
** Default values
*/
void defaults()
{
config.bbsname[0] = '\0';
strcpy(config.userfile,"user.bbs");
strcpy(config.outfile,"misc\\topusers.bbs");
strcpy(config.maxdir,"c:\\max\\");
config.topnumber = 10;
config.cls = 0;
config.avg = 1;
config.sys = 1;
config.totals = 1;
config.more = 1;
config.sysop = 1;
config.dvert = 0;
config.svert = 1;
config.dhoriz = 0;
config.shoriz = 1;
strcpy(config.line, "î");
strcpy(config.rest, "ç");
strcpy(config.banner, "Å");
strcpy(config.vacant, "ç");
strcpy(config.topcall, "Ä");
strcpy(config.topupld, "î");
strcpy(config.topdnld, "Å");
strcpy(config.topsides, "â");
strcpy(config.avgcalls, "ï");
strcpy(config.avguplds, "ï");
strcpy(config.avgdnlds, "ï");
strcpy(config.syscalls, "ï");
strcpy(config.sysuplds, "ï");
strcpy(config.sysdnlds, "ï");
strcpy(config.callheader,"₧");
strcpy(config.upldheader,"₧");
strcpy(config.dnldheader,"₧");
strcpy(config.totalcalls,"ï");
strcpy(config.totaluplds,"ï");
strcpy(config.totaldnlds,"ï");
}
/* Structure of BBSTATxx.BBS */
typedef struct _bbs_stats
{
byte version;
dword num_callers;
dword quote_pos;
dword msgs_written;
time_t online_date;
dword total_dl;
dword total_ul;
sword today_callers;
union stamp_combo date;
} STATS;