home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
OSKBox.lzh
/
MAILBOX
/
CC
/
dumpuser.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-09
|
1KB
|
52 lines
#include <ctype.h>
#include "mailbox.h"
struct userstruct user;
main (argc, argv)
char *argv[];
{
int userfile;
int i;
char *p;
chdir (HOME);
if ((userfile = open ("users", 1)) <= 0) {
printf ("Error: can't open user file\n");
exit (0);
}
for (i = 1; i < argc; i++)
for (p = argv[i]; *p; p++)
*p = toupper (*p);
while (read (userfile, &user, sizeof (user)))
if (!(user.usopt & ISDELETED))
if (argc == 1)
printuser ();
else
for (i = 1; i < argc; i++)
if (strcmp (argv[i], user.uscall) == 0)
printuser ();
}
printuser ()
{
char *ctl =
"%-6.6s %02d%02d%02d %02d%02d %4.4d %4.4d %2d%c%c%c%c %-12.12s%s\n";
static int flag = 0;
if (!flag) {
printf (" Call Date Time Logd Msg Hm BBS SXPBS Name Path\n");
flag = 1;
}
printf (ctl, user.uscall, (user.usdate >> 16) % 100,
(user.usdate >> 8) & 0xff, user.usdate & 0xff,
(user.ustime >> 16) & 0xff, (user.ustime >> 8) & 0xff,
user.uscnt, user.usnmr, user.usssid, (user.usopt & ISEXPERT) ? 'Y' : 'N',
(user.usopt & ISPNG) ? 'Y' : 'N',
(user.usopt & ISBBS) ? 'Y' : 'N',
(user.usopt & ISSUPER) ? 'Y' : 'N',
user.usname, user.uspath);
}