#include "defs.h" /* * Add label * * h = head item * s = printing style * v = label type * input = cursor position */ label(h, s, v) DL h; INT s; INT v; { REG DL p, p2; REG DL q=xhairs; REG S_POS dir; chkhd(h, "wcL"); if(h->type == 'w') { if (p = findseg(h, q)){ p2 = succa(p); if(p->y == p2->y) dir = (p->x > p2->x) ? 0 : 2; else dir = (p->y > p2->y) ? 1 : 3; } else error("cannot label wire"); } else dir = 0; if (h->type == 'c') p = newdlw(AFTER, h, v, dir, q, s); else p = newdlw(BEFORE, succ(h->type, h), v, dir, q, s); show(h, p); }