Back to index

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

Go to the source code of this file.

Functions

int config_domaincmp (const char *address, const char *domain, unsigned domainl)

Function Documentation

int config_domaincmp ( const char *  address,
const char *  domain,
unsigned  domainl 
)

Definition at line 16 of file cdomaincmp.c.

{
unsigned l;

       if (!domainl) return (1);
       l=strlen(address);

       if (*domain == '.')  /* Subdomain wildcard */
       {
              if (l >= domainl)
                     return (
#if    HAVE_STRNCASECMP
                            strncasecmp(address+(l-domainl), domain,
                                   domainl)
#else
                            strnicmp(address+(l-domainl), domain,
                                   domainl)
#endif
                            );
              return (1);
       }

       if (l != domainl)    return (1);

       return (
#if    HAVE_STRNCASECMP
                     strncasecmp(address, domain, domainl)
#else
                     strnicmp(address, domain, domainl)
#endif
              );
}

Here is the caller graph for this function: