[exim-cvs] Docs: hintsdb internal APIs

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Exim Git Commits Mailing List
日付:  
To: exim-cvs
題目: [exim-cvs] Docs: hintsdb internal APIs
Gitweb: https://git.exim.org/exim.git/commitdiff/b371572e89e8ca593b8d6bb5c919fedbb67b2eeb
Commit:     b371572e89e8ca593b8d6bb5c919fedbb67b2eeb
Parent:     6fa5cd352fc9c1e86ec56ac4f2b96804b6472a5f
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Jun 6 14:45:14 2024 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Jun 6 14:46:03 2024 +0100


    Docs: hintsdb internal APIs
---
 src/src/dbfn.c    | 22 ++++++++++++++++++++--
 src/src/hintsdb.h | 35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 54 insertions(+), 3 deletions(-)


diff --git a/src/src/dbfn.c b/src/src/dbfn.c
index 389d1518e..37ff7f504 100644
--- a/src/src/dbfn.c
+++ b/src/src/dbfn.c
@@ -20,7 +20,7 @@ with database files like $spooldirectory/db/<name> */
different DBM files. This module does not contain code for reading DBM files
for (e.g.) alias expansion. That is all contained within the general search
functions. As Exim now has support for several DBM interfaces, all the relevant
-functions are called as macros.
+functions are called as inlinable functions from an included file.

 All the data in Exim's database is in the nature of *hints*. Therefore it
 doesn't matter if it gets destroyed by accident. These functions are not
@@ -35,7 +35,25 @@ means of locking on independent lock files. (Earlier attempts to lock on the
 DBM files themselves were never completely successful.) Since callers may in
 general want to do more than one read or write while holding the lock, there
 are separate open and close functions. However, the calling modules should
-arrange to hold the locks for the bare minimum of time. */
+arrange to hold the locks for the bare minimum of time.
+
+API:
+  dbfn_open
+  dbfn_close
+  dbfn_read_with_length
+  dbfn_read_enforce_length
+  dbfn_write
+  dbfn_delete
+  dbfn_scan                unused; ifdeffout out
+
+Users:
+  ACL ratelimit & seen conditions
+  delivery retry handling
+  delivery serialization
+  TLS session resumption
+  peer capability cache
+  callout & quota cache
+*/




diff --git a/src/src/hintsdb.h b/src/src/hintsdb.h
index ed1b5566d..3332f748c 100644
--- a/src/src/hintsdb.h
+++ b/src/src/hintsdb.h
@@ -16,7 +16,40 @@ from Pierre A. Humblet, so Exim could be made to work with Cygwin.

 For convenience, the definitions of the structures used in the various hints
 databases are also kept in this file, which is used by the maintenance
-utilities as well as the main Exim binary. */
+utilities as well as the main Exim binary.
+
+A key/value store is supported (only).  Keys are strings; values arbitrary
+binary blobs.
+
+The API is:
+  Functions:
+    exim_dbopen
+    exim_dbclose
+    exim_dbget
+    exim_dbput
+    exim_dbputb        (non-overwriting put)
+    exim_dbdel
+    exim_dbcreate_cursor
+    exim_dbscan        (get, and bump cursor)
+    exim_dbdelete_cursor
+    exim_datum_init
+    exim_datum_size_get
+    exim_datum_data_get
+    exim_datum_free
+  Defines:
+    EXIM_DB        access handle
+    EXIM_CURSOR        datatype for cursor
+    EXIM_DATUM        datatype for "value"
+    EXIM_DBTYPE        text for logging & debuug
+
+Selection of the shim layer implementation, and backend, is by #defines.
+
+The users of this API are:
+  hintsdb interface    dbfn.c
+  hintsdb utilities    exim_dbutil.c and exim_dbmvuild.c
+  dbmdb lookup        lookups/dbmdb,c
+  autoreply transport    transports/autoreply.c
+*/


#ifndef HINTSDB_H
#define HINTSDB_H

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/