home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
bbs_mail
/
frbts_21.arj
/
FROBOT.C
Wrap
C/C++ Source or Header
|
1991-05-10
|
3KB
|
91 lines
/****************************************************************************/
/* */
/* Frobot.c Version 2.0 By Craig Derouen */
/* Main module. */
/* */
/* */
/****************************************************************************/
/* This version is written in Microsoft C 6.0. Version 1.x was Microsoft
C 5.X but I lost the source code so I had to re-write this the hard
way!
Version 2.1 : Fixed testing of file request names, mistakenly
invalidated wildcards in testing!
*/
#define FROBOT_MAIN
#include "frobot.h"
#include "globals.h"
int main(int argc,char **argv)
{
char strng[65];
/* Parse out the drive and dir where frobot is located */
_splitpath(argv[0],hdrive,hdir,temp,temp1); /* Ignore name and extension */
if (argc >= 2) /* Only 1 argument possible, name of CTL file */
strcpy(strng,argv[1]);
else { /* If none then use default */
strcpy(strng,"Frobot.ctl"); /* Try current dir first */
if(stat(strng,&fbuf) == -1) { /* Not there, try frobot dir */
_makepath(strng,hdrive,hdir,"Frobot",".CTL");
if(stat(strng,&fbuf) == -1) { /* Not there, try Binkley env */
strcpy(strng,getenv("BINKLEY"));
if (!*strng) {
printf("Missing Frobot parameter file\n");
warble();
exit(1);
}
striptail(strng);
strcat(strng,"\\Frobot.ctl");
if(stat(strng,&fbuf) == -1) { /* Not there, give up */
printf("Missing Frobot parameter file\n");
warble();
exit(1);
}
}
}
}
FileSends = 0;
FileReqs = 0;
LogFile[0] = 0;
if(getparms(strng)) {
printf("Error processing Frobot parameter file\n");
warble();
ExitCode = 1;
}
else {
showparms();
if(doscript()) /* Process the script file */
ExitCode = 1; /* Some kind of error */
}
if (ShowActivity) {
if (FileSends)
printf("%d files were sent in this session.\n",FileSends);
if (FileReqs)
printf("%d files were requested in this session.\n",FileReqs);
if (ExitCode == 1)
printf("\r\nSome kind of error occured.");
if (ExitCode == 2)
printf("\r\nE-Mail was created, process your packer program.");
}
return(ExitCode);
}
void showvers(void)
{
printf("Frobot Utility Version %2.2f by Craig Derouen\n",Version);
printf("Last compiled: %s\n",__TIMESTAMP__);
}