#include <cat/cat.h>
#include <cat/catutil.h>
int cat_newfiledb(const char *filename, int entries, int ttl, cat_filedb **db);
The ttl argument is the time-to-live, in seconds, for each entry. Entries older than this will be purged from the database. A negative or zero ttl will cause a built-in default value to be used.
If several processes open the database, where each process specifies different values for ttl and/or entries, the value that gets selected is undefined.
If the function is successful, the db will refer to the on-disk database. The db must be closed by the caller with a call to cat_freefiledb().
The filedb functions are not thread-safe. It is up to the caller to ensure that all accesses are handled in the correct sequence.
Only one instance of a file database for a single file can exist in the same process.