This header contains general functions, primarily for users of the store (rather than storage providers).
Function Documentation
enum MAPISTORE_ERROR mapistore_add_context (struct mapistore_context *mstore_ctx, const char *uri, uint32_t *context_id)Add a new connection context to mapistore
Parameters:
mstore_ctx pointer to the mapistore context
uri the connection context URI
context_id pointer to the context identifier the function returns
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_backend_create_context(), MAPISTORE_ERR_CONTEXT_FAILED, MAPISTORE_ERR_INVALID_NAMESPACE, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_add_context_indexing (struct mapistore_context *mstore_ctx, const char *username, uint32_tcontext_id)Associate an indexing context to a mapistore context
Parameters:
mstore_ctx pointer to the mapistore context
username account name referencing the indexing record
context_id the context identifier referencing the context to alter
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, mapistore_indexing_add_ref_count(), mapistore_indexing_search(), and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_add_context_ref_count (struct mapistore_context *mstore_ctx, uint32_tcontext_id)Increase the reference counter of an existing context
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the context to update
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_backend_add_ref_count(), mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
const char* mapistore_backend_get_installdir (void)Return the full path where mapistore backends are installed.
Returns:
Pointer to the full path where backends are installed.
Referenced by mapistore_backend_load().
init_backend_fn* mapistore_backend_load (TALLOC_CTX *mem_ctx, const char *path)Load the initialization functions from backends DSO
Parameters:
mem_ctx pointer to the memory context
path pointer to the backend's DSO folder
Returns:
allocated array of functions pointers to initialization functions on success, otherwise NULL.
References mapistore_backend_get_installdir().
Referenced by mapistore_backend_init().
struct backend_context* mapistore_backend_lookup (struct backend_context_list *backend_list_ctx, uint32_tcontext_id) [read]find the context matching given context identifier
Parameters:
backend_list_ctx pointer to the backend context list
context_id the context identifier to search
Returns:
Pointer to the mapistore_backend context on success, otherwise NULL
fns pointer to an array of mapistore backends initialization functions
Returns:
true on success, otherwise false
Referenced by mapistore_backend_init().
enum MAPISTORE_ERROR mapistore_closedir (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfid)Close a directory in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the directory has to be closed/released
fid the folder identifier referencing the folder to close
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_createmessage (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, uint64_tmid)Create a message in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the messagewill be created
parent_fid the parent folder identifier
mid the message identifier to create
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_del_context (struct mapistore_context *mstore_ctx, uint32_tcontext_id)Delete an existing connection context from mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the context to delete
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_backend_delete_context(), mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_REF_COUNT, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_deletemessage (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tmid, enum MAPISTORE_DELETION_TYPEdeletion_type)Delete a message from mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the message's to be located is stored
mid the message identifier of the folder to delete
deletion_type the type of deletion (MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE)
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
const char* mapistore_errstr (enum MAPISTORE_ERRORmapistore_err)return a string explaining what a mapistore error constant means.
enum MAPISTORE_ERROR mapistore_get_fid_by_name (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, const char *name, uint64_t *fid)Search for a folder ID by name
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the folder will be searched for
parent_fid the parent folder identifier
name the name of the folder to search for
fid the fid (result)
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
enum MAPISTORE_ERROR mapistore_get_folder_count (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfid, uint32_t *RowCount)Retrieve the number of child folders within a mapistore folder
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend
fid the folder identifier
RowCount pointer to the count result to return
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_FOLDER_TABLE.
enum MAPISTORE_ERROR mapistore_get_message_count (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfid, uint32_t *RowCount)Retrieve the number of child messages within a mapistore folder
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend
fid the folder identifier
RowCount pointer to the count result to return
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_MESSAGE_TABLE.
enum MAPISTORE_ERROR mapistore_get_table_property (struct mapistore_context *mstore_ctx, uint32_tcontext_id, enum MAPISTORE_TABLE_TYPEtable_type, uint64_tfid, enum MAPITAGSproptag, uint32_tpos, void **data)Retrieve a MAPI property from a table
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend
table_type the type of table (folders or messges)
fid the folder identifier where the search takes place
proptag the MAPI property tag to retrieve value for
pos the record position in search results
data pointer on pointer to the data the function returns
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
Referenced by mapistore_get_child_fids().
enum MAPISTORE_ERROR mapistore_getprops (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfmid, uint8_ttype, struct SPropTagArray *properties, struct SRow *aRow)Get properties of a message/folder in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where properties will be fetched
fmid the identifier referencing the message/folder
type the object type (folder or message)
properties pointer to the list of properties to fetch
aRow pointer to the SRow structure
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_indexing_add (struct mapistore_context *mstore_ctx, const char *username)Open connection to indexing database for a given user
Parameters:
mstore_ctx pointer to the mapistore context
username name for which the indexing database has to be created
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References MAPISTORE_ERR_DATABASE_INIT, MAPISTORE_ERR_NOT_INITIALIZED, mapistore_get_mapping_path(), mapistore_indexing_search(), and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_indexing_del (struct mapistore_context *mstore_ctx, const char *username)Close connection to indexing database for a given user
Parameters:
mstore_ctx pointer to the mapistore context
username name for which the indexing database has to be deleted
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References MAPISTORE_ERR_NOT_INITIALIZED, mapistore_indexing_search(), and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_indexing_get_folder_list (struct mapistore_context *mstore_ctx, const char *username, uint64_tfmid, struct indexing_folders_list **_flist)Retrieve the list of parent folder identifiers until we reach the expected item
Parameters:
mstore_ctx pointer to the mapistore context
username the name of the account where to look for the indexing database
fmid the folder/message ID to search
_flist the list of folders (result)
Note:
This function is useful for the emsmdb provider when we are trying to open a folder/message using an InputHandleIdx referencing the store object. In such situation, no context ID is available since the store object access openchange.ldb.
It means we need to retrieve the list of folders to the item within the mapistore context and rely on an existing parent (if opened) or opens everything from the top parent if none is available.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
See also:
mapistore_indexing_record_open_fmid
References MAPISTORE_ERR_NOT_INITIALIZED, mapistore_indexing_search(), mapistore_indexing_search_existing_fmid(), and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_indexing_record_add_fid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfid)Add a fid record to the indexing database
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the indexing database to update
fid the fid to add
Note:
This is a wrapper to the internal common mapistore_indexing_record_add_fmid function.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_indexing_record_add_fmid().
enum MAPISTORE_ERROR mapistore_indexing_record_add_mid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tmid)Add a mid record to the indexing database
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the indexing database to update
mid the mid to add
Note:
This is a wrapper to the internal common mapistore_indexing_record_add_fmid function.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_indexing_record_add_fmid().
enum MAPISTORE_ERROR mapistore_indexing_record_del_fid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfid, enum MAPISTORE_DELETION_TYPEdeletion_type)Delete a fid record from the indexing database
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the indexing database to update
fid the fid to remove
deletion_type the type of deletion (MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE)
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_indexing_record_del_fmid().
enum MAPISTORE_ERROR mapistore_indexing_record_del_mid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tmid, enum MAPISTORE_DELETION_TYPEdeletion_type)Delete a mid record from the indexing database
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the indexing database to update
mid the mid to remove
deletion_type the type of deletion (MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE)
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
mem_ctx pointer to the memory context
path the path to the location to load the backend providers from (NULL for default)
Returns:
allocate mapistore context on success, otherwise NULL
References mapistore_backend_init(), mapistore_errstr(), and MAPISTORE_SUCCESS.
Referenced by mapistoredb_init().
enum MAPISTORE_ERROR mapistore_mkdir (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, uint64_tfid, struct SRow *aRow)Create a directory in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the directory will be created
parent_fid the parent folder identifier
fid the folder identifier for the new folder
aRow pointer to MAPI data structures with properties to be added to the new folder
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), and MAPISTORE_ERR_INVALID_PARAMETER.
int mapistore_namedprops_get_mapped_id (void *_ldb_ctx, struct MAPINAMEIDnameid, uint16_t *propID)return the mapped property ID matching the nameid structure passed in parameter.
Parameters:
_ldb_ctx pointer to the namedprops ldb context
nameid the MAPINAMEID structure to lookup
propID pointer to the property ID the function returns
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
References mapistore_namedprops_get_mapped_id(), and MAPISTORE_SUCCESS.
Referenced by mapistore_namedprops_get_mapped_id().
enum MAPISTORE_ERROR mapistore_opendir (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, uint64_tfid)Open a directory in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the directory will be opened
parent_fid the parent folder identifier
fid folder identifier to open
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_openmessage (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, uint64_tmid, struct mapistore_message *msg)Open a message in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the directory will be opened
parent_fid the parent folder identifier
mid the message identifier to open
msg pointer to the mapistore_message structure (result)
Returns:
MAPISTORE SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_release (struct mapistore_context *mstore_ctx)Release the mapistore context and destroy any data associated
Parameters:
mstore_ctx pointer to the mapistore context
Note:
The function needs to rely on talloc destructors which is not implemented in code yet.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_release_record (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfmid, uint8_ttype)Release private backend data associated a folder / message opened within the mapistore backend
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend
fmid a folder or message identifier
type the type of fmid, either MAPISTORE_FOLDER or MAPISTORE_MESSAGE
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_rmdir (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tparent_fid, uint64_tfid, uint8_tflags)Remove a directory in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend
parent_fid the parent folder identifier
fid the folder identifier representing the folder to delete
flags flags that control the behaviour of the operation
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_FOUND, mapistore_get_child_fids(), mapistore_rmdir(), and MAPISTORE_SUCCESS.
Referenced by mapistore_rmdir().
enum MAPISTORE_ERROR mapistore_savechangesmessage (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tmid, uint8_tflags)Commit the changes made to a message in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the message's changes will be saved
mid the message identifier to save
flags flags associated to the commit operation
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_search_context_by_uri (struct mapistore_context *mstore_ctx, const char *uri, uint32_t *context_id)Search for an existing context given its uri
Parameters:
mstore_ctx pointer to the mapistore context
uri the URI to lookup
context_id pointer to the context identifier to return
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_backend_lookup_by_uri(), MAPISTORE_ERR_NOT_FOUND, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_set_database_path (const char *dbname)Set the mapistore.ldb mapping path
Parameters:
dbname string pointer to the mapistore database path
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References mapistore_set_database_path(), and MAPISTORE_SUCCESS.
Referenced by mapistore_set_database_path(), and mapistoredb_init().
enum MAPISTORE_ERROR mapistore_set_mapping_path (const char *path)Set the mapping path
Parameters:
path pointer to the mapping path
Note:
The mapping path can be set unless id_mapping_context is initialized. If path is NULL and mapping path is not yet initialized, then mapping_path will be reset to its default value when the initialization routine is called.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References MAPISTORE_ERR_NO_DIRECTORY, mapistore_set_mapping_path(), and MAPISTORE_SUCCESS.
Referenced by mapistore_set_mapping_path(), and mapistoredb_init().
enum MAPISTORE_ERROR mapistore_setprops (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tfmid, uint8_ttype, struct SRow *aRow)Set properties of a message/folder in mapistore
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where properties will be stored
fmid the identifier referencing the message/folder
type the object type (folder or message)
aRow pointer to the SRow structure
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistore_submitmessage (struct mapistore_context *mstore_ctx, uint32_tcontext_id, uint64_tmid, uint8_tflags)Submits a message for sending.
Parameters:
mstore_ctx pointer to the mapistore context
context_id the context identifier referencing the backend where the message will be submitted
mid the message identifier representing the message to submit
flags flags associated to the submit operation
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE errors
References mapistore_backend_lookup(), MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
const char* mapistoredb_get_firstorg (struct mapistoredb_context *mdb_ctx)Get accessor for firstorg
Parameters:
mdb_ctx pointer to the mapistore database context
Returns:
pointer to firstorg string on success, otherwise NULL
const char* mapistoredb_get_firstou (struct mapistoredb_context *mdb_ctx)Get accessor for firstou
Parameters:
mdb_ctx pointer to the mapistore database context
Returns:
pointer to firstou string on success, otherwise NULL
enum MAPISTORE_ERROR mapistoredb_get_mapistore_uri (struct mapistoredb_context *mdb_ctx, enum MAPISTORE_DFLT_FOLDERSindex, const char *namespace_uri, const char *username, char **uri)Get a mapistore URI for a system/special folder from backend
Parameters:
mdb_ctx pointer to the mapistore database context
index the special folder index
username the username for which we want to retrieve the uri
uri the uri namespace for the backend we want to use
namespace_uri pointer to the resulting namespace uri (return value)
The special folder is specified by the index parameter. For example to create the 'inbox' folder, pass MDB_INBOX.
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
References MAPISTORE_ERR_INVALID_CONTEXT, MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.
const char* mapistoredb_get_netbiosname (struct mapistoredb_context *mdb_ctx)Get accessor for netbiosname
Parameters:
mdb_ctx pointer to the mapistore database context
Returns:
pointer to netbiosname string on success, otherwise NULL
enum MAPISTORE_ERROR mapistoredb_get_new_allocation_range (struct mapistoredb_context *mdb_ctx, uint64_trange, uint64_t *range_start, uint64_t *range_end)Retrieve a new allocation range
This function obtains a range of folder / message identifiers. Conceptually you specify how many identifiers you want, and are provided a contiguous block of identiers (in terms of a start and end, which are inclusive).
This function is a wrapper over mapistore_get_new_allocation_range from mapistore_processing.c
Parameters:
mdb_ctx pointer to the mapistore database context
range the number of IDs to allocate
range_start pointer to the first ID of the range to return
range_end pointer to the last ID of the range to return
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.
enum MAPISTORE_ERROR mapistoredb_get_new_fmid (struct mapistoredb_context *mdb_ctx, uint64_t *_fmid)Retrieve the next available folder or message identifier
This function is a wrapper over mapistore_get_new_fmid from mapistore_processing.c
Parameters:
mdb_ctx pointer to the mapistore database context
_fmid pointer on the next fmid available to return
Returns:
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
See also:
mapistoredb_get_new_allocation_range for an alternative function returning multiple identifiers
References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_INITIALIZED, and MAPISTORE_SUCCESS.