home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
PRE412.ZIP
/
BASEPRIN.C
< prev
next >
Wrap
Text File
|
1990-04-28
|
3KB
|
111 lines
/*baseprint.c */
/* Elric19.zip*/
/*
This program prints out the message base list in what will
hopefully be a useful format.
This program was written by Lord Elric, 1@8251
If you use this, the only payment I ask is that you send me a
note through WWIVNet to 1@8251 saying you are using it...not too much to
ask is it?
If you have any problems, you can reach me through WWIV-Net, 1@8251, or call
my BBS.
The Kingdom of Melnibone
812-877-3488 24 Hrs a day
3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
Auto-validation of WWIV sysops on first call
Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
Lord Elric
*/
#include <io.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "vardec.h"
int configfile,subsfile;
FILE *printer;
int num_subs;
subboardrec subboards[64];
subboardrec sub;
configrec syscfg;
int i,j,ls;
char s[81],s2[3];
void main()
{
char s3[80];
configfile=-1;
strcpy(s,"D:\\wwiv\\CONFIG.DAT");
configfile=open(s,O_RDWR | O_BINARY);
if (configfile<0) {
printf("%s NOT FOUND.\n",s);
exit(0);
}
read(configfile,(void *) (&syscfg), sizeof(configrec));
close(configfile);
subsfile=-1;
strcpy(s,syscfg.datadir);
strcat(s,"SUBS.DAT");
subsfile=open(s,O_RDWR | O_BINARY);
if (subsfile<0) {
printf("%s NOT FOUND.\n",s);
exit(0);
}
num_subs=(read(subsfile,(void *) (&subboards), (64*sizeof(subboardrec))))/
sizeof(subboardrec);
close(subsfile);
printf("Welcome to Base Print.\n");
printf("Written By Lord Elric AKA Wayne McDaniel\n");
printf("This program is for use with WWIV 4.xx\n");
printf("Please contact Lord Elric, 1@8251 WWIVNet, with any problems\n");
printf("Or call The Kingdom Of Melnibone BBS, 1-812-877-3488\n");
printf("This is officially Elric's Mod #19\n\n");
printf("Please enter the name of the file\n");
printf("you wish to send this report to. Hit Return for printer.\n");
printf("?");
gets(s3);
if (s3[0]==0)
strcpy(s3,"prn");
printer=fopen(s3,"w");
if (printer==NULL) {
printf("Cannot access printer\n");
exit(0);
}
sprintf(s,"Message base listing for %s\n\n",syscfg.systemname);
fputs(s,printer);
fputs(" # RSL PSL AR ",printer);
fputs("Name File Age Msgs Type\n",printer);
for (i=0;i<num_subs;i++)
{
sub=subboards[i];
/*here's where we print things out! */
s2[0]=0;
if (sub.ar!=0) {
for (j=0; j<16; j++)
if ((1 << j) & sub.ar)
s2[0]='A'+j;
s2[1]=0;}
sprintf(s,"%2u %3u %3u %1s %-38.38s %-8s %2u %3u %5u\n",
i+1,sub.readsl,sub.postsl,s2,sub.name,sub.filename,
sub.age,sub.maxmsgs,sub.type);
fputs(s,printer);
}
fputs("\f",printer);
fclose(printer);
}