home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / f / frbts_20.zip / FROBOT.C < prev    next >
C/C++ Source or Header  |  1991-04-27  |  3KB  |  88 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*    Frobot.c    Version 2.0    By Craig Derouen                           */
  4. /*                Main module.                                              */
  5. /*                                                                          */
  6. /*                                                                          */
  7. /****************************************************************************/
  8.  
  9. /*  This version is written in Microsoft C 6.0. Version 1.x was Microsoft
  10.     C 5.X but I lost the source code so I had to re-write this the hard
  11.     way!
  12.    
  13. */
  14.  
  15. #define  FROBOT_MAIN
  16.  
  17. #include "frobot.h"
  18. #include "globals.h"
  19.  
  20.  
  21. int main(int argc,char **argv)
  22. {
  23.    char strng[65];
  24.  
  25. /* Parse out the drive and dir where frobot is located */
  26.    _splitpath(argv[0],hdrive,hdir,temp,temp1);        /* Ignore name and extension */
  27.  
  28.    if (argc >= 2)     /* Only 1 argument possible, name of CTL file */
  29.       strcpy(strng,argv[1]);
  30.    else {        /* If none then use default */
  31.       strcpy(strng,"Frobot.ctl");        /* Try current dir first */
  32.       if(stat(strng,&fbuf) == -1) {        /* Not there, try frobot dir */
  33.          _makepath(strng,hdrive,hdir,"Frobot",".CTL");
  34.          if(stat(strng,&fbuf) == -1) {        /* Not there, try Binkley env */
  35.             strcpy(strng,getenv("BINKLEY"));
  36.             if (!*strng) {
  37.                printf("Missing Frobot parameter file\n");
  38.                warble();
  39.                exit(1);
  40.             }
  41.             striptail(strng);
  42.             strcat(strng,"\\Frobot.ctl");
  43.             if(stat(strng,&fbuf) == -1) {    /* Not there, give up */
  44.                printf("Missing Frobot parameter file\n");
  45.                warble();
  46.                exit(1);
  47.             }
  48.          }
  49.       }
  50.    }
  51.  
  52.    FileSends = 0;
  53.    FileReqs = 0;
  54.    LogFile[0] = 0;
  55.  
  56.    if(getparms(strng)) {
  57.       printf("Error processing Frobot parameter file\n");
  58.       warble();
  59.       ExitCode = 1;
  60.    }
  61.    else {
  62.       showparms();
  63.       if(doscript())        /* Process the script file */
  64.          ExitCode = 1;        /* Some kind of error */
  65.    }
  66.  
  67.    if (ShowActivity) {
  68.       if (FileSends)
  69.          printf("%d files were sent in this session.\n",FileSends);
  70.       if (FileSends)
  71.          printf("%d files were requested in this session.\n",FileSends);
  72.       if (ExitCode == 1) 
  73.          printf("\r\nSome kind of error occured.");
  74.       if (ExitCode == 2)
  75.          printf("\r\nE-Mail was created, process your packer program.");
  76.    }
  77.    return(ExitCode);
  78. }
  79.  
  80.  
  81. void showvers(void)
  82. {
  83.    printf("Frobot Utility Version %2.2f by Craig Derouen\n",Version);
  84.    printf("Last compiled: %s\n",__TIMESTAMP__);
  85.  
  86. }
  87.  
  88.