/******************************************************************************* ******************************************************************************** ** ** ** Indent Files - automatically indents a group of 'C' files ** ** ** ** Author - Michael D. Schuster, Foxboro, MA, U.S.A. ** ** ** ** ** ******************************************************************************** *******************************************************************************/ #include "eel.h" command indent_files() { char pat[FNAMELEN], *s; int i=0; int line=0; int eof=0; get_file(pat, "Indent files matching:", filename); if (!(s = do_file_match(pat, FM_EXACT | FM_NO_DIRS))) error("No matches"); while (s) { i++; note("Opening %s", s); find_it(s, 1);//open file go_line(1); // go to top while (!eof) //indent until EOF { if ((++line % 10)==0) note("Indenting %s, Line %d", s, line); do_c_indent(); if (curchar() == '\n') delete_horizontal_space(); eof=!(nl_forward()); check_abort(); } note("Saving %s", s); do_save_file(1,1,1); kill_current_buffer(); s = do_file_match(pat, 0); // Get the next file matching wildcard pattern line=0; eof=0; } note("%s indented - %d files.", pat, i); }