add try catch to all functions on struct mapistore_backend
This commit is contained in:
parent
d1f54298d2
commit
a77863947f
|
@ -53,6 +53,11 @@
|
||||||
static Class MAPIStoreContextK = Nil;
|
static Class MAPIStoreContextK = Nil;
|
||||||
static BOOL leakDebugging = NO;
|
static BOOL leakDebugging = NO;
|
||||||
|
|
||||||
|
#define TRYCATCH_START @try {
|
||||||
|
#define TRYCATCH_END } @catch (NSException * e) { \
|
||||||
|
return sogo_backend_handle_objc_exception(e, __PRETTY_FUNCTION__, __LINE__); \
|
||||||
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_backend_unexpected_error()
|
sogo_backend_unexpected_error()
|
||||||
{
|
{
|
||||||
|
@ -64,7 +69,8 @@ sogo_backend_unexpected_error()
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_backend_handle_objc_exception(NSException *e, const char *fn_name, const int line_no)
|
sogo_backend_handle_objc_exception(NSException *e, const char *fn_name, const int line_no)
|
||||||
{
|
{
|
||||||
DEBUG(0,("[SOGo: %s:%d] - EXCEPTION: %s, reason: %s\n", fn_name, line_no, [[e name] UTF8String], [[e reason] UTF8String]));
|
NSLog(@"[SOGo: %s:%d] - EXCEPTION: %@, reason: %@, stackframe: %@",
|
||||||
|
fn_name, line_no, e.name, e.reason, [e callStackSymbols]);
|
||||||
if ([[e name] isEqual:@"NotImplementedException"])
|
if ([[e name] isEqual:@"NotImplementedException"])
|
||||||
{
|
{
|
||||||
return MAPISTORE_ERR_NOT_IMPLEMENTED;
|
return MAPISTORE_ERR_NOT_IMPLEMENTED;
|
||||||
|
@ -159,6 +165,7 @@ sogo_backend_create_context(TALLOC_CTX *mem_ctx,
|
||||||
struct indexing_context *indexing,
|
struct indexing_context *indexing,
|
||||||
const char *uri, void **context_object)
|
const char *uri, void **context_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreContext *context;
|
MAPIStoreContext *context;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -184,6 +191,7 @@ sogo_backend_create_context(TALLOC_CTX *mem_ctx,
|
||||||
GSUnregisterCurrentThread ();
|
GSUnregisterCurrentThread ();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -193,6 +201,7 @@ sogo_backend_create_root_folder (const char *username,
|
||||||
// struct indexing_context *indexing,
|
// struct indexing_context *indexing,
|
||||||
TALLOC_CTX *mem_ctx, char **mapistore_urip)
|
TALLOC_CTX *mem_ctx, char **mapistore_urip)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
NSString *userName, *folderName;
|
NSString *userName, *folderName;
|
||||||
NSString *mapistoreUri;
|
NSString *mapistoreUri;
|
||||||
|
@ -222,6 +231,7 @@ sogo_backend_create_root_folder (const char *username,
|
||||||
GSUnregisterCurrentThread ();
|
GSUnregisterCurrentThread ();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -229,6 +239,7 @@ sogo_backend_list_contexts(const char *username, struct indexing_context *indexi
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct mapistore_contexts_list **contexts_listp)
|
struct mapistore_contexts_list **contexts_listp)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
NSString *userName;
|
NSString *userName;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -253,6 +264,7 @@ sogo_backend_list_contexts(const char *username, struct indexing_context *indexi
|
||||||
GSUnregisterCurrentThread ();
|
GSUnregisterCurrentThread ();
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
// andFID: fid
|
// andFID: fid
|
||||||
|
@ -274,6 +286,7 @@ static enum mapistore_error
|
||||||
sogo_context_get_path(void *backend_object, TALLOC_CTX *mem_ctx,
|
sogo_context_get_path(void *backend_object, TALLOC_CTX *mem_ctx,
|
||||||
uint64_t fmid, char **path)
|
uint64_t fmid, char **path)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreContext *context;
|
MAPIStoreContext *context;
|
||||||
|
@ -297,12 +310,14 @@ sogo_context_get_path(void *backend_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
|
sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
|
||||||
uint64_t fid, void **folder_object)
|
uint64_t fid, void **folder_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreContext *context;
|
MAPIStoreContext *context;
|
||||||
|
@ -329,6 +344,7 @@ sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -343,6 +359,7 @@ sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_open_folder(void *folder_object, TALLOC_CTX *mem_ctx, uint64_t fid, void **childfolder_object)
|
sogo_folder_open_folder(void *folder_object, TALLOC_CTX *mem_ctx, uint64_t fid, void **childfolder_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder, *childFolder;
|
MAPIStoreFolder *folder, *childFolder;
|
||||||
|
@ -369,6 +386,7 @@ sogo_folder_open_folder(void *folder_object, TALLOC_CTX *mem_ctx, uint64_t fid,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -383,6 +401,7 @@ sogo_folder_create_folder(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
uint64_t fid, struct SRow *aRow,
|
uint64_t fid, struct SRow *aRow,
|
||||||
void **childfolder_object)
|
void **childfolder_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder, *childFolder;
|
MAPIStoreFolder *folder, *childFolder;
|
||||||
|
@ -408,6 +427,7 @@ sogo_folder_create_folder(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -422,6 +442,7 @@ sogo_folder_create_folder(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_delete(void *folder_object)
|
sogo_folder_delete(void *folder_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -445,11 +466,13 @@ sogo_folder_delete(void *folder_object)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table_type, uint32_t *child_count)
|
sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table_type, uint32_t *child_count)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -473,6 +496,7 @@ sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -481,6 +505,7 @@ sogo_folder_open_message(void *folder_object,
|
||||||
uint64_t mid, bool write_access,
|
uint64_t mid, bool write_access,
|
||||||
void **message_object)
|
void **message_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -510,6 +535,7 @@ sogo_folder_open_message(void *folder_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -519,6 +545,7 @@ sogo_folder_create_message(void *folder_object,
|
||||||
uint8_t associated,
|
uint8_t associated,
|
||||||
void **message_object)
|
void **message_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -547,11 +574,13 @@ sogo_folder_create_message(void *folder_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_delete_message(void *folder_object, uint64_t mid, uint8_t flags)
|
sogo_folder_delete_message(void *folder_object, uint64_t mid, uint8_t flags)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -575,6 +604,7 @@ sogo_folder_delete_message(void *folder_object, uint64_t mid, uint8_t flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -586,6 +616,7 @@ sogo_folder_move_copy_messages(void *folder_object,
|
||||||
struct Binary_r **target_change_keys,
|
struct Binary_r **target_change_keys,
|
||||||
uint8_t want_copy)
|
uint8_t want_copy)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
MAPIStoreFolder *sourceFolder, *targetFolder;
|
MAPIStoreFolder *sourceFolder, *targetFolder;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
|
@ -619,12 +650,14 @@ sogo_folder_move_copy_messages(void *folder_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_move_folder(void *folder_object, void *target_folder_object,
|
sogo_folder_move_folder(void *folder_object, void *target_folder_object,
|
||||||
TALLOC_CTX *mem_ctx, const char *new_folder_name)
|
TALLOC_CTX *mem_ctx, const char *new_folder_name)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *moveFolder, *targetFolder;
|
MAPIStoreFolder *moveFolder, *targetFolder;
|
||||||
NSString *newFolderName;
|
NSString *newFolderName;
|
||||||
|
@ -667,12 +700,14 @@ sogo_folder_move_folder(void *folder_object, void *target_folder_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_copy_folder(void *folder_object, void *target_folder_object, TALLOC_CTX *mem_ctx,
|
sogo_folder_copy_folder(void *folder_object, void *target_folder_object, TALLOC_CTX *mem_ctx,
|
||||||
bool recursive, const char *new_folder_name)
|
bool recursive, const char *new_folder_name)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *copyFolder, *targetFolder;
|
MAPIStoreFolder *copyFolder, *targetFolder;
|
||||||
NSString *newFolderName;
|
NSString *newFolderName;
|
||||||
|
@ -709,6 +744,7 @@ sogo_folder_copy_folder(void *folder_object, void *target_folder_object, TALLOC_
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -716,6 +752,7 @@ sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
enum mapistore_table_type table_type, uint64_t change_num,
|
enum mapistore_table_type table_type, uint64_t change_num,
|
||||||
struct UI8Array_r **fmidsp, uint64_t *cnp)
|
struct UI8Array_r **fmidsp, uint64_t *cnp)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -743,6 +780,7 @@ sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -750,6 +788,7 @@ sogo_folder_open_table(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
enum mapistore_table_type table_type, uint32_t handle_id,
|
enum mapistore_table_type table_type, uint32_t handle_id,
|
||||||
void **table_object, uint32_t *row_count)
|
void **table_object, uint32_t *row_count)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -779,6 +818,7 @@ sogo_folder_open_table(void *folder_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -786,6 +826,7 @@ sogo_folder_modify_permissions(void *folder_object, uint8_t flags,
|
||||||
uint16_t pcount,
|
uint16_t pcount,
|
||||||
struct PermissionData *permissions)
|
struct PermissionData *permissions)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -811,11 +852,13 @@ sogo_folder_modify_permissions(void *folder_object, uint8_t flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_folder_preload_message_bodies(void *folder_object, enum mapistore_table_type table_type, const struct UI8Array_r *mids)
|
sogo_folder_preload_message_bodies(void *folder_object, enum mapistore_table_type table_type, const struct UI8Array_r *mids)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreFolder *folder;
|
MAPIStoreFolder *folder;
|
||||||
|
@ -840,6 +883,7 @@ sogo_folder_preload_message_bodies(void *folder_object, enum mapistore_table_typ
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -847,6 +891,7 @@ sogo_message_get_message_data(void *message_object,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct mapistore_message **msg_dataP)
|
struct mapistore_message **msg_dataP)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -872,11 +917,13 @@ sogo_message_get_message_data(void *message_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_create_attachment (void *message_object, TALLOC_CTX *mem_ctx, void **attachment_object, uint32_t *aidp)
|
sogo_message_create_attachment (void *message_object, TALLOC_CTX *mem_ctx, void **attachment_object, uint32_t *aidp)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -904,12 +951,14 @@ sogo_message_create_attachment (void *message_object, TALLOC_CTX *mem_ctx, void
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_open_attachment (void *message_object, TALLOC_CTX *mem_ctx,
|
sogo_message_open_attachment (void *message_object, TALLOC_CTX *mem_ctx,
|
||||||
uint32_t aid, void **attachment_object)
|
uint32_t aid, void **attachment_object)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -937,11 +986,13 @@ sogo_message_open_attachment (void *message_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, void **table_object, uint32_t *row_count)
|
sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, void **table_object, uint32_t *row_count)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -970,6 +1021,7 @@ sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, vo
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -978,6 +1030,7 @@ sogo_message_modify_recipients (void *message_object,
|
||||||
uint16_t count,
|
uint16_t count,
|
||||||
struct mapistore_message_recipient *recipients)
|
struct mapistore_message_recipient *recipients)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -1004,11 +1057,13 @@ sogo_message_modify_recipients (void *message_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_set_read_flag (void *message_object, uint8_t flag)
|
sogo_message_set_read_flag (void *message_object, uint8_t flag)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -1033,11 +1088,13 @@ sogo_message_set_read_flag (void *message_object, uint8_t flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_save (void *message_object, TALLOC_CTX *mem_ctx)
|
sogo_message_save (void *message_object, TALLOC_CTX *mem_ctx)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMessage *message;
|
MAPIStoreMessage *message;
|
||||||
|
@ -1062,11 +1119,13 @@ sogo_message_save (void *message_object, TALLOC_CTX *mem_ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_message_submit (void *message_object, enum SubmitFlags flags)
|
sogo_message_submit (void *message_object, enum SubmitFlags flags)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreMailVolatileMessage *message;
|
MAPIStoreMailVolatileMessage *message;
|
||||||
|
@ -1091,6 +1150,7 @@ sogo_message_submit (void *message_object, enum SubmitFlags flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1100,6 +1160,7 @@ sogo_message_attachment_open_embedded_message (void *attachment_object,
|
||||||
uint64_t *midP,
|
uint64_t *midP,
|
||||||
struct mapistore_message **msg)
|
struct mapistore_message **msg)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreAttachment *attachment;
|
MAPIStoreAttachment *attachment;
|
||||||
|
@ -1129,6 +1190,7 @@ sogo_message_attachment_open_embedded_message (void *attachment_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1137,6 +1199,7 @@ sogo_message_attachment_create_embedded_message (void *attachment_object,
|
||||||
void **message_object,
|
void **message_object,
|
||||||
struct mapistore_message **msg)
|
struct mapistore_message **msg)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreAttachment *attachment;
|
MAPIStoreAttachment *attachment;
|
||||||
|
@ -1172,11 +1235,13 @@ sogo_message_attachment_create_embedded_message (void *attachment_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error sogo_table_get_available_properties(void *table_object,
|
static enum mapistore_error sogo_table_get_available_properties(void *table_object,
|
||||||
TALLOC_CTX *mem_ctx, struct SPropTagArray **propertiesP)
|
TALLOC_CTX *mem_ctx, struct SPropTagArray **propertiesP)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1200,11 +1265,13 @@ static enum mapistore_error sogo_table_get_available_properties(void *table_obje
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_table_set_columns (void *table_object, uint16_t count, enum MAPITAGS *properties)
|
sogo_table_set_columns (void *table_object, uint16_t count, enum MAPITAGS *properties)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1229,11 +1296,13 @@ sogo_table_set_columns (void *table_object, uint16_t count, enum MAPITAGS *prope
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_table_set_restrictions (void *table_object, struct mapi_SRestriction *restrictions, uint8_t *table_status)
|
sogo_table_set_restrictions (void *table_object, struct mapi_SRestriction *restrictions, uint8_t *table_status)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1260,11 +1329,13 @@ sogo_table_set_restrictions (void *table_object, struct mapi_SRestriction *restr
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order, uint8_t *table_status)
|
sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order, uint8_t *table_status)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1291,6 +1362,7 @@ sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1298,6 +1370,7 @@ sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx,
|
||||||
enum mapistore_query_type query_type, uint32_t row_id,
|
enum mapistore_query_type query_type, uint32_t row_id,
|
||||||
struct mapistore_property_data **data)
|
struct mapistore_property_data **data)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1322,6 +1395,7 @@ sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1329,6 +1403,7 @@ sogo_table_get_row_count (void *table_object,
|
||||||
enum mapistore_query_type query_type,
|
enum mapistore_query_type query_type,
|
||||||
uint32_t *row_countp)
|
uint32_t *row_countp)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1353,11 +1428,13 @@ sogo_table_get_row_count (void *table_object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_table_handle_destructor (void *table_object, uint32_t handle_id)
|
sogo_table_handle_destructor (void *table_object, uint32_t handle_id)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreTable *table;
|
MAPIStoreTable *table;
|
||||||
|
@ -1382,12 +1459,14 @@ sogo_table_handle_destructor (void *table_object, uint32_t handle_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error sogo_properties_get_available_properties(void *object,
|
static enum mapistore_error sogo_properties_get_available_properties(void *object,
|
||||||
TALLOC_CTX *mem_ctx,
|
TALLOC_CTX *mem_ctx,
|
||||||
struct SPropTagArray **propertiesP)
|
struct SPropTagArray **propertiesP)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreObject *propObject;
|
MAPIStoreObject *propObject;
|
||||||
|
@ -1411,6 +1490,7 @@ static enum mapistore_error sogo_properties_get_available_properties(void *objec
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1419,6 +1499,7 @@ sogo_properties_get_properties (void *object,
|
||||||
uint16_t count, enum MAPITAGS *properties,
|
uint16_t count, enum MAPITAGS *properties,
|
||||||
struct mapistore_property_data *data)
|
struct mapistore_property_data *data)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreObject *propObject;
|
MAPIStoreObject *propObject;
|
||||||
|
@ -1444,11 +1525,13 @@ sogo_properties_get_properties (void *object,
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
sogo_properties_set_properties (void *object, struct SRow *aRow)
|
sogo_properties_set_properties (void *object, struct SRow *aRow)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
struct MAPIStoreTallocWrapper *wrapper;
|
struct MAPIStoreTallocWrapper *wrapper;
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
MAPIStoreObject *propObject;
|
MAPIStoreObject *propObject;
|
||||||
|
@ -1472,6 +1555,7 @@ sogo_properties_set_properties (void *object, struct SRow *aRow)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum mapistore_error
|
static enum mapistore_error
|
||||||
|
@ -1482,6 +1566,7 @@ sogo_manager_generate_uri (TALLOC_CTX *mem_ctx,
|
||||||
const char *rootURI,
|
const char *rootURI,
|
||||||
char **uri)
|
char **uri)
|
||||||
{
|
{
|
||||||
|
TRYCATCH_START
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
NSString *partialURLString, *username, *directory;
|
NSString *partialURLString, *username, *directory;
|
||||||
|
|
||||||
|
@ -1518,6 +1603,7 @@ sogo_manager_generate_uri (TALLOC_CTX *mem_ctx,
|
||||||
GSUnregisterCurrentThread ();
|
GSUnregisterCurrentThread ();
|
||||||
|
|
||||||
return MAPISTORE_SUCCESS;
|
return MAPISTORE_SUCCESS;
|
||||||
|
TRYCATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue