API for MAPI handles management.
More...
#include "mapiproxy/dcesrv_mapiproxy.h"
#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"
#include "libmapiproxy.h"
|
| _PUBLIC_ enum MAPISTATUS | mapi_handles_add (struct mapi_handles_context *handles_ctx, uint32_t container_handle, struct mapi_handles **rec) |
| _PUBLIC_ enum MAPISTATUS | mapi_handles_delete (struct mapi_handles_context *handles_ctx, uint32_t handle) |
| _PUBLIC_ enum MAPISTATUS | mapi_handles_get_private_data (struct mapi_handles *handle, void **private_data) |
| struct mapi_handles_context * | mapi_handles_init (TALLOC_CTX *mem_ctx) |
| _PUBLIC_ enum MAPISTATUS | mapi_handles_release (struct mapi_handles_context *handles_ctx) |
| _PUBLIC_ enum MAPISTATUS | mapi_handles_search (struct mapi_handles_context *handles_ctx, uint32_t handle, struct mapi_handles **rec) |
| _PUBLIC_ enum MAPISTATUS | mapi_handles_set_private_data (struct mapi_handles *handle, void *private_data) |
| static enum MAPISTATUS | mapi_handles_tdb_free (struct mapi_handles_context *handles_ctx, uint32_t handle) |
| static enum MAPISTATUS | mapi_handles_tdb_update (struct mapi_handles_context *handles_ctx, uint32_t handle, uint32_t container_handle) |
| static int | mapi_handles_traverse_delete (TDB_CONTEXT *tdb_ctx, TDB_DATA key, TDB_DATA dbuf, void *state) |
| static int | mapi_handles_traverse_null (TDB_CONTEXT *tdb_ctx, TDB_DATA key, TDB_DATA dbuf, void *state) |
API for MAPI handles management.
◆ mapi_handles_add()
| _PUBLIC_ enum MAPISTATUS mapi_handles_add |
( |
struct mapi_handles_context * | handles_ctx, |
|
|
uint32_t | container_handle, |
|
|
struct mapi_handles ** | rec ) |
Add a handles to the database and return a pointer on created record
- Parameters
-
| handles_ctx | pointer to the MAPI handles context |
| container_handle | the container handle if available |
| rec | pointer on pointer to the MAPI handle structure the function returns |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI error
References mapi_handles_tdb_free(), mapi_handles_tdb_update(), and mapi_handles_traverse_null().
◆ mapi_handles_delete()
| _PUBLIC_ enum MAPISTATUS mapi_handles_delete |
( |
struct mapi_handles_context * | handles_ctx, |
|
|
uint32_t | handle ) |
◆ mapi_handles_get_private_data()
| _PUBLIC_ enum MAPISTATUS mapi_handles_get_private_data |
( |
struct mapi_handles * | handle, |
|
|
void ** | private_data ) |
Get the private data associated to a MAPI handle
- Parameters
-
| handle | pointer to the MAPI handle structure |
| private_data | pointer on pointer to the private data the function returns |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND
◆ mapi_handles_init()
| struct mapi_handles_context * mapi_handles_init |
( |
TALLOC_CTX * | mem_ctx | ) |
|
Initialize MAPI handles context
- Parameters
-
| mem_ctx | pointer to the memory context |
- Returns
- Allocated MAPI handles context on success, otherwise NULL
◆ mapi_handles_release()
| _PUBLIC_ enum MAPISTATUS mapi_handles_release |
( |
struct mapi_handles_context * | handles_ctx | ) |
|
Release MAPI handles context
- Parameters
-
| handles_ctx | pointer to the MAPI handles context |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI error
◆ mapi_handles_search()
| _PUBLIC_ enum MAPISTATUS mapi_handles_search |
( |
struct mapi_handles_context * | handles_ctx, |
|
|
uint32_t | handle, |
|
|
struct mapi_handles ** | rec ) |
Search for a record in the TDB database
- Parameters
-
| handles_ctx | pointer to the MAPI handles context |
| handle | MAPI handle to lookup |
| rec | pointer to the MAPI handle structure the function returns |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI error
◆ mapi_handles_set_private_data()
| _PUBLIC_ enum MAPISTATUS mapi_handles_set_private_data |
( |
struct mapi_handles * | handle, |
|
|
void * | private_data ) |
Set the private data associated to a MAPI handle
- Parameters
-
| handle | pointer to the MAPI handle structure |
| private_data | pointer to the private data to associate to the MAPI handle |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI error
◆ mapi_handles_tdb_free()
| enum MAPISTATUS mapi_handles_tdb_free |
( |
struct mapi_handles_context * | handles_ctx, |
|
|
uint32_t | handle ) |
|
static |
Set a TDB record data as null meaning it can be reused in the future.
- Parameters
-
| handles_ctx | pointer to the MAPI handles context |
| handle | handle key value to free |
- Returns
- MAPI_E_SUCCESS on success, otherwise MAPI error
Referenced by mapi_handles_add(), and mapi_handles_delete().
◆ mapi_handles_tdb_update()
| enum MAPISTATUS mapi_handles_tdb_update |
( |
struct mapi_handles_context * | handles_ctx, |
|
|
uint32_t | handle, |
|
|
uint32_t | container_handle ) |
|
static |
◆ mapi_handles_traverse_delete()
| int mapi_handles_traverse_delete |
( |
TDB_CONTEXT * | tdb_ctx, |
|
|
TDB_DATA | key, |
|
|
TDB_DATA | dbuf, |
|
|
void * | state ) |
|
static |
Traverse TDB database and search for records which dbuf value is set to state.
- Parameters
-
| tdb_ctx | pointer to the TDB context |
| key | the current TDB key (potential child handle) |
| dbuf | the current TDB value (parent handle) |
| state | pointer on private data |
- Returns
- 1 when a free record is found, otherwise 0
References mapi_handles_delete().
Referenced by mapi_handles_delete().
◆ mapi_handles_traverse_null()
| int mapi_handles_traverse_null |
( |
TDB_CONTEXT * | tdb_ctx, |
|
|
TDB_DATA | key, |
|
|
TDB_DATA | dbuf, |
|
|
void * | state ) |
|
static |
Traverse TDB database and search for the first record which dbuf value is "null" string.
- Parameters
-
| tdb_ctx | pointer to the TDB context |
| key | the current TDB key |
| dbuf | the current TDB value |
| state | pointer on private data |
- Returns
- 1 when a free record is found, otherwise 0
Referenced by mapi_handles_add().