Complete merge in libmapi from trunk
authorJulien Kerihuel <j.kerihuel@openchange.org>
Wed, 22 Feb 2012 10:39:37 +0000 (10:39 +0000)
committerJulien Kerihuel <j.kerihuel@openchange.org>
Wed, 22 Feb 2012 10:39:37 +0000 (10:39 +0000)
libmapi/libmapi.h
libmapi/property.c

index e5a770af9bf6d725ceda1a8d89d00c42373fdddf..27468e697e8092c6d3d0687e575107985362115f 100644 (file)
@@ -246,10 +246,10 @@ struct SPropTagArray      *set_SPropTagArray(TALLOC_CTX *, uint32_t, ...);
 enum MAPISTATUS                SPropTagArray_add(TALLOC_CTX *, struct SPropTagArray *, enum MAPITAGS);
 enum MAPISTATUS                SPropTagArray_delete(TALLOC_CTX *, struct SPropTagArray *, uint32_t);
 enum MAPISTATUS                SPropTagArray_find(struct SPropTagArray, enum MAPITAGS, uint32_t *);
-const void             *get_SPropValue(struct SPropValue *, uint32_t);
+const void             *get_SPropValue(struct SPropValue *, enum MAPITAGS);
 struct SPropValue      *get_SPropValue_SRowSet(struct SRowSet *, uint32_t);
 const void             *get_SPropValue_SRowSet_data(struct SRowSet *, uint32_t);
-enum MAPISTATUS                set_default_error_SPropValue_SRow(struct SRow *, uint32_t, void *);
+enum MAPISTATUS                set_default_error_SPropValue_SRow(struct SRow *, enum MAPITAGS, void *);
 struct SPropValue      *get_SPropValue_SRow(struct SRow *, uint32_t);
 const void             *get_SPropValue_SRow_data(struct SRow *, uint32_t);
 const void             *find_SPropValue_data(struct SRow *, uint32_t);
@@ -257,7 +257,7 @@ const void          *find_mapi_SPropValue_data(struct mapi_SPropValue_array *, uint32_t)
 const void             *get_mapi_SPropValue_data(struct mapi_SPropValue *);
 const void             *get_SPropValue_data(struct SPropValue *);
 bool                   set_SPropValue_proptag(struct SPropValue *, enum MAPITAGS, const void *);
-struct SPropValue      *add_SPropValue(TALLOC_CTX *, struct SPropValue *, uint32_t *, uint32_t, const void *);
+struct SPropValue      *add_SPropValue(TALLOC_CTX *, struct SPropValue *, uint32_t *, enum MAPITAGS, const void *);
 struct mapi_SPropValue *add_mapi_SPropValue(TALLOC_CTX *, struct mapi_SPropValue *, uint16_t *, uint32_t, const void *);
 bool                   set_SPropValue(struct SPropValue *, const void *);
 uint32_t               get_mapi_property_size(struct mapi_SPropValue *);
@@ -269,7 +269,7 @@ uint32_t            SRowSet_propcpy(TALLOC_CTX *, struct SRowSet *, struct SPropValue);
 void                   mapi_SPropValue_array_named(mapi_object_t *, struct mapi_SPropValue_array *);
 enum MAPISTATUS                get_mapi_SPropValue_array_date_timeval(struct timeval *, struct mapi_SPropValue_array *, uint32_t);
 enum MAPISTATUS                get_mapi_SPropValue_date_timeval(struct timeval *t, struct SPropValue);
-bool                   set_SPropValue_proptag_date_timeval(struct SPropValue *, uint32_t, const struct timeval *);
+bool                   set_SPropValue_proptag_date_timeval(struct SPropValue *, enum MAPITAGS, const struct timeval *);
 struct RecurrencePattern *get_RecurrencePattern(TALLOC_CTX *, struct Binary_r *);
 struct AppointmentRecurrencePattern *get_AppointmentRecurrencePattern(TALLOC_CTX *mem_ctx, struct Binary_r *);
 struct Binary_r *set_RecurrencePattern(TALLOC_CTX *, const struct RecurrencePattern *);
index 6e4cbbfa077de1e7d96b25db90fa60c8298d0a38..182122584610c0595abaceea65112d4f4d74406c 100644 (file)
@@ -133,7 +133,7 @@ _PUBLIC_ enum MAPISTATUS SPropTagArray_delete(TALLOC_CTX *mem_ctx,
        SPropTagArray->cValues -= removed;
        SPropTagArray->aulPropTag = (enum MAPITAGS *) talloc_realloc(mem_ctx, SPropTagArray->aulPropTag,
                                                                     uint32_t, SPropTagArray->cValues + 1);
-       SPropTagArray->aulPropTag[SPropTagArray->cValues] = 0;
+       SPropTagArray->aulPropTag[SPropTagArray->cValues] = (enum MAPITAGS) 0;
 
        return MAPI_E_SUCCESS;
 }
@@ -171,7 +171,7 @@ _PUBLIC_ enum MAPISTATUS SPropTagArray_find(struct SPropTagArray SPropTagArray,
 }
 
 _PUBLIC_ const void *get_SPropValue(struct SPropValue *lpProps, 
-                                   uint32_t ulPropTag)
+                                   enum MAPITAGS ulPropTag)
 {
        uint32_t        i;
 
@@ -215,7 +215,7 @@ _PUBLIC_ const void *get_SPropValue_SRowSet_data(struct SRowSet *RowSet,
        return get_SPropValue(lpProp, ulPropTag);
 }
 
-_PUBLIC_ enum MAPISTATUS set_default_error_SPropValue_SRow(struct SRow *aRow, uint32_t ulPropTag, void *data)
+_PUBLIC_ enum MAPISTATUS set_default_error_SPropValue_SRow(struct SRow *aRow, enum MAPITAGS ulPropTag, void *data)
 {
        uint32_t        i;
 
@@ -313,11 +313,13 @@ _PUBLIC_ const void *find_SPropValue_data(struct SRow *aRow, uint32_t mapitag)
 {
        uint32_t i;
 
-       if (aRow) {
-               for (i = 0; i < aRow->cValues; i++) {
-                       if (aRow->lpProps[i].ulPropTag == mapitag) {
-                               return get_SPropValue_data(&(aRow->lpProps[i]));
-                       }
+       if (!aRow) {
+               return NULL;
+       }
+
+       for (i = 0; i < aRow->cValues; i++) {
+               if (aRow->lpProps[i].ulPropTag == mapitag) {
+                       return get_SPropValue_data(&(aRow->lpProps[i]));
                }
        }
        return NULL;
@@ -440,7 +442,11 @@ _PUBLIC_ bool set_SPropValue_proptag(struct SPropValue *lpProps, enum MAPITAGS a
        return (set_SPropValue(lpProps, data));
 }
 
-_PUBLIC_ struct SPropValue *add_SPropValue(TALLOC_CTX *mem_ctx, struct SPropValue *lpProps, uint32_t *cValues, uint32_t aulPropTag, const void * data)
+_PUBLIC_ struct SPropValue *add_SPropValue(TALLOC_CTX *mem_ctx, 
+                                          struct SPropValue *lpProps, 
+                                          uint32_t *cValues, 
+                                          enum MAPITAGS aulPropTag, 
+                                          const void * data)
 {
        lpProps = talloc_realloc(mem_ctx, lpProps, struct SPropValue, *cValues + 2);
 
@@ -1144,7 +1150,7 @@ _PUBLIC_ enum MAPISTATUS get_mapi_SPropValue_date_timeval(struct timeval *t,
        return MAPI_E_SUCCESS;
 }
 
-_PUBLIC_ bool set_SPropValue_proptag_date_timeval(struct SPropValue *lpProps, uint32_t aulPropTag, const struct timeval *t) 
+_PUBLIC_ bool set_SPropValue_proptag_date_timeval(struct SPropValue *lpProps, enum MAPITAGS aulPropTag, const struct timeval *t) 
 {
        struct FILETIME filetime;
        NTTIME          time;