#include "defs.h" /* * Create a new entry and insert it into the display list. * * return = pointer to inserted entry */ DL newdl(before, ap, type, flag, pxy, style, s1 ,s2) INT before; DL ap; INT type, flag; DL pxy; INT style; STRING s1, s2; { DL p; REG STRING cp=nil(STRING); DL1 new; INT size=0; MEMPTR te; new->type=type; new->flag=flag; new->x = pxy->x; new->y = pxy->y; new->styl=style; cp=movstr(s1, new->tag); *cp++ = 0; if (s2 != nil(STRING)) cp=movstr(s2, cp); *cp++ = 0; te = memptr(round(cp,MEMSIZ)); while(cp < adr(te)) *cp++ = 0; size=adr(cp)-adr(new); new->size=size; p = before ? ap : succa(ap); movedown(p, size); copy(new, p); return(p); } DL newdln(before, ap, type, flag, s1, s2) INT before; DL ap; S_POS type, flag; STRING s1, s2; { DL p; REG STRING cp=nil(STRING); DL1 ndl; DLN new=dln(ndl); INT size=0; MEMPTR te; new->type=type; new->flag=flag; cp=movstr(s1, new->name); *cp++ = 0; if (s2 != nil(STRING)) { cp=movstr(s2, cp); *cp++ = 0; } te = memptr(round(cp,MEMSIZ)); while(cp < adr(te)) *cp++ = 0; size=adr(cp)-adr(new); new->size=size; p = before ? ap : succa(ap); movedown(p, size); copy(dl(new), p); return(p); } DL newdlp(before, ap, type, flag, pxy) INT before; DL ap; INT type, flag; DL pxy; { DL p; DL1 new; new->type=type; new->flag=flag; new->x = pxy->x; new->y = pxy->y; p = before ? ap : succa(ap); movedown(p, DLPSIZ); copy(dl(new), p); return(p); } DL newdlh(before, ap, type, flag) INT before; DL ap; INT type, flag; { DL p; DL1 new; new->type=type; new->flag=flag; p = before ? ap : succa(ap); movedown(p, DLHSIZ); copy(dl(new), p); return(p); } DL newdlw(before, ap, type, flag, pxy, style) INT before; DL ap; S_POS type, flag; DL pxy; S_POS style; { DL p; DL1 new; new->type=type; new->flag=flag; new->x=pxy->x; new->y=pxy->y; new->styl=style; new->size=DLWSIZ; p = before ? ap : succa(ap); movedown(p, DLWSIZ); copy(dl(new), p); return(p); }