/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996, 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "config.h"
#ifndef lint
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <errno.h>
#include <stdio.h>
#include <string.h>
#endif
#include "db_int.h"
#include "shqueue.h"
#include "txn.h"
/*
* This file contains all the mapping information that we need to support
*/
/*
* __db_rmid_to_env
* Return the environment associated with a given XA rmid.
*
* PUBLIC: int __db_rmid_to_env __P((int rmid, DB_ENV **envp, int open_ok));
*/
int
int rmid;
int open_ok;
{
char *dbhome;
return (0);
}
/*
* When we map an rmid, move that environment to be the first one in
* the list of environments, so we pass the correct environment from
* the upcoming db_xa_open() call into db_open().
*/
return (0);
}
/*
* We have not found the rmid on the environment list. If we
* are allowed to do an open, search for the rmid on the name
* list and, if we find it, then open it.
*/
if (!open_ok)
return (1);
return (1);
#define XA_FLAGS \
return (1);
goto err;
goto err1;
return (0);
return (1);
}
/*
* __db_xid_to_txn
* Return the txn that corresponds to this XID.
*
* PUBLIC: int __db_xid_to_txn __P((DB_ENV *, XID *, size_t *));
*/
int
{
/*
* Search the internal active transaction table to find the
* matching xid. If this is a performance hit, then we
* can create a hash table, but I doubt it's worth it.
*/
break;
return (EINVAL);
return (0);
}
/*
* __db_map_rmid
* Create a mapping between the specified rmid and environment.
*
* PUBLIC: int __db_map_rmid __P((int, DB_ENV *));
*/
int
int rmid;
{
return (XAER_RMERR);
return (XA_OK);
}
/*
* __db_unmap_rmid
* Destroy the mapping for the given rmid.
*
* PUBLIC: int __db_unmap_rmid __P((int));
*/
int
int rmid;
{
DB_ENV *e;
e = TAILQ_NEXT(e, links));
if (e == NULL)
return (EINVAL);
return (0);
}
/*
* __db_map_xid
* Create a mapping between this XID and the transaction at
* "off" in the shared region.
*
* PUBLIC: int __db_map_xid __P((DB_ENV *, XID *, size_t));
*/
int
{
return (0);
}
/*
* __db_unmap_xid
* Destroy the mapping for the specified XID.
*
* PUBLIC: void __db_unmap_xid __P((DB_ENV *, XID *, size_t));
*/
void
{
}
/*
* __db_map_rmid_name --
* Create a mapping from an rmid to a name (the xa_info argument).
* We use this during create and then at some later point when we are
* trying to map an rmid, we might indicate that it's OK to do an open
* in which case, we'll get the xa_info parameter from here and then
* free it up.
*
* PUBLIC: int __db_map_rmid_name __P((int, char *));
*/
int
int rmid;
char *dbhome;
{
int ret;
return (ret);
return (ret);
}
return (0);
}
/*
* __db_rmid_to_name --
* Given an rmid, return the name of the home directory for that
* rmid.
*
* PUBLIC: int __db_rmid_to_name __P((int, char **));
*/
int
int rmid;
char **dbhomep;
{
return (0);
}
}
return (1);
}
/*
* __db_unmap_rmid_name --
* Given an rmid, remove its entry from the name list.
*
* PUBLIC: void __db_unmap_rmid_name __P((int));
*/
void
int rmid;
{
return;
}
}
return;
}