Back to index

courier  0.68.2
Functions
maildirparsequota.c File Reference
#include "maildirquota.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

int maildir_parsequota (const char *n, unsigned long *s)

Function Documentation

int maildir_parsequota ( const char *  n,
unsigned long *  s 
)

Definition at line 14 of file maildirparsequota.c.

{
const char *o;
int    yes;

       if ((o=strrchr(n, '/')) == 0)      o=n;

       for (; *o; o++)
              if (*o == MDIRSEP[0])       break;
       yes=0;
       for ( ; o >= n; --o)
       {
              if (*o == '/')       break;

              if (*o == ',' && o[1] == 'S' && o[2] == '=')
              {
                     yes=1;
                     o += 3;
                     break;
              }
       }
       if (yes)
       {
              *s=0;
              while (*o >= '0' && *o <= '9')
                     *s= *s*10 + (*o++ - '0');
              return (0);
       }
       return (-1);
}

Here is the caller graph for this function: