1 /*	$NetBSD: mkmap_cdb.c,v 1.1.1.1 2009/06/23 10:08:47 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	mkmap_cdb 3
6 /* SUMMARY
7 /*	create or open database, CDB style
8 /* SYNOPSIS
9 /*	#include <mkmap.h>
10 /*
11 /*	MKMAP	*mkmap_cdb_open(path)
12 /*	const char *path;
13 /*
14 /* DESCRIPTION
15 /*	This module implements support for creating DJB's CDB "constant
16 /*	databases".
17 /*
18 /*	mkmap_cdb_open() take a file name, append the ".cdb.tmp" suffix,
19 /*	create the named DB database.  On close, this file renamed to
20 /*	file name with ".cdb" suffix appended (without ".tmp" part).
21 /*	This routine is a CDB-specific helper for the more
22 /*	general mkmap_open() interface.
23 /*
24 /*	All errors are fatal.
25 /* SEE ALSO
26 /*	dict_cdb(3), CDB dictionary interface.
27 /* LICENSE
28 /* .ad
29 /* .fi
30 /*	The Secure Mailer license must be distributed with this software.
31 /* AUTHOR(S)
32 /*	Written by Michael Tokarev <mjt@tls.msk.ru> based on mkmap_db by
33 /*	Wietse Venema
34 /*	IBM T.J. Watson Research
35 /*	P.O. Box 704
36 /*	Yorktown Heights, NY 10598, USA
37 /*--*/
38 
39 /* System library. */
40 
41 #include <sys_defs.h>
42 
43 #ifdef HAS_CDB
44 
45 /* Utility library. */
46 
47 #include <mymalloc.h>
48 #include <dict.h>
49 
50 /* Application-specific. */
51 
52 #include "mkmap.h"
53 #include <dict_cdb.h>
54 
55 /* This is a dummy module, since CDB has all the functionality
56  * built-in, as cdb creation requires one global lock anyway. */
57 
58 MKMAP *mkmap_cdb_open(const char *unused_path)
59 {
60     MKMAP  *mkmap = (MKMAP *) mymalloc(sizeof(*mkmap));
61     mkmap->open = dict_cdb_open;
62     mkmap->after_open = 0;
63     mkmap->after_close = 0;
64     return (mkmap);
65 }
66 
67 #endif /* HAS_CDB */
68