int mutt_pipe_message (HEADER *h)
void mutt_pipe_message (HEADER *h)
int mutt_pipe_message (HEADER *h){  STATE s;  char buffer[LONG_STRING];  int i, rc = 0;   pid_t thepid;  buffer[0] = 0;  if (mutt_get_field (_("Pipe to command: "), buffer, sizeof (buffer), M_CMD)      != 0 || !buffer[0])    return 0;  mutt_expand_path (buffer, sizeof (buffer));  memset (&s, 0, sizeof (s));  endwin ();  if (h)  {    mutt_message_hook (Context, h, M_MESSAGEHOOK);#ifdef HAVE_PGP    if (option (OPTPIPEDECODE))    {      mutt_parse_mime_message (Context, h);      if(h->pgp & PGPENCRYPT && !pgp_valid_passphrase())	return 1;    }    endwin ();#endif    thepid = mutt_create_filter (buffer, &s.fpout, NULL, NULL);    mutt_pipe_message_to_state (h, &s);    fclose (s.fpout);    rc = mutt_wait_filter (thepid);  }  else  { /* handle tagged messages */#ifdef HAVE_PGP    if(option(OPTPIPEDECODE))    {      for (i = 0; i < Context->vcount; i++)	if(Context->hdrs[Context->v2r[i]]->tagged)	{	  mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);	  mutt_parse_mime_message(Context, Context->hdrs[Context->v2r[i]]);	  if (Context->hdrs[Context->v2r[i]]->pgp & PGPENCRYPT &&	      !pgp_valid_passphrase())	    return 1;	}    }#endif        if (option (OPTPIPESPLIT))    {      for (i = 0; i < Context->vcount; i++)      {        if (Context->hdrs[Context->v2r[i]]->tagged)        {	  mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);	  endwin ();	  thepid = mutt_create_filter (buffer, &(s.fpout), NULL, NULL);          mutt_pipe_message_to_state (Context->hdrs[Context->v2r[i]], &s);          /* add the message separator */          if (PipeSep)	    state_puts (PipeSep, &s);	  fclose (s.fpout);	  if (mutt_wait_filter (thepid) != 0)	    rc = 1;        }      }    }    else    {      endwin ();      thepid = mutt_create_filter (buffer, &(s.fpout), NULL, NULL);      for (i = 0; i < Context->vcount; i++)      {        if (Context->hdrs[Context->v2r[i]]->tagged)        {	  mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);          mutt_pipe_message_to_state (Context->hdrs[Context->v2r[i]], &s);          /* add the message separator */          if (PipeSep)	    state_puts (PipeSep, &s);        }      }      fclose (s.fpout);      if (mutt_wait_filter (thepid) != 0)	rc = 1;    }  }  if (rc || option (OPTWAITKEY))    mutt_any_key_to_continue (NULL);  return 1;}