From 87d8e6da9faf6c68255ee8668cb08319f2b273a2 Mon Sep 17 00:00:00 2001 From: patrick-scho Date: Tue, 8 Apr 2025 21:27:10 +0200 Subject: add lmdb files directly --- lmdb | 1 - lmdb/midl.h | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+), 1 deletion(-) delete mode 160000 lmdb create mode 100644 lmdb/midl.h (limited to 'lmdb/midl.h') diff --git a/lmdb b/lmdb deleted file mode 160000 index 9c9d345..0000000 --- a/lmdb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9c9d34558cc438f99aebd1ab58f83fd7faeabc0a diff --git a/lmdb/midl.h b/lmdb/midl.h new file mode 100644 index 0000000..400877e --- /dev/null +++ b/lmdb/midl.h @@ -0,0 +1,202 @@ +/** @file midl.h + * @brief LMDB ID List header file. + * + * This file was originally part of back-bdb but has been + * modified for use in libmdb. Most of the macros defined + * in this file are unused, just left over from the original. + * + * This file is only used internally in libmdb and its definitions + * are not exposed publicly. + */ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2000-2021 The OpenLDAP Foundation. + * Portions Copyright 2001-2021 Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ + +#ifndef _MDB_MIDL_H_ +#define _MDB_MIDL_H_ + +#include "lmdb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup internal LMDB Internals + * @{ + */ + +/** @defgroup idls ID List Management + * @{ + */ + /** A generic unsigned ID number. These were entryIDs in back-bdb. + * Preferably it should have the same size as a pointer. + */ +typedef mdb_size_t MDB_ID; + + /** An IDL is an ID List, a sorted array of IDs. The first + * element of the array is a counter for how many actual + * IDs are in the list. In the original back-bdb code, IDLs are + * sorted in ascending order. For libmdb IDLs are sorted in + * descending order. + */ +typedef MDB_ID *MDB_IDL; + +/* IDL sizes - likely should be even bigger + * limiting factors: sizeof(ID), thread stack size + */ +#ifndef MDB_IDL_LOGN +#define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */ +#endif +#define MDB_IDL_DB_SIZE (1<