Starting an entire subroutine with a single momentary button press

if (buttonState == pushed) {
   do_something();
   buttonState = not_pushed;
   }