1N/A** Copyright (c) 1999-2002 Sendmail, Inc. and its suppliers. 1N/A** All rights reserved. 1N/A** By using this file, you agree to the terms and conditions set 1N/A** forth in the LICENSE file which can be found at the top level of 1N/A** the sendmail distribution. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A** SMDB_MALLOC_DATABASE -- Allocates a database structure. 1N/A** An pointer to an allocated SMDB_DATABASE structure or 1N/A** NULL if it couldn't allocate the memory. 1N/A** SMDB_FREE_DATABASE -- Unallocates a database structure. 1N/A** database -- a SMDB_DATABASE pointer to deallocate. 1N/A** SMDB_LOCKFILE -- lock a file using flock or (shudder) fcntl locking 1N/A** fd -- the file descriptor of the file. 1N/A** type -- type of the lock. Bits can be: 1N/A** LOCK_EX -- exclusive lock. 1N/A** LOCK_NB -- non-blocking. 1N/A** true if the lock was acquired. 1N/A ** as type "tmp" (that is, served from swap space), the 1N/A ** previous fcntl will fail with "Invalid argument" errors. 1N/A ** Since this is fairly common during testing, we will assume 1N/A ** that this indicates that the lock is successfully grabbed. 1N/A#
else /* !HASFLOCK */ 1N/A#
endif /* !HASFLOCK */ 1N/A** SMDB_OPEN_DATABASE -- Opens a database. 1N/A** This opens a database. If type is SMDB_DEFAULT it tries to 1N/A** use a DB1 or DB2 hash. If that isn't available, it will try 1N/A** to use NDBM. If a specific type is given it will try to open 1N/A** a database of that type. 1N/A** database -- An pointer to a SMDB_DATABASE pointer where the 1N/A** opened database will be stored. This should 1N/A** db_name -- The name of the database to open. Do not include 1N/A** the file name extension. 1N/A** mode -- The mode to set on the database file or files. 1N/A** mode_mask -- Mode bits that must match on an opened database. 1N/A** sff -- Flags to safefile. 1N/A** type -- The type of database to open. Supported types 1N/A** vary depending on what was compiled in. 1N/A** user_info -- Information on the user to use for file 1N/A** params -- Params specific to the database being opened. 1N/A** Only supports some DB hash options right now 1N/A** (see smdb_db_open() for details). 1N/A** SMDBE_OK -- Success. 1N/A** Anything else is an error. Look up more info about the 1N/A** error in the comments for the specific open() used. 1N/A** SMDB_ADD_EXTENSION -- Adds an extension to a file name. 1N/A** Just adds a . followed by a string to a db_name if there 1N/A** is room and the db_name does not already have that extension. 1N/A** full_name -- The final file name. 1N/A** max_full_name_len -- The max length for full_name. 1N/A** db_name -- The name of the db. 1N/A** extension -- The extension to add. 1N/A** SMDBE_OK -- Success. 1N/A** Anything else is an error. Look up more info about the 1N/A** error in the comments for the specific open() used. 1N/A** SMDB_LOCK_FILE -- Locks the database file. 1N/A** Locks the actual database file. 1N/A** lock_fd -- The resulting descriptor for the locked file. 1N/A** db_name -- The name of the database without extension. 1N/A** mode -- The open mode. 1N/A** sff -- Flags to safefile. 1N/A** extension -- The extension for the file. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_UNLOCK_FILE -- Unlocks a file 1N/A** lock_fd -- The descriptor for the locked file. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_LOCK_MAP -- Locks a database. 1N/A** database -- database description. 1N/A** type -- type of the lock. Bits can be: 1N/A** LOCK_EX -- exclusive lock. 1N/A** LOCK_NB -- non-blocking. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_UNLOCK_MAP -- Unlocks a database 1N/A** database -- database description. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_SETUP_FILE -- Gets db file ready for use. 1N/A** Makes sure permissions on file are safe and creates it if it 1N/A** db_name -- The name of the database without extension. 1N/A** extension -- The extension. 1N/A** sff -- Flags to safefile. 1N/A** mode_mask -- Mode bits that must match. 1N/A** user_info -- Information on the user to use for file 1N/A** stat_info -- A place to put the stat info for the file. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_FILECHANGED -- Checks to see if a file changed. 1N/A** Compares the passed in stat_info with a current stat on 1N/A** the passed in file descriptor. Check filechanged for 1N/A** db_name -- The name of the database without extension. 1N/A** extension -- The extension. 1N/A** db_fd -- A file descriptor for the database file. 1N/A** stat_info -- An old stat_info. 1N/A** SMDBE_OK -- Success, otherwise errno. 1N/A** SMDB_PRINT_AVAILABLE_TYPES -- Prints the names of the available types. 1N/A** SMDB_DB_DEFINITION -- Given a database type, return database definition 1N/A** Reads though a structure making an association with the database 1N/A** List size is dynamic and must be NULL terminated. 1N/A** type -- The name of the database type. 1N/A** definition for type, otherwise NULL.