diff --git a/OpenChange/MAPIStoreFolder.h b/OpenChange/MAPIStoreFolder.h index c124cdce7..9bd9491b0 100644 --- a/OpenChange/MAPIStoreFolder.h +++ b/OpenChange/MAPIStoreFolder.h @@ -25,8 +25,6 @@ #import -#import "MAPIStoreTable.h" - @class NSArray; @class NSMutableArray; @class NSNumber; @@ -105,7 +103,7 @@ andFID: (uint64_t) fid; - (int) deleteFolderWithFID: (uint64_t) fid; - (int) getChildCount: (uint32_t *) rowCount - ofTableType: (uint8_t) tableType; + ofTableType: (enum mapistore_table_type) tableType; - (int) createMessage: (MAPIStoreMessage **) messagePtr withMID: (uint64_t) mid @@ -128,12 +126,12 @@ - (int) getDeletedFMIDs: (struct I8Array_r **) fmidsPtr andCN: (uint64_t *) cnPtr fromChangeNumber: (uint64_t) changeNum - inTableType: (uint8_t) tableType + inTableType: (enum mapistore_table_type) tableType inMemCtx: (TALLOC_CTX *) mem_ctx; - (int) getTable: (MAPIStoreTable **) tablePtr andRowCount: (uint32_t *) count - tableType: (uint8_t) tableType + tableType: (enum mapistore_table_type) tableType andHandleId: (uint32_t) handleId; - (int) modifyPermissions: (struct PermissionData *) permissions @@ -150,7 +148,7 @@ andSortOrderings: (NSArray *) sortOrderings; - (NSArray *) getDeletedKeysFromChangeNumber: (uint64_t) changeNum andCN: (NSNumber **) cnNbr - inTableType: (uint8_t) tableType; + inTableType: (enum mapistore_table_type) tableType; - (NSString *) createFolder: (struct SRow *) aRow withFID: (uint64_t) newFID; diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index fa13b9da7..155991b42 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -383,7 +383,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe } - (int) getChildCount: (uint32_t *) rowCount - ofTableType: (uint8_t) tableType + ofTableType: (enum mapistore_table_type) tableType { NSArray *keys; int rc = MAPISTORE_SUCCESS; @@ -863,7 +863,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe - (int) getDeletedFMIDs: (struct I8Array_r **) fmidsPtr andCN: (uint64_t *) cnPtr fromChangeNumber: (uint64_t) changeNum - inTableType: (uint8_t) tableType + inTableType: (enum mapistore_table_type) tableType inMemCtx: (TALLOC_CTX *) memCtx { int rc; @@ -920,7 +920,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe - (int) getTable: (MAPIStoreTable **) tablePtr andRowCount: (uint32_t *) countPtr - tableType: (uint8_t) tableType + tableType: (enum mapistore_table_type) tableType andHandleId: (uint32_t) handleId { int rc = MAPISTORE_SUCCESS; @@ -1076,7 +1076,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe andType: MAPISTORE_FAI_TABLE]; } -- (void) _cleanupTableCaches: (uint8_t) tableType +- (void) _cleanupTableCaches: (enum mapistore_table_type) tableType { NSArray *tables; NSUInteger count, max; @@ -1552,7 +1552,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe - (NSArray *) getDeletedKeysFromChangeNumber: (uint64_t) changeNum andCN: (NSNumber **) cnNbrs - inTableType: (uint8_t) tableType + inTableType: (enum mapistore_table_type) tableType { return nil; } diff --git a/OpenChange/MAPIStoreMailMessageTable.m b/OpenChange/MAPIStoreMailMessageTable.m index f4d5c2003..72133a210 100644 --- a/OpenChange/MAPIStoreMailMessageTable.m +++ b/OpenChange/MAPIStoreMailMessageTable.m @@ -326,7 +326,7 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK; - (int) getRow: (struct mapistore_property_data **) dataP withRowID: (uint32_t) rowId - andQueryType: (enum table_query_type) queryType + andQueryType: (enum mapistore_query_type) queryType inMemCtx: (TALLOC_CTX *) memCtx { if (!fetchedCoreInfos) diff --git a/OpenChange/MAPIStoreSOGo.m b/OpenChange/MAPIStoreSOGo.m index ffdbea6d0..527da32ec 100644 --- a/OpenChange/MAPIStoreSOGo.m +++ b/OpenChange/MAPIStoreSOGo.m @@ -43,10 +43,6 @@ #import "MAPIStoreTable.h" #import "NSObject+MAPIStore.h" -#undef DEBUG -#include -#include -#include #include #include @@ -331,7 +327,7 @@ sogo_folder_delete_folder(void *folder_object, uint64_t fid) } static enum mapistore_error -sogo_folder_get_child_count(void *folder_object, uint8_t table_type, uint32_t *child_count) +sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table_type, uint32_t *child_count) { struct MAPIStoreTallocWrapper *wrapper; NSAutoreleasePool *pool; @@ -494,7 +490,7 @@ sogo_folder_move_copy_messages(void *folder_object, static enum mapistore_error sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx, - uint8_t table_type, uint64_t change_num, + enum mapistore_table_type table_type, uint64_t change_num, struct I8Array_r **fmidsp, uint64_t *cnp) { struct MAPIStoreTallocWrapper *wrapper; @@ -526,7 +522,7 @@ sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx, static enum mapistore_error sogo_folder_open_table(void *folder_object, TALLOC_CTX *mem_ctx, - uint8_t table_type, uint32_t handle_id, + enum mapistore_table_type table_type, uint32_t handle_id, void **table_object, uint32_t *row_count) { struct MAPIStoreTallocWrapper *wrapper; @@ -974,7 +970,7 @@ sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order, static enum mapistore_error sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx, - enum table_query_type query_type, uint32_t row_id, + enum mapistore_query_type query_type, uint32_t row_id, struct mapistore_property_data **data) { struct MAPIStoreTallocWrapper *wrapper; @@ -1003,7 +999,7 @@ sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx, static enum mapistore_error sogo_table_get_row_count (void *table_object, - enum table_query_type query_type, + enum mapistore_query_type query_type, uint32_t *row_countp) { struct MAPIStoreTallocWrapper *wrapper; diff --git a/OpenChange/MAPIStoreTable.h b/OpenChange/MAPIStoreTable.h index 43314d313..fbf13a680 100644 --- a/OpenChange/MAPIStoreTable.h +++ b/OpenChange/MAPIStoreTable.h @@ -27,6 +27,9 @@ #import +#undef DEBUG +#include + #define SENSITIVITY_NONE 0 #define SENSITIVITY_PERSONAL 1 #define SENSITIVITY_PRIVATE 2 @@ -62,7 +65,7 @@ typedef enum { uint32_t currentRow; MAPIStoreObject *currentChild; - uint8_t tableType; /* mapistore */ + enum mapistore_table_type tableType; /* mapistore */ /* proof of concept */ uint16_t columnsCount; @@ -75,13 +78,13 @@ typedef enum { - (id) initForContainer: (MAPIStoreObject *) newContainer; - (id) container; -- (uint8_t) tableType; +- (enum mapistore_table_type) tableType; - (void) setHandleId: (uint32_t) newHandleId; - (void) destroyHandle: (uint32_t) handleId; - (id) childAtRowID: (uint32_t) rowId - forQueryType: (enum table_query_type) queryType; + forQueryType: (enum mapistore_query_type) queryType; - (void) cleanupCaches; @@ -92,10 +95,10 @@ typedef enum { withCount: (uint16_t) newColumCount; - (int) getRow: (struct mapistore_property_data **) dataP withRowID: (uint32_t) rowId - andQueryType: (enum table_query_type) queryType + andQueryType: (enum mapistore_query_type) queryType inMemCtx: (TALLOC_CTX *) memCtx; - (int) getRowCount: (uint32_t *) countP - withQueryType: (enum table_query_type) queryType; + withQueryType: (enum mapistore_query_type) queryType; - (void) notifyChangesForChild: (MAPIStoreObject *) child; diff --git a/OpenChange/MAPIStoreTable.m b/OpenChange/MAPIStoreTable.m index 530949709..16b8febf6 100644 --- a/OpenChange/MAPIStoreTable.m +++ b/OpenChange/MAPIStoreTable.m @@ -337,7 +337,7 @@ static Class NSDataK, NSStringK; return container; } -- (uint8_t) tableType +- (enum mapistore_table_type) tableType { return tableType; } @@ -765,7 +765,7 @@ static Class NSDataK, NSStringK; } - (id) childAtRowID: (uint32_t) rowId - forQueryType: (enum table_query_type) queryType + forQueryType: (enum mapistore_query_type) queryType { id child; NSArray *children, *restrictedChildren; @@ -833,7 +833,7 @@ static Class NSDataK, NSStringK; - (int) getRow: (struct mapistore_property_data **) dataP withRowID: (uint32_t) rowId - andQueryType: (enum table_query_type) queryType + andQueryType: (enum mapistore_query_type) queryType inMemCtx: (TALLOC_CTX *) memCtx { NSUInteger count; @@ -860,7 +860,7 @@ static Class NSDataK, NSStringK; } - (int) getRowCount: (uint32_t *) countP - withQueryType: (enum table_query_type) queryType + withQueryType: (enum mapistore_query_type) queryType { NSArray *children;