mapistore backends management API More...
#include <string.h>#include <dlfcn.h>#include <dirent.h>#include "mapistore.h"#include <stdio.h>#include <unistd.h>#include <stdint.h>#include <stdbool.h>#include <tdb.h>#include <ldb.h>#include <talloc.h>#include <util/debug.h>#include "libmapi/libmapi.h"#include "mapistore_private.h"#include <dlinklist.h>#include <util.h>Functions | |
| static init_backend_fn | load_backend (const char *path) |
| static init_backend_fn * | load_backends (TALLOC_CTX *mem_ctx, const char *path) |
| _PUBLIC_ int | mapistore_backend_add_ref_count (struct backend_context *bctx) |
| struct backend_context * | mapistore_backend_create_context (TALLOC_CTX *mem_ctx, const char *namespace, const char *uri) |
| _PUBLIC_ int | mapistore_backend_delete_context (struct backend_context *bctx) |
| _PUBLIC_ const char * | mapistore_backend_get_installdir (void) |
| int | mapistore_backend_init (TALLOC_CTX *mem_ctx, const char *path) |
| _PUBLIC_ init_backend_fn * | mapistore_backend_load (TALLOC_CTX *mem_ctx, const char *path) |
| _PUBLIC_ struct backend_context * | mapistore_backend_lookup (struct backend_context_list *backend_list_ctx, uint32_t context_id) |
| _PUBLIC_ struct backend_context * | mapistore_backend_lookup_by_uri (struct backend_context_list *backend_list_ctx, const char *uri) |
| _PUBLIC_ int | mapistore_backend_register (const void *_backend) |
| _PUBLIC_ bool | mapistore_backend_run_init (init_backend_fn *fns) |
mapistore backends management API
| static init_backend_fn load_backend | ( | const char * | path | ) | [static] |
Obtain the backend init function from a shared library file
| path | full path to the backend shared library |
Referenced by load_backends().
| static init_backend_fn* load_backends | ( | TALLOC_CTX * | mem_ctx, | |
| const char * | path | |||
| ) | [static] |
Load backends from specified directory
| mem_ctx | pointer to the memory context | |
| path | name of the backend's shared library folder |
References load_backend().
Referenced by mapistore_backend_load().
| _PUBLIC_ int mapistore_backend_add_ref_count | ( | struct backend_context * | bctx | ) |
Increase the ref count associated to a given backend
| bctx | pointer to the backend context |
References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.
| struct backend_context* mapistore_backend_create_context | ( | TALLOC_CTX * | mem_ctx, | |
| const char * | namespace, | |||
| const char * | uri | |||
| ) | [read] |
Create backend context
| mem_ctx | pointer to the memory context | |
| namespace | the backend namespace | |
| uri | the backend parameters which can be passes inline |
References MAPISTORE_SUCCESS.
| _PUBLIC_ int mapistore_backend_delete_context | ( | struct backend_context * | bctx | ) |
Delete a context from the specified backend
| bctx | pointer to the backend context |
References MAPISTORE_ERR_REF_COUNT, and MAPISTORE_ERROR.
| _PUBLIC_ const char* mapistore_backend_get_installdir | ( | void | ) |
Return the full path where mapistore backends are installed.
Referenced by mapistore_backend_load().
| int mapistore_backend_init | ( | TALLOC_CTX * | mem_ctx, | |
| const char * | path | |||
| ) |
Initialize mapistore backends
| mem_ctx | pointer to the memory context | |
| path | pointer to folder where mapistore backends are installed |
References mapistore_backend_load(), mapistore_backend_run_init(), MAPISTORE_ERR_BACKEND_INIT, and MAPISTORE_SUCCESS.
| _PUBLIC_ init_backend_fn* mapistore_backend_load | ( | TALLOC_CTX * | mem_ctx, | |
| const char * | path | |||
| ) |
Load the initialization functions from backends DSO
| mem_ctx | pointer to the memory context | |
| path | pointer to the backend's DSO folder |
References load_backends(), and mapistore_backend_get_installdir().
Referenced by mapistore_backend_init().
| _PUBLIC_ struct backend_context* mapistore_backend_lookup | ( | struct backend_context_list * | backend_list_ctx, | |
| uint32_t | context_id | |||
| ) | [read] |
find the context matching given context identifier
| backend_list_ctx | pointer to the backend context list | |
| context_id | the context identifier to search |
| _PUBLIC_ struct backend_context* mapistore_backend_lookup_by_uri | ( | struct backend_context_list * | backend_list_ctx, | |
| const char * | uri | |||
| ) | [read] |
find the context matching given uri string
| backend_list_ctx | pointer to the backend context list | |
| uri | the uri string to search |
| _PUBLIC_ int mapistore_backend_register | ( | const void * | _backend | ) |
Register mapistore backends
| _backend | pointer to the mapistore backend to register |
References MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
| _PUBLIC_ bool mapistore_backend_run_init | ( | init_backend_fn * | fns | ) |
Run specified initialization functions.
| fns | pointer to an array of mapistore backends initialization functions |
Referenced by mapistore_backend_init().
|
|
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |