OpenChange mapistore library 2.0 API Documentation

- Main Page
- Files

- File List
- Globals

Functions
mapistore_backend.c File Reference

mapistore backends management API More...

`#include <string.h>`
`#include <dlfcn.h>`
`#include <dirent.h>`
`#include "mapistore.h"`
`#include "mapistore_errors.h"`
`#include "mapistore_private.h"`
`#include <dlinklist.h>`
`#include <samba_util.h>`
`#include <util/debug.h>`

## Functions
_PUBLIC_ enum mapistore_error | mapistore_backend_add_ref_count (struct backend_context *bctx)
enum mapistore_error | mapistore_backend_create_context (TALLOC_CTX *mem_ctx, struct mapistore_connection_info *conn_info, struct tdb_wrap *tdbwrap, const char *namespace, const char *uri, uint64_t fid, struct backend_context **context_p)
_PUBLIC_ enum mapistore_error | mapistore_backend_delete_context (struct backend_context *bctx)
_PUBLIC_ const char * | mapistore_backend_get_installdir (void)
enum mapistore_error | mapistore_backend_init (TALLOC_CTX *mem_ctx, const char *path)
enum mapistore_error | mapistore_backend_list_contexts (const char *username, struct tdb_wrap *tdbwrap, TALLOC_CTX *mem_ctx, struct mapistore_contexts_list **contexts_listP)
_PUBLIC_ init_backend_fn * | mapistore_backend_load (TALLOC_CTX *mem_ctx, const char *path)
_PUBLIC_ struct backend_context * | mapistore_backend_lookup (struct backend_context_list *backend_list_ctx, uint32_t context_id)
_PUBLIC_ struct backend_context * | mapistore_backend_lookup_by_name (TALLOC_CTX *mem_ctx, const char *name)
_PUBLIC_ struct backend_context * | mapistore_backend_lookup_by_uri (struct backend_context_list *backend_list_ctx, const char *uri)
_PUBLIC_ enum mapistore_error | mapistore_backend_register (const void *_backend)
_PUBLIC_ enum mapistore_error | mapistore_backend_registered (const char *name)
_PUBLIC_ bool | mapistore_backend_run_init (init_backend_fn *fns)

## Detailed Description

mapistore backends management API

## Function Documentation

_PUBLIC_ enum mapistore_error mapistore_backend_add_ref_count | ( | struct backend_context * | bctx | ) |

Increase the ref count associated to a given backend

Parameters

  bctx | pointer to the backend context

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR

References MAPISTORE_ERROR, and MAPISTORE_SUCCESS.

Referenced by mapistore_add_context_ref_count().

enum mapistore_error mapistore_backend_create_context | ( | TALLOC_CTX * | mem_ctx,
|  | struct mapistore_connection_info * | conn_info,
|  | struct tdb_wrap * | tdbwrap,
|  | const char * | namespace,
|  | const char * | uri,
|  | uint64_t | fid,
|  | struct backend_context ** | context_p
| ) |  |

Create backend context

Parameters

  mem_ctx | pointer to the memory context
  namespace | the backend namespace
  uri | the backend parameters which can be passes inline

Returns
  a valid backend_context pointer on success, otherwise NULL

References MAPISTORE_ERR_NOT_FOUND, and MAPISTORE_SUCCESS.

Referenced by mapistore_add_context().

_PUBLIC_ enum mapistore_error mapistore_backend_delete_context | ( | struct backend_context * | bctx | ) |

Delete a context from the specified backend

Parameters

  bctx | pointer to the backend context

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE_ERR_REF_COUNT, and MAPISTORE_SUCCESS.

Referenced by mapistore_del_context(), and mapistore_mgmt_generate_uri().

_PUBLIC_ 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().

enum mapistore_error mapistore_backend_init | ( | TALLOC_CTX * | mem_ctx,
|  | const char * | path
| ) |  |

Initialize mapistore backends

Parameters

  mem_ctx | pointer to the memory context
  path | pointer to folder where mapistore backends are installed

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERR_BACKEND_INIT

References mapistore_backend_load(), mapistore_backend_run_init(), MAPISTORE_ERR_BACKEND_INIT, and MAPISTORE_SUCCESS.

Referenced by mapistore_init().

enum mapistore_error mapistore_backend_list_contexts | ( | const char * | username,
|  | struct tdb_wrap * | tdbwrap,
|  | TALLOC_CTX * | mem_ctx,
|  | struct mapistore_contexts_list ** | contexts_listP
| ) |  |

List backend contexts for given user

Parameters

  mem_ctx | pointer to the memory context
  namespace | the backend namespace
  uri | the backend parameters which can be passes inline

Returns
  a valid backend_context pointer on success, otherwise NULL

References MAPISTORE_ERR_INVALID_PARAMETER, and MAPISTORE_SUCCESS.

_PUBLIC_ 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().

_PUBLIC_ struct backend_context* mapistore_backend_lookup | ( | struct backend_context_list * | backend_list_ctx,
|  | uint32_t | context_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().

_PUBLIC_ 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().

_PUBLIC_ 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().

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

_PUBLIC_ enum mapistore_error mapistore_backend_registered | ( | const char * | name | ) |

Check if the specified backend is registered given its name.

Parameters

  name | backend's name to lookup

Returns
  MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References MAPISTORE_ERR_INVALID_PARAMETER, MAPISTORE_ERR_NOT_FOUND, and MAPISTORE_SUCCESS.

Referenced by mapistore_mgmt_registered_backend().

_PUBLIC_ 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().

| This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/