Back to index

courier  0.68.2
comsizelimit.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2001 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #include      "courier.h"
00007 #include      "maxlongsize.h"
00008 #include      <stdio.h>
00009 #include      <stdlib.h>
00010 
00011 
00012 static char *sizelimit_ptr=0;
00013 
00014 unsigned long config_sizelimit()
00015 {
00016 char   *sizelimitfilename;
00017 
00018        if (sizelimit_ptr == 0)
00019        {
00020               sizelimit_ptr=getenv("SIZELIMIT");
00021               if (sizelimit_ptr == 0)
00022               {
00023                      sizelimitfilename=config_localfilename("sizelimit");
00024                      sizelimit_ptr=config_read1l(sizelimitfilename);
00025                      free(sizelimitfilename);
00026                      if (sizelimit_ptr == 0)
00027                             sizelimit_ptr="10485760";
00028               }
00029        }
00030        return (atol(sizelimit_ptr));
00031 }