#include "defs.h" /* * Find the closest chip (from outside chip mode) and alter the board position. */ boardset(h) REG DL h; { DL1 p1; ITEM bp; rdname(bp, sizeof(bp)); while(cursor(p1)==SP) { if(h = findhead('c', p1)) { boardpos(h, bp); showh(h,0); } else error("cannot find chip"); } } /* * Replace board position string of chip. * * h = pointer to 'c' entry of chip * bp = board position character string */ boardpos(h, bp) DL h; STRING bp; { REG DL p; chkhd(h, "c"); p=h; while(p=nexta('c', p)) { if(p->type=='b') delete(p); } if(*bp) newdln(AFTER, h, 'b', END, bp, nil(STRING)); } /* * return pointer to board position * * h = header type 'c' * return = 0 if no board position */ STRING bdpos(h) REG DL h; { REG DL p; p=h; while(p=nexta('c', p)) { if(p->type=='b') return(dln(p)->name); } return(nil(STRING)); }