Back to index

courier  0.68.2
Functions
comqueuename.h File Reference
#include <sys/types.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const char * qmsgsdir (ino_t)
const char * qmsgsctlname (ino_t)
const char * qmsgsdatname (ino_t)
const char * qmsgqdir (time_t)
const char * qmsgqname (ino_t, time_t)
void qmsgunlink (ino_t, time_t)

Function Documentation

const char* qmsgqdir ( time_t  )

Definition at line 44 of file comqueuename.c.

{
static char buf[MAXLONGSIZE + 10 + sizeof(MSGQDIR "/") ];

       strcat(strcpy(buf, MSGQDIR "/"), strtimestamp(t));
       buf[strlen(buf)-4]=0;       /* I'm pretty sure it's at least 1971 */
       return (buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* qmsgqname ( ino_t  ,
time_t   
)

Definition at line 53 of file comqueuename.c.

{
static char buf[MAXLONGSIZE*3 + 25 + sizeof(MSGQDIR "/") ];

       strcat(strcpy(buf, qmsgqdir(t)), "/C");
       strcat(buf, strinode(i));
       strcat(buf, ".");
       strcat(buf, strtimestamp(t));
       return (buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* qmsgsctlname ( ino_t  )

Definition at line 34 of file comqueuename.c.

{
       return (qmsgsname(inum, "C"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* qmsgsdatname ( ino_t  )

Definition at line 39 of file comqueuename.c.

{
       return (qmsgsname(inum, "D"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

const char* qmsgsdir ( ino_t  )

Definition at line 18 of file comqueuename.c.

{
static char buf[MAXLONGSIZE + 10 + sizeof(MSGSDIR "/") ];

       return (strcat(strcpy(buf, MSGSDIR "/"),
              strinode(inum % QDIRCOUNT)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void qmsgunlink ( ino_t  ,
time_t   
)

Definition at line 24 of file comqueuename2.c.

{
       const char *bigbrother=getenv("ARCHIVEDIR");

       if (bigbrother && *bigbrother)
       {
              struct tm *tmptr=localtime(&rightnow);

              /* Archive this message */

              if (tmptr)
              {
                     const char *dname=qmsgsdatname(n);
                     const char *tname=strrchr(dname, '/');

                     char *p=courier_malloc(strlen(bigbrother)+
                                          strlen(tname)+40);

                     sprintf(p, "%s/%04d.%02d.%02d%s",
                            bigbrother, tmptr->tm_year + 1900,
                            tmptr->tm_mon+1,
                            tmptr->tm_mday, tname);

                     if (bigbrother_create_rename(dname, p) == 0)
                     {
                            dname=qmsgsctlname(n);

                            strcpy(strrchr(p, '/'), strrchr(dname, '/'));

                            if (rename(dname, p) == 0)
                            {
                                   free(p);
                                   return;
                            }
                     }

                     clog_msg_start_err();
                     clog_msg_str("Unable to move ");
                     clog_msg_str(dname);
                     clog_msg_str(" to ");
                     clog_msg_str(p);
                     clog_msg_send();
                     clog_msg_prerrno();

                     free(p);
              }
       }

       unlink(qmsgsdatname(n));
       unlink(qmsgsctlname(n));
}

Here is the call graph for this function:

Here is the caller graph for this function: