int main(int argc, char *argv[]) { int place_holder; int column_start = ((place_holder = set_detab_start_column(argc, argv)) > 0) ? place_holder : 0; int tabstop = ((place_holder = set_tabstop(argc, argv)) > 0) ? place_holder : 8; int character; while ((character = getchar()) != EOF) detab(column_start, tabstop, character); return 0; }
void spy_dump (spy_t s) { tabstop t; open_output(); spy_accumulate_children_stats(s); if (mode == SPY_DISPLAY_SAMPLES) { display_samples(s); } else { init_tabstop(&t); set_tabstop(s, &t); dump_header(&t); spy_dump_internal(s, &t); } }
void spy_dump_all () { int i; unsigned long total = 0; tabstop t; spy_t s; open_output(); init_tabstop(&t); for (i = 0; i < nspys; i++) { s = &spys[i]; spy_accumulate_children_stats(s); if (s->n == 0) continue; if (mode != SPY_DISPLAY_SAMPLES) set_tabstop(s, &t); total += spys[i].cumulative; } if (mode == SPY_DISPLAY_SAMPLES) { for (i = 0; i < nspys; i++) { s = &spys[i]; if (s->n == 0) continue; display_samples(s); } } else { dump_header(&t); for (i = 0; i < nspys; i++) { s = &spys[i]; if (s->n == 0) continue; spy_dump_internal(s, &t); } if (mode & SPY_DISPLAY_TOTAL) { fprintf(out, "total: %s.\n", r_dtoa(cycle_to_usec(total))); } } }