Back to index

courier  0.68.2
Functions
comrwinstall.c File Reference
#include "courier.h"
#include "rw.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int rw_install_start ()
int rw_install (const char *name, struct rw_list *(*rw_install)(const struct rw_install_info *), const char *(*rw_init)())
int rw_install_init ()

Function Documentation

int rw_install ( const char *  name,
struct rw_list *(*)(const struct rw_install_info *)  rw_install,
const char *(*)()  rw_init 
)

Definition at line 57 of file comrwinstall.c.

{
struct rw_transport *t;
struct rw_install_info install_info={RW_VERLO, RW_VERHI, COURIER_COPYRIGHT};

       if (rw_init_verbose_flag)
       {
              clog_msg_start_info();
              clog_msg_str("Installing ");
              clog_msg_str(name);
              clog_msg_send();
       }

       install_info.courier_home=courierdir();
       t=(struct rw_transport *)courier_malloc(sizeof(struct rw_transport));
       t->name=(char *)courier_malloc(strlen(name)+1);
       t->udata=0;
       if ((t->rw_ptr= (*rw_install)(&install_info)) == 0)
       {
              if (t->name)  free((void *)t->name);
              if (t)        free((void *)t);
              clog_msg_start_err();
              clog_msg_str("rw_install() failed, check for messages from the module.");
              clog_msg_send();
              return (-1);
       }
       strcpy(t->name, name);
       t->init=rw_init;
       if (rw_transport_last)      rw_transport_last->next=t;
       else   rw_transport_first=t;
       rw_transport_last=t;
       t->next=0;
       if (rw_init_verbose_flag)
       {
              clog_msg_start_info();
              clog_msg_str("Installed: ");
              clog_msg_str(t->rw_ptr->module_id);
              clog_msg_send();
       }
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int rw_install_init ( )

Definition at line 101 of file comrwinstall.c.

{
struct rw_transport *t;
const char *err;

       for (t=rw_transport_first; t; t=t->next)
       {
              if (rw_init_verbose_flag)
              {
                     clog_msg_start_info();
                     clog_msg_str("Initializing ");
                     clog_msg_str(t->name);
                     clog_msg_send();
              }
              if ((err=(*t->init)()) != 0)
              {
                     clog_msg_start_err();
                     clog_msg_str(err);
                     clog_msg_send();
                     return (-1);
              }
       }
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 37 of file comrwinstall.c.

Here is the call graph for this function:

Here is the caller graph for this function: