~ubuntu-branches/ubuntu/oneiric/nis/oneiric-proposed

« back to all changes in this revision

Viewing changes to ypserv-2.17/lib/yp_db.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2005-11-16 23:42:06 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051116234206-p00omaw5ji5q0qhr
Tags: 3.15-3ubuntu1
Resynchronise with Debian.  (me)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef __YP_DB_H__
2
 
#define __YP_DB_H__
3
 
 
4
 
#ifdef HAVE_CONFIG_H
5
 
#include "config.h"
6
 
#endif
7
 
 
8
 
#define F_ALL   0x01
9
 
#define F_NEXT  0x02
10
 
 
11
 
#if defined(HAVE_LIBGDBM)
12
 
#include <gdbm.h>
13
 
 
14
 
#define DB_FILE GDBM_FILE
15
 
#define ypdb_fetch(a,b)  gdbm_fetch(a,b)
16
 
#define ypdb_exists(a,b)  gdbm_exists(a,b)
17
 
#define ypdb_free(a) free(a)
18
 
#define ypdb_firstkey(a) gdbm_firstkey(a)
19
 
#define ypdb_nextkey(a,b) gdbm_nextkey(a,b)
20
 
 
21
 
#elif defined(HAVE_NDBM)
22
 
 
23
 
#include <ndbm.h>
24
 
 
25
 
#define DB_FILE DBM*
26
 
#define ypdb_fetch(a,b)  dbm_fetch(a,b)
27
 
#define ypdb_free(a)
28
 
 
29
 
extern int ypdb_exists (DB_FILE file, datum key);
30
 
/* extern datum ypdb_firstkey (DB_FILE file); */
31
 
#define ypdb_firstkey(a) dbm_firstkey(a)
32
 
extern datum ypdb_nextkey (DB_FILE file, datum key);
33
 
extern datum ypdb_fetch (DB_FILE file, datum key);
34
 
 
35
 
#else
36
 
 
37
 
#error "No database found or selected !"
38
 
 
39
 
#endif
40
 
 
41
 
extern DB_FILE ypdb_open (const char *domain, const char *map);
42
 
extern int ypdb_close_all (void);
43
 
extern int ypdb_close (DB_FILE file);
44
 
 
45
 
#endif