---
name: "mapistore_mgmt_interface_register_subscription"
section: "3"
platform: "linux"
package: "libmapi-dev"
version: "1:1.0-3+deb7u1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/mapistore.h"
---

# mapistore\_mgmt\_interface\_register\_subscription(3)

MAPISTORE general API.

Part of [mapistore.h(3)](/mapistore.h/3.md).

## NAME

mapiproxy/libmapistore/mapistore.h -

MAPISTORE general API.

## SYNOPSIS

`#include <sys/types.h>`\
 `#include <sys/stat.h>`\
 `#include <stdio.h>`\
 `#include <unistd.h>`\
 `#include <stdint.h>`\
 `#include <stdbool.h>`\
 `#include <mqueue.h>`\
 `#include <tdb.h>`\
 `#include <ldb.h>`\
 `#include <talloc.h>`\
 `#include <util/debug.h>`\
 `#include 'libmapi/libmapi.h'`\

### Functions

enum **mapistore\_error** **mapistore\_add\_context** (struct mapistore\_context \*, const char \*, const char \*, uint64\_t, uint32\_t \*, void \*\*)\
 enum **mapistore\_error** **mapistore\_add\_context\_ref\_count** (struct mapistore\_context \*, uint32\_t)\
 const char \* **mapistore\_backend\_get\_installdir** (void)\
 init\_backend\_fn \* **mapistore\_backend\_load** (TALLOC\_CTX \*, const char \*)\
 struct backend\_context \* **mapistore\_backend\_lookup** (struct backend\_context\_list \*, uint32\_t)\
 struct backend\_context \* **mapistore\_backend\_lookup\_by\_name** (TALLOC\_CTX \*, const char \*)\
 struct backend\_context \* **mapistore\_backend\_lookup\_by\_uri** (struct backend\_context\_list \*, const char \*)\
 enum **mapistore\_error** **mapistore\_backend\_register** (const void \*)\
 bool **mapistore\_backend\_run\_init** (init\_backend\_fn \*)\
 enum **mapistore\_error** **mapistore\_del\_context** (struct mapistore\_context \*, uint32\_t)\
 const char \* **mapistore\_errstr** (enum **mapistore\_error**)\
 enum **mapistore\_error** **mapistore\_folder\_create\_folder** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, uint64\_t, struct SRow \*, void \*\*)\
 enum **mapistore\_error** **mapistore\_folder\_create\_message** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, uint64\_t, uint8\_t, void \*\*)\
 enum **mapistore\_error** **mapistore\_folder\_delete** (struct mapistore\_context \*, uint32\_t, void \*, uint8\_t)\
 enum **mapistore\_error** **mapistore\_folder\_delete\_message** (struct mapistore\_context \*, uint32\_t, void \*, uint64\_t, uint8\_t)\
 enum **mapistore\_error** **mapistore\_folder\_get\_child\_count** (struct mapistore\_context \*, uint32\_t, void \*, enum mapistore\_table\_type, uint32\_t \*)\
 enum **mapistore\_error** **mapistore\_folder\_get\_deleted\_fmids** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, enum mapistore\_table\_type, uint64\_t, struct I8Array\_r \*\*, uint64\_t \*)\
 enum **mapistore\_error** **mapistore\_folder\_open\_folder** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, uint64\_t, void \*\*)\
 enum **mapistore\_error** **mapistore\_folder\_open\_message** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, uint64\_t, bool, void \*\*)\
 enum MAPISTATUS **mapistore\_get\_queued\_notifications** (struct mapistore\_context \*, struct mapistore\_subscription \*, struct mapistore\_notification\_list \*\*)\
 enum MAPISTATUS **mapistore\_get\_queued\_notifications\_named** (struct mapistore\_context \*, const char \*, struct mapistore\_notification\_list \*\*)\
 enum **mapistore\_error** **mapistore\_indexing\_record\_add\_fid** (struct mapistore\_context \*, uint32\_t, const char \*, uint64\_t)\
 enum **mapistore\_error** **mapistore\_indexing\_record\_add\_mid** (struct mapistore\_context \*, uint32\_t, const char \*, uint64\_t)\
 enum **mapistore\_error** **mapistore\_indexing\_record\_del\_fid** (struct mapistore\_context \*, uint32\_t, const char \*, uint64\_t, uint8\_t)\
 enum **mapistore\_error** **mapistore\_indexing\_record\_del\_mid** (struct mapistore\_context \*, uint32\_t, const char \*, uint64\_t, uint8\_t)\
 enum **mapistore\_error** **mapistore\_indexing\_record\_get\_uri** (struct mapistore\_context \*, const char \*, TALLOC\_CTX \*, uint64\_t, char \*\*, bool \*)\
 struct mapistore\_context \* **mapistore\_init** (TALLOC\_CTX \*, struct loadparm\_context \*, const char \*)\
 enum **mapistore\_error** **mapistore\_message\_get\_message\_data** (struct mapistore\_context \*, uint32\_t, void \*, TALLOC\_CTX \*, struct mapistore\_message \*\*)\
 enum **mapistore\_error** **mapistore\_message\_modify\_recipients** (struct mapistore\_context \*, uint32\_t, void \*, struct SPropTagArray \*, uint16\_t, struct mapistore\_message\_recipient \*)\
 enum **mapistore\_error** **mapistore\_message\_save** (struct mapistore\_context \*, uint32\_t, void \*)\
 enum **mapistore\_error** **mapistore\_message\_set\_read\_flag** (struct mapistore\_context \*, uint32\_t, void \*, uint8\_t)\
 enum **mapistore\_error** **mapistore\_message\_submit** (struct mapistore\_context \*, uint32\_t, void \*, enum SubmitFlags)\
 enum **mapistore\_error** **mapistore\_mgmt\_backend\_register\_user** (struct mapistore\_connection\_info \*, const char \*, const char \*)\
 enum **mapistore\_error** **mapistore\_mgmt\_backend\_unregister\_user** (struct mapistore\_connection\_info \*, const char \*, const char \*)\
 enum **mapistore\_error** **mapistore\_mgmt\_interface\_register\_bind** (struct mapistore\_connection\_info \*, uint16\_t, uint8\_t \*, uint16\_t, uint8\_t \*)\
 enum **mapistore\_error** **mapistore\_mgmt\_interface\_register\_subscription** (struct mapistore\_connection\_info \*, struct mapistore\_mgmt\_notif \*)\
 enum **mapistore\_error** **mapistore\_mgmt\_interface\_unregister\_subscription** (struct mapistore\_connection\_info \*, struct mapistore\_mgmt\_notif \*)\
 enum **mapistore\_error** **mapistore\_namedprops\_create\_id** (struct ldb\_context \*, struct MAPINAMEID, uint16\_t)\
 enum **mapistore\_error** **mapistore\_namedprops\_get\_mapped\_id** (struct ldb\_context \*ldb\_ctx, struct MAPINAMEID, uint16\_t \*)\
 enum **mapistore\_error** **mapistore\_namedprops\_get\_nameid** (struct ldb\_context \*, uint16\_t, struct MAPINAMEID \*\*)\
 uint16\_t **mapistore\_namedprops\_next\_unused\_id** (struct ldb\_context \*)\
 enum **mapistore\_error** **mapistore\_release** (struct mapistore\_context \*)\
 enum **mapistore\_error** **mapistore\_replica\_mapping\_guid\_to\_replid** (struct mapistore\_context \*, const char \*username, const struct GUID \*, uint16\_t \*)\
 enum **mapistore\_error** **mapistore\_replica\_mapping\_replid\_to\_guid** (struct mapistore\_context \*, const char \*username, uint16\_t, struct GUID \*)\
 enum **mapistore\_error** **mapistore\_search\_context\_by\_uri** (struct mapistore\_context \*, const char \*, uint32\_t \*, void \*\*)\
 enum **mapistore\_error** **mapistore\_set\_connection\_info** (struct mapistore\_context \*, struct ldb\_context \*, struct ldb\_context \*, const char \*)\
 enum **mapistore\_error** **mapistore\_set\_mapping\_path** (const char \*)\

## Detailed Description

MAPISTORE general API.

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 \*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

References mapistore\_add\_context(), mapistore\_backend\_create\_context(), MAPISTORE\_ERR\_CONTEXT\_FAILED, MAPISTORE\_ERR\_INVALID\_NAMESPACE, mapistore\_indexing\_add(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_add\_context().

### 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

References mapistore\_add\_context\_ref\_count(), mapistore\_backend\_add\_ref\_count(), mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and MAPISTORE\_ERROR.

Referenced by mapistore\_add\_context\_ref\_count().

### 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

Referenced by mapistore\_add\_context\_ref\_count(), mapistore\_del\_context(), mapistore\_folder\_create\_folder(), mapistore\_folder\_create\_message(), mapistore\_folder\_delete(), mapistore\_folder\_delete\_message(), mapistore\_folder\_get\_child\_count(), mapistore\_folder\_get\_deleted\_fmids(), mapistore\_folder\_open\_folder(), mapistore\_folder\_open\_message(), mapistore\_indexing\_record\_add\_fmid(), mapistore\_indexing\_record\_del\_fmid(), mapistore\_message\_get\_message\_data(), mapistore\_message\_modify\_recipients(), mapistore\_message\_save(), mapistore\_message\_set\_read\_flag(), and mapistore\_message\_submit().

### 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

Referenced by mapistore\_mgmt\_generate\_uri().

### 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

Referenced by mapistore\_search\_context\_by\_uri().

### 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

References MAPISTORE\_ERR\_INVALID\_PARAMETER, and MAPISTORE\_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

Referenced by mapistore\_backend\_init().

### 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\_del\_context(), MAPISTORE\_ERR\_INVALID\_PARAMETER, MAPISTORE\_ERR\_REF\_COUNT, MAPISTORE\_ERROR, and MAPISTORE\_SUCCESS.

Referenced by mapistore\_del\_context().

### 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

References MAPISTORE\_ERR\_ALREADY\_INITIALIZED, MAPISTORE\_ERR\_BACKEND\_INIT, MAPISTORE\_ERR\_BACKEND\_REGISTER, MAPISTORE\_ERR\_CONTEXT\_FAILED, MAPISTORE\_ERR\_CORRUPTED, MAPISTORE\_ERR\_DATABASE\_INIT, MAPISTORE\_ERR\_DATABASE\_OPS, MAPISTORE\_ERR\_DENIED, MAPISTORE\_ERR\_EXIST, MAPISTORE\_ERR\_INVALID\_DATA, MAPISTORE\_ERR\_INVALID\_NAMESPACE, MAPISTORE\_ERR\_INVALID\_PARAMETER, MAPISTORE\_ERR\_MSG\_RCV, MAPISTORE\_ERR\_MSG\_SEND, MAPISTORE\_ERR\_NO\_DIRECTORY, MAPISTORE\_ERR\_NO\_MEMORY, MAPISTORE\_ERR\_NOT\_FOUND, MAPISTORE\_ERR\_NOT\_IMPLEMENTED, MAPISTORE\_ERR\_NOT\_INITIALIZED, MAPISTORE\_ERR\_REF\_COUNT, MAPISTORE\_ERROR, mapistore\_errstr(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_errstr(), and mapistore\_init().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_create\_folder().

Referenced by mapistore\_folder\_create\_folder().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_create\_message().

Referenced by mapistore\_folder\_create\_message().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_EXIST, MAPISTORE\_ERR\_INVALID\_PARAMETER, mapistore\_folder\_delete(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_folder\_delete().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_delete\_message().

Referenced by mapistore\_folder\_delete\_message().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_get\_child\_count().

Referenced by mapistore\_folder\_get\_child\_count().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_get\_deleted\_fmids().

Referenced by mapistore\_folder\_get\_deleted\_fmids().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_open\_folder().

Referenced by mapistore\_folder\_open\_folder().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_folder\_open\_message().

Referenced by mapistore\_folder\_open\_message().

### 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

References MAPISTORE\_ERR\_INVALID\_PARAMETER, MAPISTORE\_ERR\_NOT\_FOUND, MAPISTORE\_ERR\_NOT\_INITIALIZED, mapistore\_get\_queued\_notifications(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_get\_queued\_notifications().

### 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.

References MAPISTORE\_ERR\_INVALID\_PARAMETER, MAPISTORE\_ERR\_NOT\_FOUND, MAPISTORE\_ERR\_NOT\_INITIALIZED, mapistore\_get\_queued\_notifications\_named(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_get\_queued\_notifications\_named().

### 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

References mapistore\_indexing\_record\_add\_fmid().

### 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

References mapistore\_indexing\_record\_add\_fmid().

### 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

References mapistore\_indexing\_record\_del\_fmid().

### 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

References mapistore\_indexing\_record\_del\_fmid().

### 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

References MAPISTORE\_ERR\_NOT\_FOUND, MAPISTORE\_ERR\_NOT\_INITIALIZED, MAPISTORE\_ERROR, mapistore\_indexing\_add(), and MAPISTORE\_SUCCESS.

### 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

References mapistore\_backend\_init(), mapistore\_errstr(), mapistore\_init(), mapistore\_set\_mapping\_path(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_init().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_message\_get\_message\_data().

Referenced by mapistore\_message\_get\_message\_data().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_message\_modify\_recipients().

Referenced by mapistore\_message\_modify\_recipients().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_message\_save().

Referenced by mapistore\_message\_save().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_message\_set\_read\_flag().

Referenced by mapistore\_message\_set\_read\_flag().

### 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

References mapistore\_backend\_lookup(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and mapistore\_message\_submit().

Referenced by mapistore\_message\_submit().

### 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

References MAPISTORE\_ERR\_DATABASE\_INIT, and mapistore\_namedprops\_create\_id().

Referenced by mapistore\_namedprops\_create\_id().

### 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

References MAPISTORE\_ERROR, mapistore\_namedprops\_get\_mapped\_id(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_namedprops\_get\_mapped\_id().

### 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

References MAPISTORE\_ERROR, mapistore\_namedprops\_get\_nameid(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_namedprops\_get\_nameid().

### 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

References mapistore\_namedprops\_next\_unused\_id().

Referenced by mapistore\_namedprops\_next\_unused\_id().

### 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, mapistore\_release(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_release().

### 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

References MAPISTORE\_ERROR, mapistore\_replica\_mapping\_guid\_to\_replid(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_replica\_mapping\_guid\_to\_replid().

### 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

References MAPISTORE\_ERROR, mapistore\_replica\_mapping\_replid\_to\_guid(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_replica\_mapping\_replid\_to\_guid().

### 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

References mapistore\_backend\_lookup\_by\_uri(), MAPISTORE\_ERR\_NOT\_FOUND, MAPISTORE\_ERROR, mapistore\_search\_context\_by\_uri(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_search\_context\_by\_uri().

### 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

References MAPISTORE\_ERR\_INVALID\_PARAMETER, MAPISTORE\_ERR\_NOT\_INITIALIZED, mapistore\_set\_connection\_info(), and MAPISTORE\_SUCCESS.

Referenced by mapistore\_set\_connection\_info().

### 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\_init(), and mapistore\_set\_mapping\_path().

## Author

Generated automatically by Doxygen for OpenChange mapistore library from the source code.
