Commit adc04460 adc04460a48cfffbfef2a6ee0fe8c66a331e38a4 by Sergey Poznyakoff

Added mu_argp.h and related stuff

1 parent a436f9a9
......@@ -56,6 +56,7 @@
#include <mailutils/error.h>
#include <argcv.h>
#include <mu_argp.h>
#ifndef INADDR_NONE
# define INADDR_NONE -1
......@@ -71,6 +72,7 @@ extern time_t overflow_delay_time;
extern int maxlines;
extern const char *username;
extern char hostname[];
extern struct daemon_param daemon_param;
extern void read_config (const char *config_file);
int acl_match (struct sockaddr_in *sa_in);
......
......@@ -82,6 +82,8 @@
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
#include <mu_argp.h>
#ifdef __cplusplus
extern "C" {
#endif
......@@ -104,10 +106,6 @@ struct imap4d_command
char *tag;
};
/* Daemon modes. */
#define INTERACTIVE 0
#define DAEMON 1
/* Global variables and constants*/
#define STATE_NONE (0)
#define STATE_NONAUTH (1 << 0)
......@@ -140,15 +138,14 @@ struct imap4d_command
extern struct imap4d_command imap4d_command_table[];
extern FILE *ofile;
extern unsigned int timeout;
extern mailbox_t mbox;
extern char *homedir;
extern char *rootdir;
extern char *maildir;
extern int state;
extern volatile size_t children;
extern int is_virtual;
extern struct daemon_param daemon_param;
#ifndef HAVE_STRTOK_R
extern char *strtok_r __P((char *s, const char *delim, char **save_ptr));
#endif
......
......@@ -386,7 +386,7 @@ imap4d_readline (FILE *fp)
line[0] = '\0'; /* start with a empty string. */
do
{
alarm (timeout);
alarm (daemon_param.timeout);
if (fgets (buffer, sizeof (buffer), fp) == NULL)
{
imap4d_bye (ERR_NO_OFILE); /* Logout. */
......
......@@ -72,6 +72,7 @@
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
#include <mu_dbm.h>
#include <mu_argp.h>
#ifdef HAVE_MYSQL
# include "../MySql/MySql.h"
......
......@@ -136,7 +136,7 @@ pop3d_readline (FILE *fp)
static char buffer[512];
char *ptr;
alarm (timeout);
alarm (daemon_param.timeout);
ptr = fgets (buffer, sizeof (buffer), fp);
alarm (0);
......
......@@ -117,6 +117,8 @@
#include <mailutils/error.h>
#include <mailutils/mutil.h>
#include <mu_argp.h>
/* For Berkley DB2 APOP password file */
#ifdef HAVE_DB_H
#include <db.h>
......@@ -141,9 +143,6 @@
#define TRANSACTION 1
#define UPDATE 2
#define INTERACTIVE 0
#define DAEMON 1
#define OK 0
#define ERR_WRONG_STATE 1
#define ERR_BAD_ARGS 2
......@@ -171,7 +170,6 @@
#endif /* __P */
extern mailbox_t mbox;
extern unsigned int timeout;
extern int state;
extern char *username;
extern char *maildir;
......@@ -179,6 +177,7 @@ extern FILE *ifile;
extern FILE *ofile;
extern char *md5shared;
extern volatile size_t children;
extern struct daemon_param daemon_param;
extern int pop3d_abquit __P ((int));
extern int pop3d_apop __P ((const char *));
......