home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersguides-&-software / hdsk41.zip / SOURCE.ZIP / HIDE.C < prev    next >
C/C++ Source or Header  |  1994-04-20  |  1KB  |  44 lines

  1. #include "hideseek.h"
  2. extern char giffile[100];
  3.  
  4.  
  5. main(int argc, char *argv[])
  6. {
  7.    FILE *infile;
  8.    char *drive=(char *)malloc(200*sizeof(char)); // 200 spaces for a file name
  9.    char *dir=(char *)malloc(200*sizeof(char));   // means you probably wont have one
  10.    char *fname=(char *)malloc(200*sizeof(char)); // that is too long.
  11.    char *ext=(char *)malloc(200*sizeof(char));   // once burned, twice shy.
  12.    int old_mode=0;
  13.    int x=0,y=0;
  14.  
  15.    process_args(argc,argv);
  16.    test_gif();
  17.  
  18.    fnsplit(argv[0],drive,dir,fname,ext);
  19.  
  20.    if (stricmp(fname,"hide")==0)
  21.    {
  22.       infile=fopen(argv[1],"rb");
  23.       if (infile==0)
  24.       {
  25.      printf("\nError opening input file %s.\n",argv[1]);
  26.      exit (0);
  27.       }
  28.  
  29.       old_mode=prepare_screen();
  30.       x=process_infile(infile);
  31.       y=fg_makegif(0,319,0,479,"outfile.gif");
  32.       fg_setmode(old_mode);
  33.       if (x==0) printf("\nError: input file %s too long!!!\n",argv[1]);
  34.       else if (y==1) printf("\nERROR: outfile.gif not made!!!\n");
  35.       else printf("\nDone! remember to delete your original file for safety, if necessary.\n");
  36.  
  37.       fclose(infile);
  38.    }
  39.    else usage_exit("hide");
  40.  
  41.    free (dir); free(drive); free(fname); free(ext);
  42.  
  43.    return 0;
  44. }