From: Howard Chu Date: Fri, 9 Aug 2013 11:51:33 +0000 (-0700) Subject: Add mdb_env_get_maxkeysize() X-Git-Tag: OPENLDAP_REL_ENG_2_4_36~12^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ac3c8308f78269b31de0bd9e6cd99dcda7b48d1;p=openldap Add mdb_env_get_maxkeysize() --- diff --git a/libraries/liblmdb/lmdb.h b/libraries/liblmdb/lmdb.h index 9019b31bdc..8bd341cca1 100644 --- a/libraries/liblmdb/lmdb.h +++ b/libraries/liblmdb/lmdb.h @@ -720,6 +720,13 @@ int mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers); */ int mdb_env_set_maxdbs(MDB_env *env, MDB_dbi dbs); + /** @brief Get the maximum size of a key for the environment. + * + * @param[in] env An environment handle returned by #mdb_env_create() + * @return The maximum size of a key. (#MDB_MAXKEYSIZE) + */ +int mdb_env_get_maxkeysize(MDB_env *env); + /** @brief Create a transaction for use with the environment. * * The transaction handle may be discarded using #mdb_txn_abort() or #mdb_txn_commit(). diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 0c53766e3f..ca7233466b 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -8069,6 +8069,11 @@ int mdb_set_relctx(MDB_txn *txn, MDB_dbi dbi, void *ctx) return MDB_SUCCESS; } +int mdb_env_get_maxkeysize(MDB_env *env) +{ + return MDB_MAXKEYSIZE; +} + int mdb_reader_list(MDB_env *env, MDB_msg_func *func, void *ctx) { unsigned int i, rdrs;