#!/bin/rc panels=`{grep '^Pops [a-z]+ops =' *.c | sed 's/^.*:Pops ([a-z]+ops) =.*/\1/' | grep -v 'rowops|colops|nilops'} panels=(nilops rowops colops $panels) cat < #include #include #include #include #include #include #include #include #include <9p.h> #include #include "gui.h" #include "cook.h" ! for (p in $panels){ echo 'extern Pops '^$p^';' } echo 'Pops* panels[] = {' for (p in $panels){ echo ' &'^$p^',' } echo ' nil,' cat <type >= 0 && p->type < nelem(panels)); } !