Back to index

courier  0.68.2
Functions
comreadtime.h File Reference
#include "courier.h"
#include <time.h>
#include <stdlib.h>
#include <ctype.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

time_t config_readtime (const char *, time_t)
time_t config_time_queuetime ()
time_t config_time_faxqueuetime ()
time_t config_time_warntime ()
time_t config_time_respawnlo ()
time_t config_time_respawnhi ()
time_t config_time_retryalpha ()
time_t config_time_retrygamma ()
time_t config_time_submitdelay ()
time_t config_time_queuefill ()

Function Documentation

time_t config_readtime ( const char *  ,
time_t   
)

Definition at line 8 of file comreadtime.c.

{
char   *n=config_localfilename(control);
char   *buf=config_read1l(n);
const char *p;

time_t t, t2;

       free(n);
       if (!buf)
              return (deftime);

       p=buf;
       t=0;
       while (*p)
       {
              if (isspace((int)(char)*p))
              {
                     p++;
                     continue;
              }

              t2=0;
              for (; *p; p++)
              {
                     if (!isdigit((int)(char)*p))       break;
                     t2 = t2 * 10 + (*p-'0');
              }
              while (*p && isspace((int)(char)*p))      p++;

              switch (*p)   {
              case 'm':
              case 'M':
                     t += t2 * 60;
                     ++p;
                     continue;
              case 'h':
              case 'H':
                     t += t2 * 60*60;
                     ++p;
                     continue;
              case 'd':
              case 'D':
                     t += t2 * 60*60*24;
                     ++p;
                     continue;
              case 'w':
              case 'W':
                     t += t2 * 60*60*24*7;
                     ++p;
                     continue;
              case '\0':
                     t += t2;
                     break;
              case 's':
              case 'S':
                     t += t2;
                     ++p;
                     continue;
              }
              break;
       }
       free(buf);
       return (t);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 79 of file comreadtime.c.

{
       return (config_readtime("faxqueuetime", 8 * 60 * 60 ));
}

Here is the call graph for this function:

Definition at line 114 of file comreadtime.c.

{
       return (config_readtime("queuefill", 5 * 60));
}

Here is the call graph for this function:

Definition at line 74 of file comreadtime.c.

{
       return (config_readtime("queuetime", 7L * 24 * 60 * 60 ));
}

Here is the call graph for this function:

Definition at line 94 of file comreadtime.c.

{
       return (config_readtime("respawnhi", 7L * 24 * 60 * 60 ));
}

Here is the call graph for this function:

Definition at line 89 of file comreadtime.c.

{
       return (config_readtime("respawnlo", 60 * 60));
}

Here is the call graph for this function:

Definition at line 99 of file comreadtime.c.

{
       return (config_readtime("retryalpha", 60 * 5));
}

Here is the call graph for this function:

Definition at line 104 of file comreadtime.c.

{
       return (config_readtime("retrygamma", 60 * 15));
}

Here is the call graph for this function:

Definition at line 109 of file comreadtime.c.

{
       return (config_readtime("submitdelay", 0));
}

Here is the call graph for this function:

Definition at line 84 of file comreadtime.c.

{
       return (config_readtime("warntime", 4L * 60 * 60));
}

Here is the call graph for this function: