home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
c
/
clinfo12.zip
/
CALLINFO.C
next >
Wrap
Text File
|
1992-01-19
|
7KB
|
224 lines
/* USERINFO -> Waffle BBS Traffic Monitor
Copyright 1991,1992 Greg Argendeli
Version 1.2
January 18, 1992
Waffle is Copyright Darkside Inc.
When compiled under Turbo C (Copyright Borland Int'l) under the TINY
memory model, this software will show a list of the top 10 callers, and
the number of calls each, as well as a breakdown of baud rates.
The data is from the CALLERS data file, normally found in \waffle\admin\
CALLERS. The program does NOT include uucp connections in it's output.
For use in WAFFLE, this program should be compiled under Borland's TURBO C
(TINY model), and then converted to a .com file via exe2bin. Please see
the Waffle BBS documentation on how to provide your users access to this
package.
This piece of code is Copyright 1991 Greg Argendeli. The author retains
all rights to this program. The source code is distributed for the purpose
of allowing system operators the option of modifying it for their individual
systems.
This code may be distributed under the following conditions:
1) This Copyright block MUST remain intact
2) No charge is made for access, copying, or other packaging. This
software may NOT be packaged with any other software without the
expressed, written consent of the author. Any system
distributing this code MUST NOT CHARGE FOR ACCESS IN ANY WAY.
3) You do not claim authorship.
4) When modifying this code, please increment the VERSION_MINOR number
ONLY. Your changes should be 1.XXXX where XXXX is VERSION_MINOR.
5) This code may only be distributed in an un-modified form. If you
have changed it,you may make your changes available, but they must
be in a sepparate file, and this source code must be included.
6) This code was a hack. if you have any suggestions, please send
them to me. Either use the number listed below, or send mail to
arg@arghouse.uucp.
While I do not plan to get rich on this software, I won't turn down any
money sent, as a token of appreciation, say $2 US :)
The Listening Post BBS
BBS: 619-563-1084
Thank you for respecting these conditions. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* The following includes are standards that I put in all my code... -arg*/
/* Location of the WAFFLE 1.64 Files */
#define TRAFFIC_FILE "/waffle/admin/traffic"
#define CALLERS_FILE "/waffle/admin/callers"
#define MAIL_FILE "/waffle/admin/mail"
#define VERSION_NAME "Userinfo"
#define VERSION_MAJOR 1
#define VERSION_MINOR 21
#define DATE_RELEASED "January 19, 1992"
/* Name of your organization. (MUST be 22 characters in length) */
#define WAFFLENAME "The Usenet Community "
/* If you modify the code, please increment the 0001 portion of the next def*/
#define REGISTRATION "92NET"
/* If you change the spacing and/or length of system names, you will
probably have to change them in the lower portion of the program.. */
struct alpha
{
char username[9];
int calls;
} users[400];
header()
{
printf("\n\n\n\n\n\n");
printf("%s [%d.%d] {%s}\n",VERSION_NAME,VERSION_MAJOR,VERSION_MINOR,DATE_RELEASED);
printf("Copyright 1991, 1992 arg@arghouse.uucp\n");
#ifdef REGISTRATION
printf("Registered to: %s [%s]\n",WAFFLENAME,REGISTRATION);
#endif
#ifndef REGISTRATION
printf("%s\n",WAFFLENAME);
#endif
printf("----------------------------------------------\n");
}
main()
{
FILE * fptr;
int baud_300=0,
swap,
baud_1200=0,
baud_450=0,
baud_1600=0,
baud_2400=0,
baud_4800=0,
count=0,
user_count=0,
ii=0,
i=0,
AA=0,
high_call=0,
baud_9600=0,
old_high=0,
baud_19200=0,
baud_38400=0,
call_count=0,
average=0,
match=0,
turn_count=0;
char dummy[99],
user[9],
baud[12],
turns[4];
int temp_calls;
struct x
{
char user[9];
int call;
} high_user;
header();
printf("Reading Caller: ");
fptr=fopen(CALLERS_FILE,"r");
if (fptr==NULL)
{
printf("OOPS, CANNOT OPEN DATA FILE\n");
exit(86);
}
while (!feof(fptr))
{
count++;
if (count==25) printf("25 ");
if (count==100) printf("100 ");
if (count==150) printf("150 ");
if (count==220) printf("220 ");
if (count==310) printf("310 ");
if (count==400) printf("400 ");
if (count==1000) printf("1000 ");
if (count==1600) printf("1600 ");
if (count==2000) printf("2000 ");
if (count==3000) printf("3000 ");
fscanf(fptr,"%s %s",dummy,baud);
fread(dummy,57,1,fptr);
strncpy(user,dummy,8);
user[8]=NULL;
fscanf(fptr,"%s %s",turns,dummy);
if (strcmp(baud,"300b")==0) baud_300++;
if (strcmp(baud,"450b")==0) baud_450++;
if (strcmp(baud,"1200b")==0) baud_1200++;
if (strcmp(baud,"2400b")==0) baud_2400++;
if (strcmp(baud,"4800b")==0) baud_4800++;
if (strcmp(baud,"9600b")==0) baud_9600++;
if (strcmp(baud,"19200")==0) baud_19200++;
match=0;
for (i=1;i<=user_count;i++)
{
if (strcmp(user,users[i].username)==0)
{
users[i].calls++;
match=1;
}
}
if (!match)
{
user_count++;
strcpy(users[user_count].username,user);
users[i].calls++;
}
match=0;
}
printf("%d\n",count);
strcpy(user,NULL);
temp_calls=0;
high_call=0;
printf("\n Top 10 Callers (excluding UUCP)\n");
printf("\tRank\t User\t\tCalls\n");
printf("+-----------------------------------\n");
for (i=1;i<=10;i++)
{
high_call=0;
printf("|\t(%d)\t",i);
for (AA=1;AA<=user_count;AA++)
{
if (users[AA].call > high_call)
{
/*printf("%d\n",AA); */
high_call=users[AA].call;
strcpy(user,users[AA].username);
users[AA].call=0;
}
}
printf("%s\t[%d]",user,high_call);
if (i==1) printf("\t Speed Breakdown");
if (i==2) printf("\t-BAUD----Calls---");
if (i==3) printf("\t 300 %d",baud_300);
if (i==4) printf("\t 450 %d",baud_450 );
if (i==5) printf("\t 1200 %d",baud_1200);
if (i==6) printf("\t 2400 %d",baud_2400);
if (i==7) printf("\t 4800 %d",baud_4800);
if (i==8) printf("\t 9600 %d",baud_9600);
if (i==9) printf("\t19200 %d",baud_19200);
if (i==10) printf("\tUnique Ids: %d",user_count);
printf("\n");
}
printf("+-----------------------------------\n");
}