/*
    slforum version 1.x - Simple chat room usable via telnet.
    Copyright (C) 2000 Jeremy D. Monin, Dan Chin, Matt Lochansky
	(forum@shadowlands.org).
    Based on jdkchat version 1.3, J.D.Koftinoff Software, Ltd. (GPL'd)

    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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/* This file should always be included, to declare things.
 * If USE_VIRTUSERS isn't 1, the corresponding .c file will
 * just write some stub functions.
 */

#ifndef __PASSWD_DB_INC_H
#define __PASSWD_DB_INC_H 1

#include <pwd.h>
#include <sys/types.h>  /* for struct passwd */

#ifdef __cplusplus
extern "C" {
#endif


#define SLF_VIRTUSER_DATASIZE  1000  /* max entry len for ndbm records 
				      * (solaris manpage says 1024 or more
				      * for the key - content pair)
				      */

  const char *slf_virtuser_get_dbfname (void);  /* could be NULL */
  void slf_virtuser_set_dbfname (const char *newfname);

  struct slf_userinfo *slf_virtuser_get_info
	(const char*name, const char*guess_of_pw, bool dynalloc);

  bool slf_virtuser_put_info
	(const struct slf_userinfo *udata);

  bool slf_virtuser_remove
	(const char *uname);

  const struct slf_userinfo *slf_virtuser_getfirst (void);
  const struct slf_userinfo *slf_virtuser_getnext (void);
  void slf_virtuser_getstop (void);

  const char* slf_cryptnewpw
	(const char *unenc_pw);


#ifdef __cplusplus
	   }
#endif	/* defined __cplusplus */
#endif	/* ndef'd __PASSWD_DB_INC_H */
