/*****************************************************************************

  POPular -- A POP3 server and proxy for large mail systems

  $Id: util.h,v 1.17 2001/04/30 15:14:14 sqrt Exp $

  http://www.remote.org/jochen/mail/popular/

******************************************************************************

  Copyright (C) 1999-2001  Jochen Topf <jochen@remote.org>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA

*****************************************************************************/

#ifndef _POPULAR_UTIL_H
#define _POPULAR_UTIL_H

int lock_shmem(int fd, int type);
int unlock_shmem(int fd);
int get_int(const char *string, int min, int max, int overflow, int error, int empty);
char *sec2timedesc(int sec);
char *sec2prettytime(int sec);
int timedesc2sec(char *desc, int min, int max);
int get_port(const char *s);
int sep_args(char *string, char **argv, int maxlen);
int valid_id(const char *s);
char *print_ip(const struct sockaddr_in *sin, char *buf);
int touch(const char *dir, const char *file);
long get_load();
char *search_string(char *s, char *t, int len);
ssize_t rel_write(int fd, const char *buf, size_t count);
int rel_select(fd_set *readset, int sec, int usec);


#endif /* _POPULAR_UTIL_H */


/** THE END *****************************************************************/


syntax highlighted by Code2HTML, v. 0.9.1