---
name: "mapistore_indexing_record_del_mid"
section: "3"
platform: "linux"
package: "libmapi-dev"
version: "1:2.2-6+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mapistore.h"
---

# mapistore\_indexing\_record\_del\_mid(3)

MAPISTORE general API.

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

## NAME

mapiproxy/libmapistore/mapistore.h -  MAPISTORE general API.

## SYNOPSIS

`#include <stdio.h>`\
 `#include <time.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'`\

### 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 UI8Array\_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 **mapistore\_error** **mapistore\_get\_queued\_notifications** (struct mapistore\_context \*, struct mapistore\_subscription \*, struct mapistore\_notification\_list \*\*)\
 enum **mapistore\_error** **mapistore\_get\_queued\_notifications\_named** (struct mapistore\_context \*, const char \*, struct mapistore\_notification\_list \*\*)\
 enum **mapistore\_error** **mapistore\_indexing\_get\_new\_folderID** (struct mapistore\_context \*, uint64\_t \*)\
 enum **mapistore\_error** **mapistore\_indexing\_get\_new\_folderID\_as\_user** (struct mapistore\_context \*, const char \*, uint64\_t \*)\
 enum **mapistore\_error** **mapistore\_indexing\_get\_new\_folderIDs** (struct mapistore\_context \*, TALLOC\_CTX \*, uint64\_t, struct UI8Array\_r \*\*)\
 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 \*)\
 enum **mapistore\_error** **mapistore\_indexing\_reserve\_fmid\_range** (struct mapistore\_context \*, uint64\_t, uint64\_t \*)\
 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 \*, TALLOC\_CTX \*)\
 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\_namedprops\_create\_id** (struct namedprops\_context \*, struct MAPINAMEID, uint16\_t)\
 enum **mapistore\_error** **mapistore\_namedprops\_get\_mapped\_id** (struct namedprops\_context \*, struct MAPINAMEID, uint16\_t \*)\
 enum **mapistore\_error** **mapistore\_namedprops\_get\_nameid** (struct namedprops\_context \*, uint16\_t, TALLOC\_CTX \*mem\_ctx, struct MAPINAMEID \*\*)\
 enum **mapistore\_error** **mapistore\_namedprops\_get\_nameid\_type** (struct namedprops\_context \*, uint16\_t, uint16\_t \*)\
 enum **mapistore\_error** **mapistore\_namedprops\_next\_unused\_id** (struct namedprops\_context \*, uint16\_t \*)\
 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 openchangedb\_context \*, const char \*)\
 void **mapistore\_set\_default\_indexing\_url** (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\_backend\_create\_context(), MAPISTORE\_ERR\_CONTEXT\_FAILED, MAPISTORE\_ERR\_INVALID\_NAMESPACE, mapistore\_indexing\_add(), 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 \
 *contex\_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(), MAPISTORE\_ERR\_INVALID\_PARAMETER, and 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.

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)

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)

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)

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

### 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\_INVALID\_URI, 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, and MAPISTORE\_SUCCESS.

Referenced by 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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, and MAPISTORE\_SUCCESS.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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 UI8Array\_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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### enum mapistore\_error 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, and MAPISTORE\_SUCCESS.

### enum mapistore\_error 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, and MAPISTORE\_SUCCESS.

### enum mapistore\_error mapistore\_indexing\_get\_new\_folderID (struct mapistore\_context \*mstore\_ctx, uint64\_t \*fid)

Allocates a new FolderID and returns it

**Parameters:**

*mstore\_ctx* pointer to the mapistore context \
 *fid* pointer to the fid value the function returns

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE error

References mapistore\_indexing\_get\_new\_folderID\_as\_user().

### enum mapistore\_error mapistore\_indexing\_get\_new\_folderID\_as\_user (struct mapistore\_context \*mstore\_ctx, const char \*username, uint64\_t \*fid)

Allocates a new FolderID for a specific user and returns it

**Parameters:**

*mstore\_ctx* pointer to the mapistore context \
 *username* name of the mailbox \
 *fid* pointer to the fid value the function returns

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE\_SUCCESS.

Referenced by mapistore\_indexing\_get\_new\_folderID().

### enum mapistore\_error mapistore\_indexing\_get\_new\_folderIDs (struct mapistore\_context \*mstore\_ctx, TALLOC\_CTX \*mem\_ctx, uint64\_tmax, struct UI8Array\_r \*\*fids\_p)

Allocates a batch of new folder ids and returns them

**Parameters:**

*mstore\_ctx* pointer to the mapistore context \
 *mem\_ctx* memory context where the fid will be allocated \
 *max* number of fids to allocate \
 *fids\_p* pointer array of fids values the function returns

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE\_SUCCESS.

### 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\_INITIALIZED, MAPISTORE\_ERROR, and mapistore\_indexing\_add().

### enum mapistore\_error mapistore\_indexing\_reserve\_fmid\_range (struct mapistore\_context \*mstore\_ctx, uint64\_trange\_len, uint64\_t \*first\_fmidp)

Reserve a range of FMID

**Parameters:**

*mstore\_ctx* pointer to the mapistore context \
 *range\_len* size of the range of fmids to reserve \
 *first\_fmidp* pointer to the first reserved fid value the function returns

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE\_ERR\_INVALID\_PARAMETER, mapistore\_indexing\_search(), and MAPISTORE\_SUCCESS.

### struct mapistore\_context\* mapistore\_init (TALLOC\_CTX \*mem\_ctx, struct loadparm\_context \*lp\_ctx, const char \*path)

Initialize the mapistore context

**Parameters:**

*mem\_ctx* pointer to the memory context \
 *lp\_ctx* loadparm\_context to get smb.conf options \
 *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\_set\_default\_indexing\_url(), mapistore\_set\_mapping\_path(), and MAPISTORE\_SUCCESS.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### enum mapistore\_error mapistore\_message\_save (struct mapistore\_context \*mstore\_ctx, uint32\_tcontext\_id, void \*message, TALLOC\_CTX \*mem\_ctx)

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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### 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(), and MAPISTORE\_ERR\_INVALID\_PARAMETER.

### enum mapistore\_error mapistore\_namedprops\_create\_id (struct namedprops\_context \*nprops, 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\_ERROR.

### enum mapistore\_error mapistore\_namedprops\_get\_mapped\_id (struct namedprops\_context \*nprops, 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.

### enum mapistore\_error mapistore\_namedprops\_get\_nameid (struct namedprops\_context \*nprops, uint16\_tpropID, TALLOC\_CTX \*mem\_ctx, 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.

### enum mapistore\_error mapistore\_namedprops\_get\_nameid\_type (struct namedprops\_context \*nprops, uint16\_tpropID, uint16\_t \*propTypeP)

return the type matching the mapped property ID passed in parameter.

**Parameters:**

*ldb\_ctx* pointer to the namedprops ldb context \
 *propID* the property ID to lookup \
 *propTypeP* pointer to the uint16\_t that will receive the property type

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE\_ERROR

References MAPISTORE\_ERROR, and MAPISTORE\_SUCCESS.

### enum mapistore\_error mapistore\_namedprops\_next\_unused\_id (struct namedprops\_context \*nprops, uint16\_t \*highest\_id)

Returns the next unmapped property ID

**Parameters:**

*nprops* pointer to the namedprops context \
 *highest\_id* pointer to the next unused id to return

**Returns:**

MAPISTORE\_SUCCESS on success, otherwise MAPISTORE error

References 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\_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, and MAPISTORE\_SUCCESS.

### 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, and MAPISTORE\_SUCCESS.

### 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, and MAPISTORE\_SUCCESS.

### enum mapistore\_error mapistore\_set\_connection\_info (struct mapistore\_context \*mstore\_ctx, struct ldb\_context \*sam\_ctx, struct openchangedb\_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, and MAPISTORE\_SUCCESS.

### void mapistore\_set\_default\_indexing\_url (const char \*url)

Set the default backend url. If none is set, a tdb file per user will be used.

**Parameters:**

*url* default backend url to be used

Referenced by mapistore\_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, and MAPISTORE\_SUCCESS.

Referenced by mapistore\_init().

## Author

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