libmapi/lzfu.c File Reference

Compressed RTF related functions. More...

#include <libmapi/libmapi.h>

Defines

#define LE16_CPU(x)
#define LE32_CPU(x)
#define LZFU_COMPRESSED   0x75465a4c
#define LZFU_DICTLENGTH   0x1000
#define LZFU_HEADERLENGTH   0x10
#define LZFU_INITDICT
#define LZFU_INITLENGTH   207
#define LZFU_UNCOMPRESSED   0x414c454d

Typedefs

typedef struct _lzfuheader lzfuheader

Functions

_PUBLIC_ enum MAPISTATUS uncompress_rtf (TALLOC_CTX *mem_ctx, uint8_t *rtfcomp, uint32_t in_size, DATA_BLOB *rtf)
_PUBLIC_ enum MAPISTATUS WrapCompressedRTFStream (mapi_object_t *obj_stream, DATA_BLOB *rtf)

Detailed Description

Compressed RTF related functions.


Define Documentation

#define LE16_CPU (  ) 
Value:
x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8));
#define LE32_CPU (  ) 
Value:
x = ((((x) & 0xff000000) >> 24) | \
       (((x) & 0x00ff0000) >> 8 ) | \
       (((x) & 0x0000ff00) << 8 ) | \
       (((x) & 0x000000ff) << 24));

Referenced by uncompress_rtf().

#define LZFU_COMPRESSED   0x75465a4c

Referenced by uncompress_rtf().

#define LZFU_DICTLENGTH   0x1000

Referenced by uncompress_rtf().

#define LZFU_HEADERLENGTH   0x10

Referenced by uncompress_rtf().

#define LZFU_INITDICT
Value:
"{\\rtf1\\ansi\\mac\\deff0\\deftab720{\\fonttbl;}"      \
  "{\\f0\\fnil \\froman \\fswiss \\fmodern \\fscrip"    \
  "t \\fdecor MS Sans SerifSymbolArialTimes Ne"         \
  "w RomanCourier{\\colortbl\\red0\\green0\\blue0"      \
  "\r\n\\par \\pard\\plain\\f0\\fs20\\b\\i\\u\\tab"     \
  "\\tx"

Referenced by uncompress_rtf().

#define LZFU_INITLENGTH   207

Referenced by uncompress_rtf().

#define LZFU_UNCOMPRESSED   0x414c454d

Referenced by uncompress_rtf().


Typedef Documentation

typedef struct _lzfuheader lzfuheader

Function Documentation

_PUBLIC_ enum MAPISTATUS uncompress_rtf ( TALLOC_CTX *  mem_ctx,
uint8_t *  rtfcomp,
uint32_t  in_size,
DATA_BLOB *  rtf 
)
_PUBLIC_ enum MAPISTATUS WrapCompressedRTFStream ( mapi_object_t obj_stream,
DATA_BLOB *  rtf 
)

creates a DATA_BLOB in uncompressed Rich Text Format (RTF) from the compressed format used in the PR_RTF_COMPRESSED property opened in the stream.

Parameters:
obj_stream stream object with RTF stream content
rtf the output blob with uncompressed content
Returns:
MAPI_E_SUCCESS on success, otherwise MAPI error. Possible MAPI error codes are:
  • MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  • MAPI_E_INVALID_PARAMETER: obj_stream is not a valid pointer
  • MAPI_E_CORRUPT_DATA: a problem was encountered while decompressing the RTF compressed data
  • MAPI_E_CALL_FAILED: A network problem was encountered during the transaction
Note:
Developers may also call GetLastError() to retrieve the last MAPI error code.
rtf->data needs to be freed with MAPIFreeBuffer
See also:
OpenStream

References GetLastError(), global_mapi_ctx, mapi_ctx::mem_ctx, OPENCHANGE_RETVAL_IF, ReadStream(), and uncompress_rtf().


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/