/[mailutils]/mailutils/libmu_scm/mu_message.c
ViewVC logotype

Diff of /mailutils/libmu_scm/mu_message.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by gray, Tue Oct 23 22:30:41 2001 UTC revision 1.11 by gray, Fri Dec 28 11:17:47 2001 UTC
# Line 630  SCM_DEFINE (mu_message_get_user_flag, "m Line 630  SCM_DEFINE (mu_message_get_user_flag, "m
630  {  {
631    message_t msg;    message_t msg;
632    attribute_t attr;    attribute_t attr;
   int ret = 0;  
633    
634    SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);    SCM_ASSERT (mu_scm_is_message (MESG), MESG, SCM_ARG1, FUNC_NAME);
635    msg = mu_scm_message_get (MESG);    msg = mu_scm_message_get (MESG);
# Line 731  SCM_DEFINE (mu_message_get_body, "mu-mes Line 730  SCM_DEFINE (mu_message_get_body, "mu-mes
730  }  }
731  #undef FUNC_NAME  #undef FUNC_NAME
732    
733  SCM_DEFINE (mu_message_send, "mu-message-send", 1, 1, 0,  SCM_DEFINE (mu_message_send, "mu-message-send", 1, 3, 0,
734              (SCM MESG, SCM MAILER),              (SCM MESG, SCM MAILER, SCM FROM, SCM TO),
735              "Sends the message MESG. Optional MAILER overrides default\n"              "Sends the message MESG. Optional MAILER overrides default\n"
736              "mailer settings in mu-mailer.\n")              "mailer settings in mu-mailer.\n"
737                "Optional FROM and TO are sender and recever addresses\n")
738  #define FUNC_NAME s_mu_message_send  #define FUNC_NAME s_mu_message_send
739  {  {
740    char *mailer_name;    char *mailer_name;
741      address_t from = NULL;
742      address_t to = NULL;
743    mailer_t mailer;    mailer_t mailer;
744    message_t msg;    message_t msg;
745    int status;    int status;
# Line 754  SCM_DEFINE (mu_message_send, "mu-message Line 756  SCM_DEFINE (mu_message_send, "mu-message
756    else    else
757      mailer_name = SCM_CHARS(_mu_scm_mailer);      mailer_name = SCM_CHARS(_mu_scm_mailer);
758    
759      if (!SCM_UNBNDP (FROM))
760        {
761          SCM_ASSERT (SCM_NIMP (FROM) && SCM_STRINGP (FROM)
762                      && address_create (&from, SCM_CHARS (FROM)) == 0,
763                      FROM, SCM_ARG3, FUNC_NAME);
764        }
765      
766      if (!SCM_UNBNDP (TO))
767        {
768          SCM_ASSERT (SCM_NIMP (TO) && SCM_STRINGP (TO)
769                      && address_create (&to, SCM_CHARS (TO)) == 0,
770                      TO, SCM_ARG4, FUNC_NAME);
771        }
772    
773    if (mailer_create (&mailer, mailer_name))    if (mailer_create (&mailer, mailer_name))
774      {      {
775        return SCM_BOOL_F;        return SCM_BOOL_F;
# Line 769  SCM_DEFINE (mu_message_send, "mu-message Line 785  SCM_DEFINE (mu_message_send, "mu-message
785    status = mailer_open (mailer, MU_STREAM_RDWR);    status = mailer_open (mailer, MU_STREAM_RDWR);
786    if (status == 0)    if (status == 0)
787      {      {
788        status = mailer_send_message (mailer, msg);        status = mailer_send_message (mailer, msg, from, to);
789        mailer_close (mailer);        mailer_close (mailer);
790      }      }
791    mailer_destroy (&mailer);    mailer_destroy (&mailer);

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26