static int attribute_directly(void) { BUFFER *bp = curbp; int code = FALSE; #if OPT_MAJORMODE if (valid_buffer(bp)) { #if OPT_AUTOCOLOR VL_ELAPSED begin_time; (void) vl_elapsed(&begin_time, TRUE); #endif discard_syntax_highlighting(); if (b_val(bp, MDHILITE)) { char *filtername = 0; TBUFF *token = 0; if (clexec || isnamedcmd) filtername = mac_unquotedarg(&token); if (filtername == 0 && bp->majr != 0) filtername = bp->majr->shortname; if (filtername != 0 && flt_start(filtername)) { TRACE(("attribute_directly(%s) using %s\n", bp->b_bname, filtername)); flt_finish(); code = TRUE; } tb_free(&token); } attach_attrib(selbufp, &selregion); attach_attrib(startbufp, &startregion); #if OPT_HILITEMATCH if (bp->b_highlight & HILITE_ON) { bp->b_highlight |= HILITE_DIRTY; attrib_matches(); } #endif #if OPT_AUTOCOLOR bp->last_autocolor_time = vl_elapsed(&begin_time, FALSE); bp->next_autocolor_time = 0; #endif } #endif return code; }
static void begin_elapsed(const char *txt) { ETRACE(("%d:%s", elapsed_sp, txt)); if (elapsed_sp + 1 < (int) TABLESIZE(elapsed_stack)) { BI_DATA *p = find_elapsed(txt + strlen(T_CALLED)); if (p != 0) { ELAPSED_DATA *q = p->data; elapsed_stack[elapsed_sp] = p; if (!(q->nesting_time++)) { (void) vl_elapsed(&(q->this_time), TRUE); } } } ++elapsed_sp; }
static void end_elapsed(void) { if (elapsed_sp > 0) { if (--elapsed_sp < (int) TABLESIZE(elapsed_stack)) { BI_DATA *p = elapsed_stack[elapsed_sp]; ETRACE(("%d:%s::%s\n", elapsed_sp, T_RETURN, p->bi_key)); if (p != 0) { ELAPSED_DATA *q = p->data; if (!(--(q->nesting_time))) { q->total_time += vl_elapsed(&(q->this_time), FALSE); q->total_calls += 1; } } } } }