Back to index

courier  0.68.2
Defines | Functions
comfax.h File Reference
#include "courier.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.

Defines

#define FAX_LOWRES   1
#define FAX_OKUNKNOWN   2
#define FAX_COVERONLY   4

Functions

int comgetfaxopts (const char *, int *)
int comgetfaxoptsn (const char *, int, int *)

Define Documentation

#define FAX_COVERONLY   4

Definition at line 20 of file comfax.h.

#define FAX_LOWRES   1

Definition at line 18 of file comfax.h.

#define FAX_OKUNKNOWN   2

Definition at line 19 of file comfax.h.


Function Documentation

int comgetfaxopts ( const char *  ,
int *   
)

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 *  ,
int  ,
int *   
)

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: