int create_cats (DCATINFO *dnode, CATCODE **cfirst);
void make_temps (CATCODE *cnode, WININFO *win);
void searchfms (char *fmsname, FMSFILE *fmsdata, int *linelength);
void readfms (FMSFILE *fmsdata, int num_cats, WININFO *win, CATCODE *cfirst, int *totalfiles, long *totalbytes, int *zip_fms_index, long *zip_fms_pos, char *zipname, int minseclvl, int maxseclvl);
if ((fp = fopen ((fmsdata + i)->name, "r")) == NULL)
fail ("Unable to open FMS file", fmsname);
fgets (buffer, MAXLINE, fp);
/*********************************
* if linelength is not already *
* set, then set it *
*********************************/
if (*linelength == 0)
*linelength = strlen (buffer) + 1;
/***************************
* if line is FMS header, *
***************************/
if (strncmp (buffer, "\\FMS", 4) == 0)
{
/**************************************
* set work pointer to next argument *
* and get next argument *
**************************************/
work = strtok (buffer, "\n");
work += 4;
fmsarg = strtok (work, " ");
/*********************************
* for each remaining argument, *
*********************************/
while (fmsarg)
{
/***************************************
* if "CH()" command, get the name of *
* the file to chain to, and set the *
* chain flag to TRUE *
***************************************/
if (strncmp (fmsarg, "CH(", 3) == 0)
{
fmsarg += 3;
strcpy (fmsname, fmsarg);
fmsname[strlen(fmsarg)-1] = '\0';
chain = TRUE;
}
/*******************************************
* otherwise, if argument is TOP command, *
* set the TOP flag to TRUE *
*******************************************/
else if (strcmp (fmsarg, "TOP") == 0)
(fmsdata + i)->top = TRUE;
/**************************
* get the next argument *
**************************/
fmsarg = strtok (NULL, " ");
}
}
/***************************
* close the FMS file and *
* increment the index *
***************************/
fclose (fp);
i++;
}
/**********************************
* if the FMS array is not full, *
* set the next filename to NULL *
***********************************/
if (i < MAXFMS)
strcpy ( (fmsdata + i)->name, "");
}
void readfms (FMSFILE *fmsdata, int num_cats, WININFO *win, CATCODE *cfirst, int *totalfiles, long *totalbytes, int *zip_fms_index, long *zip_fms_pos, char *outname, int minseclvl, int maxseclvl)