/* relay-blocking tests;  Added for ZMailer 2.99.44 by Matti Aarnio
   on 16-Dec-96 */

/* Pre-included before including this:
     - all type-defining files
     - *DB* headers
 */

#ifdef _RELAYTEST_INTERNAL_

typedef enum { _dbt_none, _dbt_btree, _dbt_ndbm, _dbt_gdbm } dbtypes;

struct relaytest {
  char *dbtype;
  char *dbpath;
  dbtypes dbt;
  union {
#ifdef HAVE_NDBM_H
    DBM *_ndbm;
#endif
#ifdef HAVE_GDBM_H
    GDBM_FILE _gdbm;
#endif
#ifdef HAVE_DB_H
    DB *_db;
#endif    
  } db_;
#define btree db_._db
#define gdbm  db_._gdbm
#define ndbm  db_._ndbm
};

#else  /* This is the external interface -- doesn't tell a thing ;-) */

struct relaytest {
  void *dummy;
};

#endif


extern void reldefine __((struct relaytest **relp,char *dbtype, char *dbpath));
extern int  reltest     __((struct relaytest *rel, char *str));
extern int  reltestaddr __((struct relaytest *rel, struct sockaddr *raddr));
