ulong perform_action (char WR *out, int len, char *arg, ulong rq_flags)
{
  ulong result = do_something (out, len, arg, rq_flags);

  if (result == NO_ERROR) 
  {
    print_string ("All done." "\n");
  } 
  else 
  {
    handle_error (result);
  }

  return result;
}