table of contents
other versions
- wheezy 1:1.0-3+deb7u1
- wheezy-backports 1:2.1-1~bpo70+1+b1
- jessie 1:2.2-6+deb8u1
mapiproxy/libmapistore/mapistore.h(3) | OpenChange mapistore library | mapiproxy/libmapistore/mapistore.h(3) |
NAME¶
mapiproxy/libmapistore/mapistore.h - MAPISTORE general API.SYNOPSIS¶
#include <sys/types.h>Functions¶
enum mapistore_error mapistore_add_context (struct mapistore_context *, const char *, const char *, uint64_t, uint32_t *, void **)
Detailed Description¶
MAPISTORE general API.Function Documentation¶
enum mapistore_error mapistore_add_context (struct mapistore_context *mstore_ctx, const char *owner, const char *uri, uint64_tfid, uint32_t *context_id, void **backend_object)¶
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
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
contex_id the context identifier referencing the context to update
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
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.
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.
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
struct backend_context* mapistore_backend_lookup_by_name (TALLOC_CTX *mem_ctx, const char *name) [read]¶
Return a pointer on backend functions given its name Parameters:mem_ctx pointer to the memory context
name the backend name to lookup
Returns:
Allocated pointer to the mapistore_backend
context on success, otherwise NULL
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 Parameters:backend_list_ctx pointer to the backend
context list
uri the uri string to search
Returns:
Pointer to the mapistore_backend context on
success, otherwise NULL
enum mapistore_error mapistore_backend_register (const void *_backend)¶
Register mapistore backends Parameters:backend pointer to the mapistore
backend to register
Returns:
MAPISTORE_SUCCESS on success
bool mapistore_backend_run_init (init_backend_fn *fns)¶
Run specified initialization functions. Parameters:fns pointer to an array of mapistore
backends initialization functions
Returns:
true on success, otherwise false
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
const char* mapistore_errstr (enum mapistore_errormapistore_err)¶
return a string explaining what a mapistore error constant means. Parameters:mapistore_err the mapistore error
constant
Returns:
constant string
enum mapistore_error mapistore_folder_create_folder (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, TALLOC_CTX *mem_ctx, uint64_tfid, struct SRow *aRow, void **child_folder)¶
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
new_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
enum mapistore_error mapistore_folder_create_message (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, TALLOC_CTX *mem_ctx, uint64_tmid, uint8_tassociated, void **messagep)¶
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
enum mapistore_error mapistore_folder_delete (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, 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
enum mapistore_error mapistore_folder_delete_message (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, uint64_tmid, uint8_tflags)¶
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
flags flags that control the behaviour of the operation
(MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE)
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE errors
enum mapistore_error mapistore_folder_get_child_count (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, enum mapistore_table_typetable_type, 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
enum mapistore_error mapistore_folder_get_deleted_fmids (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, TALLOC_CTX *mem_ctx, enum mapistore_table_typetable_type, uint64_tchange_num, struct I8Array_r **fmidsp, uint64_t *cnp)¶
Get the array of deleted items following a specific change number 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
folder the folder backend object
mem_ctx the TALLOC_CTX that should be used as parent for the returned
array
table_type the type of object that we want to take into account
change_num the reference change number
fmidsp a pointer to the returned array
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE errors
enum mapistore_error mapistore_folder_open_folder (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, TALLOC_CTX *mem_ctx, uint64_tfid, void **child_folder)¶
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
enum mapistore_error mapistore_folder_open_message (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *folder, TALLOC_CTX *mem_ctx, uint64_tmid, boolread_write, void **messagep)¶
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
pointer to the mapistore_message structure
Returns:
MAPISTORE SUCCESS on success, otherwise
MAPISTORE errors
enum MAPISTATUS mapistore_get_queued_notifications (struct mapistore_context *mstore_ctx, struct mapistore_subscription *s, struct mapistore_notification_list **nl)¶
Return the list of pending mapistore notifications within the queue pointed by the mapistore subscription structure. Parameters:mstore_ctx pointer to the mapistore
context
s pointer to the mapistore subscription where the mqueue file descriptor
is stored
nl pointer on pointer to the list of mapistore noficiations to
return
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum MAPISTATUS mapistore_get_queued_notifications_named (struct mapistore_context *mstore_ctx, const char *mqueue_name, struct mapistore_notification_list **nl)¶
Return the list of pending mapistore notifications available on the queue name specified in argument. Parameters:mstore_ctx pointer to the mapistore
context
mqueue_name the name of the queue to open
nl pointer on pointer to the list of mapistore notifications to
return
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error.
enum mapistore_error mapistore_indexing_record_add_fid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, const char *username, 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
enum mapistore_error mapistore_indexing_record_add_mid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, const char *username, 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
enum mapistore_error mapistore_indexing_record_del_fid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, const char *username, uint64_tfid, uint8_tflags)¶
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
flags the type of deletion MAPISTORE_SOFT_DELETE or
MAPISTORE_PERMANENT_DELETE
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_indexing_record_del_mid (struct mapistore_context *mstore_ctx, uint32_tcontext_id, const char *username, uint64_tmid, uint8_tflags)¶
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
flags the type of deletion MAPISTORE_SOFT_DELETE or
MAPISTORE_PERMANENT_DELETE
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_indexing_record_get_uri (struct mapistore_context *mstore_ctx, const char *username, TALLOC_CTX *mem_ctx, uint64_tfmid, char **urip, bool *soft_deletedp)¶
Returns record data Parameters:mstore_ctx pointer to the mapistore
context
username the name of the account where to look for the indexing database
mem_ctx pointer to the memory context
fmid the fmid/key to the record
urip pointer to the uri pointer
soft_deletedp pointer to the soft deleted pointer
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
struct mapistore_context* mapistore_init (TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *path) [read]¶
Initialize the mapistore context Parameters: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
enum mapistore_error mapistore_message_get_message_data (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *message, TALLOC_CTX *mem_ctx, struct mapistore_message **msg)¶
Modify recipients of a message in mapistore Parameters:mstore_ctx pointer to the mapistore
context
context_id the context identifier referencing the backend where
properties will be stored
mid the identifier referencing the message the array of recipient rows
the number of elements in the array
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE errors
enum mapistore_error mapistore_message_modify_recipients (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *message, struct SPropTagArray *columns, uint16_tcount, struct mapistore_message_recipient *recipients)¶
Modify recipients of a message in mapistore Parameters:mstore_ctx pointer to the mapistore
context
context_id the context identifier referencing the backend where
properties will be stored
mid the identifier referencing the message the array of recipient rows
the number of elements in the array
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE errors
enum mapistore_error mapistore_message_save (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *message)¶
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
enum mapistore_error mapistore_message_set_read_flag (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *message, uint8_tflag)¶
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
enum mapistore_error mapistore_message_submit (struct mapistore_context *mstore_ctx, uint32_tcontext_id, void *message, enum SubmitFlagsflags)¶
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
enum mapistore_error mapistore_mgmt_backend_register_user (struct mapistore_connection_info *conn_info, const char *backend, const char *vuser)¶
Register the mapping between a system user and a backend user for a specific backend. Parameters:conn_info pointer to the connection
information
backend the name of the backend
vuser the name of the matching user in the backend
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_mgmt_backend_unregister_user (struct mapistore_connection_info *conn_info, const char *backend, const char *vuser)¶
Unregister the mapping between a system user and a backend user for a specific backend. Parameters:conn_info pointer to the connection
information
backend the name of the backend
vuser the name of the matching user in the backend
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_mgmt_interface_register_bind (struct mapistore_connection_info *conn_info, uint16_tcbContext, uint8_t *rgbContext, uint16_tcbCallbackAddress, uint8_t *rgbCallbackAddress)¶
Register a callback address for UDP notifications to be dispatched for given user Parameters:conn_info pointer to the connection
information
cbContext number of bytes in rgbContext
rgbContext array of bytes holding the notification key
cbCallbackAddress number of bytes in rgbCallbackAddress
rgbCallbackAddress array of bytes holding the sockaddr structure to
send
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_mgmt_interface_register_subscription (struct mapistore_connection_info *conn_info, struct mapistore_mgmt_notif *notification)¶
Register a subscription for the given user Parameters:conn_info pointer to the connection
information
notification pointer to the structure holding notification data
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_mgmt_interface_unregister_subscription (struct mapistore_connection_info *conn_info, struct mapistore_mgmt_notif *notification)¶
Unregister a subscription for the given user Parameters:conn_info pointer to the connection
information
notification pointer to the structure holding notification data
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_namedprops_create_id (struct ldb_context *ldb_ctx, struct MAPINAMEIDnameid, uint16_tmapped_id)¶
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
enum mapistore_error mapistore_namedprops_get_mapped_id (struct ldb_context *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
enum mapistore_error mapistore_namedprops_get_nameid (struct ldb_context *ldb_ctx, uint16_tpropID, struct MAPINAMEID **nameidp)¶
return the nameid structture matching the mapped property ID passed in parameter. Parameters:ldb_ctx pointer to the namedprops ldb
context
propID the property ID to lookup
nameid pointer to the MAPINAMEID structure the function returns
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE_ERROR
uint16_t mapistore_namedprops_next_unused_id (struct ldb_context *ldb_ctx)¶
return the next unmapped property ID Parameters:ldb_ctx pointer to the namedprops ldb
context
Returns:
0 on error, the next mapped id otherwise
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
enum mapistore_error mapistore_replica_mapping_guid_to_replid (struct mapistore_context *mstore_ctx, const char *username, const struct GUID *guidP, uint16_t *replidP)¶
Search a replica guid in the database, creates it if it does not exist Parameters:mstore_ctx pointer to the mapistore
context
guidP the replica guid
replidP pointer to the returned replica id
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_replica_mapping_replid_to_guid (struct mapistore_context *mstore_ctx, const char *username, uint16_treplid, struct GUID *guidP)¶
Search a replica id in the database Parameters:mstore_ctx pointer to the mapistore
context
replid the replica id
guidP pointer to the returned replica guid
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
enum mapistore_error mapistore_search_context_by_uri (struct mapistore_context *mstore_ctx, const char *uri, uint32_t *context_id, void **backend_object)¶
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
enum mapistore_error mapistore_set_connection_info (struct mapistore_context *mstore_ctx, struct ldb_context *sam_ctx, struct ldb_context *oc_ctx, const char *username)¶
Set connection info for current mapistore context Parameters:mstore_ctx pointer to the mapistore
context
oc_ctx pointer to the openchange ldb database
username pointer to the current username
Returns:
MAPISTORE_SUCCESS on success, otherwise
MAPISTORE error
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
Author¶
Generated automatically by Doxygen for OpenChange mapistore library from the source code.Sat Jun 14 2014 | Version 1.0 |