13503Seric # include	"../hdr/defines.h"
23503Seric 
3*19940Ssam SCCSID(@(#)pf_ab.c	1.3	05/04/85);
43503Seric 
53503Seric pf_ab(s,pp,all)
63503Seric char *s;
73503Seric register struct pfile *pp;
83503Seric int all;
93503Seric {
103503Seric 	register char *p;
113503Seric 	register int i;
123503Seric 	extern char *Datep;
133503Seric 	char *xp;
143503Seric 
153503Seric 	xp = p = alloca(size(s));
163503Seric 	copy(s,p);
173503Seric 	for (; *p; p++)
183503Seric 		if (*p == '\n') {
193503Seric 			*p = 0;
203503Seric 			break;
213503Seric 		}
223503Seric 	p = xp;
233503Seric 	p = sid_ab(p,&pp->pf_gsid);
243503Seric 	++p;
253503Seric 	p = sid_ab(p,&pp->pf_nsid);
263503Seric 	++p;
27*19940Ssam 	xp = index(p,' ');
283503Seric 	pp->pf_user[0] = 0;
29*19940Ssam 	if ((unsigned)(i = xp-p) < SZLNAM) {
30*19940Ssam 		bcopy(p,pp->pf_user,i);
313503Seric 		pp->pf_user[i] = 0;
323503Seric 	}
333503Seric 	else
343503Seric 		fatal("bad p-file format (co17)");
35*19940Ssam 	p = xp + 1;
363503Seric 	date_ab(p,&pp->pf_date);
373503Seric 	p = Datep;
383503Seric 	pp->pf_ilist = 0;
393503Seric 	pp->pf_elist = 0;
403503Seric 	if (!all || !*p)
413503Seric 		return;
423503Seric 	p =+ 2;
433503Seric 	xp = alloc(size(p));
443503Seric 	copy(p,xp);
453503Seric 	p = xp;
463503Seric 	if (*p == 'i') {
473503Seric 		pp->pf_ilist = ++p;
483503Seric 		for (; *p; p++)
493503Seric 			if (*p == ' ') {
503503Seric 				*p++ = 0;
513503Seric 				p++;
523503Seric 				break;
533503Seric 			}
543503Seric 	}
553503Seric 	if (*p == 'x')
563503Seric 		pp->pf_elist = ++p;
573503Seric }
58