Back to index

courier  0.68.2
Functions | Variables
comtmpfile.c File Reference
#include "courier.h"
#include "maxlongsize.h"
#include <time.h>

Go to the source code of this file.

Functions

void gettmpfilenameargs (const char **time_buf, const char **pid_buf, const char **hostname_buf)
void getnewtmpfilenameargs (const char **time_buf, const char **pid_buf, const char **hostname_buf)

Variables

static char tbuf [MAXLONGSIZE]
static char pbuf [MAXLONGSIZE]
static const char * hostnameptr = 0
static char * timeptr = 0
static char * pidptr = 0

Function Documentation

void getnewtmpfilenameargs ( const char **  time_buf,
const char **  pid_buf,
const char **  hostname_buf 
)

Definition at line 53 of file comtmpfile.c.

{
       hostnameptr=0;
       gettmpfilenameargs(time_buf, pid_buf, hostname_buf);
}

Here is the call graph for this function:

void gettmpfilenameargs ( const char **  time_buf,
const char **  pid_buf,
const char **  hostname_buf 
)

Definition at line 21 of file comtmpfile.c.

{
       if (!hostnameptr)
       {
       time_t t;
       pid_t  p;

              time(&t);
              timeptr=tbuf+sizeof(tbuf)-1;
              *timeptr=0;
              do
              {
                     *--timeptr= '0' + (t % 10);
                     t /= 10;
              } while (t);

              p=getpid();
              pidptr=pbuf+sizeof(pbuf)-1;
              *pidptr=0;
              do
              {
                     *--pidptr= '0' + (p % 10);
                     p /= 10;
              } while (p);
              hostnameptr=config_me();
       }
       *time_buf=timeptr;
       *pid_buf=pidptr;
       *hostname_buf=hostnameptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char* hostnameptr = 0 [static]

Definition at line 18 of file comtmpfile.c.

char pbuf[MAXLONGSIZE] [static]

Definition at line 17 of file comtmpfile.c.

char * pidptr = 0 [static]

Definition at line 19 of file comtmpfile.c.

char tbuf[MAXLONGSIZE] [static]

Definition at line 17 of file comtmpfile.c.

char* timeptr = 0 [static]

Definition at line 19 of file comtmpfile.c.