xref: /onnv-gate/usr/src/lib/krb5/plugins/kdb/db2/libdb2/include/db-ndbm.h (revision 7934:6aeeafc994de)
14960Swillf /*-
24960Swillf  * Copyright (c) 1990, 1993
34960Swillf  *	The Regents of the University of California.  All rights reserved.
44960Swillf  *
54960Swillf  * This code is derived from software contributed to Berkeley by
64960Swillf  * Margo Seltzer.
74960Swillf  *
84960Swillf  * Redistribution and use in source and binary forms, with or without
94960Swillf  * modification, are permitted provided that the following conditions
104960Swillf  * are met:
114960Swillf  * 1. Redistributions of source code must retain the above copyright
124960Swillf  *    notice, this list of conditions and the following disclaimer.
134960Swillf  * 2. Redistributions in binary form must reproduce the above copyright
144960Swillf  *    notice, this list of conditions and the following disclaimer in the
154960Swillf  *    documentation and/or other materials provided with the distribution.
164960Swillf  * 3. All advertising materials mentioning features or use of this software
174960Swillf  *    must display the following acknowledgement:
184960Swillf  *	This product includes software developed by the University of
194960Swillf  *	California, Berkeley and its contributors.
204960Swillf  * 4. Neither the name of the University nor the names of its contributors
214960Swillf  *    may be used to endorse or promote products derived from this software
224960Swillf  *    without specific prior written permission.
234960Swillf  *
244960Swillf  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
254960Swillf  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
264960Swillf  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
274960Swillf  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
284960Swillf  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
294960Swillf  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
304960Swillf  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
314960Swillf  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
324960Swillf  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
334960Swillf  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
344960Swillf  * SUCH DAMAGE.
354960Swillf  *
364960Swillf  *	@(#)ndbm.h	8.1 (Berkeley) 6/2/93
374960Swillf  */
384960Swillf 
394960Swillf #ifndef _NDBM_H_
404960Swillf #define	_NDBM_H_
414960Swillf 
424960Swillf #include "db.h"
434960Swillf 
444960Swillf /* Map dbm interface onto db(3). */
454960Swillf #define DBM_RDONLY	O_RDONLY
464960Swillf 
474960Swillf /* Flags to dbm_store(). */
484960Swillf #define DBM_INSERT      0
494960Swillf #define DBM_REPLACE     1
504960Swillf 
514960Swillf /*
524960Swillf  * The db(3) support for ndbm(3) always appends this suffix to the
534960Swillf  * file name to avoid overwriting the user's original database.
544960Swillf  */
554960Swillf #define	DBM_SUFFIX	".db"
564960Swillf 
574960Swillf typedef struct {
584960Swillf 	char *dptr;
594960Swillf 	int dsize;
604960Swillf } datum;
614960Swillf 
624960Swillf typedef DB DBM;
634960Swillf #define	dbm_pagfno(a)	DBM_PAGFNO_NOT_AVAILABLE
644960Swillf 
654960Swillf #define dbm_close	kdb2_dbm_close
664960Swillf #define dbm_delete	kdb2_dbm_delete
674960Swillf #define dbm_fetch	kdb2_dbm_fetch
684960Swillf #define dbm_firstkey	kdb2_dbm_firstkey
694960Swillf #define dbm_forder	kdb2_dbm_forder
704960Swillf #define dbm_nextkey	kdb2_dbm_nextkey
714960Swillf #define dbm_open	kdb2_dbm_open
724960Swillf #define dbm_store	kdb2_dbm_store
73*7934SMark.Phalan@Sun.COM #define dbm_dirfno	kdb2_dbm_dirfno
744960Swillf #define dbm_error	kdb2_dbm_error
754960Swillf #define dbm_clearerr	kdb2_dbm_clearerr
764960Swillf 
774960Swillf __BEGIN_DECLS
784960Swillf void	 dbm_close __P((DBM *));
794960Swillf int	 dbm_delete __P((DBM *, datum));
804960Swillf datum	 dbm_fetch __P((DBM *, datum));
814960Swillf datum	 dbm_firstkey __P((DBM *));
824960Swillf long	 dbm_forder __P((DBM *, datum));
834960Swillf datum	 dbm_nextkey __P((DBM *));
844960Swillf DBM	*dbm_open __P((const char *, int, int));
854960Swillf int	 dbm_store __P((DBM *, datum, datum, int));
864960Swillf int	 dbm_dirfno __P((DBM *));
874960Swillf int	 dbm_error __P((DBM *db));
884960Swillf int	 dbm_clearerr __P((DBM *db));
894960Swillf __END_DECLS
904960Swillf 
914960Swillf #endif /* !_NDBM_H_ */
92