/* * If you have the Gnuish version of c.e, here is a command that will list * all the c functions in the current buffer. */ command list_defuns () on c_tab[ALT('#')] { int start = point; char *obufname = bufname; iter = 0; point = 0; zap ("*Functions*"); while (SEARCH_FORWARD("\n{")) { int brace = point; char buff[512]; point--; skip_c_comments (-1); if (character (point) == ')') { int tail = point + 1; beginning_of_defun(); skip_c_comments (1); grab (point, tail, buff); bufname = "*Functions*"; bprintf ("%s\n", buff); bufname = obufname; } point = brace; } point = start; view_buffer ("*Functions*"); }