/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
/* number of archive types */
#define narc 3

/* extensions for theese archives */
char archivefiles[narc][6] = {".ZIP;",
                              ".BCK;",
                              ".TAR;"};

/* commands to list content for theese archives */
char listfmt[narc][30] = {"OLDZIPINFO %s",
                          "BACKUP/LIST %s/SAVE_SET",
                          "TAR TF %s"};

/* column with filenames for theese archives */
int filecolumn[narc] = {9,1,7};

/* commands to extract files from theese archives */
char extractfmt[narc][60] = {"UNZIP -J -O %s \"%s\"",
                             "BACKUP %s/SAVE_SET/SELECT=%s []*.*/NEW_VERSION",
                             "TAR XF %s \"%s\""};

/* number of compressed types */
#define ncomp 1

/* extension addition for those compressed files */
char compressfiles[ncomp][6] = {"-GZ;"};

/* commands to decompress those compressed files */
char decompfmt[ncomp][60] = {"GZIP -D %s"};

/* number of binary file extensions */
#define nbin 10

/* binary file extensions */
char binaryfilesupper[nbin][5] = {".EXE",
                                  ".GIF",
                                  ".JPG",
                                  ".ZIP",
                                  ".BCK",
                                  ".TAR",
                                  ".TLB",
                                  ".JAR",
                                  ".HLP",
                                  ".OLB"};

char binaryfileslower[nbin][5];

/* determine whether line from list contains a file or not */
int linewithfile(char *s,int ix)
{
   int res;
   res=0;
   switch (ix) {
      case 0:
         if(strstr(s," files")==NULL) res=1;
         break;
      case 1:
         if(s[0]=='[') res=1;
         break;
      case 2:
         res=1;
         break;
   }
   return res;
}

