/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1996, 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#include "config.h"
#ifndef lint
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <errno.h>
#include <string.h>
#endif
#include "db_int.h"
#include "db_page.h"
#include "btree.h"
#include "db_am.h"
/*
* __db_ret --
* Build return DBT.
*
* PUBLIC: int __db_ret __P((DB *,
* PUBLIC: PAGE *, u_int32_t, DBT *, void **, u_int32_t *));
*/
int
PAGE *h;
void **memp;
{
void *data;
switch (TYPE(h)) {
case P_HASH:
}
break;
case P_DUPLICATE:
case P_LBTREE:
case P_LRECNO:
}
break;
default:
}
}
/*
* __db_retcopy --
* Copy the returned data into the user's DBT, handling special flags.
*
* PUBLIC: int __db_retcopy __P((DBT *,
* PUBLIC: void *, u_int32_t, void **, u_int32_t *, void *(*)(size_t)));
*/
int
void *data;
void **memp;
{
int ret;
/* If returning a partial record, reset the length. */
} else
len = 0;
}
/*
* Return the length of the returned record in the DBT size field.
* This satisfies the requirement that if we're using user memory
* and insufficient memory was provided, return the amount necessary
* in the size field.
*/
/*
* Allocate memory to be owned by the application: DB_DBT_MALLOC.
*
* !!!
* We always allocate memory, even if we're copying out 0 bytes. This
* guarantees consistency, i.e., the application can always free memory
* without concern as to how many bytes of the record were requested.
*
* Use the memory specified by the application: DB_DBT_USERMEM.
*
* !!!
* If the length we're going to copy is 0, the application-supplied
* memory pointer is allowed to be NULL.
*/
return (ret);
return (ENOMEM);
return (EINVAL);
} else {
*memsize = 0;
return (ret);
}
}
}
if (len != 0)
return (0);
}