Build courier-authlib 0.60.2-0hcoop1.
[hcoop/debian/courier-authlib.git] / userdb / userdb.h
CommitLineData
d9898ee8 1#ifndef userdb_h
2#define userdb_h
3
4/*
5** Copyright 1998 - 2001 Double Precision, Inc.
6** See COPYING for distribution information.
7*/
8
9static const char userdb_rcsid_h[]="$Id: userdb.h,v 1.8 2004/04/18 15:54:39 mrsam Exp $";
10
11#include <sys/types.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/*
18 Functions to access local/config/userdb.dat
19*/
20
21void userdb_set_debug(int);
22void userdb_init(const char *);
23void userdb_close();
24char *userdb(const char *); /* Fetch the record */
25char *userdbshadow(const char *,
26 const char *); /* Fetch the userdbshadow record */
27
28 /* Extract field from the record */
29const char *userdb_get(const char *, /* The record */
30 const char *, /* Field name */
31 int *); /* Content length returned */
32
33 /* Extract numerical field from record */
34
35unsigned userdb_getu(const char *, /* The record */
36 const char *, /* Field name */
37 unsigned); /* Returned if field not found */
38
39 /* Extract string into malloced buffer */
40char *userdb_gets(const char *, /* The record */
41 const char *); /* The field */
42
43struct userdbs {
44 char *udb_name; /* Account name, ONLY set by userdb_createsuid */
45 char *udb_gecos; /* GECOS */
46 char *udb_dir; /* Home directory */
47 char *udb_shell; /* Shell */
48 char *udb_mailbox; /* Default mailbox */
49 char *udb_quota; /* Maildir quota */
50 char *udb_options; /* Options, see INSTALL */
51 uid_t udb_uid;
52 gid_t udb_gid;
53
54 char *udb_source; /* Non-blank - source file in userdb dir */
55 } ;
56
57struct userdbs *userdb_creates(const char *);
58struct userdbs *userdb_createsuid(uid_t);
59struct userdbs *userdb_enum_first();
60struct userdbs *userdb_enum_next();
61
62void userdb_frees(struct userdbs *);
63char *userdb_mkmd5pw(const char *);
64
65#ifdef __cplusplus
66} ;
67#endif
68
69#endif