#include #include /* * FOUTHD performs miscellaneous housekeeping for the creation of a new * picture file from an existing one when the header information is not * to be changed, save for the inclusion of the calling program's argument * line. The header is modified to reflect the new length of the * comments and is output to FOUT. OUTHD then copies the existing * comments from FIN to FOUT, unless a negative value has been given * for FIN, or the existing comment length is zero. The call line is * then appended to the comments by a call to PRARGV. */ /* Joseph Pallas 9/18/80 cc -O -c fouthd.c */ int fouthd(fin, fout, newarea, argv) FILE *fin, *fout; struct cvl_p *newarea; char *argv[]; { register int old_length; register int total; register int arglen; /* update header comment_length field */ old_length = newarea->cv_lcom; arglen = lnargv(argv); newarea->cv_lcom += arglen; /* write new header */ if (fohead(fout, newarea) == -1) return(-1); /* test for copy */ if ((old_length > 0) && (fin != NULL)) { if ((total = fcpcmnt(fin, fout, old_length)) != old_length) return(-1); } else total = 0; /* add new comments */ if (fprargv(fout, argv) != arglen) return(-1); return(total + arglen); }