CTRACE(tfp,"  a=%p, l=%p, curanchor=%d\n",a,l,curanchor);
CTRACE((tfp,"  a=%p, l=%p, curanchor=%d\n",a,l,curanchor));
PUBLIC int HTGetRelLinkNum ARGS3(	int,	num,	int,	rel,	int,	cur){    TextAnchor *a, *l = 0;    int scrtop = HText_getTopOfScreen(); /*XXX +1? */    int curline = links[cur].anchor_line_num;    int curpos = links[cur].lx;    int on_screen = ( curline >= scrtop && curline < (scrtop + display_lines) );    /* curanchor may or may not be the "current link", depending whether it's     * on the current screen     */    int curanchor = links[cur].anchor_number;    CTRACE(tfp, "HTGetRelLinkNum(%d,%d,%d) -- HTMainText=%p\n",	   num, rel, cur, HTMainText);    CTRACE(tfp,"  scrtop=%d, curline=%d, curanchor=%d, display_lines=%d, %s\n",	   scrtop, curline, curanchor, display_lines,	   on_screen ? "on_screen" : "0");    if (!HTMainText) return 0;    if ( rel==0 ) return num;    /* if cur numbered link is on current page, use it */    if ( on_screen && curanchor ) {	CTRACE(tfp,"curanchor=%d at line %d on screen\n",curanchor,curline);	if ( rel == '+' ) return curanchor + num;	else if ( rel == '-' ) return curanchor - num;	else return num; /* shouldn't happen */    }    /* no current link on screen, or current link is not numbered     * -- find previous closest numbered link     */    for (a = HTMainText->first_anchor; a; a = a->next) {	CTRACE(tfp,"  a->line_num=%d, a->number=%d\n",a->line_num,a->number);	if ( a->line_num >= scrtop ) break;	if ( a->number == 0 ) continue;	l = a;	curanchor = l->number;    }    CTRACE(tfp,"  a=%p, l=%p, curanchor=%d\n",a,l,curanchor);    if ( on_screen ) { /* on screen but not a numbered link */	for ( ;  a;  a = a->next ) {	    if ( a->number ) { l = a; curanchor = l->number; }	    if ( curline == a->line_num && curpos == a->line_pos ) break;	}    }    if ( rel == '+' ) {	return curanchor + num;    } else if ( rel == '-' ) {	if ( l )	    return curanchor + 1 - num;	else {	    for ( ;  a && a->number==0;  a = a->next ) ;	    return a ? a->number - num : 0;	}    }    else return num; /* shouldn't happen */}