Patch #: 9 Type: upgrade Priority: high Affects: printing with LaserWriter drivers 6.1, 6.2 and 7.0 (?) Reported: Dave Platt Archived: munnari.OZ.AU mac/cap.patches/cap60.patch009 Summary: Cope with multiple procsets per print job File: cap60/applications/lwsrv/procset.c File: cap60/applications/lwsrv/procset.h File: cap60/applications/lwsrv/simple.c *** applications/lwsrv/procset.c.orig Tue May 7 19:04:49 1991 --- applications/lwsrv/procset.c Tue May 7 19:19:58 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/06 16:05:38 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.2 1991/05/06 16:05:38 djh Exp djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/07 09:19:15 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.c,v 2.3 1991/05/07 09:19:15 djh Exp djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * procset - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 68,74 **** --- 68,82 ---- return(NULL); } + void ClearProcSetsSent() + { + DictList *dl; + for (dl = dicthead; dl != (DictList *) NULL; dl = dl->ad_next) { + dl->ad_sent = FALSE; + } + } + /* * checks if the file is there and should be readable * *************** *** 175,180 **** --- 183,189 ---- } dl->ad_ver = strdup(psn); /* remember proc set name */ dl->ad_fn = strdup(dp->d_name); /* remember file name */ + dl->ad_sent = FALSE; baddict: free(dp); } *** applications/lwsrv/procset.h.orig Tue May 7 19:09:19 1991 --- applications/lwsrv/procset.h Tue May 7 19:20:48 1991 *************** *** 1,6 **** ! /* "$Author: djh $ $Date: 91/02/15 21:15:06 $" */ ! /* "$Header: procset.h,v 2.1 91/02/15 21:15:06 djh Rel $" */ ! /* "$Revision: 2.1 $" */ /* * procset - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! /* "$Author: djh $ $Date: 1991/05/07 09:20:28 $" */ ! /* "$Header: /mac/src/cap60/applications/lwsrv/RCS/procset.h,v 2.2 1991/05/07 09:20:28 djh Exp djh $" */ ! /* "$Revision: 2.2 $" */ /* * procset - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 21,28 **** --- 21,30 ---- struct Dict_List *ad_next; /* pointer to next */ char *ad_fn; /* the file name */ char *ad_ver; /* the version number */ + int ad_sent; /* downloaded during this job? */ } DictList; DictList *GetProcSet(); /* DictList *GetProcSet(char *) */ + void ClearProcSetsSent(); void newdictionary(); /* void newdictionary(DictList *) */ void ListProcSet(); *** applications/lwsrv/simple.c.orig Tue May 7 19:13:01 1991 --- applications/lwsrv/simple.c Tue May 7 19:20:50 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/06 16:05:38 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/simple.c,v 2.2 1991/05/06 16:05:38 djh Exp djh $"; ! static char revision[] = "$Revision: 2.2 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/05/07 09:20:28 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/simple.c,v 2.3 1991/05/07 09:20:28 djh Exp djh $"; ! static char revision[] = "$Revision: 2.3 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 511,519 **** echo = FALSE; stripspaces(ts); /* clear off extra spaces */ if ((dl = GetProcSet(ts)) != NULL) { ! fprintf(stderr, "lwsrv: simple: procset already known\n"); break; } #ifdef xenix5 sprintf(tmpstr, "%s/Found.%d",dictdir,time(0)); #else xenix5 --- 511,520 ---- echo = FALSE; stripspaces(ts); /* clear off extra spaces */ if ((dl = GetProcSet(ts)) != NULL) { ! fprintf(stderr, "lwsrv: simple: procset %s already known\n", ts); break; } + sleep(1); /* raise odds of unique timestamp */ #ifdef xenix5 sprintf(tmpstr, "%s/Found.%d",dictdir,time(0)); #else xenix5 *************** *** 533,538 **** --- 534,540 ---- dl->ad_ver = strdup(ts); dl->ad_fn = strdup(tmpstr+strlen(dictdir)+1); dl->ad_next = NULL; + dl->ad_sent = FALSE; fprintf(procsetfile, "%%%%BeginProcSet: %s\n", ts); } /* copy from BPS to end into file or memory */ *************** *** 552,558 **** newdictionary(dlnew); dlnew = NULL; /* close off */ } ! if (dl) { fprintf(stderr, ((adobe_dsc2_conformant) ? "lwsrv: simple: dsc2: document supplied procset %s = %s\n" : --- 554,560 ---- newdictionary(dlnew); dlnew = NULL; /* close off */ } ! if (dl && !dl->ad_sent) { fprintf(stderr, ((adobe_dsc2_conformant) ? "lwsrv: simple: dsc2: document supplied procset %s = %s\n" : *************** *** 561,566 **** --- 563,569 ---- fprintf(outfile,"%% ** Procset From File: %s **\n",dl->ad_fn); ListProcSet(dl->ad_fn, dictdir, outfile, 0); fprintf(outfile,"%% ** End of ProcSet **\n"); + dl->ad_sent = TRUE; } dl = NULL; /* Close off */ break; *************** *** 649,654 **** --- 652,658 ---- } if (procsetfile) { fclose(procsetfile); + procsetfile = NULL; if (dlnew) { unlink(dlnew->ad_fn); free(dlnew->ad_fn); /* free fn */ *************** *** 699,704 **** --- 703,709 ---- fprintf(outfile,"%% ** Prepending ProcSet from: %s **\n",dl->ad_fn); ListProcSet(dl->ad_fn, dictdir, outfile, 1); /* prepend appledict */ fprintf(outfile,"%% ** End of ProcSet **\n"); + dl->ad_sent = TRUE; } } else { fprintf(stderr,"lwsrv: simple: Unknown ProcSet file for '%s'\n",ver); *** README.orig Wed May 8 20:52:53 1991 --- README Wed May 8 20:53:05 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 8, May 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 9, May 1991 Introduction ------------