ocpf.h File Reference
#include "libmapi/libmapi.h"

Enumerations

enum  ocpf_recipClass { OCPF_MAPI_TO = 0x1, OCPF_MAPI_CC, OCPF_MAPI_BCC }
 

Functions

enum MAPISTATUS ocpf_clear_props (uint32_t context_id)
 
int ocpf_del_context (uint32_t)
 
void ocpf_dump (uint32_t)
 
void ocpf_dump_folder (uint32_t)
 
void ocpf_dump_named_property (uint32_t)
 
void ocpf_dump_oleguid (uint32_t)
 
void ocpf_dump_property (uint32_t)
 
void ocpf_dump_recipients (uint32_t)
 
void ocpf_dump_type (uint32_t)
 
void ocpf_dump_variable (uint32_t)
 
enum MAPISTATUS ocpf_get_recipients (TALLOC_CTX *, uint32_t, struct SRowSet **)
 
struct SPropValue * ocpf_get_SPropValue (uint32_t, uint32_t *)
 
__BEGIN_DECLS int ocpf_init (void)
 
int ocpf_new_context (const char *, uint32_t *, uint8_t)
 
enum MAPISTATUS ocpf_OpenFolder (uint32_t, mapi_object_t *, mapi_object_t *)
 
int ocpf_parse (uint32_t)
 
int ocpf_release (void)
 
enum MAPISTATUS ocpf_server_add_SPropValue (uint32_t, struct SPropValue *)
 
enum MAPISTATUS ocpf_server_set_SPropValue (TALLOC_CTX *, uint32_t)
 
enum MAPISTATUS ocpf_server_set_type (uint32_t, const char *)
 
enum MAPISTATUS ocpf_server_sync (uint32_t)
 
enum MAPISTATUS ocpf_set_Recipients (TALLOC_CTX *, uint32_t, mapi_object_t *)
 
enum MAPISTATUS ocpf_set_SPropValue (TALLOC_CTX *, uint32_t, mapi_object_t *, mapi_object_t *)
 
int ocpf_write_auto (uint32_t, mapi_object_t *, struct mapi_SPropValue_array *)
 
int ocpf_write_commit (uint32_t)
 
int ocpf_write_init (uint32_t, mapi_id_t)
 

Variables

struct ocpf * ocpf
 

Enumeration Type Documentation

Enumerator
OCPF_MAPI_TO 
OCPF_MAPI_CC 
OCPF_MAPI_BCC 

Function Documentation

enum MAPISTATUS ocpf_clear_props ( uint32_t  context_id)

Clear the known properties from the OCPF entity

Parameters
context_ididentifier of the context to clear properties from
Returns
MAPI_E_SUCCESS on success, otherwise a non-zero error code

References ctx, ocpf, and ocpf_context_search_by_context_id().

int ocpf_del_context ( uint32_t  context_id)

Delete an OCPF context

Parameters
context_idcontext identifier referencing the context to delete
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR

References ctx, ocpf, ocpf_context_delete(), and ocpf_context_search_by_context_id().

void ocpf_dump_folder ( uint32_t  context_id)

Dump OCPF Destination Folder

Dump OCPF Registered Destination Folder

References ctx, INDENT, indent, ocpf, ocpf_context_search_by_context_id(), OCPF_DUMP, OCPF_DUMP_TITLE, and OCPF_DUMP_TOPLEVEL.

Referenced by ocpf_dump().

void ocpf_dump_named_property ( uint32_t  )
void ocpf_dump_oleguid ( uint32_t  context_id)

Dump OCPF OLEGUID

Dump OCPF Registered OLEGUID

References ctx, INDENT, indent, ocpf, ocpf_context_search_by_context_id(), OCPF_DUMP_TITLE, and OCPF_DUMP_TOPLEVEL.

Referenced by ocpf_dump().

void ocpf_dump_property ( uint32_t  )
void ocpf_dump_recipients ( uint32_t  context_id)

Dump OCPF Recipients

Dump OCPF Recipients

References ctx, indent, ocpf, ocpf_context_search_by_context_id(), OCPF_DUMP_SUBLEVEL, OCPF_DUMP_TITLE, and OCPF_DUMP_TOPLEVEL.

Referenced by ocpf_dump().

void ocpf_dump_type ( uint32_t  context_id)

Dump OCPF Type

Dump OCPF Registered Type

References ctx, INDENT, indent, ocpf, ocpf_context_search_by_context_id(), OCPF_DUMP, OCPF_DUMP_TITLE, and OCPF_DUMP_TOPLEVEL.

Referenced by ocpf_dump().

void ocpf_dump_variable ( uint32_t  )
enum MAPISTATUS ocpf_get_recipients ( TALLOC_CTX *  mem_ctx,
uint32_t  context_id,
struct SRowSet **  SRowSet 
)

Get the message recipients from ocpf context

This function gets the recipient (To, Cc, Bcc) from the ocpf context and information stored.

Parameters
mem_ctxthe memory context to use for memory allocation
context_ididentifier to the context to set recipients for
SRowSetpointer on pointer to the set of recipients to return
Returns
MAPI_E_SUCCESS on success, otherwise NULL
See Also
ocpf

References ctx, ocpf, and ocpf_context_search_by_context_id().

struct SPropValue* ocpf_get_SPropValue ( uint32_t  context_id,
uint32_t *  cValues 
)

Get the OCPF SPropValue array

This function is an accessor designed to return the SPropValue structure created with ocpf_set_SPropValue.

Parameters
context_ididentifier of the context to retrieve SPropValue from
cValuespointer on the number of SPropValue entries
Returns
NULL on error, otherwise returns an allocated lpProps pointer
See Also
ocpf_set_SPropValue

References ctx, ocpf, and ocpf_context_search_by_context_id().

__BEGIN_DECLS int ocpf_init ( void  )

Initialize OCPF context

Initialize ocpf context and allocate memory for internal structures

Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
ocpf_release, ocpf_parse

References ocpf.

int ocpf_new_context ( const char *  filename,
uint32_t *  context_id,
uint8_t  flags 
)

Create a new OCPF context

Parameters
filenamethe filename to process
context_idpointer to the context identifier the function
flagsFlags controlling how the OCPF should be opened
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR

References ctx, ocpf, and ocpf_context_add().

enum MAPISTATUS ocpf_OpenFolder ( uint32_t  context_id,
mapi_object_t *  obj_store,
mapi_object_t *  obj_folder 
)

Open OCPF folder

This function opens the folder associated with the ocpf folder global context value.

Parameters
context_ididentifier of the context to open the folder for
obj_storethe store object
obj_folderthe folder to open
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND.
Note
Developers should call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized.
  • MAPI_E_INVALID_PARAMETER: obj_store is undefined
  • MAPI_E_NOT_FOUND: The specified folder could not be found or is not yet supported.
See Also
ocpf_init, ocpf_parse

References ctx, ocpf, and ocpf_context_search_by_context_id().

int ocpf_parse ( uint32_t  context_id)

Parse OCPF file

Parse and process the given ocpf file.

Parameters
context_idthe identifier of the context holding the file to be parsed
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
ocpf_init

References ctx, ocpf, ocpf_context_search_by_context_id(), ocpf_yylex_destroy(), ocpf_yylex_init(), ocpf_yylex_init_extra(), ocpf_yyparse(), ocpf_yyset_in(), and scanner.

int ocpf_release ( void  )

Uninitialize OCPF context

Uninitialize the global OCPF context and release memory.

Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
ocpf_init

References ocpf.

enum MAPISTATUS ocpf_server_add_SPropValue ( uint32_t  context_id,
struct SPropValue *  lpProps 
)

Add a SPropValue structure to the context

This functions adds a SPropValue to the ocpf context. This property must be part of the known property namespace. If the property already exists in the list, it is automatically replaced with the new one.

Parameters
context_ididentifier of the ocpf context
lpPropspointer to the SPropValue structure to add to the context
Returns
MAPI_E_SUCCESS on success, otheriwse MAPI/OCPF error
See Also
ocpf_server_add_named_SPropValue

References ctx, ocpf, and ocpf_context_search_by_context_id().

enum MAPISTATUS ocpf_server_set_SPropValue ( TALLOC_CTX *  mem_ctx,
uint32_t  context_id 
)

Build a SPropValue array from ocpf context

This function builds a SPropValue array from the ocpf context and information stored.

Parameters
mem_ctxpointer to the memory context to use for memory allocation
context_ididentifier of the context to build a SPropValue array for
Note
This function is a server-side convenient function only. It doesn't handle named properties and its scope is much more limited than ocpf_set_SpropValue. Developers working on a client-side software/library must use ocpf_set_SPropValue instead.
Returns
MAPI_E_SUCCESS on success, otherwise MAPI/OCPF error
See Also
ocpf_get_SPropValue

References ctx, ocpf, ocpf_context_search_by_context_id(), and ocpf_server_set_type().

enum MAPISTATUS ocpf_server_set_type ( uint32_t  context_id,
const char *  type 
)

Set the message class (type) associated to an OCPF file.

Parameters
context_ididentifier of the context to set type for
typepointer to the type's string to set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI/OCPF error

References ctx, ocpf, and ocpf_context_search_by_context_id().

Referenced by ocpf_server_set_SPropValue().

enum MAPISTATUS ocpf_server_sync ( uint32_t  context_id)

Synchronize data on filesystem

Parameters
context_ididentifier of the ocpf context
Returns
MAPI_E_SUCCESS on success, otherwise otheriwse MAPI/OCPF error

References ctx, ocpf, and ocpf_context_search_by_context_id().

enum MAPISTATUS ocpf_set_Recipients ( TALLOC_CTX *  mem_ctx,
uint32_t  context_id,
mapi_object_t *  obj_message 
)

Set the message recipients from ocpf context

This function sets the recipient (To, Cc, Bcc) from the ocpf context and information stored.

Parameters
mem_ctxthe memory context to use for memory allocation
context_ididentifier to the context to set recipients for
obj_messagepointer to the message object we use for internal MAPI operations
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR.
See Also
ocpf

References ctx, ocpf, and ocpf_context_search_by_context_id().

enum MAPISTATUS ocpf_set_SPropValue ( TALLOC_CTX *  mem_ctx,
uint32_t  context_id,
mapi_object_t *  obj_folder,
mapi_object_t *  obj_message 
)

Build a SPropValue array from ocpf context

This function builds a SPropValue array from the ocpf context and information stored.

Parameters
mem_ctxthe memory context to use for memory allocation
context_ididentifier of the context to build a SPropValue array for
obj_folderpointer the folder object we use for internal MAPI operations
obj_messagepointer to the message object we use for internal MAPI operations
Returns
MAPI_E_SUCCESS on success, otherwise -1.
Note
Developers should call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
See Also
ocpf_get_SPropValue

References ctx, ocpf, and ocpf_context_search_by_context_id().

int ocpf_write_auto ( uint32_t  context_id,
mapi_object_t *  obj_message,
struct mapi_SPropValue_array *  mapi_lpProps 
)

Create the OCPF structure required for the commit operation

This function process properties and named properties from the specified mapi_SPropValue_array and generates an OCPF structure with all the attributes required to create an OCPF file in the commit operation.

Parameters
context_idthe identifier representing the context
obj_messagethe message object
mapi_lpPropsthe array of mapi properties returned by GetPropsAll
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
GetPropsAll, ocpf_write_commit

References ctx, kw_PROPERTY, ocpf, and ocpf_context_search_by_context_id().

int ocpf_write_commit ( uint32_t  context_id)

Write OCPF structure to OCPF file

This function dumps the OCPF structure content into the OCPF file defined in ocpf_write_init.

Parameters
context_idthe identifier representing the context
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
ocpf_write_init, ocpf_write_auto

References ctx, ocpf, and ocpf_context_search_by_context_id().

int ocpf_write_init ( uint32_t  context_id,
mapi_id_t  folder_id 
)

Specify the OCPF file name to write

Specify the ocpf file to create

Parameters
context_idthe identifier representing the context
folder_idthe folder
Returns
OCPF_SUCCESS on success, otherwise OCPF_ERROR
See Also
ocpf_init

References ctx, ocpf, and ocpf_context_search_by_context_id().

Variable Documentation


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