Back to index

courier  0.68.2
Functions
comfax.c File Reference
#include "courier_lib_config.h"
#include "comfax.h"
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Functions

int comgetfaxopts (const char *s, int *flags)
int comgetfaxoptsn (const char *s, int sl, int *flags)

Function Documentation

int comgetfaxopts ( const char *  s,
int *  flags 
)

Definition at line 22 of file comfax.c.

{
       return (comgetfaxoptsn(s, strlen(s), flags));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int comgetfaxoptsn ( const char *  s,
int  sl,
int *  flags 
)

Definition at line 31 of file comfax.c.

{
       *flags=0;

       if (sl < 3)
              return (-1);

       if (strncasecmp(s, "fax", 3))
              return (-1);

       s += 3;
       sl -= 3;

       while (sl)
       {
              if (*s != '-')
                     return (-1);

              ++s;
              --sl;
              if (!sl)
                     return (-1);

              if (sl >= 6 && strncasecmp(s, "lowres", 6) == 0)
              {
                     s += 6;
                     sl -= 6;
                     *flags |= FAX_LOWRES;
              }
              else if (sl >= 6 && strncasecmp(s, "ignore", 6) == 0)
              {
                     s += 6;
                     sl -= 6;
                     *flags |= FAX_OKUNKNOWN;
              }
              else if (sl >= 5 && strncasecmp(s, "cover", 5) == 0)
              {
                     s += 5;
                     sl -= 5;
                     *flags |= FAX_COVERONLY;
              }
              else
                     return (-1);
       }

       return (0);
}

Here is the caller graph for this function: