This module provides support for storing key-value pairs in a table known as a registry, backing up registries to Mnesia in an atomic manner, and later restoring the contents of a registry from Mnesia.
Open (create) a registry. The registry will be
initially empty. Use
On success, an empty registry will be returned. On failure, NULL will be returned.
Change the size of a registry.
On success, the registry will be resized, all contents rehashed, and the function will return 0. On failure, the registry will be left unchanged and the function will return -1.
A registry that has previously been created with
The function returns 0.
Create a key-value pair with the specified
The function returns 0 on success, or -1 on failure.
Create a key-value pair with the specified
The function returns 0 on success, or -1 on failure.
Create a key-value pair with the specified
The function returns 0 on success, or -1 on failure.
Create a key-value pair with the specified
The function returns 0 on success, or -1 on failure.
Create a key-value pair with the specified
If you wish to store an arbitrary pointer in the registry,
specify a
The function returns 0 on success, or -1 on failure.
Get the value associated with
On success, the function returns the value associated with
Get the value associated with
On success, the function returns the value associated with
Get the value associated with
On success, the function returns the value associated with
Get the value associated with
On success, the function returns the value associated with
This is a general function for retrieving any kind of object from the registry.
If the function succeeds,
Mark a registry object as dirty. This will ensure that it is included in the next backup to Mnesia. Normally this operation will not be necessary since all of the normal registry 'set' functions do this automatically. However if you have retrieved the value of a string or binary object from the registry and modified the contents, then the change will be invisible to the registry and the object will be assumed to be unmodified. This function allows you to make such modifications and then let the registry know about them.
The function returns 0 on success, or -1 on failure.
Delete an object from the registry. The object is not actually removed from the registry, it is only marked for later removal so that on subsequent backups to Mnesia, the corresponding object can be removed from the Mnesia table as well. If another object is later created with the same key, the object will be reused.
The object will be removed from the registry after a call to
If the object was found, the function returns 0 indicating success. Otherwise the function returns -1.
Return information about an object.
In
The
The function returns 0 and initializes
Return information about a registry. Using information returned by this function, you can see whether the size of the registry is suitable for the amount of data it contains.
The
On success, the function returns 0 and
Dump the contents of a registry to a Mnesia table in an atomic manner, i.e. either all data will be updated, or none of it will. If any errors are encountered while backing up the data, the entire operation is aborted.
If
Alternatively, setting flags to EI_FORCE will cause a full
backup to be done, and EI_NOPURGE will cause the deleted objects
to be left in the registry afterwards. These can be bitwise ORed
together if both behaviours are desired. If EI_NOPURGE was
specified, you can use
The function returns 0 on success, or -1 on failure.
The contents of a Mnesia table are read into the registry.
Note that only tables of a certain format can be
restored, i.e. those that have been created and backed up to
with
After the restore operation, the entire contents of the registry is marked as unmodified. Note that this includes any objects that were modified before the restore and not overwritten by the restore.
The function returns 0 on success, or -1 on failure.
Remove all objects marked for deletion. When objects
are deleted with
The function returns 0 on success, or -1 on failure.