//Filtering functions void logfile_set_filter(logfile *log, logfilter filter, void *data) { log->filter = filter; log->filter_data = data; if (filter == NULL) { log->errors = errorlist_merge(log->errors, log->filtered_errors, log->sorting); log->filtered_errors = NULL; log->filtered_entries = 0; return; } logerror *weeded = NULL; logerror *passing = NULL; int weeded_count = 0; int passed_count = 0; debug_list("---------------", NULL); debug_list("Changing filter", NULL); debug_list(data, NULL); debug_list("errors", log->errors); debug_list("filtered_errors", log->filtered_errors); weeded_count = loglist_filter(&(log->errors), &weeded, filter, data, FILTER_REMOVE_FAILED); passed_count = loglist_filter(&(log->filtered_errors), &passing, filter, data, FILTER_REMOVE_PASSED); debug_list("--------------", NULL); debug_list("errors", log->errors); debug_list("weeded", weeded); debug_list("filtered_errors", log->filtered_errors); debug_list("passing", passing); log->errors = errorlist_merge(log->errors, passing, log->sorting); log->filtered_errors = errorlist_merge(log->filtered_errors, weeded, log->sorting); log->filtered_entries = log->filtered_entries + weeded_count - passed_count; }
thing_th *funky_dump(thing_th *args) { while(args) { debug_list(Car(args)); args=Cdr(args); } return args; }
void Condition_list_base::debug( int depth_P ) { char tmp[ 1024 ]; int i; for( i = 0; i < depth_P; ++i ) tmp[ i ] = ' '; tmp[ i ] = '\0'; kdDebug( 1217 ) << tmp << typeid( *this ).name() << ":(" << this << ")" << endl; debug_list( *this, depth_P + 1 ); }
/* main loop, parse lines into trees and execute them * ----------------------------------------------------------------------- */ void sh_loop(void) { struct parser p; union node *list; stralloc cmd; buffer_puts(fd_err->w, "nargarith.next: "); buffer_putulong(fd_err->w, &((struct nargarith*)0)->next); buffer_putnlflush(fd_err->w); /* if we're in interactive mode some additional stuff is to be initialized */ if(source->mode & SOURCE_IACTIVE) history_load(); stralloc_init(&cmd); parse_init(&p, P_DEFAULT); while(!(parse_gettok(&p, P_DEFAULT) & T_EOF)) { p.pushback++; parse_lineno = source->line; var_setvint("LINENO", parse_lineno, V_DEFAULT); /* launch the parser to get a complete command */ if((list = parse_list(&p))) { struct eval e; if(source->mode & SOURCE_IACTIVE) { tree_printlist(list, &cmd, NULL); stralloc_catc(&cmd, '\n'); stralloc_nul(&cmd); history_set(cmd.s); cmd.s = NULL; history_advance(); } #ifdef DEBUG debug_list(list, 0); buffer_putnlflush(fd_err->w); #endif /* DEBUG */ eval_push(&e, E_JCTL); eval_tree(&e, list, E_ROOT|E_LIST); sh->exitcode = eval_pop(&e); stralloc_zero(&cmd); tree_free(list); } else if(!(p.tok & (T_NL | T_SEMI | T_BGND))) { /* we have a parse error */ if(p.tok != T_EOF) parse_error(&p, 0); /* exit if not interactive */ if(!(source->mode & SOURCE_IACTIVE)) sh_exit(1); /* ..otherwise discard the input buffer */ source_flush(); p.pushback = 0; } if(p.tok & (T_NL|T_SEMI|T_BGND)) p.pushback = 0; /* reset prompt */ prompt_number = 0; } }
void run() { debug_list(); }