home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
UTILITY
/
PUSER100.ZIP
/
PUSER.C
next >
Wrap
C/C++ Source or Header
|
1992-06-09
|
4KB
|
146 lines
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <sys\stat.h>
#include <dos.h>
#include <alloc.h>
#include <time.h>
int COL = 4;
int MAXCOL = 80;
char FORM[81];
char BUF[81];
/* DATA FOR EVERY USER */
typedef struct {
char name[31], /* user's name */
realname[21], /* user's real name */
callsign[7], /* user's amateur callsign */
phone[13], /* user's phone number */
pw[9], /* user's password */
laston[9], /* last date on */
firston[9], /* first date on */
note[41], /* sysop's note about user */
macros[3][81], /* macro keys */
sex; /* user's sex */
unsigned char age, /* user's age */
inact, /* if deleted or inactive */
comp_type, /* computer type */
defprot, /* deflt transfer protocol */
defed, /* default editor */
screenchars,screenlines,/* screen size */
sl, /* security level */
dsl, /* transfer security level */
exempt, /* exempt from ratios, etc */
colors[8], /* user's colors */
votes[20], /* user's votes */
illegal, /* illegal logons */
waiting, /* number mail waiting */
sysopsub, /* sysop sub board number */
ontoday; /* num times on today */
unsigned short homeuser,homesys, /* where user can be found */
forwardusr,forwardsys, /* where to forward mail */
msgpost, /* number messages posted */
emailsent, /* number of email sent */
feedbacksent, /* number of f-back sent */
posttoday, /* number posts today */
etoday, /* number emails today */
ar, /* board access */
dar, /* directory access */
restrict, /* restrictions on account */
ass_pts, /* bad things the user did */
uploaded, /* number files uploaded */
downloaded, /* number files downloaded */
lastrate, /* last baud rate on */
logons; /* total number of logons */
unsigned long msgread, /* total num msgs read */
uk, /* number of k uploaded */
dk, /* number of k downloaded */
qscn, /* which subs to n-scan */
qscnptr[33], /* q-scan pointers */
nscn1,nscn2, /* which dirs to n-scan */
daten, /* numerical time last on */
sysstatus; /* status/defaults */
float timeontoday, /* time on today */
extratime, /* time left today */
timeon, /* total time on system */
pos_account, /* $ credit */
neg_account, /* $ debit */
gold; /* game money */
unsigned char bwcolors[8]; /* b&w colors */
unsigned char month,day,year; /* user's birthday */
unsigned int emailnet, /* email sent into net */
postnet; /* posts sent into net */
unsigned short fsenttoday1; /* feedbacks today */
unsigned char num_extended; /* num lines of ext desc */
unsigned char optional_val; /* optional lines in msgs */
unsigned long wwiv_regnum; /* users WWIV reg number */
char res[29]; /* reserved bytes */
#if MAX_SUBS>32
unsigned long qscn2; /* additional qscan ptr */
unsigned long qscnptr2[MAX_SUBS-32]; /* additional quickscan ptrs */
#endif
} userrec;
int userfile = -1;
void open_user()
{
if (userfile<0) {
userfile=open(".\\DATA\\USER.LST",O_RDWR | O_BINARY);
if (userfile<0) {
userfile=-1;
}
}
}
void strcol(size,s)
int size;
char *s;
{
COL+=size;
if(COL >= MAXCOL){
printf("\n ");
COL= 4 + size;
}
sprintf(FORM,":%%-%us",size);
printf(FORM,s);
}
void intcol(size,s,val)
int size;
unsigned long val;
{
sprintf(FORM,"%s%%%ulu",s,size);
sprintf(BUF,FORM,val);
strcol(strlen(BUF),BUF);
}
void main(int argc, char **argv){
userrec rec;
unsigned int uid;
fprintf(stderr,"\tPUSER 1.00 Copyright 1992 Richard Spencer Balding\n");
open_user();
uid=1;
read(userfile, &rec, sizeof(rec));
while(read(userfile, &rec, sizeof(rec)) > 0 ){
printf("%3u",uid++);
if(rec.inact){
printf(" ***DELETED**\n");
continue;
}
COL+=4;
intcol(3,"SL=",rec.sl);
strcol(12,rec.phone);
strcol(30,rec.name);
strcol(20,rec.realname);
/*
strcol(9,rec.pw);
sprintf(BUF,"%9s to %9s",rec.firston,rec.laston);strcol(22,BUF);
*/
printf("\n");
COL=0;
}
exit(0);
}