home *** CD-ROM | disk | FTP | other *** search
- /* MSGCHECK, a utility for QuickBBS users. MSGCHECK sets the DOS
- ERRORLEVEL to 1 if the message base needs to be renumbered. The
- upper limit for the number of allowed messages is entered on the
- command line. If the message base does not need to be renumbered,
- ERRORLEVEL is set to 0. MSGCHECK always exits with ERRORLEVEL set
- to 1 if the high message number is 32000 or more.
-
- This utility was written by David L. Emory, FidoNet 1:105/360
- */
-
-
- #include <stdio.h>
-
- main(argc,argv)
-
- int argc;
- char *argv[];
- {
- int limit;
-
- struct
- {
- int lowmsg,highmsg,totalactive,active[199];
- } msgrecord;
-
- FILE *fptr;
- int recno;
- if((fptr=fopen("msginfo.bbs","rb"))==NULL)
- {
- printf("Can't open msginfo.bbs.\n");
- printf("Run MSGCHECK in the QuickBBS subdirectory.\n");
- exit(0);
- }
- if (argc < 2)
- {
- printf("Syntax: MSGCHECK <Limit>\n");
- printf("Run MSGCHECK in the QuickBBS subdirectory.\n");
- exit(0);
- }
-
- limit = atoi(argv[1]);
- fread(&msgrecord,sizeof(msgrecord),1,fptr);
- printf("High Message Limit: %d\t\t",limit);
- printf("High Message Number: %d\n",msgrecord.highmsg);
- fclose(fptr);
-
- if ((limit < msgrecord.highmsg) | (32000 < msgrecord.highmsg))
- {
- printf("Message base needs to be renumbered.\n");
- printf("Setting ErrorLevel to 1.\n");
- exit(1);
- }
- printf("Message base does not need to be renumbered.\n");
- printf("Setting Errorlevel to 0.\n");
- exit(0);
- }
-
-
-