#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
◆ metall_manager
◆ metall_open()
Attempts to open the metall datastore at path.
- Parameters
-
- Returns
- true on success, false on failure. On failure, sets errno to one of the following values:
- ENOTRECOVERABLE if the given metall datastore is inconsistent
- Examples
- c_api.c.
◆ metall_open_read_only()
Attempts to open the metall datastore at path in read only mode.
- Parameters
-
- Returns
- true on success, false on failure. On failure, sets errno to one of the following values:
- ENOTRECOVERABLE if the given metall datastore is inconsistent
◆ metall_create()
Attempts to create a metall datastore at path.
- Parameters
-
path | path at which to create a datastore |
- Returns
- true on success, false on failure. On failure, sets errno to one of the following values:
- EEXIST if the given path already exists
- ENOTRECOVERABLE if the datastore could not be created for some other reason
- Examples
- c_api.c.
◆ metall_snapshot()
bool metall_snapshot |
( |
metall_manager * |
manager, |
|
|
const char * |
dst_path |
|
) |
| |
Creates a snapshot of the metall datastore of manager and places it at dst_path.
- Parameters
-
manager | manager to perform snapshot |
dst_path | path where to place the snapshot |
- Returns
- true if the snapshot was successfully created otherwise false.
- Examples
- c_api.c.
◆ metall_flush()
Flushes the given manager.
- Parameters
-
- Examples
- c_api.c.
◆ metall_close()
Closes a metall manager.
- Examples
- c_api.c.
◆ metall_remove()
bool metall_remove |
( |
const char * |
path | ) |
|
Removes the metall datastore at path.
- Parameters
-
path | path to datastore to remove |
- Returns
- true on successful removal, false otherwise. On failure, sets errno to one of the following values:
- EADDRINUSE if there is a metall manager open for the given path
- Warning
- Behaviour is undefined if there is still a metall manager for path open
- Examples
- c_api.c.
◆ metall_malloc()
Allocates size bytes.
- Parameters
-
manager | manager to allocate with |
size | number of bytes to allocate |
- Returns
- pointer to allocated memory if successful otherwise returns NULL and sets errno to one of the following values
- Examples
- c_api.c.
◆ metall_free()
Frees memory previously allocated by metall_malloc.
- Parameters
-
manager | manager from which to free |
ptr | memory to free |
- Examples
- c_api.c.
◆ metall_named_malloc()
void* metall_named_malloc |
( |
metall_manager * |
manager, |
|
|
const char * |
name, |
|
|
size_t |
size |
|
) |
| |
Allocates size bytes and associates the allocated memory with a name.
- Parameters
-
manager | manager to allocate with |
name | A name of the allocated memory |
size | number of bytes to allocate |
- Returns
- pointer to the allocated memory if sucessful otherwise returns NULL and sets errno to one of the following values
- EINVAL if the given path does not have a metall datastore open
- ENOMEM if the memory could not be allocated
- Examples
- c_api.c.
◆ metall_find()
Finds memory that was previously allocated using metall_named_alloc.
- Parameters
-
manager | manager to find the object in |
name | name of the allocated memory to find |
- Returns
- pointer to the allocated memory if found. Otherwise, returns NULL and sets errno to one of the following values
- EINVAL if the given path does not have a metall datastore open
- ENOTENT if the object could not be found
- Examples
- c_api.c.
◆ metall_named_free()
bool metall_named_free |
( |
metall_manager * |
manager, |
|
|
const char * |
name |
|
) |
| |
Frees memory previously allocated by metall_named_malloc.
- Parameters
-
manager | manager from which to free |
name | name of the allocated memory to free |
- Returns
- true if sucessfully freed, otherwise returns false and sets errno to one of the following values
- EINVAL if the given path does not have a metall datastore open
- ENOENT if the referred to object does not exist
- Examples
- c_api.c.